@eox/chart 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- (function(jn,Nt){typeof exports=="object"&&typeof module<"u"?Nt(exports):typeof define=="function"&&define.amd?define(["exports"],Nt):(jn=typeof globalThis<"u"?globalThis:jn||self,Nt(jn["eox-chart"]={}))})(this,function(jn){"use strict";var cpe=Object.defineProperty;var fpe=(jn,Nt,co)=>Nt in jn?cpe(jn,Nt,{enumerable:!0,configurable:!0,writable:!0,value:co}):jn[Nt]=co;var hL=(jn,Nt,co)=>fpe(jn,typeof Nt!="symbol"?Nt+"":Nt,co);/**
1
+ (function(jn,Dt){typeof exports=="object"&&typeof module<"u"?Dt(exports):typeof define=="function"&&define.amd?define(["exports"],Dt):(jn=typeof globalThis<"u"?globalThis:jn||self,Dt(jn["eox-chart"]={}))})(this,function(jn){"use strict";var lpe=Object.defineProperty;var cpe=(jn,Dt,co)=>Dt in jn?lpe(jn,Dt,{enumerable:!0,configurable:!0,writable:!0,value:co}):jn[Dt]=co;var hL=(jn,Dt,co)=>cpe(jn,typeof Dt!="symbol"?Dt+"":Dt,co);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var fL,dL;const Nt=globalThis,co=Nt.ShadowRoot&&(Nt.ShadyCSS===void 0||Nt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,T_=Symbol(),O_=new WeakMap;let gL=class{constructor(t,n,i){if(this._$cssResult$=!0,i!==T_)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o;const n=this.t;if(co&&t===void 0){const i=n!==void 0&&n.length===1;i&&(t=O_.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&O_.set(n,t))}return t}toString(){return this.cssText}};const mL=e=>new gL(typeof e=="string"?e:e+"",void 0,T_),yL=(e,t)=>{if(co)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of t){const i=document.createElement("style"),r=Nt.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=n.cssText,e.appendChild(i)}},N_=co?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const i of t.cssRules)n+=i.cssText;return mL(n)})(e):e;/**
5
+ */var fL,dL;const Dt=globalThis,co=Dt.ShadowRoot&&(Dt.ShadyCSS===void 0||Dt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,T_=Symbol(),O_=new WeakMap;let pL=class{constructor(t,n,i){if(this._$cssResult$=!0,i!==T_)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o;const n=this.t;if(co&&t===void 0){const i=n!==void 0&&n.length===1;i&&(t=O_.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&O_.set(n,t))}return t}toString(){return this.cssText}};const gL=e=>new pL(typeof e=="string"?e:e+"",void 0,T_),mL=(e,t)=>{if(co)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of t){const i=document.createElement("style"),r=Dt.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=n.cssText,e.appendChild(i)}},D_=co?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const i of t.cssRules)n+=i.cssText;return gL(n)})(e):e;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:bL,defineProperty:vL,getOwnPropertyDescriptor:xL,getOwnPropertyNames:wL,getOwnPropertySymbols:EL,getPrototypeOf:_L}=Object,fo=globalThis,D_=fo.trustedTypes,$L=D_?D_.emptyScript:"",m0=fo.reactiveElementPolyfillSupport,Cl=(e,t)=>e,y0={toAttribute(e,t){switch(t){case Boolean:e=e?$L:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},R_=(e,t)=>!bL(e,t),P_={attribute:!0,type:String,converter:y0,reflect:!1,hasChanged:R_};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),fo.litPropertyMetadata??(fo.litPropertyMetadata=new WeakMap);let za=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=P_){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(t,n),!n.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,n);r!==void 0&&vL(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){const{get:r,set:o}=xL(this.prototype,t)??{get(){return this[n]},set(s){this[n]=s}};return{get(){return r==null?void 0:r.call(this)},set(s){const a=r==null?void 0:r.call(this);o.call(this,s),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??P_}static _$Ei(){if(this.hasOwnProperty(Cl("elementProperties")))return;const t=_L(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Cl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Cl("properties"))){const n=this.properties,i=[...wL(n),...EL(n)];for(const r of i)this.createProperty(r,n[r])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[i,r]of n)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[n,i]of this.elementProperties){const r=this._$Eu(n,i);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)n.unshift(N_(r))}else t!==void 0&&n.push(N_(t));return n}static _$Eu(t,n){const i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(n=>n(this))}addController(t){var n;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)==null||n.call(t))}removeController(t){var n;(n=this._$EO)==null||n.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const i of n.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return yL(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostConnected)==null?void 0:i.call(n)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostDisconnected)==null?void 0:i.call(n)})}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$EC(t,n){var o;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const s=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:y0).toAttribute(n,i.type);this._$Em=t,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,n){var o;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const s=i.getPropertyOptions(r),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:y0;this._$Em=r,this[r]=a.fromAttribute(n,s.type),this._$Em=null}}requestUpdate(t,n,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??R_)(this[t],n))return;this.P(t,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,n,i){this._$AL.has(t)||this._$AL.set(t,n),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,s]of r)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],s)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(n)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){var n;(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(t){}firstUpdated(t){}};za.elementStyles=[],za.shadowRootOptions={mode:"open"},za[Cl("elementProperties")]=new Map,za[Cl("finalized")]=new Map,m0==null||m0({ReactiveElement:za}),(fo.reactiveElementVersions??(fo.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:yL,defineProperty:bL,getOwnPropertyDescriptor:vL,getOwnPropertyNames:xL,getOwnPropertySymbols:wL,getPrototypeOf:EL}=Object,fo=globalThis,N_=fo.trustedTypes,_L=N_?N_.emptyScript:"",y0=fo.reactiveElementPolyfillSupport,Cl=(e,t)=>e,b0={toAttribute(e,t){switch(t){case Boolean:e=e?_L:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},R_=(e,t)=>!yL(e,t),P_={attribute:!0,type:String,converter:b0,reflect:!1,hasChanged:R_};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),fo.litPropertyMetadata??(fo.litPropertyMetadata=new WeakMap);let za=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=P_){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(t,n),!n.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,n);r!==void 0&&bL(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){const{get:r,set:o}=vL(this.prototype,t)??{get(){return this[n]},set(s){this[n]=s}};return{get(){return r==null?void 0:r.call(this)},set(s){const a=r==null?void 0:r.call(this);o.call(this,s),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??P_}static _$Ei(){if(this.hasOwnProperty(Cl("elementProperties")))return;const t=EL(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Cl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Cl("properties"))){const n=this.properties,i=[...xL(n),...wL(n)];for(const r of i)this.createProperty(r,n[r])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[i,r]of n)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[n,i]of this.elementProperties){const r=this._$Eu(n,i);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)n.unshift(D_(r))}else t!==void 0&&n.push(D_(t));return n}static _$Eu(t,n){const i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(n=>n(this))}addController(t){var n;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)==null||n.call(t))}removeController(t){var n;(n=this._$EO)==null||n.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const i of n.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mL(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostConnected)==null?void 0:i.call(n)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostDisconnected)==null?void 0:i.call(n)})}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$EC(t,n){var o;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const s=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:b0).toAttribute(n,i.type);this._$Em=t,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,n){var o;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const s=i.getPropertyOptions(r),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:b0;this._$Em=r,this[r]=a.fromAttribute(n,s.type),this._$Em=null}}requestUpdate(t,n,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??R_)(this[t],n))return;this.P(t,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,n,i){this._$AL.has(t)||this._$AL.set(t,n),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,s]of r)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],s)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(n)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){var n;(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(t){}firstUpdated(t){}};za.elementStyles=[],za.shadowRootOptions={mode:"open"},za[Cl("elementProperties")]=new Map,za[Cl("finalized")]=new Map,y0==null||y0({ReactiveElement:za}),(fo.reactiveElementVersions??(fo.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const Ml=globalThis,pd=Ml.trustedTypes,L_=pd?pd.createPolicy("lit-html",{createHTML:e=>e}):void 0,I_="$lit$",ho=`lit$${Math.random().toFixed(9).slice(2)}$`,z_="?"+ho,SL=`<${z_}>`,ys=document,Fl=()=>ys.createComment(""),Tl=e=>e===null||typeof e!="object"&&typeof e!="function",b0=Array.isArray,AL=e=>b0(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",v0=`[
14
- \f\r]`,Ol=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B_=/-->/g,U_=/>/g,bs=RegExp(`>|${v0}(?:([^\\s"'>=/]+)(${v0}*=${v0}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),j_=/'/g,q_=/"/g,W_=/^(?:script|style|textarea|title)$/i,kL=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),CL=kL(1),Ba=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),H_=new WeakMap,vs=ys.createTreeWalker(ys,129);function G_(e,t){if(!b0(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return L_!==void 0?L_.createHTML(t):t}const ML=(e,t)=>{const n=e.length-1,i=[];let r,o=t===2?"<svg>":t===3?"<math>":"",s=Ol;for(let a=0;a<n;a++){const u=e[a];let l,c,f=-1,d=0;for(;d<u.length&&(s.lastIndex=d,c=s.exec(u),c!==null);)d=s.lastIndex,s===Ol?c[1]==="!--"?s=B_:c[1]!==void 0?s=U_:c[2]!==void 0?(W_.test(c[2])&&(r=RegExp("</"+c[2],"g")),s=bs):c[3]!==void 0&&(s=bs):s===bs?c[0]===">"?(s=r??Ol,f=-1):c[1]===void 0?f=-2:(f=s.lastIndex-c[2].length,l=c[1],s=c[3]===void 0?bs:c[3]==='"'?q_:j_):s===q_||s===j_?s=bs:s===B_||s===U_?s=Ol:(s=bs,r=void 0);const h=s===bs&&e[a+1].startsWith("/>")?" ":"";o+=s===Ol?u+SL:f>=0?(i.push(l),u.slice(0,f)+I_+u.slice(f)+ho+h):u+ho+(f===-2?a:h)}return[G_(e,o+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let x0=class pL{constructor({strings:t,_$litType$:n},i){let r;this.parts=[];let o=0,s=0;const a=t.length-1,u=this.parts,[l,c]=ML(t,n);if(this.el=pL.createElement(l,i),vs.currentNode=this.el.content,n===2||n===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(r=vs.nextNode())!==null&&u.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const f of r.getAttributeNames())if(f.endsWith(I_)){const d=c[s++],h=r.getAttribute(f).split(ho),p=/([.?@])?(.*)/.exec(d);u.push({type:1,index:o,name:p[2],strings:h,ctor:p[1]==="."?TL:p[1]==="?"?OL:p[1]==="@"?NL:gd}),r.removeAttribute(f)}else f.startsWith(ho)&&(u.push({type:6,index:o}),r.removeAttribute(f));if(W_.test(r.tagName)){const f=r.textContent.split(ho),d=f.length-1;if(d>0){r.textContent=pd?pd.emptyScript:"";for(let h=0;h<d;h++)r.append(f[h],Fl()),vs.nextNode(),u.push({type:2,index:++o});r.append(f[d],Fl())}}}else if(r.nodeType===8)if(r.data===z_)u.push({type:2,index:o});else{let f=-1;for(;(f=r.data.indexOf(ho,f+1))!==-1;)u.push({type:7,index:o}),f+=ho.length-1}o++}}static createElement(t,n){const i=ys.createElement("template");return i.innerHTML=t,i}};function Ua(e,t,n=e,i){var s,a;if(t===Ba)return t;let r=i!==void 0?(s=n.o)==null?void 0:s[i]:n.l;const o=Tl(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==o&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),o===void 0?r=void 0:(r=new o(e),r._$AT(e,n,i)),i!==void 0?(n.o??(n.o=[]))[i]=r:n.l=r),r!==void 0&&(t=Ua(e,r._$AS(e,t.values),r,i)),t}class FL{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??ys).importNode(n,!0);vs.currentNode=r;let o=vs.nextNode(),s=0,a=0,u=i[0];for(;u!==void 0;){if(s===u.index){let l;u.type===2?l=new Nl(o,o.nextSibling,this,t):u.type===1?l=new u.ctor(o,u.name,u.strings,this,t):u.type===6&&(l=new DL(o,this,t)),this._$AV.push(l),u=i[++a]}s!==(u==null?void 0:u.index)&&(o=vs.nextNode(),s++)}return vs.currentNode=ys,r}p(t){let n=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}class Nl{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,n,i,r){this.type=2,this._$AH=ct,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this.v=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Ua(this,t,n),Tl(t)?t===ct||t==null||t===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):t!==this._$AH&&t!==Ba&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):AL(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ct&&Tl(this._$AH)?this._$AA.nextSibling.data=t:this.T(ys.createTextNode(t)),this._$AH=t}$(t){var o;const{values:n,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=x0.createElement(G_(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===r)this._$AH.p(n);else{const s=new FL(r,this),a=s.u(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(t){let n=H_.get(t.strings);return n===void 0&&H_.set(t.strings,n=new x0(t)),n}k(t){b0(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,r=0;for(const o of t)r===n.length?n.push(i=new Nl(this.O(Fl()),this.O(Fl()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,n){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,n);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var n;this._$AM===void 0&&(this.v=t,(n=this._$AP)==null||n.call(this,t))}}class gd{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,r,o){this.type=1,this._$AH=ct,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ct}_$AI(t,n=this,i,r){const o=this.strings;let s=!1;if(o===void 0)t=Ua(this,t,n,0),s=!Tl(t)||t!==this._$AH&&t!==Ba,s&&(this._$AH=t);else{const a=t;let u,l;for(t=o[0],u=0;u<o.length-1;u++)l=Ua(this,a[i+u],n,u),l===Ba&&(l=this._$AH[u]),s||(s=!Tl(l)||l!==this._$AH[u]),l===ct?t=ct:t!==ct&&(t+=(l??"")+o[u+1]),this._$AH[u]=l}s&&!r&&this.j(t)}j(t){t===ct?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let TL=class extends gd{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ct?void 0:t}};class OL extends gd{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ct)}}class NL extends gd{constructor(t,n,i,r,o){super(t,n,i,r,o),this.type=5}_$AI(t,n=this){if((t=Ua(this,t,n,0)??ct)===Ba)return;const i=this._$AH,r=t===ct&&i!==ct||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==ct&&(i===ct||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,t):this._$AH.handleEvent(t)}}let DL=class{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Ua(this,t)}};const w0=Ml.litHtmlPolyfillSupport;w0==null||w0(x0,Nl),(Ml.litHtmlVersions??(Ml.litHtmlVersions=[])).push("3.2.0");const RL=(e,t,n)=>{const i=(n==null?void 0:n.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const o=(n==null?void 0:n.renderBefore)??null;i._$litPart$=r=new Nl(t.insertBefore(Fl(),o),o,void 0,n??{})}return r._$AI(e),r};/**
13
+ */const Ml=globalThis,gd=Ml.trustedTypes,L_=gd?gd.createPolicy("lit-html",{createHTML:e=>e}):void 0,I_="$lit$",ho=`lit$${Math.random().toFixed(9).slice(2)}$`,z_="?"+ho,$L=`<${z_}>`,ys=document,Fl=()=>ys.createComment(""),Tl=e=>e===null||typeof e!="object"&&typeof e!="function",v0=Array.isArray,SL=e=>v0(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",x0=`[
14
+ \f\r]`,Ol=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B_=/-->/g,U_=/>/g,bs=RegExp(`>|${x0}(?:([^\\s"'>=/]+)(${x0}*=${x0}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),j_=/'/g,q_=/"/g,W_=/^(?:script|style|textarea|title)$/i,AL=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),kL=AL(1),Ba=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),H_=new WeakMap,vs=ys.createTreeWalker(ys,129);function G_(e,t){if(!v0(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return L_!==void 0?L_.createHTML(t):t}const CL=(e,t)=>{const n=e.length-1,i=[];let r,o=t===2?"<svg>":t===3?"<math>":"",s=Ol;for(let a=0;a<n;a++){const u=e[a];let l,c,f=-1,d=0;for(;d<u.length&&(s.lastIndex=d,c=s.exec(u),c!==null);)d=s.lastIndex,s===Ol?c[1]==="!--"?s=B_:c[1]!==void 0?s=U_:c[2]!==void 0?(W_.test(c[2])&&(r=RegExp("</"+c[2],"g")),s=bs):c[3]!==void 0&&(s=bs):s===bs?c[0]===">"?(s=r??Ol,f=-1):c[1]===void 0?f=-2:(f=s.lastIndex-c[2].length,l=c[1],s=c[3]===void 0?bs:c[3]==='"'?q_:j_):s===q_||s===j_?s=bs:s===B_||s===U_?s=Ol:(s=bs,r=void 0);const h=s===bs&&e[a+1].startsWith("/>")?" ":"";o+=s===Ol?u+$L:f>=0?(i.push(l),u.slice(0,f)+I_+u.slice(f)+ho+h):u+ho+(f===-2?a:h)}return[G_(e,o+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class Dl{constructor({strings:t,_$litType$:n},i){let r;this.parts=[];let o=0,s=0;const a=t.length-1,u=this.parts,[l,c]=CL(t,n);if(this.el=Dl.createElement(l,i),vs.currentNode=this.el.content,n===2||n===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(r=vs.nextNode())!==null&&u.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const f of r.getAttributeNames())if(f.endsWith(I_)){const d=c[s++],h=r.getAttribute(f).split(ho),p=/([.?@])?(.*)/.exec(d);u.push({type:1,index:o,name:p[2],strings:h,ctor:p[1]==="."?FL:p[1]==="?"?TL:p[1]==="@"?OL:md}),r.removeAttribute(f)}else f.startsWith(ho)&&(u.push({type:6,index:o}),r.removeAttribute(f));if(W_.test(r.tagName)){const f=r.textContent.split(ho),d=f.length-1;if(d>0){r.textContent=gd?gd.emptyScript:"";for(let h=0;h<d;h++)r.append(f[h],Fl()),vs.nextNode(),u.push({type:2,index:++o});r.append(f[d],Fl())}}}else if(r.nodeType===8)if(r.data===z_)u.push({type:2,index:o});else{let f=-1;for(;(f=r.data.indexOf(ho,f+1))!==-1;)u.push({type:7,index:o}),f+=ho.length-1}o++}}static createElement(t,n){const i=ys.createElement("template");return i.innerHTML=t,i}}function Ua(e,t,n=e,i){var s,a;if(t===Ba)return t;let r=i!==void 0?(s=n._$Co)==null?void 0:s[i]:n._$Cl;const o=Tl(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==o&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),o===void 0?r=void 0:(r=new o(e),r._$AT(e,n,i)),i!==void 0?(n._$Co??(n._$Co=[]))[i]=r:n._$Cl=r),r!==void 0&&(t=Ua(e,r._$AS(e,t.values),r,i)),t}let ML=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??ys).importNode(n,!0);vs.currentNode=r;let o=vs.nextNode(),s=0,a=0,u=i[0];for(;u!==void 0;){if(s===u.index){let l;u.type===2?l=new Nl(o,o.nextSibling,this,t):u.type===1?l=new u.ctor(o,u.name,u.strings,this,t):u.type===6&&(l=new DL(o,this,t)),this._$AV.push(l),u=i[++a]}s!==(u==null?void 0:u.index)&&(o=vs.nextNode(),s++)}return vs.currentNode=ys,r}p(t){let n=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}};class Nl{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,n,i,r){this.type=2,this._$AH=ct,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Ua(this,t,n),Tl(t)?t===ct||t==null||t===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):t!==this._$AH&&t!==Ba&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):SL(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ct&&Tl(this._$AH)?this._$AA.nextSibling.data=t:this.T(ys.createTextNode(t)),this._$AH=t}$(t){var o;const{values:n,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Dl.createElement(G_(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===r)this._$AH.p(n);else{const s=new ML(r,this),a=s.u(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(t){let n=H_.get(t.strings);return n===void 0&&H_.set(t.strings,n=new Dl(t)),n}k(t){v0(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,r=0;for(const o of t)r===n.length?n.push(i=new Nl(this.O(Fl()),this.O(Fl()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,n){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,n);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var n;this._$AM===void 0&&(this._$Cv=t,(n=this._$AP)==null||n.call(this,t))}}class md{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,r,o){this.type=1,this._$AH=ct,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ct}_$AI(t,n=this,i,r){const o=this.strings;let s=!1;if(o===void 0)t=Ua(this,t,n,0),s=!Tl(t)||t!==this._$AH&&t!==Ba,s&&(this._$AH=t);else{const a=t;let u,l;for(t=o[0],u=0;u<o.length-1;u++)l=Ua(this,a[i+u],n,u),l===Ba&&(l=this._$AH[u]),s||(s=!Tl(l)||l!==this._$AH[u]),l===ct?t=ct:t!==ct&&(t+=(l??"")+o[u+1]),this._$AH[u]=l}s&&!r&&this.j(t)}j(t){t===ct?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class FL extends md{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ct?void 0:t}}class TL extends md{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ct)}}class OL extends md{constructor(t,n,i,r,o){super(t,n,i,r,o),this.type=5}_$AI(t,n=this){if((t=Ua(this,t,n,0)??ct)===Ba)return;const i=this._$AH,r=t===ct&&i!==ct||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==ct&&(i===ct||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,t):this._$AH.handleEvent(t)}}class DL{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Ua(this,t)}}const w0=Ml.litHtmlPolyfillSupport;w0==null||w0(Dl,Nl),(Ml.litHtmlVersions??(Ml.litHtmlVersions=[])).push("3.2.1");const NL=(e,t,n)=>{const i=(n==null?void 0:n.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const o=(n==null?void 0:n.renderBefore)??null;i._$litPart$=r=new Nl(t.insertBefore(Fl(),o),o,void 0,n??{})}return r._$AI(e),r};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let Dl=class extends za{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var n;const t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=RL(n,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return Ba}};Dl._$litElement$=!0,Dl.finalized=!0,(fL=globalThis.litElementHydrateSupport)==null||fL.call(globalThis,{LitElement:Dl});const E0=globalThis.litElementPolyfillSupport;E0==null||E0({LitElement:Dl}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");const PL=`
19
+ */class Rl extends za{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=NL(n,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Ba}}Rl._$litElement$=!0,Rl.finalized=!0,(fL=globalThis.litElementHydrateSupport)==null||fL.call(globalThis,{LitElement:Rl});const E0=globalThis.litElementPolyfillSupport;E0==null||E0({LitElement:Rl}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");const RL=`
20
20
  :root, :host, eox-chart {
21
21
  display: block;
22
22
  }
@@ -24,34 +24,34 @@
24
24
  width: 100%;
25
25
  height: 100%;
26
26
  }
27
- `,LL=`
27
+ `,PL=`
28
28
  eox-chart {
29
29
  font-family: Roboto, sans-serif;
30
30
  }
31
- `,IL=`:root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}button,.button { display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon):not(.json-editor-btntype-*),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-btn-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon,button[class*="json-editor-btntype-"] { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before,button[class*="json-editor-btntype-"]::before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0;}input[type="checkbox"] { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; display: flex; flex-direction: row; align-items: center; width: 24px; height: 24px;}input[type="checkbox"]:after { display: block; content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-blank-outline%3C/title%3E%3Cpath d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z' /%3E%3C/svg%3E"); width: 20px; height: 20px; margin-right: 4px;}input[type="checkbox"]:checked:after { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-marked%3C/title%3E%3Cpath d='M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z' /%3E%3C/svg%3E");}textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004;}ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}input[type="radio"] { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; display: flex; flex-direction: row; align-items: center; width: 24px; height: 24px;}label span { font-size: small;}input[type="radio"]:after { display: block; content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E"); width: 20px; height: 20px; margin-right: 4px;}input[type="radio"]:checked:after { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-marked%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z' /%3E%3C/svg%3E");}input[type="range"] { -webkit-appearance: none; width: 90%; margin-left: 5%; height: 6px; border-radius: 5px; background: #d7dcdf; outline: none; padding: 0;}input[type="range"]::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #2c3e50; cursor: pointer; transition: background 0.15s ease-in-out;}.range-slider { margin: 60px 0 0 0;}.range-slider { width: 100%;}input[type="range"]::-webkit-slider-thumb:hover { background: #00416f;}input[type="range"]:active::-webkit-slider-thumb { background: #00416f;}input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #2c3e50; cursor: pointer; transition: background 0.15s ease-in-out;}input[type="range"]::-moz-range-thumb:hover { background: #00416f;}input[type="range"]:active::-moz-range-thumb { background: #00416f;}input[type="range"]:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff0, 0 0 0 6px #00416f00;}.range-slider__value { display: inline-block; position: relative; width: 60px; color: #fff; line-height: 20px; text-align: center; border-radius: 3px; background: #2c3e50; padding: 5px 10px; margin-left: 8px;}.range-slider__value:after { position: absolute; top: 8px; left: -7px; width: 0; height: 0; border-top: 7px solid transparent; border-right: 7px solid #2c3e50; border-bottom: 7px solid transparent; content: "";}input::-moz-focus-inner,input::-moz-focus-outer { border: 0;}`;/*!
31
+ `,LL=`:root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}button,.button { display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon):not(.json-editor-btntype-*),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-btn-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon,button[class*="json-editor-btntype-"] { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before,button[class*="json-editor-btntype-"]::before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0;}input[type="checkbox"] { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; display: flex; flex-direction: row; align-items: center; width: 24px; height: 24px;}input[type="checkbox"]:after { display: block; content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-blank-outline%3C/title%3E%3Cpath d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z' /%3E%3C/svg%3E"); width: 20px; height: 20px; margin-right: 4px;}input[type="checkbox"]:checked:after { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-marked%3C/title%3E%3Cpath d='M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z' /%3E%3C/svg%3E");}textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004;}ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}input[type="radio"] { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; display: flex; flex-direction: row; align-items: center; width: 24px; height: 24px;}label span { font-size: small;}input[type="radio"]:after { display: block; content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E"); width: 20px; height: 20px; margin-right: 4px;}input[type="radio"]:checked:after { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-marked%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z' /%3E%3C/svg%3E");}input[type="range"] { -webkit-appearance: none; width: 90%; margin-left: 5%; height: 6px; border-radius: 5px; background: #d7dcdf; outline: none; padding: 0;}input[type="range"]::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #2c3e50; cursor: pointer; transition: background 0.15s ease-in-out;}.range-slider { margin: 60px 0 0 0;}.range-slider { width: 100%;}input[type="range"]::-webkit-slider-thumb:hover { background: #00416f;}input[type="range"]:active::-webkit-slider-thumb { background: #00416f;}input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #2c3e50; cursor: pointer; transition: background 0.15s ease-in-out;}input[type="range"]::-moz-range-thumb:hover { background: #00416f;}input[type="range"]:active::-moz-range-thumb { background: #00416f;}input[type="range"]:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff0, 0 0 0 6px #00416f00;}.range-slider__value { display: inline-block; position: relative; width: 60px; color: #fff; line-height: 20px; text-align: center; border-radius: 3px; background: #2c3e50; padding: 5px 10px; margin-left: 8px;}.range-slider__value:after { position: absolute; top: 8px; left: -7px; width: 0; height: 0; border-top: 7px solid transparent; border-right: 7px solid #2c3e50; border-bottom: 7px solid transparent; content: "";}input::-moz-focus-inner,input::-moz-focus-outer { border: 0;}`;/*!
32
32
  * https://github.com/Starcounter-Jack/JSON-Patch
33
33
  * (c) 2017-2022 Joachim Wester
34
34
  * MIT licensed
35
- */var zL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),BL=Object.prototype.hasOwnProperty;function _0(e,t){return BL.call(e,t)}function $0(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)_0(e,r)&&i.push(r);return i}function Cn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function S0(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function xs(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function V_(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function A0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(A0(e[t]))return!0}else if(typeof e=="object"){for(var i=$0(e),r=i.length,o=0;o<r;o++)if(A0(e[i[o]]))return!0}}return!1}function Y_(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
36
- `)}var X_=function(e){zL(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,Y_(n,{name:i,index:r,operation:o,tree:s}))||this;return u.name=i,u.index=r,u.operation=o,u.tree=s,Object.setPrototypeOf(u,a.prototype),u.message=Y_(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),Ve=X_,UL=Cn,ja={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=md(n,this.path);i&&(i=Cn(i));var r=ws(n,{op:"remove",path:this.from}).removed;return ws(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=md(n,this.from);return ws(n,{op:"add",path:this.path,value:Cn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Rl(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},jL={add:function(e,t,n){return S0(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:ja.move,copy:ja.copy,test:ja.test,_get:ja._get};function md(e,t){if(t=="")return e;var n={op:"_get",path:t};return ws(e,n),n.value}function ws(e,t,n,i,r,o){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):bd(t,0)),t.path===""){var s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=md(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=Rl(e,t.value),s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Cn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=bd;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=V_(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))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&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!S0(h))throw new Ve("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);S0(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Ve("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=jL[t.op].call(t,l,h,e);if(s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=ja[t.op].call(t,l,h,e);if(s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Ve("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function yd(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Cn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=ws(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function qL(e,t,n){var i=ws(e,t);if(i.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function bd(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ve("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(ja[e.op]){if(typeof e.path!="string")throw new Ve("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ve('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ve("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&A0(e.value))throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new Ve("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Ve("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=K_([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ve("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function K_(e,t,n){try{if(!Array.isArray(e))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)yd(Cn(t),Cn(e),n||!0);else{n=n||bd;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Ve)return r;throw r}}function Rl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,o,s;if(n&&i){if(o=e.length,o!=t.length)return!1;for(r=o;r--!==0;)if(!Rl(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(o=a.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=o;r--!==0;)if(s=a[r],!Rl(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}const WL=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Ve,_areEquals:Rl,applyOperation:ws,applyPatch:yd,applyReducer:qL,deepClone:UL,getValueByPointer:md,validate:K_,validator:bd},Symbol.toStringTag,{value:"Module"}));/*!
35
+ */var IL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),zL=Object.prototype.hasOwnProperty;function _0(e,t){return zL.call(e,t)}function $0(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)_0(e,r)&&i.push(r);return i}function Cn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function S0(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function xs(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function V_(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function A0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(A0(e[t]))return!0}else if(typeof e=="object"){for(var i=$0(e),r=i.length,o=0;o<r;o++)if(A0(e[i[o]]))return!0}}return!1}function Y_(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
36
+ `)}var X_=function(e){IL(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,Y_(n,{name:i,index:r,operation:o,tree:s}))||this;return u.name=i,u.index=r,u.operation=o,u.tree=s,Object.setPrototypeOf(u,a.prototype),u.message=Y_(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),Ve=X_,BL=Cn,ja={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=yd(n,this.path);i&&(i=Cn(i));var r=ws(n,{op:"remove",path:this.from}).removed;return ws(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=yd(n,this.from);return ws(n,{op:"add",path:this.path,value:Cn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Pl(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},UL={add:function(e,t,n){return S0(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:ja.move,copy:ja.copy,test:ja.test,_get:ja._get};function yd(e,t){if(t=="")return e;var n={op:"_get",path:t};return ws(e,n),n.value}function ws(e,t,n,i,r,o){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):vd(t,0)),t.path===""){var s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=yd(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=Pl(e,t.value),s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Cn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=vd;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=V_(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))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&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!S0(h))throw new Ve("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);S0(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Ve("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=UL[t.op].call(t,l,h,e);if(s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=ja[t.op].call(t,l,h,e);if(s.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Ve("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function bd(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Cn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=ws(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function jL(e,t,n){var i=ws(e,t);if(i.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function vd(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ve("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(ja[e.op]){if(typeof e.path!="string")throw new Ve("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ve('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ve("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&A0(e.value))throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new Ve("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Ve("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=K_([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ve("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function K_(e,t,n){try{if(!Array.isArray(e))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)bd(Cn(t),Cn(e),n||!0);else{n=n||vd;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Ve)return r;throw r}}function Pl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,o,s;if(n&&i){if(o=e.length,o!=t.length)return!1;for(r=o;r--!==0;)if(!Pl(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(o=a.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=o;r--!==0;)if(s=a[r],!Pl(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}const qL=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Ve,_areEquals:Pl,applyOperation:ws,applyPatch:bd,applyReducer:jL,deepClone:BL,getValueByPointer:yd,validate:K_,validator:vd},Symbol.toStringTag,{value:"Module"}));/*!
37
37
  * https://github.com/Starcounter-Jack/JSON-Patch
38
38
  * (c) 2017-2021 Joachim Wester
39
39
  * MIT license
40
- */var k0=new WeakMap,HL=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),GL=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function VL(e){return k0.get(e)}function YL(e,t){return e.observers.get(t)}function XL(e,t){e.observers.delete(t.callback)}function KL(e,t){t.unobserve()}function ZL(e,t){var n=[],i,r=VL(e);if(!r)r=new HL(e),k0.set(e,r);else{var o=YL(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Cn(e),t){i.callback=t,i.next=null;var s=function(){C0(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){C0(i),clearTimeout(i.next),XL(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new GL(t,i)),i}function C0(e,t){t===void 0&&(t=!1);var n=k0.get(e.object);M0(n.value,e.object,e.patches,"",t),e.patches.length&&yd(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function M0(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=$0(t),s=$0(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(_0(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?M0(c,f,n,i+"/"+xs(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+xs(l),value:Cn(c)}),n.push({op:"replace",path:i+"/"+xs(l),value:Cn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+xs(l),value:Cn(c)}),n.push({op:"remove",path:i+"/"+xs(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&o.length==s.length))for(var u=0;u<o.length;u++){var l=o[u];!_0(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+xs(l),value:Cn(t[l])})}}}function JL(e,t,n){n===void 0&&(n=!1);var i=[];return M0(e,t,i,"",n),i}Object.assign({},WL,Object.freeze(Object.defineProperty({__proto__:null,compare:JL,generate:C0,observe:ZL,unobserve:KL},Symbol.toStringTag,{value:"Module"})),{JsonPatchError:X_,deepClone:Cn,escapePathComponent:xs,unescapePathComponent:V_});function QL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eI=/("(?:[^\\"]|\\.)*")|[:,]/g,tI=function(t,n){var i,r,o;return n=n||{},i=JSON.stringify([1],void 0,n.indent===void 0?2:n.indent).slice(2,-3),r=i===""?1/0:n.maxLength===void 0?80:n.maxLength,o=n.replacer,function s(a,u,l){var c,f,d,h,p,g,m,y,b,v,x,w;if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),x=JSON.stringify(a,o),x===void 0)return x;if(m=r-u.length-l,x.length<=m&&(b=x.replace(eI,function(_,E){return E||_+" "}),b.length<=m))return b;if(o!=null&&(a=JSON.parse(x),o=void 0),typeof a=="object"&&a!==null){if(y=u+i,d=[],f=0,Array.isArray(a))for(v="[",c="]",m=a.length;f<m;f++)d.push(s(a[f],y,f===m-1?0:1)||"null");else for(v="{",c="}",g=Object.keys(a),m=g.length;f<m;f++)h=g[f],p=JSON.stringify(h)+": ",w=s(a[h],y,p.length+(f===m-1?0:1)),w!==void 0&&d.push(p+w);if(d.length>0)return[v,i+d.join(`,
40
+ */var k0=new WeakMap,WL=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),HL=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function GL(e){return k0.get(e)}function VL(e,t){return e.observers.get(t)}function YL(e,t){e.observers.delete(t.callback)}function XL(e,t){t.unobserve()}function KL(e,t){var n=[],i,r=GL(e);if(!r)r=new WL(e),k0.set(e,r);else{var o=VL(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Cn(e),t){i.callback=t,i.next=null;var s=function(){C0(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){C0(i),clearTimeout(i.next),YL(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new HL(t,i)),i}function C0(e,t){t===void 0&&(t=!1);var n=k0.get(e.object);M0(n.value,e.object,e.patches,"",t),e.patches.length&&bd(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function M0(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=$0(t),s=$0(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(_0(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?M0(c,f,n,i+"/"+xs(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+xs(l),value:Cn(c)}),n.push({op:"replace",path:i+"/"+xs(l),value:Cn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+xs(l),value:Cn(c)}),n.push({op:"remove",path:i+"/"+xs(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&o.length==s.length))for(var u=0;u<o.length;u++){var l=o[u];!_0(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+xs(l),value:Cn(t[l])})}}}function ZL(e,t,n){n===void 0&&(n=!1);var i=[];return M0(e,t,i,"",n),i}Object.assign({},qL,Object.freeze(Object.defineProperty({__proto__:null,compare:ZL,generate:C0,observe:KL,unobserve:XL},Symbol.toStringTag,{value:"Module"})),{JsonPatchError:X_,deepClone:Cn,escapePathComponent:xs,unescapePathComponent:V_});function JL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var QL=/("(?:[^\\"]|\\.)*")|[:,]/g,eI=function(t,n){var i,r,o;return n=n||{},i=JSON.stringify([1],void 0,n.indent===void 0?2:n.indent).slice(2,-3),r=i===""?1/0:n.maxLength===void 0?80:n.maxLength,o=n.replacer,function s(a,u,l){var c,f,d,h,p,g,m,y,b,v,x,w;if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),x=JSON.stringify(a,o),x===void 0)return x;if(m=r-u.length-l,x.length<=m&&(b=x.replace(QL,function(_,E){return E||_+" "}),b.length<=m))return b;if(o!=null&&(a=JSON.parse(x),o=void 0),typeof a=="object"&&a!==null){if(y=u+i,d=[],f=0,Array.isArray(a))for(v="[",c="]",m=a.length;f<m;f++)d.push(s(a[f],y,f===m-1?0:1)||"null");else for(v="{",c="}",g=Object.keys(a),m=g.length;f<m;f++)h=g[f],p=JSON.stringify(h)+": ",w=s(a[h],y,p.length+(f===m-1?0:1)),w!==void 0&&d.push(p+w);if(d.length>0)return[v,i+d.join(`,
41
41
  `+y),c].join(`
42
- `+u)}return x}(t,"",0)};const F0=QL(tI);function hn(e,t,n){return e.fields=t||[],e.fname=n,e}function Ye(e){return e==null?null:e.fname}function Dt(e){return e==null?null:e.fields}function Z_(e){return e.length===1?nI(e[0]):iI(e)}const nI=e=>function(t){return t[e]},iI=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function R(e){throw Error(e)}function zi(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||R("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&R("Access path missing closing bracket: "+e),i&&R("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function qn(e,t,n){const i=zi(e);return e=i.length===1?i[0]:e,hn((n&&n.get||Z_)(i),[e],t||e)}const Pl=qn("id"),Rt=hn(e=>e,[],"identity"),po=hn(()=>0,[],"zero"),qa=hn(()=>1,[],"one"),Wn=hn(()=>!0,[],"true"),go=hn(()=>!1,[],"false");function rI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const J_=0,T0=1,O0=2,Q_=3,e$=4;function N0(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rI,i=e||J_;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=T0&&n(t||"error","ERROR",arguments),this},warn(){return i>=O0&&n(t||"warn","WARN",arguments),this},info(){return i>=Q_&&n(t||"log","INFO",arguments),this},debug(){return i>=e$&&n(t||"log","DEBUG",arguments),this}}}var L=Array.isArray;function Y(e){return e===Object(e)}const t$=e=>e!=="__proto__";function Wa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=oI(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Ha(i,o,r[o],s)}return i},{})}function Ha(e,t,n,i){if(!t$(t))return;let r,o;if(Y(n)&&!L(n)){o=Y(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Ha(o,r,n[r]):t$(r)&&(o[r]=n[r])}else e[t]=n}function oI(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function ve(e){return e[e.length-1]}function Pt(e){return e==null||e===""?null:+e}const n$=e=>t=>e*Math.exp(t),i$=e=>t=>Math.log(e*t),r$=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),o$=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,vd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function xd(e,t,n,i){const r=n(e[0]),o=n(ve(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function s$(e,t){return xd(e,t,Pt,Rt)}function a$(e,t){var n=Math.sign(e[0]);return xd(e,t,i$(n),n$(n))}function u$(e,t,n){return xd(e,t,vd(n),vd(1/n))}function l$(e,t,n){return xd(e,t,r$(n),o$(n))}function wd(e,t,n,i,r){const o=i(e[0]),s=i(ve(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function D0(e,t,n){return wd(e,t,n,Pt,Rt)}function R0(e,t,n){const i=Math.sign(e[0]);return wd(e,t,n,i$(i),n$(i))}function Ed(e,t,n,i){return wd(e,t,n,vd(i),vd(1/i))}function P0(e,t,n,i){return wd(e,t,n,r$(i),o$(i))}function c$(e){return 1+~~(new Date(e).getMonth()/3)}function f$(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?L(e)?e:[e]:[]}function d$(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ce(e){return typeof e=="function"}const sI="descending";function L0(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],o={},s=n.comparator||aI;return X(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===sI?-1:1),r.push(a=ce(a)?a:qn(a,null,n)),(Dt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:hn(s(r,i),Object.keys(o))}const _d=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),aI=(e,t)=>e.length===1?uI(e[0],t[0]):lI(e,t,e.length),uI=(e,t)=>function(n,i){return _d(e(n),e(i))*t},lI=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=_d(o(i),o(r));return s*t[a]});function Lt(e){return ce(e)?e:()=>e}function I0(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function fe(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Bi(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function h$(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}const cI=Object.prototype.hasOwnProperty;function Z(e,t){return cI.call(e,t)}const $d={};function Ga(e){let t={},n;function i(o){return Z(t,o)&&t[o]!==$d}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===$d&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=$d),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==$d&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function p$(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=ve(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),fe(i,n)}function Va(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function mo(e){return typeof e=="boolean"}function yo(e){return Object.prototype.toString.call(e)==="[object Date]"}function g$(e){return e&&ce(e[Symbol.iterator])}function _e(e){return typeof e=="number"}function m$(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function z0(e,t,n){e&&(e=t?X(e).map(a=>a.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||Z_,o=a=>r(t?[a]:zi(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return hn(s,e,"key")}function y$(e,t){const n=e[0],i=ve(e),r=+t;return r?r===1?i:n+r*(i-n):n}const fI=1e4;function b$(e){e=+e||fI;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>Z(t,s)||Z(n,s),get:s=>Z(t,s)?t[s]:Z(n,s)?o(s,n[s]):void 0,set:(s,a)=>Z(t,s)?t[s]=a:o(s,a)}}function v$(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Ll(e,t){let n="";for(;--t>=0;)n+=e;return n}function x$(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Ll(r,s)+o:i==="center"?Ll(r,~~(s/2))+o+Ll(r,Math.ceil(s/2)):o+Ll(r,s)}function Il(e){return e&&ve(e)-e[0]||0}function H(e){return L(e)?"["+e.map(H)+"]":Y(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function B0(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const dI=e=>_e(e)||yo(e)?e:Date.parse(e);function U0(e,t){return t=t||dI,e==null||e===""?null:t(e)}function j0(e){return e==null||e===""?null:e+""}function li(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function w$(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function bo(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var E$={},q0={},W0=34,zl=10,H0=13;function _$(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function hI(e,t){var n=_$(e);return function(i,r){return t(n(i),r,e)}}function $$(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function pn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function pI(e){return e<0?"-"+pn(-e,6):e>9999?"+"+pn(e,6):pn(e,4)}function gI(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":pI(e.getUTCFullYear())+"-"+pn(e.getUTCMonth()+1,2)+"-"+pn(e.getUTCDate(),2)+(r?"T"+pn(t,2)+":"+pn(n,2)+":"+pn(i,2)+"."+pn(r,3)+"Z":i?"T"+pn(t,2)+":"+pn(n,2)+":"+pn(i,2)+"Z":n||t?"T"+pn(t,2)+":"+pn(n,2)+"Z":"")}function mI(e){var t=new RegExp('["'+e+`
43
- \r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?hI(m,d):_$(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===zl&&--p,f.charCodeAt(p-1)===H0&&--p;function x(){if(b)return q0;if(v)return v=!1,E$;var _,E=g,$;if(f.charCodeAt(E)===W0){for(;g++<p&&f.charCodeAt(g)!==W0||f.charCodeAt(++g)===W0;);return(_=g)>=p?b=!0:($=f.charCodeAt(g++))===zl?v=!0:$===H0&&(v=!0,f.charCodeAt(g)===zl&&++g),f.slice(E+1,_-1).replace(/""/g,'"')}for(;g<p;){if(($=f.charCodeAt(_=g++))===zl)v=!0;else if($===H0)v=!0,f.charCodeAt(g)===zl&&++g;else if($!==n)continue;return f.slice(E,_)}return b=!0,f.slice(E,p)}for(;(y=x())!==q0;){for(var w=[];y!==E$&&y!==q0;)w.push(y),y=x();d&&(w=d(w,m++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function s(f,d){return d==null&&(d=$$(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
42
+ `+u)}return x}(t,"",0)};const F0=JL(eI);function hn(e,t,n){return e.fields=t||[],e.fname=n,e}function Ye(e){return e==null?null:e.fname}function Nt(e){return e==null?null:e.fields}function Z_(e){return e.length===1?tI(e[0]):nI(e)}const tI=e=>function(t){return t[e]},nI=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function R(e){throw Error(e)}function zi(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||R("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&R("Access path missing closing bracket: "+e),i&&R("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function qn(e,t,n){const i=zi(e);return e=i.length===1?i[0]:e,hn((n&&n.get||Z_)(i),[e],t||e)}const Ll=qn("id"),Rt=hn(e=>e,[],"identity"),po=hn(()=>0,[],"zero"),qa=hn(()=>1,[],"one"),Wn=hn(()=>!0,[],"true"),go=hn(()=>!1,[],"false");function iI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const J_=0,T0=1,O0=2,Q_=3,e$=4;function D0(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:iI,i=e||J_;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=T0&&n(t||"error","ERROR",arguments),this},warn(){return i>=O0&&n(t||"warn","WARN",arguments),this},info(){return i>=Q_&&n(t||"log","INFO",arguments),this},debug(){return i>=e$&&n(t||"log","DEBUG",arguments),this}}}var L=Array.isArray;function Y(e){return e===Object(e)}const t$=e=>e!=="__proto__";function Wa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=rI(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Ha(i,o,r[o],s)}return i},{})}function Ha(e,t,n,i){if(!t$(t))return;let r,o;if(Y(n)&&!L(n)){o=Y(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Ha(o,r,n[r]):t$(r)&&(o[r]=n[r])}else e[t]=n}function rI(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function ve(e){return e[e.length-1]}function Pt(e){return e==null||e===""?null:+e}const n$=e=>t=>e*Math.exp(t),i$=e=>t=>Math.log(e*t),r$=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),o$=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,xd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function wd(e,t,n,i){const r=n(e[0]),o=n(ve(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function s$(e,t){return wd(e,t,Pt,Rt)}function a$(e,t){var n=Math.sign(e[0]);return wd(e,t,i$(n),n$(n))}function u$(e,t,n){return wd(e,t,xd(n),xd(1/n))}function l$(e,t,n){return wd(e,t,r$(n),o$(n))}function Ed(e,t,n,i,r){const o=i(e[0]),s=i(ve(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function N0(e,t,n){return Ed(e,t,n,Pt,Rt)}function R0(e,t,n){const i=Math.sign(e[0]);return Ed(e,t,n,i$(i),n$(i))}function _d(e,t,n,i){return Ed(e,t,n,xd(i),xd(1/i))}function P0(e,t,n,i){return Ed(e,t,n,r$(i),o$(i))}function c$(e){return 1+~~(new Date(e).getMonth()/3)}function f$(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?L(e)?e:[e]:[]}function d$(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ce(e){return typeof e=="function"}const oI="descending";function L0(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],o={},s=n.comparator||sI;return X(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===oI?-1:1),r.push(a=ce(a)?a:qn(a,null,n)),(Nt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:hn(s(r,i),Object.keys(o))}const $d=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),sI=(e,t)=>e.length===1?aI(e[0],t[0]):uI(e,t,e.length),aI=(e,t)=>function(n,i){return $d(e(n),e(i))*t},uI=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=$d(o(i),o(r));return s*t[a]});function Lt(e){return ce(e)?e:()=>e}function I0(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function fe(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Bi(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function h$(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}const lI=Object.prototype.hasOwnProperty;function Z(e,t){return lI.call(e,t)}const Sd={};function Ga(e){let t={},n;function i(o){return Z(t,o)&&t[o]!==Sd}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===Sd&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=Sd),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==Sd&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function p$(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=ve(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),fe(i,n)}function Va(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function mo(e){return typeof e=="boolean"}function yo(e){return Object.prototype.toString.call(e)==="[object Date]"}function g$(e){return e&&ce(e[Symbol.iterator])}function _e(e){return typeof e=="number"}function m$(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function z0(e,t,n){e&&(e=t?X(e).map(a=>a.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||Z_,o=a=>r(t?[a]:zi(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return hn(s,e,"key")}function y$(e,t){const n=e[0],i=ve(e),r=+t;return r?r===1?i:n+r*(i-n):n}const cI=1e4;function b$(e){e=+e||cI;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>Z(t,s)||Z(n,s),get:s=>Z(t,s)?t[s]:Z(n,s)?o(s,n[s]):void 0,set:(s,a)=>Z(t,s)?t[s]=a:o(s,a)}}function v$(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Il(e,t){let n="";for(;--t>=0;)n+=e;return n}function x$(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Il(r,s)+o:i==="center"?Il(r,~~(s/2))+o+Il(r,Math.ceil(s/2)):o+Il(r,s)}function zl(e){return e&&ve(e)-e[0]||0}function H(e){return L(e)?"["+e.map(H)+"]":Y(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function B0(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const fI=e=>_e(e)||yo(e)?e:Date.parse(e);function U0(e,t){return t=t||fI,e==null||e===""?null:t(e)}function j0(e){return e==null||e===""?null:e+""}function li(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function w$(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function bo(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var E$={},q0={},W0=34,Bl=10,H0=13;function _$(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function dI(e,t){var n=_$(e);return function(i,r){return t(n(i),r,e)}}function $$(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function pn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function hI(e){return e<0?"-"+pn(-e,6):e>9999?"+"+pn(e,6):pn(e,4)}function pI(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":hI(e.getUTCFullYear())+"-"+pn(e.getUTCMonth()+1,2)+"-"+pn(e.getUTCDate(),2)+(r?"T"+pn(t,2)+":"+pn(n,2)+":"+pn(i,2)+"."+pn(r,3)+"Z":i?"T"+pn(t,2)+":"+pn(n,2)+":"+pn(i,2)+"Z":n||t?"T"+pn(t,2)+":"+pn(n,2)+"Z":"")}function gI(e){var t=new RegExp('["'+e+`
43
+ \r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?dI(m,d):_$(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Bl&&--p,f.charCodeAt(p-1)===H0&&--p;function x(){if(b)return q0;if(v)return v=!1,E$;var _,E=g,$;if(f.charCodeAt(E)===W0){for(;g++<p&&f.charCodeAt(g)!==W0||f.charCodeAt(++g)===W0;);return(_=g)>=p?b=!0:($=f.charCodeAt(g++))===Bl?v=!0:$===H0&&(v=!0,f.charCodeAt(g)===Bl&&++g),f.slice(E+1,_-1).replace(/""/g,'"')}for(;g<p;){if(($=f.charCodeAt(_=g++))===Bl)v=!0;else if($===H0)v=!0,f.charCodeAt(g)===Bl&&++g;else if($!==n)continue;return f.slice(E,_)}return b=!0,f.slice(E,p)}for(;(y=x())!==q0;){for(var w=[];y!==E$&&y!==q0;)w.push(y),y=x();d&&(w=d(w,m++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function s(f,d){return d==null&&(d=$$(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
44
44
  `)}function a(f,d){return d==null&&(d=$$(f)),o(f,d).join(`
45
45
  `)}function u(f){return f.map(l).join(`
46
- `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?gI(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function yI(e){return e}function bI(e){if(e==null)return yI;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+o,f[1]=(n+=a[1])*r+s;l<c;)f[l]=a[l],++l;return f}}function vI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function xI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return S$(e,n)})}:S$(e,t)}function S$(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=A$(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function A$(e,t){var n=bI(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&vI(f,p)}function o(c){return n(c)}function s(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=s(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=s(c.arcs);break;case"MultiLineString":d=c.arcs.map(s);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function wI(e,t){var n={},i={},r={},o=[],s=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function EI(e){return A$(e,_I.apply(this,arguments))}function _I(e,t,n){var i,r,o;if(arguments.length>1)i=$I(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:wI(e,i)}}function $I(e,t,n){var i=[],r=[],o;function s(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function kr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function SI(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ya(e){let t,n,i;e.length!==2?(t=kr,n=(a,u)=>kr(e(a),u),i=(a,u)=>e(a)-u):(t=e===kr||e===SI?e:AI,n=e,i=e);function r(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function s(a,u,l=0,c=a.length){const f=r(a,u,l,c-1);return f>l&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:s,right:o}}function AI(){return 0}function k$(e){return e===null?NaN:+e}function*kI(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const C$=Ya(kr),vo=C$.right,CI=C$.left;Ya(k$).center;function MI(e,t){let n=0,i,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(i=s-r,r+=i/++n,o+=i*(s-r));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,o+=i*(a-r))}if(n>1)return o/(n-1)}function FI(e,t){const n=MI(e,t);return n&&Math.sqrt(n)}class Xt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[i++]=a),t=s}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,o,s=0;if(n>0){for(s=t[--n];n>0&&(i=s,r=t[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class M$ extends Map{constructor(t,n=O$){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(G0(this,t))}has(t){return super.has(G0(this,t))}set(t,n){return super.set(F$(this,t),n)}delete(t){return super.delete(T$(this,t))}}class Sd extends Set{constructor(t,n=O$){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(G0(this,t))}add(t){return super.add(F$(this,t))}delete(t){return super.delete(T$(this,t))}}function G0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function F$({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function T$({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function O$(e){return e!==null&&typeof e=="object"?e.valueOf():e}function TI(e,t){return Array.from(t,n=>e[n])}function OI(e=kr){if(e===kr)return N$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function N$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const NI=Math.sqrt(50),DI=Math.sqrt(10),RI=Math.sqrt(2);function Ad(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=NI?10:o>=DI?5:o>=RI?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/s,a=Math.round(e*l),u=Math.round(t*l),a/l<e&&++a,u/l>t&&--u,l=-l):(l=Math.pow(10,r)*s,a=Math.round(e/l),u=Math.round(t/l),a*l<e&&++a,u*l>t&&--u),u<a&&.5<=n&&n<2?Ad(e,t,n*2):[a,u,l]}function V0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,o,s]=i?Ad(t,e,n):Ad(e,t,n);if(!(o>=r))return[];const a=o-r+1,u=new Array(a);if(i)if(s<0)for(let l=0;l<a;++l)u[l]=(o-l)/-s;else for(let l=0;l<a;++l)u[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)u[l]=(r+l)/-s;else for(let l=0;l<a;++l)u[l]=(r+l)*s;return u}function Y0(e,t,n){return t=+t,e=+e,n=+n,Ad(e,t,n)[2]}function xo(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?Y0(t,e,n):Y0(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function Es(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function X0(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function D$(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?N$:OI(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));D$(e,t,h,p,r)}const o=e[t];let s=n,a=i;for(Bl(e,n,t),r(e[i],o)>0&&Bl(e,n,i);s<a;){for(Bl(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Bl(e,n,a):(++a,Bl(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Bl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function K0(e,t,n){if(e=Float64Array.from(kI(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return X0(e);if(t>=1)return Es(e);var i,r=(i-1)*t,o=Math.floor(r),s=Es(D$(e,o).subarray(0,o+1)),a=X0(e.subarray(o+1));return s+(a-s)*(r-o)}}function R$(e,t,n=k$){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}}function PI(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function P$(e,t){return K0(e,.5,t)}function*LI(e){for(const t of e)yield*t}function L$(e){return Array.from(LI(e))}function Mn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++i<r;)o[i]=e+i*n;return o}function I$(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function II(e,...t){e=new Sd(e),t=t.map(zI);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function zI(e){return e instanceof Sd?e:new Sd(e)}function BI(...e){const t=new Sd;for(const n of e)for(const i of n)t.add(i);return t}function UI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function kd(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Xa(e){return e=kd(Math.abs(e)),e?e[1]:NaN}function jI(e,t){return function(n,i){for(var r=n.length,o=[],s=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),o.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function qI(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var WI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _s(e){if(!(t=WI.exec(e)))throw new Error("invalid format: "+e);var t;return new Z0({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]})}_s.prototype=Z0.prototype;function Z0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Z0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function HI(e){e:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var z$;function GI(e,t){var n=kd(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(z$=Math.max(-8,Math.min(8,Math.floor(r/3)))*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")+kd(e,Math.max(0,t+o-1))[0]}function B$(e,t){var n=kd(e,t);if(!n)return e+"";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")}const U$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:UI,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)=>B$(e*100,t),r:B$,s:GI,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function j$(e){return e}var q$=Array.prototype.map,W$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function H$(e){var t=e.grouping===void 0||e.thousands===void 0?j$:jI(q$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?j$:qI(q$.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=_s(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,w=f.type;w==="n"?(b=!0,w="g"):U$[w]||(v===void 0&&(v=12),x=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",E=g==="$"?i:/[%p]/.test(w)?s:"",$=U$[w],S=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function M(k){var N=_,A=E,F,C,T;if(w==="c")A=$(k)+A,k="";else{k=+k;var P=k<0||1/k<0;if(k=isNaN(k)?u:$(Math.abs(k),v),x&&(k=HI(k)),P&&+k==0&&p!=="+"&&(P=!1),N=(P?p==="("?p:a:p==="-"||p==="("?"":p)+N,A=(w==="s"?W$[8+z$/3]:"")+A+(P&&p==="("?")":""),S){for(F=-1,C=k.length;++F<C;)if(T=k.charCodeAt(F),48>T||T>57){A=(T===46?r+k.slice(F+1):k.slice(F))+A,k=k.slice(0,F);break}}}b&&!m&&(k=t(k,1/0));var I=N.length+k.length+A.length,z=I<y?new Array(y-I+1).join(d):"";switch(b&&m&&(k=t(z+k,z.length?y-A.length:1/0),z=""),h){case"<":k=N+k+A+z;break;case"=":k=N+z+k+A;break;case"^":k=z.slice(0,I=z.length>>1)+N+k+A+z.slice(I);break;default:k=z+N+k+A;break}return o(k)}return M.toString=function(){return f+""},M}function c(f,d){var h=l((f=_s(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Xa(d)/3)))*3,g=Math.pow(10,-p),m=W$[8+p/3];return function(y){return h(g*y)+m}}return{format:l,formatPrefix:c}}var Cd,Md,J0;VI({thousands:",",grouping:[3],currency:["$",""]});function VI(e){return Cd=H$(e),Md=Cd.format,J0=Cd.formatPrefix,Cd}function G$(e){return Math.max(0,-Xa(Math.abs(e)))}function V$(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xa(t)/3)))*3-Xa(Math.abs(e)))}function Y$(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xa(t)-Xa(e))+1}const Q0=new Date,e1=new Date;function it(e,t,n,i){function r(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(e(o=new Date(+o)),o),r.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const u=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return u;let l;do u.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return u},r.filter=o=>it(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(r.count=(o,s)=>(Q0.setTime(+o),e1.setTime(+s),e(Q0),e(e1),Math.floor(n(Q0,e1))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const Ka=it(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ka.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?it(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ka),Ka.range;const Cr=1e3,Hn=Cr*60,Mr=Hn*60,Fr=Mr*24,t1=Fr*7,X$=Fr*30,n1=Fr*365,Tr=it(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCSeconds());Tr.range;const Fd=it(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getMinutes());Fd.range;const Td=it(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getUTCMinutes());Td.range;const Od=it(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr-e.getMinutes()*Hn)},(e,t)=>{e.setTime(+e+t*Mr)},(e,t)=>(t-e)/Mr,e=>e.getHours());Od.range;const Nd=it(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Mr)},(e,t)=>(t-e)/Mr,e=>e.getUTCHours());Nd.range;const Or=it(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hn)/Fr,e=>e.getDate()-1);Or.range;const wo=it(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Fr,e=>e.getUTCDate()-1);wo.range;const K$=it(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Fr,e=>Math.floor(e/Fr));K$.range;function $s(e){return it(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Hn)/t1)}const Za=$s(0),Dd=$s(1),YI=$s(2),XI=$s(3),Ja=$s(4),KI=$s(5),ZI=$s(6);Za.range,Dd.range,YI.range,XI.range,Ja.range,KI.range,ZI.range;function Ss(e){return it(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/t1)}const Qa=Ss(0),Rd=Ss(1),JI=Ss(2),QI=Ss(3),eu=Ss(4),ez=Ss(5),tz=Ss(6);Qa.range,Rd.range,JI.range,QI.range,eu.range,ez.range,tz.range;const Ul=it(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ul.range;const jl=it(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jl.range;const Ui=it(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());Ui.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:it(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)}),Ui.range;const ji=it(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());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:it(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)}),ji.range;function Z$(e,t,n,i,r,o){const s=[[Tr,1,Cr],[Tr,5,5*Cr],[Tr,15,15*Cr],[Tr,30,30*Cr],[o,1,Hn],[o,5,5*Hn],[o,15,15*Hn],[o,30,30*Hn],[r,1,Mr],[r,3,3*Mr],[r,6,6*Mr],[r,12,12*Mr],[i,1,Fr],[i,2,2*Fr],[n,1,t1],[t,1,X$],[t,3,3*X$],[e,1,n1]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){const d=Math.abs(c-l)/f,h=Ya(([,,m])=>m).right(s,d);if(h===s.length)return e.every(xo(l/n1,c/n1,f));if(h===0)return Ka.every(Math.max(xo(l,c,f),1));const[p,g]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(g)}return[a,u]}const[nz,iz]=Z$(ji,jl,Qa,K$,Nd,Td),[rz,oz]=Z$(Ui,Ul,Za,Or,Od,Fd),Et="year",gn="quarter",It="month",rt="week",mn="date",zt="day",qi="dayofyear",Fn="hours",Tn="minutes",Gn="seconds",ci="milliseconds",i1=[Et,gn,It,rt,mn,zt,qi,Fn,Tn,Gn,ci],r1=i1.reduce((e,t,n)=>(e[t]=1+n,e),{});function o1(e){const t=X(e).slice(),n={};return t.length||R("Missing time unit."),t.forEach(r=>{Z(r1,r)?n[r]=1:R(`Invalid time unit: ${r}.`)}),(n[rt]||n[zt]?1:0)+(n[gn]||n[It]||n[mn]?1:0)+(n[qi]?1:0)>1&&R(`Incompatible time units: ${e}`),t.sort((r,o)=>r1[r]-r1[o]),t}const sz={[Et]:"%Y ",[gn]:"Q%q ",[It]:"%b ",[mn]:"%d ",[rt]:"W%U ",[zt]:"%a ",[qi]:"%j ",[Fn]:"%H:00",[Tn]:"00:%M",[Gn]:":%S",[ci]:".%L",[`${Et}-${It}`]:"%Y-%m ",[`${Et}-${It}-${mn}`]:"%Y-%m-%d ",[`${Fn}-${Tn}`]:"%H:%M"};function J$(e,t){const n=fe({},sz,t),i=o1(e),r=i.length;let o="",s=0,a,u;for(s=0;s<r;)for(a=i.length;a>s;--a)if(u=i.slice(s,a).join("-"),n[u]!=null){o+=n[u],s=a;break}return o.trim()}const As=new Date;function s1(e){return As.setFullYear(e),As.setMonth(0),As.setDate(1),As.setHours(0,0,0,0),As}function Q$(e){return tS(new Date(e))}function eS(e){return a1(new Date(e))}function tS(e){return Or.count(s1(e.getFullYear())-1,e)}function a1(e){return Za.count(s1(e.getFullYear())-1,e)}function u1(e){return s1(e).getDay()}function az(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);return a.setFullYear(e),a}return new Date(e,t,n,i,r,o,s)}function nS(e){return rS(new Date(e))}function iS(e){return l1(new Date(e))}function rS(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return wo.count(t-1,e)}function l1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Qa.count(t-1,e)}function c1(e){return As.setTime(Date.UTC(e,0,1)),As.getUTCDay()}function uz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,o,s))}function oS(e,t,n,i,r){const o=t||1,s=ve(e),a=(y,b,v)=>(v=v||y,lz(n[v],i[v],y===s&&o,b)),u=new Date,l=li(e),c=l[Et]?a(Et):Lt(2012),f=l[It]?a(It):l[gn]?a(gn):po,d=l[rt]&&l[zt]?a(zt,1,rt+zt):l[rt]?a(rt,1):l[zt]?a(zt,1):l[mn]?a(mn,1):l[qi]?a(qi,1):qa,h=l[Fn]?a(Fn):po,p=l[Tn]?a(Tn):po,g=l[Gn]?a(Gn):po,m=l[ci]?a(ci):po;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function lz(e,t,n,i){const r=n<=1?e:i?(o,s)=>i+n*Math.floor((e(o,s)-i)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(r(o,s),s):r}function tu(e,t,n){return t+e*7-(n+6)%7}const cz={[Et]:e=>e.getFullYear(),[gn]:e=>Math.floor(e.getMonth()/3),[It]:e=>e.getMonth(),[mn]:e=>e.getDate(),[Fn]:e=>e.getHours(),[Tn]:e=>e.getMinutes(),[Gn]:e=>e.getSeconds(),[ci]:e=>e.getMilliseconds(),[qi]:e=>tS(e),[rt]:e=>a1(e),[rt+zt]:(e,t)=>tu(a1(e),e.getDay(),u1(t)),[zt]:(e,t)=>tu(1,e.getDay(),u1(t))},fz={[gn]:e=>3*e,[rt]:(e,t)=>tu(e,0,u1(t))};function sS(e,t){return oS(e,t||1,cz,fz,az)}const dz={[Et]:e=>e.getUTCFullYear(),[gn]:e=>Math.floor(e.getUTCMonth()/3),[It]:e=>e.getUTCMonth(),[mn]:e=>e.getUTCDate(),[Fn]:e=>e.getUTCHours(),[Tn]:e=>e.getUTCMinutes(),[Gn]:e=>e.getUTCSeconds(),[ci]:e=>e.getUTCMilliseconds(),[qi]:e=>rS(e),[rt]:e=>l1(e),[zt]:(e,t)=>tu(1,e.getUTCDay(),c1(t)),[rt+zt]:(e,t)=>tu(l1(e),e.getUTCDay(),c1(t))},hz={[gn]:e=>3*e,[rt]:(e,t)=>tu(e,0,c1(t))};function aS(e,t){return oS(e,t||1,dz,hz,uz)}const pz={[Et]:Ui,[gn]:Ul.every(3),[It]:Ul,[rt]:Za,[mn]:Or,[zt]:Or,[qi]:Or,[Fn]:Od,[Tn]:Fd,[Gn]:Tr,[ci]:Ka},gz={[Et]:ji,[gn]:jl.every(3),[It]:jl,[rt]:Qa,[mn]:wo,[zt]:wo,[qi]:wo,[Fn]:Nd,[Tn]:Td,[Gn]:Tr,[ci]:Ka};function nu(e){return pz[e]}function iu(e){return gz[e]}function uS(e,t,n){return e?e.offset(t,n):void 0}function lS(e,t,n){return uS(nu(e),t,n)}function cS(e,t,n){return uS(iu(e),t,n)}function fS(e,t,n,i){return e?e.range(t,n,i):void 0}function dS(e,t,n,i){return fS(nu(e),t,n,i)}function hS(e,t,n,i){return fS(iu(e),t,n,i)}const ql=1e3,Wl=ql*60,Hl=Wl*60,Pd=Hl*24,mz=Pd*7,pS=Pd*30,f1=Pd*365,gS=[Et,It,mn,Fn,Tn,Gn,ci],Gl=gS.slice(0,-1),Vl=Gl.slice(0,-1),Yl=Vl.slice(0,-1),yz=Yl.slice(0,-1),bz=[Et,rt],mS=[Et,It],yS=[Et],Xl=[[Gl,1,ql],[Gl,5,5*ql],[Gl,15,15*ql],[Gl,30,30*ql],[Vl,1,Wl],[Vl,5,5*Wl],[Vl,15,15*Wl],[Vl,30,30*Wl],[Yl,1,Hl],[Yl,3,3*Hl],[Yl,6,6*Hl],[Yl,12,12*Hl],[yz,1,Pd],[bz,1,mz],[mS,1,pS],[mS,3,3*pS],[yS,1,f1]];function bS(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Il(t))/n;let r=Ya(a=>a[2]).right(Xl,i),o,s;return r===Xl.length?(o=yS,s=xo(t[0]/f1,t[1]/f1,n)):r?(r=Xl[i/Xl[r-1][2]<Xl[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=gS,s=Math.max(xo(t[0],t[1],n),1)),{units:o,step:s}}function d1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function h1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Kl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function vS(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,u=e.shortMonths,l=Zl(r),c=Jl(r),f=Zl(o),d=Jl(o),h=Zl(s),p=Jl(s),g=Zl(a),m=Jl(a),y=Zl(u),b=Jl(u),v={a:P,A:I,b:z,B:te,c:null,d:SS,e:SS,f:Uz,g:Zz,G:Qz,H:Iz,I:zz,j:Bz,L:AS,m:jz,M:qz,p:ne,q:de,Q:OS,s:NS,S:Wz,u:Hz,U:Gz,V:Vz,w:Yz,W:Xz,x:null,X:null,y:Kz,Y:Jz,Z:e8,"%":TS},x={a:ke,A:Ee,b:Ie,B:$r,c:null,d:CS,e:CS,f:r8,g:p8,G:m8,H:t8,I:n8,j:i8,L:MS,m:o8,M:s8,p:Ia,q:ms,Q:OS,s:NS,S:a8,u:u8,U:l8,V:c8,w:f8,W:d8,x:null,X:null,y:h8,Y:g8,Z:y8,"%":TS},w={a:M,A:k,b:N,B:A,c:F,d:_S,e:_S,f:Dz,g:ES,G:wS,H:$S,I:$S,j:Fz,L:Nz,m:Mz,M:Tz,p:S,q:Cz,Q:Pz,s:Lz,S:Oz,u:_z,U:$z,V:Sz,w:Ez,W:Az,x:C,X:T,y:ES,Y:wS,Z:kz,"%":Rz};v.x=_(n,v),v.X=_(i,v),v.c=_(t,v),x.x=_(n,x),x.X=_(i,x),x.c=_(t,x);function _(J,he){return function(me){var W=[],Ot=-1,Oe=0,Yt=J.length,wt,Sr,g0;for(me instanceof Date||(me=new Date(+me));++Ot<Yt;)J.charCodeAt(Ot)===37&&(W.push(J.slice(Oe,Ot)),(Sr=xS[wt=J.charAt(++Ot)])!=null?wt=J.charAt(++Ot):Sr=wt==="e"?" ":"0",(g0=he[wt])&&(wt=g0(me,Sr)),W.push(wt),Oe=Ot+1);return W.push(J.slice(Oe,Ot)),W.join("")}}function E(J,he){return function(me){var W=Kl(1900,void 0,1),Ot=$(W,J,me+="",0),Oe,Yt;if(Ot!=me.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(he&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Oe=h1(Kl(W.y,0,1)),Yt=Oe.getUTCDay(),Oe=Yt>4||Yt===0?Rd.ceil(Oe):Rd(Oe),Oe=wo.offset(Oe,(W.V-1)*7),W.y=Oe.getUTCFullYear(),W.m=Oe.getUTCMonth(),W.d=Oe.getUTCDate()+(W.w+6)%7):(Oe=d1(Kl(W.y,0,1)),Yt=Oe.getDay(),Oe=Yt>4||Yt===0?Dd.ceil(Oe):Dd(Oe),Oe=Or.offset(Oe,(W.V-1)*7),W.y=Oe.getFullYear(),W.m=Oe.getMonth(),W.d=Oe.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Yt="Z"in W?h1(Kl(W.y,0,1)).getUTCDay():d1(Kl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Yt+5)%7:W.w+W.U*7-(Yt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,h1(W)):d1(W)}}function $(J,he,me,W){for(var Ot=0,Oe=he.length,Yt=me.length,wt,Sr;Ot<Oe;){if(W>=Yt)return-1;if(wt=he.charCodeAt(Ot++),wt===37){if(wt=he.charAt(Ot++),Sr=w[wt in xS?he.charAt(Ot++):wt],!Sr||(W=Sr(J,me,W))<0)return-1}else if(wt!=me.charCodeAt(W++))return-1}return W}function S(J,he,me){var W=l.exec(he.slice(me));return W?(J.p=c.get(W[0].toLowerCase()),me+W[0].length):-1}function M(J,he,me){var W=h.exec(he.slice(me));return W?(J.w=p.get(W[0].toLowerCase()),me+W[0].length):-1}function k(J,he,me){var W=f.exec(he.slice(me));return W?(J.w=d.get(W[0].toLowerCase()),me+W[0].length):-1}function N(J,he,me){var W=y.exec(he.slice(me));return W?(J.m=b.get(W[0].toLowerCase()),me+W[0].length):-1}function A(J,he,me){var W=g.exec(he.slice(me));return W?(J.m=m.get(W[0].toLowerCase()),me+W[0].length):-1}function F(J,he,me){return $(J,t,he,me)}function C(J,he,me){return $(J,n,he,me)}function T(J,he,me){return $(J,i,he,me)}function P(J){return s[J.getDay()]}function I(J){return o[J.getDay()]}function z(J){return u[J.getMonth()]}function te(J){return a[J.getMonth()]}function ne(J){return r[+(J.getHours()>=12)]}function de(J){return 1+~~(J.getMonth()/3)}function ke(J){return s[J.getUTCDay()]}function Ee(J){return o[J.getUTCDay()]}function Ie(J){return u[J.getUTCMonth()]}function $r(J){return a[J.getUTCMonth()]}function Ia(J){return r[+(J.getUTCHours()>=12)]}function ms(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var he=_(J+="",v);return he.toString=function(){return J},he},parse:function(J){var he=E(J+="",!1);return he.toString=function(){return J},he},utcFormat:function(J){var he=_(J+="",x);return he.toString=function(){return J},he},utcParse:function(J){var he=E(J+="",!0);return he.toString=function(){return J},he}}}var xS={"-":"",_:" ",0:"0"},ft=/^\s*\d+/,vz=/^%/,xz=/[\\^$*+?|[\]().{}]/g;function $e(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function wz(e){return e.replace(xz,"\\$&")}function Zl(e){return new RegExp("^(?:"+e.map(wz).join("|")+")","i")}function Jl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Ez(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function _z(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function $z(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Sz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Az(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function wS(e,t,n){var i=ft.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function ES(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function kz(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Cz(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Mz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function _S(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Fz(e,t,n){var i=ft.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function $S(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Tz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Oz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Nz(e,t,n){var i=ft.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Dz(e,t,n){var i=ft.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Rz(e,t,n){var i=vz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Pz(e,t,n){var i=ft.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Lz(e,t,n){var i=ft.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function SS(e,t){return $e(e.getDate(),t,2)}function Iz(e,t){return $e(e.getHours(),t,2)}function zz(e,t){return $e(e.getHours()%12||12,t,2)}function Bz(e,t){return $e(1+Or.count(Ui(e),e),t,3)}function AS(e,t){return $e(e.getMilliseconds(),t,3)}function Uz(e,t){return AS(e,t)+"000"}function jz(e,t){return $e(e.getMonth()+1,t,2)}function qz(e,t){return $e(e.getMinutes(),t,2)}function Wz(e,t){return $e(e.getSeconds(),t,2)}function Hz(e){var t=e.getDay();return t===0?7:t}function Gz(e,t){return $e(Za.count(Ui(e)-1,e),t,2)}function kS(e){var t=e.getDay();return t>=4||t===0?Ja(e):Ja.ceil(e)}function Vz(e,t){return e=kS(e),$e(Ja.count(Ui(e),e)+(Ui(e).getDay()===4),t,2)}function Yz(e){return e.getDay()}function Xz(e,t){return $e(Dd.count(Ui(e)-1,e),t,2)}function Kz(e,t){return $e(e.getFullYear()%100,t,2)}function Zz(e,t){return e=kS(e),$e(e.getFullYear()%100,t,2)}function Jz(e,t){return $e(e.getFullYear()%1e4,t,4)}function Qz(e,t){var n=e.getDay();return e=n>=4||n===0?Ja(e):Ja.ceil(e),$e(e.getFullYear()%1e4,t,4)}function e8(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function CS(e,t){return $e(e.getUTCDate(),t,2)}function t8(e,t){return $e(e.getUTCHours(),t,2)}function n8(e,t){return $e(e.getUTCHours()%12||12,t,2)}function i8(e,t){return $e(1+wo.count(ji(e),e),t,3)}function MS(e,t){return $e(e.getUTCMilliseconds(),t,3)}function r8(e,t){return MS(e,t)+"000"}function o8(e,t){return $e(e.getUTCMonth()+1,t,2)}function s8(e,t){return $e(e.getUTCMinutes(),t,2)}function a8(e,t){return $e(e.getUTCSeconds(),t,2)}function u8(e){var t=e.getUTCDay();return t===0?7:t}function l8(e,t){return $e(Qa.count(ji(e)-1,e),t,2)}function FS(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function c8(e,t){return e=FS(e),$e(eu.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function f8(e){return e.getUTCDay()}function d8(e,t){return $e(Rd.count(ji(e)-1,e),t,2)}function h8(e,t){return $e(e.getUTCFullYear()%100,t,2)}function p8(e,t){return e=FS(e),$e(e.getUTCFullYear()%100,t,2)}function g8(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function m8(e,t){var n=e.getUTCDay();return e=n>=4||n===0?eu(e):eu.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function y8(){return"+0000"}function TS(){return"%"}function OS(e){return+e}function NS(e){return Math.floor(+e/1e3)}var ru,p1,DS,g1,RS;b8({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"]});function b8(e){return ru=vS(e),p1=ru.format,DS=ru.parse,g1=ru.utcFormat,RS=ru.utcParse,ru}function Ql(e){const t={};return n=>t[n]||(t[n]=e(n))}function v8(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=x8(i,r);const s=o<i.length?i.slice(o):"";for(;--o>r;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function x8(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function PS(e){const t=Ql(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=_s(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return v8(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=_s(s??",f");const a=xo(i,r,o),u=Math.max(Math.abs(i),Math.abs(r));let l;if(s.precision==null)switch(s.type){case"s":return isNaN(l=V$(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=Y$(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=G$(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let m1;LS();function LS(){return m1=PS({format:Md,formatPrefix:J0})}function IS(e){return PS(H$(e))}function Ld(e){return arguments.length?m1=IS(e):m1}function zS(e,t,n){n=n||{},Y(n)||R(`Invalid time multi-format specifier: ${n}`);const i=t(Gn),r=t(Tn),o=t(Fn),s=t(mn),a=t(rt),u=t(It),l=t(gn),c=t(Et),f=e(n[ci]||".%L"),d=e(n[Gn]||":%S"),h=e(n[Tn]||"%I:%M"),p=e(n[Fn]||"%I %p"),g=e(n[mn]||n[zt]||"%a %d"),m=e(n[rt]||"%b %d"),y=e(n[It]||"%B"),b=e(n[gn]||"%B"),v=e(n[Et]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:o(x)<x?h:s(x)<x?p:u(x)<x?a(x)<x?g:m:c(x)<x?l(x)<x?y:b:v)(x)}function BS(e){const t=Ql(e.format),n=Ql(e.utcFormat);return{timeFormat:i=>K(i)?t(i):zS(t,nu,i),utcFormat:i=>K(i)?n(i):zS(n,iu,i),timeParse:Ql(e.parse),utcParse:Ql(e.utcParse)}}let y1;US();function US(){return y1=BS({format:p1,parse:DS,utcFormat:g1,utcParse:RS})}function jS(e){return BS(vS(e))}function ec(e){return arguments.length?y1=jS(e):y1}const b1=(e,t)=>fe({},e,t);function qS(e,t){const n=e?IS(e):Ld(),i=t?jS(t):ec();return b1(n,i)}function v1(e,t){const n=arguments.length;return n&&n!==2&&R("defaultLocale expects either zero or two arguments."),n?b1(Ld(e),ec(t)):b1(Ld(),ec())}function w8(){return LS(),US(),v1()}const E8=/^(data:|([A-Za-z]+:)?\/\/)/,_8=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,$8=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,WS="file://";function S8(e,t){return n=>({options:n||{},sanitize:k8,load:A8,fileAccess:!!t,file:C8(t),http:F8(e)})}async function A8(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function k8(e,t){t=fe({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=_8.test(e.replace($8,""));(e==null||typeof e!="string"||!a)&&R("Sanitize failure, invalid URI: "+H(e));const u=E8.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(WS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(WS.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function C8(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):M8}async function M8(){R("No file system access.")}function F8(e){return e?async function(t,n){const i=fe({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?ce(o[r])?o[r]():o.text():R(o.status+""+o.statusText)}:T8}async function T8(){R("No HTTP fetch method available.")}const O8=e=>e!=null&&e===e,N8=e=>e==="true"||e==="false"||e===!0||e===!1,D8=e=>!Number.isNaN(Date.parse(e)),HS=e=>!Number.isNaN(+e)&&!(e instanceof Date),R8=e=>HS(e)&&Number.isInteger(+e),x1={boolean:B0,integer:Pt,number:Pt,date:U0,string:j0,unknown:Rt},Id=[N8,R8,HS,D8],P8=["boolean","integer","number","date"];function GS(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Id.length,r=Id.map((o,s)=>s+1);for(let o=0,s=0,a,u;o<n;++o)for(u=t?e[o][t]:e[o],a=0;a<i;++a)if(r[a]&&O8(u)&&!Id[a](u)&&(r[a]=0,++s,s===Id.length))return"string";return P8[r.reduce((o,s)=>o===0?s:o,0)-1]}function VS(e,t){return t.reduce((n,i)=>(n[i]=GS(e,i),n),{})}function YS(e){const t=function(n,i){const r={delimiter:e};return w1(n,i?fe(i,r):r)};return t.responseType="text",t}function w1(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
47
- `+e),mI(t.delimiter).parse(e+"")}w1.responseType="text";function L8(e){return typeof Buffer=="function"&&ce(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function E1(e,t){const n=t&&t.property?qn(t.property):Rt;return Y(e)&&!L8(e)?I8(n(e),t):n(JSON.parse(e))}E1.responseType="json";function I8(e,t){return!L(e)&&g$(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const z8={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function XS(e,t){let n,i,r,o;return e=E1(e,t),t&&t.feature?(n=xI,r=t.feature):t&&t.mesh?(n=EI,r=t.mesh,o=z8[t.filter]):R("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):R("Invalid TopoJSON object: "+r),i&&i.features||[i]}XS.responseType="json";const zd={dsv:w1,csv:YS(","),tsv:YS(" "),json:E1,topojson:XS};function _1(e,t){return arguments.length>1?(zd[e]=t,this):Z(zd,e)?zd[e]:null}function KS(e){const t=_1(e);return t&&t.responseType||"text"}function ZS(e,t,n,i){t=t||{};const r=_1(t.type||"json");return r||R("Unknown data format type: "+t.type),e=r(e,t),t.parse&&B8(e,t.parse,n,i),Z(e,"columns")&&delete e.columns,e}function B8(e,t,n,i){if(!e.length)return;const r=ec();n=n||r.timeParse,i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,l,c,f;t==="auto"&&(t=VS(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!x1[p])throw Error("Illegal format pattern: "+h+":"+p);return x1[p]});for(u=0,c=e.length,f=o.length;u<c;++u)for(s=e[u],l=0;l<f;++l)a=o[l],s[a]=d[l](s[a])}const Bd=S8(typeof fetch<"u"&&fetch,null);function Ud(e){const t=e||Rt,n=[],i={};return n.add=r=>{const o=t(r);return i[o]||(i[o]=1,n.push(r)),n},n.remove=r=>{const o=t(r);if(i[o]){i[o]=0;const s=n.indexOf(r);s>=0&&n.splice(s,1)}return n},n}async function jd(e,t){try{await t(e)}catch(n){e.error(n)}}const JS=Symbol("vega_id");let U8=1;function qd(e){return!!(e&&ie(e))}function ie(e){return e[JS]}function QS(e,t){return e[JS]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return ie(t)?t:QS(t,U8++)}function $1(e){return Wd(e,Ce({}))}function Wd(e,t){for(const n in e)t[n]=e[n];return t}function eA(e,t){return QS(t,ie(e))}function ks(e,t){return e?t?(n,i)=>e(n,i)||ie(t(n))-ie(t(i)):(n,i)=>e(n,i)||ie(n)-ie(i):null}function tA(e){return e&&e.constructor===Cs}function Cs(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:Cs,insert(a){const u=X(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ce(a)?i:t,l=X(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Lt(l)};return ce(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ce(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[ie(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[ie(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[ie(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=ie(g),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[ie(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,s||(c[ie(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[ie(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[ie(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[ie(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||i.length))&&a.clean(!0),a}}}const Hd="_:mod:_";function Gd(){Object.defineProperty(this,Hd,{writable:!0,value:{}})}Gd.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[Hd];return t!=null&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(r[e]=n,s[e]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[Hd];if(arguments.length){if(L(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Hd]={},this}};let j8=0;const q8="pulse",W8=new Gd,H8=1,G8=2;function Le(e,t,n,i){this.id=++j8,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function nA(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Le.prototype={targets(){return this._targets||(this._targets=Ud(Pl))},set(e){return this.value!==e?(this.value=e,1):0},skip:nA(H8),modified:nA(G8),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Gd,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Le?(h!==this&&(t&&h.targets().add(this),o.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(s in e)if(a=e[s],s===q8)X(a).forEach(f=>{f instanceof Le?f!==this&&(f.targets().add(this),o.push(f)):R("Pulse parameters must be operator instances.")}),this.source=a;else if(L(a))for(i.set(s,-1,Array(u=a.length)),l=0;l<u;++l)c(s,l,a[l]);else c(s,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||W8,n=this._argops;let i,r,o,s;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],o=i.op,s=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,s);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function V8(e,t,n,i){let r=1,o;return e instanceof Le?o=e:e&&e.prototype instanceof Le?o=new e:ce(e)?o=new Le(null,e):(r=0,o=new Le(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function Y8(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let X8=0;function Vd(e,t,n){this.id=++X8,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Eo(e,t,n){return new Vd(e,t,n)}Vd.prototype={_filter:Wn,_apply:Rt,targets(){return this._targets||(this._targets=Ud(Pl))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Eo(e);return this.targets().add(t),t},apply(e){const t=Eo(null,e);return this.targets().add(t),t},merge(){const e=Eo();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Eo();return this.targets().add(Eo(null,null,I0(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(Eo(null,null,()=>n=!0)),t.targets().add(Eo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Wn,this._targets=null}};function K8(e,t,n,i){const r=this,o=Eo(n,i),s=function(l){l.dataflow=r;try{o.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=X(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function Z8(e,t){const n=this.locale();return ZS(e,t,n.timeParse,n.utcParse)}function J8(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function Q8(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:KS(t&&t.type)});try{r=n.parse(r,t)}catch(o){i=-2,n.warn("Data ingestion failed",e,o)}}catch(o){i=-1,n.warn("Loading failed",e,o)}return{data:r,status:i}}async function e9(e,t,n){const i=this,r=i._pending||t9(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Wn).insert(o.data||[])),r.done(),o}function t9(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const n9={skip:!0};function i9(e,t,n,i,r){return(e instanceof Le?o9:r9)(this,e,t,n,i,r),this}function r9(e,t,n,i,r,o){const s=fe({},o,n9);let a,u;ce(n)||(n=Lt(n)),i===void 0?a=l=>e.touch(n(l)):ce(i)?(u=new Le(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;tA(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function o9(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Le(null,s9(n,i),r,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function s9(e,t){return t=ce(t)?t:Lt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function a9(e){e.rank=++this._rank}function u9(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&R("Cycle detected in dataflow graph.")}const Yd={},Wi=1,_o=2,Nr=4,l9=Wi|_o,iA=Wi|Nr,ou=Wi|_o|Nr,rA=8,tc=16,oA=32,sA=64;function $o(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function S1(e,t){const n=[];return bo(e,t,i=>n.push(i)),n}function aA(e,t){const n={};return e.visit(t,i=>{n[ie(i)]=1}),i=>n[ie(i)]?null:i}function Xd(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}$o.prototype={StopPropagation:Yd,ADD:Wi,REM:_o,MOD:Nr,ADD_REM:l9,ADD_MOD:iA,ALL:ou,REFLOW:rA,SOURCE:tc,NO_SOURCE:oA,NO_FIELDS:sA,fork(e){return new $o(this.dataflow).init(this,e)},clone(){const e=this.fork(ou);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(ou|tc)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new $o(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&&!(t&sA)&&(n.fields=e.fields),t&Wi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&_o?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Nr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&oA?(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||ou;return t&Wi&&this.add.length||t&_o&&this.rem.length||t&Nr&&this.mod.length},reflow(e){if(e)return this.fork(ou).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Nr,aA(this,Wi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Wi&&(n.addF=Xd(n.addF,t)),e&_o&&(n.remF=Xd(n.remF,t)),e&Nr&&(n.modF=Xd(n.modF,t)),e&tc&&(n.srcF=Xd(n.srcF,t)),n},materialize(e){e=e||ou;const t=this;return e&Wi&&t.addF&&(t.add=S1(t.add,t.addF),t.addF=null),e&_o&&t.remF&&(t.rem=S1(t.rem,t.remF),t.remF=null),e&Nr&&t.modF&&(t.mod=S1(t.mod,t.modF),t.modF=null),e&tc&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&tc)return bo(n.source,n.srcF,i),n;e&Wi&&bo(n.add,n.addF,i),e&_o&&bo(n.rem,n.remF,i),e&Nr&&bo(n.mod,n.modF,i);const r=n.source;if(e&rA&&r){const o=n.add.length+n.mod.length;o===r.length||(o?bo(r,aA(n,iA),i):bo(r,n.srcF,i))}return n}};function A1(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=r.fields||(r.fields={});for(const u in s.fields)a[u]=1}s.changed(r.ADD)&&(o|=r.ADD),s.changed(r.REM)&&(o|=r.REM),s.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}G(A1,$o,{fork(e){const t=new $o(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?L(e)?e.some(i=>n[i]):n[e]:0},filter(){R("MultiPulse does not support filtering.")},materialize(){R("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});async function c9(e,t,n){const i=this,r=[];if(i._pulse)return uA(i);if(i._pending&&await i._pending,t&&await jd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new $o(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ud(Pl);let s=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Yd),u!==Yd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++s}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${s} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await jd(i,c[f].callback)}return n&&await jd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function f9(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function d9(e,t,n){return this._pulse?uA(this):(this.evaluate(e,t,n),this)}function h9(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function uA(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function p9(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function g9(e,t){const n=e.source,i=this._clock;return n&&L(n)?new A1(this,i,n.map(r=>r.pulse),t):this._input[e.id]||m9(this._pulse,n&&n.pulse)}function m9(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Yd&&(e.source=t.source),e)}const k1={skip:!1,force:!1};function y9(e,t){const n=t||k1;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function b9(e,t,n){const i=n||k1;return(e.set(t)||i.force)&&this.touch(e,i),this}function v9(e,t,n){this.touch(e,n||k1);const i=new $o(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function x9(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),lA(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,w9(t,0,e)):i=n,i}}}function lA(e,t,n,i){let r,o;const s=e[n];for(;n>t;){if(o=n-1>>1,r=e[o],i(s,r)<0){e[n]=r,n=o;continue}break}return e[n]=s}function w9(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,lA(e,i,t,n)}function su(){this.logger(N0()),this.logLevel(T0),this._clock=0,this._rank=0,this._locale=v1();try{this._loader=Bd()}catch{}this._touched=Ud(Pl),this._input={},this._pulse=null,this._heap=x9((e,t)=>e.qrank-t.qrank),this._postrun=[]}function nc(e){return function(){return this._log[e].apply(this,arguments)}}su.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:nc("error"),warn:nc("warn"),info:nc("info"),debug:nc("debug"),logLevel:nc("level"),cleanThreshold:1e4,add:V8,connect:Y8,rank:a9,rerank:u9,pulse:v9,touch:y9,update:b9,changeset:Cs,ingest:J8,parse:Z8,preload:e9,request:Q8,events:K8,on:i9,evaluate:c9,run:d9,runAsync:f9,runAfter:h9,_enqueue:p9,_getPulse:g9};function O(e,t){Le.call(this,e,null,t)}G(O,Le,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):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 au={};function cA(e){const t=fA(e);return t&&t.Definition||null}function fA(e){return e=e&&e.toLowerCase(),Z(au,e)?au[e]:null}function*dA(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function C1(e,t,n){const i=Float64Array.from(dA(e,n));return i.sort(kr),t.map(r=>R$(i,r))}function M1(e,t){return C1(e,[.25,.5,.75],t)}function F1(e,t){const n=e.length,i=FI(e,t),r=M1(e,t),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 hA(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,l,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+g)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var Vn=Math.random;function E9(e){Vn=e}function pA(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(dA(e,i)),o=r.length,s=t;let a,u,l,c;for(l=0,c=Array(s);l<s;++l){for(a=0,u=0;u<o;++u)a+=r[~~(Vn()*o)];c[l]=a/o}return c.sort(kr),[K0(c,n/2),K0(c,1-n/2)]}function gA(e,t,n,i){i=i||(d=>d);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;s<a;++s)o[s]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;s<a;++s)o[s]=l;return n?_9(o,t+t/4):o}function _9(e,t){const n=e.length;let i=0,r=1,o,s;for(;e[i]===e[r];)++r;for(;r<n;){for(o=r+1;e[r]===e[o];)++o;if(e[r]-e[r-1]<t){for(s=r+(i+o-r-r>>1);s<r;)e[s++]=e[r];for(;s>r;)e[s--]=e[i]}i=r,r=o}return e}function $9(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function S9(e,t){t==null&&(t=e,e=0);let n,i,r;const o={min(s){return arguments.length?(n=s||0,r=i-n,o):n},max(s){return arguments.length?(i=s||0,r=i-n,o):i},sample(){return n+Math.floor(r*Vn())},pdf(s){return s===Math.floor(s)&&s>=n&&s<i?1/r:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=i?1:(a-n+1)/r},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*r):NaN}};return o.min(e).max(t)}const mA=Math.sqrt(2*Math.PI),A9=Math.SQRT2;let ic=NaN;function Kd(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(ic===ic)n=ic,ic=NaN;else{do n=Vn()*2-1,i=Vn()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,ic=i*o}return e+n*t}function T1(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*mA)}function Zd(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37)o=0;else{const s=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,o=s*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,o=o/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,o=s/a/2.506628274631)}return i>0?1-o:o}function Jd(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*A9*k9(2*e-1)}function k9(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function O1(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>Kd(n,i),pdf:o=>T1(o,n,i),cdf:o=>Zd(o,n,i),icdf:o=>Jd(o,n,i)};return r.mean(e).stdev(t)}function N1(e,t){const n=O1();let i=0;const r={data(o){return arguments.length?(e=o,i=o?o.length:0,r.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=F1(e)),r):t},sample(){return e[~~(Vn()*i)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<i;++a)s+=n.pdf((o-e[a])/t);return s/t/i},cdf(o){let s=0,a=0;for(;a<i;++a)s+=n.cdf((o-e[a])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function D1(e,t){return e=e||0,t=t??1,Math.exp(e+Kd()*t)}function R1(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*mA*e)}function P1(e,t,n){return Zd(Math.log(e),t,n)}function L1(e,t,n){return Math.exp(Jd(e,t,n))}function yA(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>D1(n,i),pdf:o=>R1(o,n,i),cdf:o=>P1(o,n,i),icdf:o=>L1(o,n,i)};return r.mean(e).stdev(t)}function bA(e,t){let n=0,i;function r(s){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=s[l]==null?1:+s[l];for(l=0;l<n;++l)a[l]/=u;return a}const o={weights(s){return arguments.length?(i=r(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=Vn();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(s<u){a=e[l];break}return a.sample()},pdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(s);return a},cdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function I1(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Vn()}function z1(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function B1(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function U1(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function vA(e,t){let n,i;const r={min(o){return arguments.length?(n=o||0,r):n},max(o){return arguments.length?(i=o??1,r):i},sample:()=>I1(n,i),pdf:o=>z1(o,n,i),cdf:o=>B1(o,n,i),icdf:o=>U1(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function j1(e,t,n){let i=0,r=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(i+=(s-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function rc(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function Qd(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)o[a]-=u,s[a]-=l;return[o,s,u,l]}function oc(e,t,n,i){let r=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&i(o,s,++r)}function uu(e,t,n,i,r){let o=0,s=0;return oc(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function q1(e,t,n){let i=0,r=0,o=0,s=0,a=0;oc(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=rc(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:uu(e,t,n,r,l)}}function xA(e,t,n){let i=0,r=0,o=0,s=0,a=0;oc(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=rc(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:uu(e,t,n,r,l)}}function wA(e,t,n){const[i,r,o,s]=Qd(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;oc(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=rc(u/s,a/s,l/s,c/s),y=b=>Math.exp(g+m*(b-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:uu(e,t,n,s,y)}}function EA(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;oc(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,o+=(h*p-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=rc(i,r,o,s),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:uu(e,t,n,a,c)}}function W1(e,t,n){const[i,r,o,s]=Qd(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,w=-v*u,_=E=>(E=E-o,v*E*E+x*E+w+s);return{coef:[w-x*o+v*o*o+s,x-2*v*o,v],predict:_,rSquared:uu(e,t,n,s,_)}}function _A(e,t,n,i){if(i===0)return j1(e,t,n);if(i===1)return q1(e,t,n);if(i===2)return W1(e,t,n);const[r,o,s,a]=Qd(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*o[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=M9(c),b=v=>{v-=s;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:C9(f,y,-s,a),predict:b,rSquared:uu(e,t,n,a,b)}}function C9(e,t,n,i){const r=Array(e);let o,s,a,u;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],u=1,r[o]+=a,s=1;s<=o;++s)u*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*u;return r[0]+=i,r}function M9(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;i<t;++i){for(s=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][s])&&(s=r);for(o=i;o<t+1;++o)a=e[o][i],e[o][i]=e[o][s],e[o][s]=a;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,o=r+1;o<t;++o)a+=e[o][r]*n[o];n[r]=(e[t][r]-a)/e[r][r]}return n}const $A=2,SA=1e-12;function AA(e,t,n,i){const[r,o,s,a]=Qd(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=$A;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let w=0,_=0,E=0,$=0,S=0;const M=1/Math.abs(r[x]-y||1);for(let A=b;A<=v;++A){const F=r[A],C=o[A],T=F9(Math.abs(y-F)*M)*d[A],P=F*T;w+=T,_+=P,E+=C*T,$+=C*P,S+=F*P}const[k,N]=rc(_/w,E/w,$/w,S/w);c[m]=k+N*y,f[m]=Math.abs(o[m]-c[m]),T9(r,m+1,p)}if(h===$A)break;const g=P$(f);if(Math.abs(g)<SA)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?SA:(b=1-y*y)*b}return O9(r,c,s,a)}function F9(e){return(e=1-e*e*e)*e*e}function T9(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}function O9(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],l;for(;s<r;++s)l=e[s]+n,u[0]===l?u[1]+=(t[s]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[s]],o.push(u));return u[1]+=i,o}const N9=.5*Math.PI/180;function eh(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(o+g/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let g=n;--g>0;)c.push(r(o+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=D9(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&R9(f,g,d,h,p)>N9?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function D9(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const s=t[o][1];s<n&&(n=s),s>i&&(i=s)}return 1/(i-n)}function R9(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),s=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-s)}function P9(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function H1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:P9(e)}function kA(e,t,n){return n||e+(t?"_"+t:"")}const G1=()=>{},L9={init:G1,add:G1,rem:G1,idx:0},sc={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.valid?e.sum:void 0,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<e.min||e.min===void 0)&&(e.min=t)},rem:(e,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||e.max===void 0)&&(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<e.min&&(e.argmin=n)},rem:(e,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}},ac=Object.keys(sc).filter(e=>e!=="__count__");function I9(e,t){return(n,i)=>fe({name:e,aggregate_param:i,out:n||e},L9,t)}[...ac,"__count__"].forEach(e=>{sc[e]=I9(e,sc[e])});function CA(e,t,n){return sc[e](n,t)}function MA(e,t){return e.idx-t.idx}function z9(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=sc[r]())})};return e.forEach(n),Object.values(t).sort(MA)}function B9(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function U9(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function j9(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function q9(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function FA(e,t){const n=t||Rt,i=z9(e),r=e.slice().sort(MA);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=B9,o.prototype.add=U9,o.prototype.rem=j9,o.prototype.set=q9,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function V1(e){this._key=e?qn(e):ie,this.reset()}const _t=V1.prototype;_t.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},_t.add=function(e){this._add.push(e)},_t.rem=function(e){this._rem.push(e)},_t.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,l;for(a=0;a<r;++a)s[n(t[a])]=1;for(a=0,u=0;a<i;++a)s[n(l=e[a])]?s[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o},_t.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",Z(n,o)||(n[o]=1,++r);return r},_t.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=h$(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},_t.argmin=function(e){return this.extent(e)[0]||{}},_t.argmax=function(e){return this.extent(e)[1]||{}},_t.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},_t.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},_t.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=M1(this.values(),e),this._get=e),this._q},_t.q1=function(e){return this.quartile(e)[0]},_t.q2=function(e){return this.quartile(e)[1]},_t.q3=function(e){return this.quartile(e)[2]},_t.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=pA(this.values(),1e3,.05,e),this._get=e),this._ci},_t.ci0=function(e){return this.ci(e)[0]},_t.ci1=function(e){return this.ci(e)[1]};function So(e){O.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}So.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ac},{name:"aggregate_params",type:"number",null:!0,array:!0},{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"}]},G(So,O,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}o(e._prev),o(t);function s(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?s(h,u,l):t[h]||e.cell(h,u)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=X(Dt(b)),x=v.length;let w=0,_;for(;w<x;++w)i[_=v[w]]||(i[_]=1,t.push(_))}this._dims=X(e.groupby),this._dnames=this._dims.map(b=>{const v=Ye(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:H1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,p,g,m,y;for(l!==s.length&&R("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&R("Null aggregate field specified."),g=Ye(f),m=kA(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(CA(d,h,m))}return this._measures=this._measures.map(b=>FA(b,b.field)),Object.create(null)},cellkey:H1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let o=0;o<r;++o)n.agg[o]=new i[o](n)}return n.store&&(n.data=new V1),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let s=0;s<r;++s)o[n[s]]=i[s](e);return t?eA(t.tuple,o):Ce(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,o=i.length;r<o;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,s=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&s.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?s:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const W9=1e-14;function Y1(e){O.call(this,null,e)}Y1.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"]}]},G(Y1,O,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,o=i.step,s=e.as||["bin0","bin1"],a=s[0],u=s[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Dt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+o*(1+(f-r)/o)}:c=>c[a]=i(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=hA(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;(s=e.anchor)!=null&&(a=s-(r+i*Math.floor((s-r)/i)),r+=a,o+=a);const u=function(l){let c=Pt(t(l));return c==null?null:c<r?-1/0:c>o?1/0:(c=Math.max(r,Math.min(c,o-i)),r+i*Math.floor(W9+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=hn(u,Dt(t),e.name||"bin_"+Ye(t))}});function TA(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:u=>o.push(u),remove:u=>s[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!s[i(c)]),s={},a=0),l&&u&&r.sort(u),o.length&&(r=u?v$(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function X1(e){O.call(this,[],e)}X1.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},G(X1,O,{transform(e,t){const n=t.fork(t.ALL),i=TA(ie,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(ks(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function OA(e){Le.call(this,null,H9,e)}G(OA,Le);function H9(e){return this.value&&!e.modified()?this.value:L0(e.fields,e.orders)}function K1(e){O.call(this,null,e)}K1.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"]}]};function G9(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(K1,O,{transform(e,t){const n=f=>d=>{for(var h=G9(a(d),e.case,o)||[],p,g=0,m=h.length;g<m;++g)s.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,s=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_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,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[o]=l,s.add.push(u)):l===0?(u&&s.rem.push(u),n[a]=null,i[a]=null):u[o]!==l&&(u[o]=l,s.mod.push(u));return s.modifies(t)}});function Z1(e){O.call(this,null,e)}Z1.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},G(Z1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=V9(a,r,o,e.filter||Wn)):n.mod=a,n.source=this.value,n.modifies(i)}});function V9(e,t,n,i){for(var r=[],o={},s=e.length,a=0,u,l;a<s;++a)for(o[t]=l=e[a],u=0;u<s;++u)o[n]=e[u],i(o)&&(r.push(Ce(o)),o={},o[t]=l);return r}const NA={kde:N1,mixture:bA,normal:O1,lognormal:yA,uniform:vA},Y9="distributions",DA="function",X9="field";function RA(e,t){const n=e[DA];Z(NA,n)||R("Unknown distribution function: "+n);const i=NA[n]();for(const r in e)r===X9?i.data((e.from||t()).map(e[r])):r===Y9?i[r](e[r].map(o=>RA(o,t))):typeof i[r]===DA&&i[r](e[r]);return i}function J1(e){O.call(this,null,e)}const PA=[{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}]}],K9={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:PA},{name:"weights",type:"number",array:!0}]};J1.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:PA.concat(K9)},{name:"as",type:"string",array:!0,default:["value","density"]}]},G(J1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=RA(e.distribution,Z9(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&R("Invalid density method: "+s),!e.extent&&!i.data&&R("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||Bi(i.data()),l=eh(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Z9(e){return()=>e.materialize(e.SOURCE).source}function LA(e,t){return e?e.map((n,i)=>t[i]||Ye(n)):null}function Q1(e,t,n){const i=[],r=f=>f(u);let o,s,a,u,l,c;if(t==null)i.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)u=e[s],l=t.map(r),c=o[l],c||(o[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const IA="bin";function ey(e){O.call(this,null,e)}ey.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:IA}]};const J9=(e,t)=>Il(Bi(e,t))/30;G(ey,O,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Q1(t.source,e.groupby,Rt),r=e.smooth||!1,o=e.field,s=e.step||J9(n,o),a=ks((p,g)=>o(p)-o(g)),u=e.as||IA,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of gA(p,s,r,o))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function zA(e){Le.call(this,null,Q9,e),this.modified(!0)}G(zA,Le);function Q9(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:hn(n=>t(n,e),Dt(t),Ye(t))}function ty(e){O.call(this,[void 0,void 0],e)}ty.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},G(ty,O,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if((r||o==null)&&(o=1/0,s=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Pt(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Ye(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function ny(e,t){Le.call(this,e),this.parent=t,this.count=0}G(ny,Le,{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}});function th(e){O.call(this,{},e),this._keys=Ga();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(th,O,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=Z(r,e)&&r[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=i||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new ny(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),r[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,s=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ie(u),c=o.get(l);c!==void 0&&(o.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);o.set(ie(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ie(u),c=o.get(l),f=i(u);c===f?a(f).mod(u):(o.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(o.get(ie(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=ie(u),c=o.get(l),f=i(u);c!==f&&(o.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function BA(e){Le.call(this,null,e7,e)}G(BA,Le);function e7(e){return this.value&&!e.modified()?this.value:L(e.name)?X(e.name).map(t=>qn(t)):qn(e.name,e.as)}function iy(e){O.call(this,Ga(),e)}iy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},G(iy,O,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ie(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(ie(f),1)});function c(f){const d=ie(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),o.push(f)):!h&&!p?(i.set(d,1),s.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function ry(e){O.call(this,[],e)}ry.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}]},G(ry,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=LA(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=$1(a),f=0;f<s;++f)d[r[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}});function oy(e){O.call(this,[],e)}oy.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},G(oy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Ye),o=e.as||["key","value"],s=o[0],a=o[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=$1(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function sy(e){O.call(this,null,e)}sy.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},G(sy,O,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,s=>s[i]=n(s,e))}});function UA(e){O.call(this,[],e)}G(UA,O,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;)s.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=r.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-o);return n.source=this.value=r,n}});const nh={value:"value",median:P$,mean:PI,min:X0,max:Es},t7=[];function ay(e){O.call(this,[],e)}ay.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}]};function n7(e){var t=e.method||nh.value,n;if(nh[t]==null)R("Unrecognized imputation method: "+t);else return t===nh.value?(n=e.value!==void 0?e.value:0,()=>n):nh[t]}function i7(e){const t=e.field;return n=>n?t(n):NaN}G(ay,O,{transform(e,t){var n=t.fork(t.ALL),i=n7(e),r=i7(e),o=Ye(e.field),s=Ye(e.key),a=(e.groupby||[]).map(Ye),u=r7(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,w;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],w={_impute:!0},y=0,x=p.length;y<x;++y)w[a[y]]=p[y];w[s]=g,w[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(w))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function r7(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=s.push(p)),c=(l=t?t.map(r):t7)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function uy(e){So.call(this,e)}uy.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:ac},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},G(uy,So,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(r=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{fe(o,r[n.cellkey(o)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function ly(e){O.call(this,null,e)}ly.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},G(ly,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Q1(i,e.groupby,e.field),o=(e.groupby||[]).map(Ye),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&R("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Bi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=N1(h,s)[a],g=e.counts?h.length:1,m=c||Bi(h);eh(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<o.length;++v)b[o[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function jA(e){Le.call(this,null,o7,e)}G(jA,Le);function o7(e){return this.value&&!e.modified()?this.value:z0(e.fields,e.flat)}function qA(e){O.call(this,[],e),this._pending=null}G(qA,O,{transform(e,t){const n=t.dataflow;return this._pending?cy(this,t,this._pending):s7(e)?t.StopPropagation:e.values?cy(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=X(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>cy(this,t,X(i.data)))}});function s7(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function cy(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function fy(e){O.call(this,{},e)}fy.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}]},G(fy,O,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&R('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&R('The "as" parameter has too few output field names.'),c=c||r.map(Ye),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=o;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||R("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??o}),s?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function WA(e){Le.call(this,null,a7,e)}G(WA,Le);function a7(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<i&&(i=s[0]),s[1]>r&&(r=s[1]);return[i,r]}function HA(e){Le.call(this,null,u7,e)}G(HA,Le);function u7(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function GA(e){O.call(this,null,e)}G(GA,O,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function dy(e){So.call(this,e)}dy.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:ac,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},G(dy,So,{_transform:So.prototype.transform,transform(e,t){return this._transform(l7(e,t),t)}});function l7(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=Dt(n).concat(Dt(i)),s=f7(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(a=>c7(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function c7(e,t,n,i){return hn(r=>t(r)===e?n(r):NaN,i,e+"")}function f7(e,t,n){const i={},r=[];return n.visit(n.SOURCE,o=>{const s=e(o);i[s]||(i[s]=1,r.push(s))}),r.sort(_d),t?r.slice(0,t):r}function VA(e){th.call(this,e)}G(VA,th,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(ie(o),n,t,o);return(e.modified("field")||i&&t.modified(Dt(i)))&&R("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,o=>{const s=r(o);i(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=r(o);i(o).forEach(a=>s.add(Ce(a)))}),t.visit(t.REM,o=>{const s=r(o);i(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>r(o).mod(o)),t.visit(t.ADD,o=>r(o).add(o)),t.visit(t.REM,o=>r(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function hy(e){O.call(this,null,e)}hy.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},G(hy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=LA(e.fields,e.as||[]),o=i?(a,u)=>d7(a,u,i,r):Wd;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=ie(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Ce({}));s[ie(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[ie(a)]))}),n}});function d7(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function YA(e){O.call(this,null,e)}G(YA,O,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function py(e){O.call(this,null,e)}py.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"]}]};const h7=1e-14;G(py,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=Q1(r,e.groupby,e.field),s=(e.groupby||[]).map(Ye),a=[],u=e.step||.01,l=e.probs||Mn(u/2,1-h7,u),c=l.length;return o.forEach(f=>{const d=C1(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<s.length;++g)p[s[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function XA(e){O.call(this,null,e)}G(XA,O,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const o=ie(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=$1(r);i[ie(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[ie(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function gy(e){O.call(this,[],e),this.count=0}gy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},G(gy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[ie(f)]=1,c),{});let s=this.value,a=this.count,u=0;function l(c){let f,d;s.length<r?s.push(c):(d=~~((a+1)*Vn()),d<s.length&&d>=u&&(f=s[d],o[ie(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ie(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[ie(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[ie(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[ie(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ie(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[ie(c)])),this.count=a,this.value=n.source=s,n}});function my(e){O.call(this,null,e)}my.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"}]},G(my,O,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Mn(e.start,e.stop,e.step||1).map(r=>{const o={};return o[i]=r,Ce(o)}),n.add=t.add.concat(this.value),n}});function KA(e){O.call(this,null,e),this.modified(!0)}G(KA,O,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function yy(e){O.call(this,null,e)}const ZA=["unit0","unit1"];yy.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:i1,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:ZA}]},G(yy,O,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?iu:nu)(o.unit).offset,a=e.as||ZA,u=a[0],l=a[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(Dt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=o(g),i&&(p[l]=y=s(m,c)),m<f&&(f=m),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:bS({extent:e.extent||Bi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=o1(i),s=this.value||{},a=(n?aS:sS)(o,r);return a.unit=ve(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function JA(e){O.call(this,Ga(),e)}G(JA,O,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=a=>r.set(i(a),a);let s=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function QA(e){O.call(this,null,e)}G(QA,O,{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(ks(e.sort)):t.source).map(e.field))}});function p7(e,t,n,i){const r=uc[e](t,n);return{init:r.init||po,update:function(o,s){s[i]=r.next(o)}}}const uc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=uc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||R("ntile num must be greater than zero.");const n=uc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(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,t>0||R("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=g7(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function g7(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const m7=Object.keys(uc);function ek(e){const t=X(e.ops),n=X(e.fields),i=X(e.params),r=X(e.aggregate_params),o=X(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){X(Dt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Ye(m),x=kA(p,v,o[g]);if(h(m),s.push(x),Z(uc,p))a.push(p7(p,m,y,x));else{if(m==null&&p!=="count"&&R("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let w=l[v];w||(w=l[v]=[],w.field=m,f.push(w)),w.push(CA(p,b,x))}}),(c.length||f.length)&&(this.cell=y7(f,c,d)),this.inputs=Object.keys(u)}const tk=ek.prototype;tk.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},tk.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(r[s]);for(s=e.p1;s<e.i1;++s)n.add(r[s]);n.set(t)}for(s=0;s<o;++s)i[s].update(e,t)};function y7(e,t,n){e=e.map(u=>FA(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),s=0;s<r;++s)o[s]=new e[s](i);if(i.store)var a=i.data=new V1;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)o[l].add(o[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)o[l].rem(o[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)o[u].init()},i}function by(e){O.call(this,{},e),this._mlen=0,this._mods=[]}by.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:m7.concat(ac)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},G(by,O,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ks(e.sort),r=H1(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new ek(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)b7(this._mods[a],s,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=TA(ie),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function b7(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,s=i.frame||[null,0],a=e.data(n),u=a.length,l=o?Ya(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Lt(-1)};t.init();for(let f=0;f<u;++f)v7(c,s,f,u),o&&x7(c,l),t.update(c,a[f])}function v7(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function x7(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,s=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<s&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}const w7=Object.freeze(Object.defineProperty({__proto__:null,aggregate:So,bin:Y1,collect:X1,compare:OA,countpattern:K1,cross:Z1,density:J1,dotbin:ey,expression:zA,extent:ty,facet:th,field:BA,filter:iy,flatten:ry,fold:oy,formula:sy,generate:UA,impute:ay,joinaggregate:uy,kde:ly,key:jA,load:qA,lookup:fy,multiextent:WA,multivalues:HA,params:GA,pivot:dy,prefacet:VA,project:hy,proxy:YA,quantile:py,relay:XA,sample:gy,sequence:my,sieve:KA,subflow:ny,timeunit:yy,tupleindex:JA,values:QA,window:by},Symbol.toStringTag,{value:"Module"}));function Me(e){return function(){return e}}const nk=Math.abs,Bt=Math.atan2,Ms=Math.cos,E7=Math.max,vy=Math.min,Hi=Math.sin,Fs=Math.sqrt,Ut=1e-12,lu=Math.PI,ih=lu/2,ik=2*lu;function _7(e){return e>1?0:e<-1?lu:Math.acos(e)}function rk(e){return e>=1?ih:e<=-1?-ih:Math.asin(e)}const xy=Math.PI,wy=2*xy,Ts=1e-6,$7=wy-Ts;function ok(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function S7(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ok;const n=10**t;return function(i){this._+=i[0];for(let r=1,o=i.length;r<o;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let Ey=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ok:S7(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,o,s){this._append`C${+t},${+n},${+i},${+r},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,i,r,o){if(t=+t,n=+n,i=+i,r=+r,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,u=i-t,l=r-n,c=s-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Ts)if(!(Math.abs(f*u-l*c)>Ts)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-s,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=o*Math.tan((xy-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,w=v/y;Math.abs(x-1)>Ts&&this._append`L${t+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*h>c*p)},${this._x1=t+w*u},${this._y1=n+w*l}`}}arc(t,n,i,r,o,s){if(t=+t,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^s,d=s?r-o:o-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Ts||Math.abs(this._y1-c)>Ts)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%wy+wy),d>$7?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>Ts&&this._append`A${i},${i},0,${+(d>=xy)},${f},${this._x1=t+i*Math.cos(o)},${this._y1=n+i*Math.sin(o)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function rh(){return new Ey}rh.prototype=Ey.prototype;function oh(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Ey(t)}function A7(e){return e.innerRadius}function k7(e){return e.outerRadius}function C7(e){return e.startAngle}function M7(e){return e.endAngle}function F7(e){return e&&e.padAngle}function T7(e,t,n,i,r,o,s,a){var u=n-e,l=i-t,c=s-r,f=a-o,d=f*u-c*l;if(!(d*d<Ut))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function sh(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/Fs(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,x=b*b+v*v,w=r-o,_=d*g-p*h,E=(v<0?-1:1)*Fs(E7(0,w*w*x-_*_)),$=(_*v-b*E)/x,S=(-_*b-v*E)/x,M=(_*v+b*E)/x,k=(-_*b+v*E)/x,N=$-m,A=S-y,F=M-m,C=k-y;return N*N+A*A>F*F+C*C&&($=M,S=k),{cx:$,cy:S,x01:-c,y01:-f,x11:$*(r/w-1),y11:S*(r/w-1)}}function O7(){var e=A7,t=k7,n=Me(0),i=null,r=C7,o=M7,s=F7,a=null,u=oh(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-ih,g=o.apply(this,arguments)-ih,m=nk(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Ut))a.moveTo(0,0);else if(m>ik-Ut)a.moveTo(h*Ms(p),h*Hi(p)),a.arc(0,0,h,p,g,!y),d>Ut&&(a.moveTo(d*Ms(g),d*Hi(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,w=g,_=m,E=m,$=s.apply(this,arguments)/2,S=$>Ut&&(i?+i.apply(this,arguments):Fs(d*d+h*h)),M=vy(nk(h-d)/2,+n.apply(this,arguments)),k=M,N=M,A,F;if(S>Ut){var C=rk(S/d*Hi($)),T=rk(S/h*Hi($));(_-=C*2)>Ut?(C*=y?1:-1,x+=C,w-=C):(_=0,x=w=(p+g)/2),(E-=T*2)>Ut?(T*=y?1:-1,b+=T,v-=T):(E=0,b=v=(p+g)/2)}var P=h*Ms(b),I=h*Hi(b),z=d*Ms(w),te=d*Hi(w);if(M>Ut){var ne=h*Ms(v),de=h*Hi(v),ke=d*Ms(x),Ee=d*Hi(x),Ie;if(m<lu)if(Ie=T7(P,I,ke,Ee,ne,de,z,te)){var $r=P-Ie[0],Ia=I-Ie[1],ms=ne-Ie[0],J=de-Ie[1],he=1/Hi(_7(($r*ms+Ia*J)/(Fs($r*$r+Ia*Ia)*Fs(ms*ms+J*J)))/2),me=Fs(Ie[0]*Ie[0]+Ie[1]*Ie[1]);k=vy(M,(d-me)/(he-1)),N=vy(M,(h-me)/(he+1))}else k=N=0}E>Ut?N>Ut?(A=sh(ke,Ee,P,I,h,N,y),F=sh(ne,de,z,te,h,N,y),a.moveTo(A.cx+A.x01,A.cy+A.y01),N<M?a.arc(A.cx,A.cy,N,Bt(A.y01,A.x01),Bt(F.y01,F.x01),!y):(a.arc(A.cx,A.cy,N,Bt(A.y01,A.x01),Bt(A.y11,A.x11),!y),a.arc(0,0,h,Bt(A.cy+A.y11,A.cx+A.x11),Bt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,N,Bt(F.y11,F.x11),Bt(F.y01,F.x01),!y))):(a.moveTo(P,I),a.arc(0,0,h,b,v,!y)):a.moveTo(P,I),!(d>Ut)||!(_>Ut)?a.lineTo(z,te):k>Ut?(A=sh(z,te,ne,de,d,-k,y),F=sh(P,I,ke,Ee,d,-k,y),a.lineTo(A.cx+A.x01,A.cy+A.y01),k<M?a.arc(A.cx,A.cy,k,Bt(A.y01,A.x01),Bt(F.y01,F.x01),!y):(a.arc(A.cx,A.cy,k,Bt(A.y01,A.x01),Bt(A.y11,A.x11),!y),a.arc(0,0,d,Bt(A.cy+A.y11,A.cx+A.x11),Bt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,k,Bt(F.y11,F.x11),Bt(F.y01,F.x01),!y))):a.arc(0,0,d,w,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-lu/2;return[Ms(f)*c,Hi(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Me(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Me(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Me(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Me(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Me(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Me(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Me(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function sk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ak(e){this._context=e}ak.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&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);break}}};function _y(e){return new ak(e)}function uk(e){return e[0]}function lk(e){return e[1]}function ck(e,t){var n=Me(!0),i=null,r=_y,o=null,s=oh(a);e=typeof e=="function"?e:e===void 0?uk:Me(e),t=typeof t=="function"?t:t===void 0?lk:Me(t);function a(u){var l,c=(u=sk(u)).length,f,d=!1,h;for(i==null&&(o=r(h=s())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Me(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Me(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Me(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(o=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=o=null:o=r(i=u),a):i},a}function fk(e,t,n){var i=null,r=Me(!0),o=null,s=_y,a=null,u=oh(l);e=typeof e=="function"?e:e===void 0?uk:Me(+e),t=typeof t=="function"?t:Me(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lk:Me(+n);function l(f){var d,h,p,g=(f=sk(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(o==null&&(a=s(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return ck().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Me(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Me(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Me(!!f),l):r},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}const N7={draw(e,t){const n=Fs(t/lu);e.moveTo(n,0),e.arc(0,0,n,0,ik)}};function D7(e,t){let n=null,i=oh(r);e=typeof e=="function"?e:Me(e||N7),t=typeof t=="function"?t:Me(t===void 0?64:+t);function r(){let o;if(n||(n=o=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return r.type=function(o){return arguments.length?(e=typeof o=="function"?o:Me(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Me(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function Ao(){}function ah(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 uh(e){this._context=e}uh.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:ah(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:ah(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R7(e){return new uh(e)}function dk(e){this._context=e}dk.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},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:ah(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function P7(e){return new dk(e)}function hk(e){this._context=e}hk.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||this._line!==0&&this._point===3)&&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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:ah(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function L7(e){return new hk(e)}function pk(e,t){this._basis=new uh(e),this._beta=t}pk.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 i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const I7=function e(t){function n(i){return t===1?new uh(i):new pk(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function lh(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 $y(e,t){this._context=e,this._k=(1-t)/6}$y.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:lh(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:lh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const z7=function e(t){function n(i){return new $y(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Sy(e,t){this._context=e,this._k=(1-t)/6}Sy.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},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:lh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const B7=function e(t){function n(i){return new Sy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ay(e,t){this._context=e,this._k=(1-t)/6}Ay.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||this._line!==0&&this._point===3)&&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:lh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const U7=function e(t){function n(i){return new Ay(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ky(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Ut){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ut){var l=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*l+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function gk(e,t){this._context=e,this._alpha=t}gk.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ky(this,e,t);break}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}};const j7=function e(t){function n(i){return t?new gk(i,t):new $y(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function mk(e,t){this._context=e,this._alpha=t}mk.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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=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:ky(this,e,t);break}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}};const q7=function e(t){function n(i){return t?new mk(i,t):new Sy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function yk(e,t){this._context=e,this._alpha=t}yk.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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:ky(this,e,t);break}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}};const W7=function e(t){function n(i){return t?new yk(i,t):new Ay(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bk(e){this._context=e}bk.prototype={areaStart:Ao,areaEnd:Ao,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function H7(e){return new bk(e)}function vk(e){return e<0?-1:1}function xk(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(vk(o)+vk(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function wk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Cy(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function ch(e){this._context=e}ch.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Cy(this,this._t0,wk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){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,Cy(this,wk(this,n=xk(this,e,t)),n);break;default:Cy(this,this._t0,n=xk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ek(e){this._context=new _k(e)}(Ek.prototype=Object.create(ch.prototype)).point=function(e,t){ch.prototype.point.call(this,t,e)};function _k(e){this._context=e}_k.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function G7(e){return new ch(e)}function V7(e){return new Ek(e)}function $k(e){this._context=e}$k.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=Sk(e),r=Sk(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Sk(e){var t,n=e.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(r[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function Y7(e){return new $k(e)}function fh(e,t){this._context=e,this._t=t}fh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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)}break}}this._x=e,this._y=t}};function X7(e){return new fh(e,.5)}function K7(e){return new fh(e,0)}function Z7(e){return new fh(e,1)}function ko(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const J7=()=>typeof Image<"u"?Image:null;function Gi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Co(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const My=Symbol("implicit");function Fy(){var e=new M$,t=[],n=[],i=My;function r(o){let s=e.get(o);if(s===void 0){if(i!==My)return i;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new M$;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Fy(t,n).unknown(i)},Gi.apply(r,arguments),r}function cu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function lc(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Mo(){}var Os=.7,fu=1/Os,du="\\s*([+-]?\\d+)\\s*",cc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q7=/^#([0-9a-f]{3,8})$/,eB=new RegExp(`^rgb\\(${du},${du},${du}\\)$`),tB=new RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),nB=new RegExp(`^rgba\\(${du},${du},${du},${cc}\\)$`),iB=new RegExp(`^rgba\\(${Vi},${Vi},${Vi},${cc}\\)$`),rB=new RegExp(`^hsl\\(${cc},${Vi},${Vi}\\)$`),oB=new RegExp(`^hsla\\(${cc},${Vi},${Vi},${cc}\\)$`),Ak={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};cu(Mo,fc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kk,formatHex:kk,formatHex8:sB,formatHsl:aB,formatRgb:Ck,toString:Ck});function kk(){return this.rgb().formatHex()}function sB(){return this.rgb().formatHex8()}function aB(){return Nk(this).formatHsl()}function Ck(){return this.rgb().formatRgb()}function fc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Mk(t):n===3?new dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?dh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?dh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=eB.exec(e))?new dt(t[1],t[2],t[3],1):(t=tB.exec(e))?new dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nB.exec(e))?dh(t[1],t[2],t[3],t[4]):(t=iB.exec(e))?dh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rB.exec(e))?Ok(t[1],t[2]/100,t[3]/100,1):(t=oB.exec(e))?Ok(t[1],t[2]/100,t[3]/100,t[4]):Ak.hasOwnProperty(e)?Mk(Ak[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function Mk(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function dh(e,t,n,i){return i<=0&&(e=t=n=NaN),new dt(e,t,n,i)}function Ty(e){return e instanceof Mo||(e=fc(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function Fo(e,t,n,i){return arguments.length===1?Ty(e):new dt(e,t,n,i??1)}function dt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}cu(dt,Fo,lc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dt(Ns(this.r),Ns(this.g),Ns(this.b),hh(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:Fk,formatHex:Fk,formatHex8:uB,formatRgb:Tk,toString:Tk}));function Fk(){return`#${Ds(this.r)}${Ds(this.g)}${Ds(this.b)}`}function uB(){return`#${Ds(this.r)}${Ds(this.g)}${Ds(this.b)}${Ds((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tk(){const e=hh(this.opacity);return`${e===1?"rgb(":"rgba("}${Ns(this.r)}, ${Ns(this.g)}, ${Ns(this.b)}${e===1?")":`, ${e})`}`}function hh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ns(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ds(e){return e=Ns(e),(e<16?"0":"")+e.toString(16)}function Ok(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fi(e,t,n,i)}function Nk(e){if(e instanceof fi)return new fi(e.h,e.s,e.l,e.opacity);if(e instanceof Mo||(e=fc(e)),!e)return new fi;if(e instanceof fi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,u=(o+r)/2;return a?(t===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-t)/a+2:s=(t-n)/a+4,a/=u<.5?o+r:2-o-r,s*=60):a=u>0&&u<1?0:s,new fi(s,a,u,e.opacity)}function ph(e,t,n,i){return arguments.length===1?Nk(e):new fi(e,t,n,i??1)}function fi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(fi,ph,lc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new fi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new fi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dt(Oy(e>=240?e-240:e+120,r,i),Oy(e,r,i),Oy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new fi(Dk(this.h),gh(this.s),gh(this.l),hh(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=hh(this.opacity);return`${e===1?"hsl(":"hsla("}${Dk(this.h)}, ${gh(this.s)*100}%, ${gh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dk(e){return e=(e||0)%360,e<0?e+360:e}function gh(e){return Math.max(0,Math.min(1,e||0))}function Oy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Rk=Math.PI/180,Pk=180/Math.PI,mh=18,Lk=.96422,Ik=1,zk=.82521,Bk=4/29,hu=6/29,Uk=3*hu*hu,lB=hu*hu*hu;function jk(e){if(e instanceof Yi)return new Yi(e.l,e.a,e.b,e.opacity);if(e instanceof Dr)return qk(e);e instanceof dt||(e=Ty(e));var t=Py(e.r),n=Py(e.g),i=Py(e.b),r=Ny((.2225045*t+.7168786*n+.0606169*i)/Ik),o,s;return t===n&&n===i?o=s=r:(o=Ny((.4360747*t+.3850649*n+.1430804*i)/Lk),s=Ny((.0139322*t+.0971045*n+.7141733*i)/zk)),new Yi(116*r-16,500*(o-r),200*(r-s),e.opacity)}function yh(e,t,n,i){return arguments.length===1?jk(e):new Yi(e,t,n,i??1)}function Yi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}cu(Yi,yh,lc(Mo,{brighter(e){return new Yi(this.l+mh*(e??1),this.a,this.b,this.opacity)},darker(e){return new Yi(this.l-mh*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Lk*Dy(t),e=Ik*Dy(e),n=zk*Dy(n),new dt(Ry(3.1338561*t-1.6168667*e-.4906146*n),Ry(-.9787684*t+1.9161415*e+.033454*n),Ry(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Ny(e){return e>lB?Math.pow(e,1/3):e/Uk+Bk}function Dy(e){return e>hu?e*e*e:Uk*(e-Bk)}function Ry(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 cB(e){if(e instanceof Dr)return new Dr(e.h,e.c,e.l,e.opacity);if(e instanceof Yi||(e=jk(e)),e.a===0&&e.b===0)return new Dr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Pk;return new Dr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function bh(e,t,n,i){return arguments.length===1?cB(e):new Dr(e,t,n,i??1)}function Dr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function qk(e){if(isNaN(e.h))return new Yi(e.l,0,0,e.opacity);var t=e.h*Rk;return new Yi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}cu(Dr,bh,lc(Mo,{brighter(e){return new Dr(this.h,this.c,this.l+mh*(e??1),this.opacity)},darker(e){return new Dr(this.h,this.c,this.l-mh*(e??1),this.opacity)},rgb(){return qk(this).rgb()}}));var Wk=-.14861,Ly=1.78277,Iy=-.29227,vh=-.90649,dc=1.97294,Hk=dc*vh,Gk=dc*Ly,Vk=Ly*Iy-vh*Wk;function fB(e){if(e instanceof Rs)return new Rs(e.h,e.s,e.l,e.opacity);e instanceof dt||(e=Ty(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(Vk*i+Hk*t-Gk*n)/(Vk+Hk-Gk),o=i-r,s=(dc*(n-r)-Iy*o)/vh,a=Math.sqrt(s*s+o*o)/(dc*r*(1-r)),u=a?Math.atan2(s,o)*Pk-120:NaN;return new Rs(u<0?u+360:u,a,r,e.opacity)}function zy(e,t,n,i){return arguments.length===1?fB(e):new Rs(e,t,n,i??1)}function Rs(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(Rs,zy,lc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Rs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new Rs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Rk,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new dt(255*(t+n*(Wk*i+Ly*r)),255*(t+n*(Iy*i+vh*r)),255*(t+n*(dc*i)),this.opacity)}}));function Yk(e,t,n,i,r){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*i+s*r)/6}function Xk(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],o=e[i+1],s=i>0?e[i-1]:2*r-o,a=i<t-1?e[i+2]:2*o-r;return Yk((n-i/t)*t,s,r,o,a)}}function Kk(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],o=e[i%t],s=e[(i+1)%t],a=e[(i+2)%t];return Yk((n-i/t)*t,r,o,s,a)}}const xh=e=>()=>e;function Zk(e,t){return function(n){return e+n*t}}function dB(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function wh(e,t){var n=t-e;return n?Zk(e,n>180||n<-180?n-360*Math.round(n/360):n):xh(isNaN(e)?t:e)}function hB(e){return(e=+e)==1?ht:function(t,n){return n-t?dB(t,n,e):xh(isNaN(t)?n:t)}}function ht(e,t){var n=t-e;return n?Zk(e,n):xh(isNaN(e)?t:e)}const By=function e(t){var n=hB(t);function i(r,o){var s=n((r=Fo(r)).r,(o=Fo(o)).r),a=n(r.g,o.g),u=n(r.b,o.b),l=ht(r.opacity,o.opacity);return function(c){return r.r=s(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function Jk(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Fo(t[s]),i[s]=a.r||0,r[s]=a.g||0,o[s]=a.b||0;return i=e(i),r=e(r),o=e(o),a.opacity=1,function(u){return a.r=i(u),a.g=r(u),a.b=o(u),a+""}}}var pB=Jk(Xk),gB=Jk(Kk);function Uy(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=e[r]*(1-o)+t[r]*o;return i}}function Qk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mB(e,t){return(Qk(t)?Uy:eC)(e,t)}function eC(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=To(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function tC(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function di(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nC(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=To(e[r],t[r]):i[r]=t[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var jy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qy=new RegExp(jy.source,"g");function yB(e){return function(){return e}}function bB(e){return function(t){return e(t)+""}}function iC(e,t){var n=jy.lastIndex=qy.lastIndex=0,i,r,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(i=jy.exec(e))&&(r=qy.exec(t));)(o=r.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,u.push({i:s,x:di(i,r)})),n=qy.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?bB(u[0].x):yB(t):(t=u.length,function(l){for(var c=0,f;c<t;++c)a[(f=u[c]).i]=f.x(l);return a.join("")})}function To(e,t){var n=typeof t,i;return t==null||n==="boolean"?xh(t):(n==="number"?di:n==="string"?(i=fc(t))?(t=i,By):iC:t instanceof fc?By:t instanceof Date?tC:Qk(t)?Uy:Array.isArray(t)?eC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nC:di)(e,t)}function vB(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function xB(e,t){var n=wh(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function hc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var rC=180/Math.PI,Wy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function oC(e,t,n,i,r,o){var s,a,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,u/=a),e*i<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*rC,skewX:Math.atan(u)*rC,scaleX:s,scaleY:a}}var Eh;function wB(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wy:oC(t.a,t.b,t.c,t.d,t.e,t.f)}function EB(e){return e==null||(Eh||(Eh=document.createElementNS("http://www.w3.org/2000/svg","g")),Eh.setAttribute("transform",e),!(e=Eh.transform.baseVal.consolidate()))?Wy:(e=e.matrix,oC(e.a,e.b,e.c,e.d,e.e,e.f))}function sC(e,t,n,i){function r(l){return l.length?l.pop()+" ":""}function o(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push("translate(",null,t,null,n);p.push({i:g-4,x:di(l,f)},{i:g-2,x:di(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:di(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:di(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:di(l,f)},{i:g-2,x:di(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,d),s(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,g=d.length,m;++p<g;)f[(m=d[p]).i]=m.x(h);return f.join("")}}}var _B=sC(wB,"px, ","px)","deg)"),$B=sC(EB,", ",")",")"),SB=1e-12;function aC(e){return((e=Math.exp(e))+1/e)/2}function AB(e){return((e=Math.exp(e))-1/e)/2}function kB(e){return((e=Math.exp(2*e))-1)/(e+1)}const CB=function e(t,n,i){function r(o,s){var a=o[0],u=o[1],l=o[2],c=s[0],f=s[1],d=s[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<SB)y=Math.log(d/l)/t,m=function(E){return[a+E*h,u+E*p,l*Math.exp(t*E*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),w=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(x*x+1)-x);y=(_-w)/t,m=function(E){var $=E*y,S=aC(w),M=l/(n*b)*(S*kB(t*$+w)-AB(w));return[a+M*h,u+M*p,l*S/aC(t*$+w)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(o){var s=Math.max(.001,+o),a=s*s,u=a*a;return e(s,a,u)},r}(Math.SQRT2,2,4);function uC(e){return function(t,n){var i=e((t=ph(t)).h,(n=ph(n)).h),r=ht(t.s,n.s),o=ht(t.l,n.l),s=ht(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const MB=uC(wh);var FB=uC(ht);function TB(e,t){var n=ht((e=yh(e)).l,(t=yh(t)).l),i=ht(e.a,t.a),r=ht(e.b,t.b),o=ht(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=i(s),e.b=r(s),e.opacity=o(s),e+""}}function lC(e){return function(t,n){var i=e((t=bh(t)).h,(n=bh(n)).h),r=ht(t.c,n.c),o=ht(t.l,n.l),s=ht(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const OB=lC(wh);var NB=lC(ht);function cC(e){return function t(n){n=+n;function i(r,o){var s=e((r=zy(r)).h,(o=zy(o)).h),a=ht(r.s,o.s),u=ht(r.l,o.l),l=ht(r.opacity,o.opacity);return function(c){return r.h=s(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const DB=cC(wh);var RB=cC(ht);function Hy(e,t){t===void 0&&(t=e,e=To);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function PB(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const LB=Object.freeze(Object.defineProperty({__proto__:null,interpolate:To,interpolateArray:mB,interpolateBasis:Xk,interpolateBasisClosed:Kk,interpolateCubehelix:DB,interpolateCubehelixLong:RB,interpolateDate:tC,interpolateDiscrete:vB,interpolateHcl:OB,interpolateHclLong:NB,interpolateHsl:MB,interpolateHslLong:FB,interpolateHue:xB,interpolateLab:TB,interpolateNumber:di,interpolateNumberArray:Uy,interpolateObject:nC,interpolateRgb:By,interpolateRgbBasis:pB,interpolateRgbBasisClosed:gB,interpolateRound:hc,interpolateString:iC,interpolateTransformCss:_B,interpolateTransformSvg:$B,interpolateZoom:CB,piecewise:Hy,quantize:PB},Symbol.toStringTag,{value:"Module"}));function IB(e){return function(){return e}}function Gy(e){return+e}var fC=[0,1];function yn(e){return e}function Vy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:IB(isNaN(t)?NaN:.5)}function zB(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function BB(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=Vy(r,i),o=n(s,o)):(i=Vy(i,r),o=n(o,s)),function(a){return o(i(a))}}function UB(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=Vy(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var u=vo(e,a,1,i)-1;return o[u](r[u](a))}}function pc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _h(){var e=fC,t=fC,n=To,i,r,o,s=yn,a,u,l;function c(){var d=Math.min(e.length,t.length);return s!==yn&&(s=zB(e[0],e[d-1])),a=d>2?UB:BB,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(u||(u=a(e.map(i),t,n)))(i(s(d)))}return f.invert=function(d){return s(r((l||(l=a(t,e.map(i),di)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Gy),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=hc,c()},f.clamp=function(d){return arguments.length?(s=d?!0:yn,c()):s!==yn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return i=d,r=h,c()}}function dC(){return _h()(yn,yn)}function hC(e,t,n,i){var r=xo(e,t,n),o;switch(i=_s(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(o=V$(r,s))&&(i.precision=o),J0(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=Y$(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=G$(r))&&(i.precision=o-(i.type==="%")*2);break}}return Md(i)}function Ps(e){var t=e.domain;return e.ticks=function(n){var i=t();return V0(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return hC(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,o=i.length-1,s=i[r],a=i[o],u,l,c=10;for(a<s&&(l=s,s=a,a=l,l=r,r=o,o=l);c-- >0;){if(l=Y0(s,a,n),l===u)return i[r]=s,i[o]=a,t(i);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function pC(){var e=dC();return e.copy=function(){return pc(e,pC())},Gi.apply(e,arguments),Ps(e)}function gC(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Gy),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return gC(e).unknown(t)},e=arguments.length?Array.from(e,Gy):[0,1],Ps(n)}function mC(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),e[n]=t.floor(r),e[i]=t.ceil(o),e}function yC(e){return Math.log(e)}function bC(e){return Math.exp(e)}function jB(e){return-Math.log(-e)}function qB(e){return-Math.exp(-e)}function WB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function HB(e){return e===10?WB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function GB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function vC(e){return(t,n)=>-e(-t,n)}function Yy(e){const t=e(yC,bC),n=t.domain;let i=10,r,o;function s(){return r=GB(i),o=HB(i),n()[0]<0?(r=vC(r),o=vC(o),e(jB,qB)):e(yC,bC),t}return t.base=function(a){return arguments.length?(i=+a,s()):i},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=V0(l,c,m))}else y=V0(d,h,Math.min(h-d,m)).map(o);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=_s(u)).precision==null&&(u.trim=!0),u=Md(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/o(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(mC(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function xC(){const e=Yy(_h()).domain([1,10]);return e.copy=()=>pc(e,xC()).base(e.base()),Gi.apply(e,arguments),e}function wC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function EC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Xy(e){var t=1,n=e(wC(t),EC(t));return n.constant=function(i){return arguments.length?e(wC(t=+i),EC(t)):t},Ps(n)}function _C(){var e=Xy(_h());return e.copy=function(){return pc(e,_C()).constant(e.constant())},Gi.apply(e,arguments)}function $C(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function VB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function YB(e){return e<0?-e*e:e*e}function Ky(e){var t=e(yn,yn),n=1;function i(){return n===1?e(yn,yn):n===.5?e(VB,YB):e($C(n),$C(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Ps(t)}function Zy(){var e=Ky(_h());return e.copy=function(){return pc(e,Zy()).exponent(e.exponent())},Gi.apply(e,arguments),e}function XB(){return Zy.apply(null,arguments).exponent(.5)}function SC(){var e=[],t=[],n=[],i;function r(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=R$(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[vo(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(kr),r()},o.range=function(s){return arguments.length?(t=Array.from(s),r()):t.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return SC().domain(e).range(t).unknown(i)},Gi.apply(o,arguments)}function AC(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[vo(i,u,0,n)]:o}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},s.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},s.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},s.unknown=function(u){return arguments.length&&(o=u),s},s.thresholds=function(){return i.slice()},s.copy=function(){return AC().domain([e,t]).range(r).unknown(o)},Gi.apply(Ps(s),arguments)}function kC(){var e=[.5],t=[0,1],n,i=1;function r(o){return o!=null&&o<=o?t[vo(e,o,0,i)]:n}return r.domain=function(o){return arguments.length?(e=Array.from(o),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(o){return arguments.length?(t=Array.from(o),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},r.unknown=function(o){return arguments.length?(n=o,r):n},r.copy=function(){return kC().domain(e).range(t).unknown(n)},Gi.apply(r,arguments)}function KB(e){return new Date(e)}function ZB(e){return e instanceof Date?+e:+new Date(+e)}function Jy(e,t,n,i,r,o,s,a,u,l){var c=dC(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function w(_){return(u(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:i(_)<_?r(_)<_?y:b:n(_)<_?v:x)(_)}return c.invert=function(_){return new Date(f(_))},c.domain=function(_){return arguments.length?d(Array.from(_,ZB)):d().map(KB)},c.ticks=function(_){var E=d();return e(E[0],E[E.length-1],_??10)},c.tickFormat=function(_,E){return E==null?w:l(E)},c.nice=function(_){var E=d();return(!_||typeof _.range!="function")&&(_=t(E[0],E[E.length-1],_??10)),_?d(mC(E,_)):c},c.copy=function(){return pc(c,Jy(e,t,n,i,r,o,s,a,u,l))},c}function JB(){return Gi.apply(Jy(rz,oz,Ui,Ul,Za,Or,Od,Fd,Tr,p1).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function QB(){return Gi.apply(Jy(nz,iz,ji,jl,Qa,wo,Nd,Td,Tr,g1).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function $h(){var e=0,t=1,n,i,r,o,s=yn,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:s(r===0?.5:(f=(o(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),i=o(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),l):[s(0),s(1)]}}return l.range=c(To),l.rangeRound=c(hc),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function Oo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Qy(){var e=Ps($h()(yn));return e.copy=function(){return Oo(e,Qy())},Co.apply(e,arguments)}function CC(){var e=Yy($h()).domain([1,10]);return e.copy=function(){return Oo(e,CC()).base(e.base())},Co.apply(e,arguments)}function MC(){var e=Xy($h());return e.copy=function(){return Oo(e,MC()).constant(e.constant())},Co.apply(e,arguments)}function eb(){var e=Ky($h());return e.copy=function(){return Oo(e,eb()).exponent(e.exponent())},Co.apply(e,arguments)}function eU(){return eb.apply(null,arguments).exponent(.5)}function Sh(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=yn,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-o)*(i*g<i*o?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),o=c(t=+t),s=c(n=+n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Hy(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(To),h.rangeRound=p(hc),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),o=g(t),s=g(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function FC(){var e=Ps(Sh()(yn));return e.copy=function(){return Oo(e,FC())},Co.apply(e,arguments)}function TC(){var e=Yy(Sh()).domain([.1,1,10]);return e.copy=function(){return Oo(e,TC()).base(e.base())},Co.apply(e,arguments)}function OC(){var e=Xy(Sh());return e.copy=function(){return Oo(e,OC()).constant(e.constant())},Co.apply(e,arguments)}function tb(){var e=Ky(Sh());return e.copy=function(){return Oo(e,tb()).exponent(e.exponent())},Co.apply(e,arguments)}function tU(){return tb.apply(null,arguments).exponent(.5)}function Xi(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const nU=Xi("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),iU=Xi("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),rU=Xi("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),oU=Xi("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),sU=Xi("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),aU=Xi("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),uU=Xi("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),lU=Xi("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),cU=Xi("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),fU=Xi("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function nb(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const dU="identity",pu="linear",Rr="log",gc="pow",mc="sqrt",Ah="symlog",Ls="time",Is="utc",Ki="sequential",gu="diverging",mu="quantile",kh="quantize",Ch="threshold",ib="ordinal",rb="point",NC="band",ob="bin-ordinal",ot="continuous",yc="discrete",bc="discretizing",Yn="interpolating",sb="temporal";function hU(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function pU(e){return function(t){const n=e.range();let i=t[0],r=t[1],o=-1,s,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(o<0&&(o=u),s=u);if(!(o<0))return i=e.invertExtent(n[o]),r=e.invertExtent(n[s]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function ab(){const e=Fy().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,o,s=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=nb(f,a,u);let g=i[d-0];r=(h-g)/(p||1),s&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,o=r*(1-a),s&&(g=Math.round(g),o=Math.round(o));const m=Mn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,vo(h,g)-1),b=g===m?y:vo(h,m)-1,g-h[y]>o+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return ab().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function DC(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return DC(t())},e}function gU(){return DC(ab().paddingInner(1))}var mU=Array.prototype.map;function yU(e){return mU.call(e,Pt)}const bU=Array.prototype.slice;function RC(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(vo(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=yU(i),n):e.slice()},n.range=function(i){return arguments.length?(t=bU.call(i),n):t.slice()},n.tickFormat=function(i,r){return hC(e[0],ve(e),i??10,r)},n.copy=function(){return RC().domain(n.domain()).range(n.range())},n}const Mh=new Map,PC=Symbol("vega_scale");function LC(e){return e[PC]=!0,e}function vU(e){return e&&e[PC]===!0}function xU(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?hU(o):o.invertExtent?pU(o):void 0),o.type=e,LC(o)};return i.metadata=li(X(n)),i}function Se(e,t,n){return arguments.length>1?(Mh.set(e,xU(e,t,n)),this):IC(e)?Mh.get(e):void 0}Se(dU,gC),Se(pu,pC,ot),Se(Rr,xC,[ot,Rr]),Se(gc,Zy,ot),Se(mc,XB,ot),Se(Ah,_C,ot),Se(Ls,JB,[ot,sb]),Se(Is,QB,[ot,sb]),Se(Ki,Qy,[ot,Yn]),Se(`${Ki}-${pu}`,Qy,[ot,Yn]),Se(`${Ki}-${Rr}`,CC,[ot,Yn,Rr]),Se(`${Ki}-${gc}`,eb,[ot,Yn]),Se(`${Ki}-${mc}`,eU,[ot,Yn]),Se(`${Ki}-${Ah}`,MC,[ot,Yn]),Se(`${gu}-${pu}`,FC,[ot,Yn]),Se(`${gu}-${Rr}`,TC,[ot,Yn,Rr]),Se(`${gu}-${gc}`,tb,[ot,Yn]),Se(`${gu}-${mc}`,tU,[ot,Yn]),Se(`${gu}-${Ah}`,OC,[ot,Yn]),Se(mu,SC,[bc,mu]),Se(kh,AC,bc),Se(Ch,kC,bc),Se(ob,RC,[yc,bc]),Se(ib,Fy,yc),Se(NC,ab,yc),Se(rb,gU,yc);function IC(e){return Mh.has(e)}function zs(e,t){const n=Mh.get(e);return n&&n.metadata[t]}function ub(e){return zs(e,ot)}function yu(e){return zs(e,yc)}function lb(e){return zs(e,bc)}function zC(e){return zs(e,Rr)}function wU(e){return zs(e,sb)}function BC(e){return zs(e,Yn)}function UC(e){return zs(e,mu)}const EU=["clamp","base","constant","exponent"];function jC(e,t){const n=t[0],i=ve(t)-n;return function(r){return e(n+r*i)}}function Fh(e,t,n){return Hy(cb(t||"rgb",n),e)}function qC(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function WC(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?Lt(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=Se(o)().domain([t,n]).range([0,1]),EU.forEach(a=>e[a]?s[a](e[a]()):0),s)}function cb(e,t){const n=LB[_U(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function _U(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const $U={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"},SU={accent:iU,category10:nU,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:rU,observable10:oU,paired:sU,pastel1:aU,pastel2:uU,set1:lU,set2:cU,set3:fU,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function HC(e){if(L(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function GC(e,t){for(const n in e)fb(n,t(e[n]))}const VC={};GC(SU,HC),GC($U,e=>Fh(HC(e)));function fb(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(VC[e]=t,this):VC[e]}const Th="symbol",AU="discrete",kU="gradient",CU=e=>L(e)?e.map(t=>String(t)):String(e),MU=(e,t)=>e[1]-t[1],FU=(e,t)=>t[1]-e[1];function db(e,t,n){let i;return _e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Il(e.domain())/n||1)+1))),Y(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Ls?nu(t):e.type==Is?iu(t):R("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function YC(e,t,n){let i=e.range(),r=i[0],o=ve(i),s=MU;if(r>o&&(i=o,o=r,r=i,s=FU),r=Math.floor(r),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],ve(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function hb(e,t){return e.bins?YC(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function XC(e,t,n,i,r,o){const s=t.type;let a=CU;if(s===Ls||r===Ls)a=e.timeFormat(i);else if(s===Is||r===Is)a=e.utcFormat(i);else if(zC(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=KC(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function KC(e,t,n){const i=hb(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/o));return l*r<r-.5&&(l*=r),l<=s};return n?i.filter(a):a}const pb={[mu]:"quantiles",[kh]:"thresholds",[Ch]:"domain"},ZC={[mu]:"quantiles",[kh]:"domain"};function JC(e,t){return e.bins?NU(e.bins):e.type===Rr?KC(e,t,!0):pb[e.type]?OU(e[pb[e.type]]()):hb(e,t)}function TU(e,t,n){const i=t[ZC[t.type]](),r=i.length;let o=r>1?i[1]-i[0]:i[0],s;for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,3*10,n)}function OU(e){const t=[-1/0].concat(e);return t.max=1/0,t}function NU(e){const t=e.slice(0,-1);return t.max=ve(e),t}const DU=e=>pb[e.type]||e.bins;function QC(e,t,n,i,r,o,s){const a=ZC[t.type]&&o!==Ls&&o!==Is?TU(e,t,r):XC(e,t,n,r,o,s);return i===Th&&DU(t)?RU(a):i===AU?PU(a):LU(a)}const RU=e=>(t,n,i)=>{const r=eM(i[n+1],eM(i.max,1/0)),o=tM(t,e),s=tM(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},eM=(e,t)=>e??t,PU=e=>(t,n)=>n?e(t):null,LU=e=>t=>e(t),tM=(e,t)=>Number.isFinite(e)?t(e):null;function IU(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ve(t),o=r-i;if(e.type===Ch){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function zU(e,t,n,i){const r=i||t.type;return K(n)&&wU(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ls?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Is?e.utcFormat("%A, %d %B %Y, %X UTC"):QC(e,t,5,null,n,i,!0)}function nM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=zU(e,t,n.format,n.formatType);if(lb(t.type)){const o=JC(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(yu(t.type)){const o=t.domain(),s=o.length,a=s>i?o.slice(0,i-2).map(r).join(", ")+", ending with "+o.slice(-1).map(r):o.map(r).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${r(o[0])} to ${r(ve(o))}`}}let iM=0;function BU(){iM=0}const Oh="p_";function gb(e){return e&&e.gradient}function rM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Oh:"";return r||(r=e.id="gradient_"+iM++,i==="radial"?(e.x1=Zi(e.x1,.5),e.y1=Zi(e.y1,.5),e.r1=Zi(e.r1,0),e.x2=Zi(e.x2,.5),e.y2=Zi(e.y2,.5),e.r2=Zi(e.r2,.5),o=Oh):(e.x1=Zi(e.x1,0),e.y1=Zi(e.y1,0),e.x2=Zi(e.x2,1),e.y2=Zi(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function Zi(e,t){return e??t}function oM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const sM={basis:{curve:R7},"basis-closed":{curve:P7},"basis-open":{curve:L7},bundle:{curve:I7,tension:"beta",value:.85},cardinal:{curve:z7,tension:"tension",value:0},"cardinal-open":{curve:U7,tension:"tension",value:0},"cardinal-closed":{curve:B7,tension:"tension",value:0},"catmull-rom":{curve:j7,tension:"alpha",value:.5},"catmull-rom-closed":{curve:q7,tension:"alpha",value:.5},"catmull-rom-open":{curve:W7,tension:"alpha",value:.5},linear:{curve:_y},"linear-closed":{curve:H7},monotone:{horizontal:V7,vertical:G7},natural:{curve:Y7},step:{curve:X7},"step-after":{curve:Z7},"step-before":{curve:K7}};function mb(e,t,n){var i=Z(sM,e)&&sM[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const UU={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},jU=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,qU=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,WU=/^((\s+,?\s*)|(,\s*))/,HU=/^[01]/;function bu(e){const t=[];return(e.match(jU)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=UU[o],a=GU(o,s,i.slice(1).trim()),u=a.length;if(u<s||u&&u%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,s)]),u!==s){o==="m"&&(r=r==="M"?"L":"l");for(let l=s;l<u;l+=s)t.push([r,...a.slice(l,l+s)])}}),t}function GU(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?HU:qU,a=n.slice(r).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(WU);u!==null&&(r+=u[0].length)}return i}const No=Math.PI/180,VU=1e-14,Bs=Math.PI/2,Ji=Math.PI*2,vu=Math.sqrt(3)/2;var yb={},bb={},aM=[].join;function YU(e,t,n,i,r,o,s,a,u){const l=aM.call(arguments);if(yb[l])return yb[l];const c=s*No,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,w=b*a+v*u,_=m*e+y*t,E=b*e+v*t;let S=1/((_-x)*(_-x)+(E-w)*(E-w))-.25;S<0&&(S=0);let M=Math.sqrt(S);o==r&&(M=-M);const k=.5*(x+_)-M*(E-w),N=.5*(w+E)+M*(_-x),A=Math.atan2(w-N,x-k);let C=Math.atan2(E-N,_-k)-A;C<0&&o===1?C+=Ji:C>0&&o===0&&(C-=Ji);const T=Math.ceil(Math.abs(C/(Bs+.001))),P=[];for(let I=0;I<T;++I){const z=A+I*C/T,te=A+(I+1)*C/T;P[I]=[k,N,z,te,n,i,f,d]}return yb[l]=P}function XU(e){const t=aM.call(e);if(bb[t])return bb[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7];const c=l*s,f=-u*a,d=u*s,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(o),y=Math.sin(o),b=.5*(o-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),w=n+p-x*g,_=i+g+x*p,E=n+m,$=i+y,S=E+x*y,M=$-x*m;return bb[t]=[c*w+f*_,d*w+h*_,c*S+f*M,d*S+h*M,c*E+f*$,d*E+h*$]}const Xn=["l",0,0,0,0,0,0,0];function KU(e,t,n){const i=Xn[0]=e[0];if(i==="a"||i==="A")Xn[1]=t*e[1],Xn[2]=n*e[2],Xn[3]=e[3],Xn[4]=e[4],Xn[5]=e[5],Xn[6]=t*e[6],Xn[7]=n*e[7];else if(i==="h"||i==="H")Xn[1]=t*e[1];else if(i==="v"||i==="V")Xn[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)Xn[r]=(r%2==1?t:n)*e[r];return Xn}function vc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),o==null&&(o=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(s=t[b],(r!==1||o!==1)&&(s=KU(s,r,o)),s[0]){case"l":u+=s[1],l+=s[2],e.lineTo(u+n,l+i);break;case"L":u=s[1],l=s[2],e.lineTo(u+n,l+i);break;case"h":u+=s[1],e.lineTo(u+n,l+i);break;case"H":u=s[1],e.lineTo(u+n,l+i);break;case"v":l+=s[1],e.lineTo(u+n,l+i);break;case"V":l=s[1],e.lineTo(u+n,l+i);break;case"m":u+=s[1],l+=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=s[1],l=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+s[5],h=l+s[6],c=u+s[3],f=l+s[4],e.bezierCurveTo(u+s[1]+n,l+s[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=s[5],l=s[6],c=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+s[3],h=l+s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+s[1]+n,l+s[2]+i,d+n,h+i),c=u+s[1],f=l+s[2],u=d,l=h;break;case"S":d=s[3],h=s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"q":d=u+s[3],h=l+s[4],c=u+s[1],f=l+s[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"t":d=u+s[1],h=l+s[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+s[1],f=l+s[2];break;case"T":d=s[1],h=s[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":uM(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+n,s[7]+l+i]),u+=s[6],l+=s[7];break;case"A":uM(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),u=s[6],l=s[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=s}}function uM(e,t,n,i){const r=YU(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const s=XU(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const lM=.5773502691896257,cM={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Ji)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n,r=i-n*lM,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n,r=i-n*lM;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function fM(e){return Z(cM,e)?cM[e]:ZU(e)}var vb={};function ZU(e){if(!Z(vb,e)){const t=bu(e);vb[e]={draw:function(n,i){vc(n,t,0,0,Math.sqrt(i)/2)}}}return vb[e]}const Do=.448084975506;function JU(e){return e.x}function QU(e){return e.y}function ej(e){return e.width}function tj(e){return e.height}function Pr(e){return typeof e=="function"?e:()=>+e}function Nh(e,t,n){return Math.max(t,Math.min(e,n))}function dM(){var e=JU,t=QU,n=ej,i=tj,r=Pr(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Nh(+r.call(this,c),0,b),x=Nh(+o.call(this,c),0,b),w=Nh(+s.call(this,c),0,b),_=Nh(+a.call(this,c),0,b);if(u||(u=h=rh()),v<=0&&x<=0&&w<=0&&_<=0)u.rect(p,g,m,y);else{var E=p+m,$=g+y;u.moveTo(p+v,g),u.lineTo(E-x,g),u.bezierCurveTo(E-Do*x,g,E,g+Do*x,E,g+x),u.lineTo(E,$-_),u.bezierCurveTo(E,$-Do*_,E-Do*_,$,E-_,$),u.lineTo(p+w,$),u.bezierCurveTo(p+Do*w,$,p,$-Do*w,p,$-w),u.lineTo(p,g+v),u.bezierCurveTo(p,g+Do*v,p+Do*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Pr(c),l):e},l.y=function(c){return arguments.length?(t=Pr(c),l):t},l.width=function(c){return arguments.length?(n=Pr(c),l):n},l.height=function(c){return arguments.length?(i=Pr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Pr(c),o=f!=null?Pr(f):r,a=d!=null?Pr(d):r,s=h!=null?Pr(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function hM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(s-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(s+b,a+v),r.arc(s,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,Ji);r.closePath()}else o=1;s=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=rh()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(o=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function xc(e,t){return e??t}const wc=e=>e.x||0,Ec=e=>e.y||0,nj=e=>e.width||0,ij=e=>e.height||0,rj=e=>(e.x||0)+(e.width||0),oj=e=>(e.y||0)+(e.height||0),sj=e=>e.startAngle||0,aj=e=>e.endAngle||0,uj=e=>e.padAngle||0,lj=e=>e.innerRadius||0,cj=e=>e.outerRadius||0,fj=e=>e.cornerRadius||0,dj=e=>xc(e.cornerRadiusTopLeft,e.cornerRadius)||0,hj=e=>xc(e.cornerRadiusTopRight,e.cornerRadius)||0,pj=e=>xc(e.cornerRadiusBottomRight,e.cornerRadius)||0,gj=e=>xc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,mj=e=>xc(e.size,64),yj=e=>e.size||1,Dh=e=>e.defined!==!1,bj=e=>fM(e.shape||"circle"),vj=O7().startAngle(sj).endAngle(aj).padAngle(uj).innerRadius(lj).outerRadius(cj).cornerRadius(fj),xj=fk().x(wc).y1(Ec).y0(oj).defined(Dh),wj=fk().y(Ec).x1(wc).x0(rj).defined(Dh),Ej=ck().x(wc).y(Ec).defined(Dh),_j=dM().x(wc).y(Ec).width(nj).height(ij).cornerRadius(dj,hj,pj,gj),$j=D7().type(bj).size(mj),Sj=hM().x(wc).y(Ec).defined(Dh).size(yj);function xb(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Aj(e,t){return vj.context(e)(t)}function kj(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?wj:xj).curve(mb(i,n.orient,n.tension)).context(e)(t)}function Cj(e,t){const n=t[0],i=n.interpolate||"linear";return Ej.curve(mb(i,n.orient,n.tension)).context(e)(t)}function xu(e,t,n,i){return _j.context(e)(t,n,i)}function Mj(e,t){return(t.mark.shape||t.shape).context(e)(t)}function Fj(e,t){return $j.context(e)(t)}function Tj(e,t){return Sj.context(e)(t)}var pM=1;function gM(){pM=1}function wb(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+pM++),s=r.clipping[o]||(r.clipping[o]={id:o});return ce(i)?s.path=i(null):xb(n)?s.path=xu(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function nt(e){this.clear(),e&&this.union(e)}nt.prototype={clone(){return new nt(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,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.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 i=this.rotatedPoints(e,t,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(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*s+l,u*i+a*s+c,a*o-u*r+l,u*o+a*r+c,a*o-u*s+l,u*o+a*s+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.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<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.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.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Rh(e){this.mark=e,this.bounds=this.bounds||new nt}function Ph(e){Rh.call(this,e),this.items=this.items||[]}G(Ph,Rh);class mM{constructor(t){this._pending=0,this._loader=t||Bd()}pending(){return this._pending}sanitizeURL(t){const n=this;return yM(n),n._loader.sanitize(t,{context:"href"}).then(i=>(_c(n),i)).catch(()=>(_c(n),null))}loadImage(t){const n=this,i=J7();return yM(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=Z(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>_c(n),s.onerror=()=>_c(n),s.src=o,s}).catch(r=>(_c(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function yM(e){e._pending+=1}function _c(e){e._pending-=1}function Lr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?Oj(t,i):0))}return e}function Oj(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const Nj=Ji-1e-8;let Lh,Ih,zh,Us,Eb,Bh,_b,$b;const Ro=(e,t)=>Lh.add(e,t),Uh=(e,t)=>Ro(Ih=e,zh=t),bM=e=>Ro(e,Lh.y1),vM=e=>Ro(Lh.x1,e),js=(e,t)=>Eb*e+_b*t,qs=(e,t)=>Bh*e+$b*t,Sb=(e,t)=>Ro(js(e,t),qs(e,t)),Ab=(e,t)=>Uh(js(e,t),qs(e,t));function $c(e,t){return Lh=e,t?(Us=t*No,Eb=$b=Math.cos(Us),Bh=Math.sin(Us),_b=-Bh):(Eb=$b=1,Us=Bh=_b=0),Dj}const Dj={beginPath(){},closePath(){},moveTo:Ab,lineTo:Ab,rect(e,t,n,i){Us?(Sb(e+n,t),Sb(e+n,t+i),Sb(e,t+i),Ab(e,t)):(Ro(e+n,t+i),Uh(e,t))},quadraticCurveTo(e,t,n,i){const r=js(e,t),o=qs(e,t),s=js(n,i),a=qs(n,i);xM(Ih,r,s,bM),xM(zh,o,a,vM),Uh(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=js(e,t),a=qs(e,t),u=js(n,i),l=qs(n,i),c=js(r,o),f=qs(r,o);wM(Ih,s,u,c,bM),wM(zh,a,l,f,vM),Uh(c,f)},arc(e,t,n,i,r,o){if(i+=Us,r+=Us,Ih=n*Math.cos(r)+e,zh=n*Math.sin(r)+t,Math.abs(r-i)>Nj)Ro(e-n,t-n),Ro(e+n,t+n);else{const s=l=>Ro(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%Ji,i<0&&(i+=Ji),r=r%Ji,r<0&&(r+=Ji),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=Ji,a=i-i%Bs,u=0;u<4&&a>r;++u,a-=Bs)s(a);else for(a=i-i%Bs+Bs,u=0;u<4&&a<r;++u,a=a+Bs)s(a)}}};function xM(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function wM(e,t,n,i,r){const o=i-e+3*t-3*n,s=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(o)>VU?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),u=(-s+c)/o,l=(-s-c)/o)):u=.5*a/s,0<u&&u<1&&r(EM(u,e,t,n,i)),0<l&&l<1&&r(EM(l,e,t,n,i))}function EM(e,t,n,i,r){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*i+a*e*r}var Po=(Po=ko(1,1))?Po.getContext("2d"):null;const kb=new nt;function Cb(e){return function(t,n){if(!Po)return!0;e(Po,t),kb.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=kb;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Po.isPointInPath(u,a))return!0;return!1}}function Mb(e,t){return t.contains(e.x||0,e.y||0)}function _M(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(kb.set(n,i,n+r,i+o))}function $M(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:i;return wu(t,n,i,r,o)}function wu(e,t,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(o-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(s-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function Eu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function hi(e,t){return e??t}function SM(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Rj(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+hi(t.x1,.5)*i,n.y1+hi(t.y1,.5)*r,Math.max(i,r)*hi(t.r1,0),n.x1+hi(t.x2,.5)*i,n.y1+hi(t.y2,.5)*r,Math.max(i,r)*hi(t.r2,.5));else{const s=hi(t.x1,0),a=hi(t.y1,0),u=hi(t.x2,1),l=hi(t.y2,0);if(s===u||a===l||i===r)o=e.createLinearGradient(n.x1+s*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=ko(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=SM(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return SM(o,t.stops)}function AM(e,t,n){return gb(n)?Rj(e,n,t.bounds):n}function jh(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=AM(e,t,t.fill),!0):!1}var Pj=[];function _u(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=AM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Pj),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function Lj(e,t){return e.zindex-t.zindex||e.index-t.index}function Fb(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(Lj)}function pi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=Fb(e);if(o&&o.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=o}for(i=0,r=n.length;i<r;++i)t(n[i])}function qh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=Fb(e);for(o&&o.length&&(n=o),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===o){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Tb(e){return function(t,n,i){pi(n,r=>{(!i||i.intersects(r.bounds))&&kM(e,t,r,r)})}}function Ij(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&kM(e,t,n.items[0],n.items)}}function kM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Eu(t,n),n.fill&&jh(t,n,r)&&t.fill(),n.stroke&&_u(t,n,r)&&t.stroke()))}function Wh(e){return e=e||Wn,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,qh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Sc(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t??s.fill,u=s.stroke&&n.isPointInStroke,l,c;return u&&(l=s.strokeWidth,c=s.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function Ob(e){return Wh(Sc(e))}function Ws(e,t){return"translate("+e+","+t+")"}function Nb(e){return"rotate("+e+")"}function zj(e,t){return"scale("+e+","+t+")"}function CM(e){return Ws(e.x||0,e.y||0)}function Bj(e){return Ws(e.x||0,e.y||0)+(e.angle?" "+Nb(e.angle):"")}function Uj(e){return Ws(e.x||0,e.y||0)+(e.angle?" "+Nb(e.angle):"")+(e.scaleX||e.scaleY?" "+zj(e.scaleX||1,e.scaleY||1):"")}function Db(e,t,n){function i(s,a){s("transform",Bj(a)),s("d",t(null,a))}function r(s,a){return t($c(s,a.angle),a),Lr(s,a).translate(a.x||0,a.y||0)}function o(s,a){var u=a.x||0,l=a.y||0,c=a.angle||0;s.translate(u,l),c&&s.rotate(c*=No),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Tb(o),pick:Ob(o),isect:n||Cb(o)}}var jj=Db("arc",Aj);function qj(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=1/0,s,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<o&&(o=a,s=e[r]));return s}function Wj(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,o,s;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],o=e[i].y-t[1],s=r*r+o*o,s<n))return e[i];return null}function Hj(e,t){for(var n=e.length,i,r,o;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],o=i*i+r*r,i=e[n].size||1,o<i*i))return e[n];return null}function Rb(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t($c(u),c),Lr(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Sc(o);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:Ij(o),pick:a,isect:Mb,tip:n}}var Gj=Rb("area",kj,qj);function Vj(e,t){var n=t.clip;e.save(),ce(n)?(e.beginPath(),n(e),e.clip()):MM(e,t.group)}function MM(e,t){e.beginPath(),xb(t)?xu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function FM(e){const t=hi(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function Yj(e,t){e("transform",CM(t))}function TM(e,t){const n=FM(t);e("d",xu(null,t,n,n))}function Xj(e,t){e("class","background"),e("aria-hidden",!0),TM(e,t)}function Kj(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?TM(e,t):e("d","")}function Zj(e,t,n){const i=t.clip?wb(n,t,t):null;e("clip-path",i)}function Jj(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Lr(e,t),e.translate(t.x||0,t.y||0)}function Ac(e,t,n,i){const r=FM(t);e.beginPath(),xu(e,t,(n||0)+r,(i||0)+r)}const Qj=Sc(Ac),eq=Sc(Ac,!1),tq=Sc(Ac,!0);function nq(e,t,n,i){pi(t,r=>{const o=r.x||0,s=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Ac(e,r,o,s),Eu(e,r),r.fill&&jh(e,r,u)&&e.fill(),r.stroke&&!a&&_u(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&MM(e,r),n&&n.translate(-o,-s),pi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(o,s),e.restore(),a&&r.stroke&&u&&(Ac(e,r,o,s),Eu(e,r),_u(e,r,u)&&e.stroke())})}function iq(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const s=n*e.pixelRatio,a=i*e.pixelRatio;return qh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,g&&xb(u)&&!tq(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&eq(e,u,s,a)?(e.restore(),u):(l=qh(u,b=>rq(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&Qj(e,u,s,a)&&(l=u),e.restore(),l||null)})}function rq(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var oq={type:"group",tag:"g",nested:!1,attr:Yj,bound:Jj,draw:nq,pick:iq,isect:_M,content:Zj,background:Xj,foreground:Kj},kc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Pb(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(i=>{e.image=i,e.image.url=e.url})),n}function Lb(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Ib(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Hh(e,t){return e==="center"?t/2:e==="right"?t:0}function Gh(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function sq(e,t,n){const i=Pb(t,n),r=Lb(t,i),o=Ib(t,i),s=(t.x||0)-Hh(t.align,r),a=(t.y||0)-Gh(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,kc["xmlns:xlink"],"xlink:href"),e("transform",Ws(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function aq(e,t){const n=t.image,i=Lb(t,n),r=Ib(t,n),o=(t.x||0)-Hh(t.align,i),s=(t.y||0)-Gh(t.baseline,r);return e.set(o,s,o+i,s+r)}function uq(e,t,n){pi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Pb(i,this);let o=Lb(i,r),s=Ib(i,r);if(o===0||s===0)return;let a=(i.x||0)-Hh(i.align,o),u=(i.y||0)-Gh(i.baseline,s),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(s-d)/2,s=d):(d=s*c,a+=(o-d)/2,o=d))),(r.complete||r.toDataURL)&&(Eu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var lq={type:"image",tag:"image",nested:!1,attr:sq,bound:aq,draw:uq,pick:Wh(),isect:Wn,get:Pb,xOffset:Hh,yOffset:Gh},cq=Rb("line",Cj,Wj);function fq(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",Uj(t)),e("d",t.path)}function Vh(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*No,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=bu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),vc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):vc(e,u,i,r,o,s)}function dq(e,t){return Vh($c(e,t.angle),t)?e.set(0,0,0,0):Lr(e,t,!0)}var hq={type:"path",tag:"path",nested:!1,attr:fq,bound:dq,draw:Tb(Vh),pick:Ob(Vh),isect:Cb(Vh)};function pq(e,t){e("d",xu(null,t))}function gq(e,t){var n,i;return Lr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function OM(e,t){e.beginPath(),xu(e,t)}var mq={type:"rect",tag:"path",nested:!1,attr:pq,bound:gq,draw:Tb(OM),pick:Ob(OM),isect:_M};function yq(e,t){e("transform",CM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function bq(e,t){var n,i;return Lr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function NM(e,t,n){var i,r,o,s;return t.stroke&&_u(e,t,n)?(i=t.x||0,r=t.y||0,o=t.x2!=null?t.x2:i,s=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,s),!0):!1}function vq(e,t,n){pi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&NM(e,i,r)&&(Eu(e,i),e.stroke())}})}function xq(e,t,n,i){return e.isPointInStroke?NM(e,t,1)&&e.isPointInStroke(n,i):!1}var wq={type:"rule",tag:"line",nested:!1,attr:yq,bound:bq,draw:vq,pick:Wh(xq),isect:$M},Eq=Db("shape",Mj),_q=Db("symbol",Fj,Mb);const DM=b$();var On={height:Qi,measureWidth:zb,estimateWidth:Yh,width:Yh,canvas:RM};RM(!0);function RM(e){On.width=e&&Po?zb:Yh}function Yh(e,t){return PM(Io(e,t),Qi(e))}function PM(e,t){return~~(.8*e.length*t)}function zb(e,t){return Qi(e)<=0||!(t=Io(e,t))?0:LM(t,Xh(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=DM.get(n);return i===void 0&&(Po.font=t,i=Po.measureText(e).width,DM.set(n,i)),i}function Qi(e){return e.fontSize!=null?+e.fontSize||0:11}function Lo(e){return e.lineHeight!=null?e.lineHeight:Qi(e)+2}function $q(e){return L(e)?e.length>1?e:e[0]:e}function Cc(e){return $q(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function Bb(e){const t=Cc(e);return(L(t)?t.length-1:0)*Lo(e)}function Io(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?Aq(e,n):n}function Sq(e){if(On.width===zb){const t=Xh(e);return n=>LM(n,t)}else if(On.width===Yh){const t=Qi(e);return n=>PM(n,t)}else return t=>On.width(e,t)}function Aq(e,t){var n=+e.limit,i=Sq(e);if(i(t)<n)return t;var r=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,u;if(n-=i(r),o){for(;s<a;)u=s+a>>>1,i(t.slice(u))>n?s=u+1:a=u;return r+t.slice(s)}else{for(;s<a;)u=1+(s+a>>>1),i(t.slice(0,u))<n?s=u:a=u-1;return t.slice(0,s)+r}}function Mc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xh(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Qi(e)+"px "+Mc(e,t)}function Ub(e){var t=e.baseline,n=Qi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Lo(e):t==="line-bottom"?.29*n-.5*Lo(e):0)}const kq={left:"start",center:"middle",right:"end"},Fc=new nt;function Kh(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Bs,t+=i*Math.cos(r),n+=i*Math.sin(r)),Fc.x1=t,Fc.y1=n,Fc}function Cq(e,t){var n=t.dx||0,i=(t.dy||0)+Ub(t),r=Kh(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",kq[t.align]||"start"),a?(u=Ws(o,s)+" "+Nb(a),(n||i)&&(u+=" "+Ws(n,i))):u=Ws(o+n,s+i),e("transform",u)}function jb(e,t,n){var i=On.height(t),r=t.align,o=Kh(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+Ub(t)-Math.round(.8*i),c=Cc(t),f;if(L(c)?(i+=Lo(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,On.width(t,h)),0)):f=On.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=s,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*No,s,a);else if(n===2)return e.rotatedPoints(t.angle*No,s,a);return e}function Mq(e,t,n){pi(t,i=>{var r=i.opacity==null?1:i.opacity,o,s,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Xh(i),e.textAlign=i.align||"left",o=Kh(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*No),s=a=0),s+=i.dx||0,a+=(i.dy||0)+Ub(i),c=Cc(i),Eu(e,i),L(c))for(l=Lo(i),u=0;u<c.length;++u)f=Io(i,c[u]),i.fill&&jh(e,i,r)&&e.fillText(f,s,a),i.stroke&&_u(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=Io(i,c),i.fill&&jh(e,i,r)&&e.fillText(f,s,a),i.stroke&&_u(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function Fq(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Kh(t),a=s.x1,u=s.y1,l=jb(Fc,t,1),c=-t.angle*No,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),p=d*r+f*o+(u-d*a-f*u);return l.contains(h,p)}function Tq(e,t){const n=jb(Fc,e,2);return wu(t,n[0],n[1],n[2],n[3])||wu(t,n[0],n[1],n[4],n[5])||wu(t,n[4],n[5],n[6],n[7])||wu(t,n[2],n[3],n[6],n[7])}var Oq={type:"text",tag:"text",nested:!1,attr:Cq,bound:jb,draw:Mq,pick:Wh(Fq),isect:Tq},Nq=Rb("trail",Tj,Hj),Nn={arc:jj,area:Gj,group:oq,image:lq,line:cq,path:hq,rect:mq,rule:wq,shape:Eq,symbol:_q,text:Oq,trail:Nq};function qb(e,t,n){var i=Nn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new nt),e,n)}var IM={mark:null};function zM(e,t,n){var i=Nn[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(IM.mark=e,l=IM),c=qb(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new nt,s)for(a=0,u=o.length;a<u;++a)t.union(qb(o[a],r,n));return e.bounds=t}const Dq=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function BM(e,t){return JSON.stringify(e,Dq,t)}function UM(e){const t=typeof e=="string"?JSON.parse(e):e;return jM(t)}function jM(e){var t=e.marktype,n=e.items,i,r,o;if(n)for(r=0,o=n.length;r<o;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&jM(n[r]);return t&&zM(e),e}class qM{constructor(t){arguments.length?this.root=UM(t):(this.root=WM({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Ph(this.root)])}toJSON(t){return BM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=WM(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function WM(e,t){const n={bounds:new nt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function zo(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function Wb(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function st(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=zo(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function Kn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function HM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Zh(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Rq(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=Nn[r.marktype]).tip){for(s=Zh(t,n),s[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(r.items,s)}return e}let Hb=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||Bd(),this._tooltip=n||Pq}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}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,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(t.type,t),s=zo(null,"a");for(const a in r)s.setAttribute(a,r[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=Rq(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=t.bounds,s=o.width(),a=o.height();let u=o.x1+r[0]+i.left,l=o.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:s,height:a,left:u,top:l,right:u+s,bottom:l+a}}};function Pq(e,t,n,i){e.element().setAttribute("title",i||"")}class Tc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new mM(t)}initialize(t,n,i,r,o){return this._el=t,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const Lq="keydown",Iq="keypress",zq="keyup",GM="dragenter",Jh="dragleave",VM="dragover",Gb="pointerdown",Bq="pointerup",Qh="pointermove",ep="pointerout",YM="pointerover",Vb="mousedown",Uq="mouseup",XM="mousemove",tp="mouseout",KM="mouseover",np="click",jq="dblclick",qq="wheel",ZM="mousewheel",ip="touchstart",rp="touchmove",op="touchend",Wq=[Lq,Iq,zq,GM,Jh,VM,Gb,Bq,Qh,ep,YM,Vb,Uq,XM,tp,KM,np,jq,qq,ZM,ip,rp,op],Yb=Qh,Oc=tp,Xb=np;class Nc extends Hb{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Wq,this.pointermove=QM([Qh,XM],[YM,KM],[ep,tp]),this.dragover=QM([VM],[GM],[Jh]),this.pointerout=eF([ep,tp]),this.dragleave=eF([Jh])}initialize(t,n,i){return this._canvas=t&&Wb(t,"canvas"),[np,Vb,Gb,Qh,ep,Jh].forEach(r=>JM(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(ZM,t)}pointerdown(t){this._down=this._active,this.fire(Gb,t)}mousedown(t){this._down=this._active,this.fire(Vb,t)}click(t){this._down===this._active&&(this.fire(np,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(ip,t,!0)}touchmove(t){this.fire(rp,t,!0)}touchend(t){this.fire(op,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===Xb&&r&&r.href?this.handleHref(n,r,r.href):(t===Yb||t===Oc)&&this.handleTooltip(n,r,t!==Oc),o)for(let s=0,a=o.length;s<a;++s)o[s].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(JM(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&r.splice(o,1),this}pickEvent(t){const n=Zh(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,o){const s=this.context();return Nn[t.marktype].pick.call(this,s,t,n,i,r,o)}}const Hq=e=>e===ip||e===rp||e===op?[ip,rp,op]:[e];function JM(e,t){Hq(t).forEach(n=>Gq(e,n))}function Gq(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Dc(e,t,n){t.forEach(i=>e.fire(i,n))}function QM(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?Dc(this,e,i):((!r||!r.exit)&&Dc(this,n,i),this._active=o,Dc(this,t,i),Dc(this,e,i))}}function eF(e){return function(t){Dc(this,e,t),this._active=null}}function Vq(){return typeof window<"u"&&window.devicePixelRatio||1}function Yq(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?Vq():r;e.width=t*u,e.height=n*u;for(const l in o)a[l]=o[l];return s&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class sp extends Tc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new nt,this._tempb=new nt}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:ko(1,1,this._options.type),t&&this._canvas&&(Kn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,o)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)Yq(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||R("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.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 n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,a=this._dirty,u=Xq(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):Kq(i,u.intersect(a),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=Nn[n.marktype];n.clip&&Vj(t,n),o.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,i,r))}}const Xq=(e,t,n)=>new nt().set(0,0,t,n).translate(-e[0],-e[1]);function Kq(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}class tF extends Hb{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Kb(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Kb(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Oc)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(Xb,this._hrefHandler),r.removeEventListener(Yb,this._tooltipHandler),r.removeEventListener(Oc,this._tooltipHandler)),this._svg=r=t&&Wb(t,"svg"),r&&(r.addEventListener(Xb,this._hrefHandler),r.addEventListener(Yb,this._tooltipHandler),r.addEventListener(Oc,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const s={type:t,handler:n,listener:Kb(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Kb=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},nF="aria-hidden",Zb="aria-label",Jb="role",Qb="aria-roledescription",iF="graphics-object",ev="graphics-symbol",rF=(e,t,n)=>({[Jb]:e,[Qb]:t,[Zb]:n||void 0}),Zq=li(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),oF={axis:{desc:"axis",caption:eW},legend:{desc:"legend",caption:tW},"title-text":{desc:"title",caption:e=>`Title text '${lF(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${lF(e)}'`}},sF={ariaRole:Jb,ariaRoleDescription:Qb,description:Zb};function aF(e,t){const n=t.aria===!1;if(e(nF,n||void 0),n||t.description==null)for(const i in sF)e(sF[i],void 0);else{const i=t.mark.marktype;e(Zb,t.description),e(Jb,t.ariaRole||(i==="group"?iF:ev)),e(Qb,t.ariaRoleDescription||`${i} mark`)}}function uF(e){return e.aria===!1?{[nF]:!0}:Zq[e.role]?null:oF[e.role]?Qq(e,oF[e.role]):Jq(e)}function Jq(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return rF(n?iF:ev,`${t} mark container`,e.description)}function Qq(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return rF(t.role||ev,t.desc,n.description||i(n))}catch{return null}}function lF(e){return X(e.text).join(" ")}function eW(e){const t=e.datum,n=e.orient,i=t.title?cF(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${yu(a)?"discrete":a} scale with ${nM(s,o,e)}`}function tW(e){const t=e.datum,n=t.title?cF(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return iW(i)+(n?` titled '${n}'`:"")+` for ${nW(o)} with ${nM(u,a,e)}`}function cF(e){try{return X(ve(e.items).items[0].text).join(" ")}catch{return null}}function nW(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ve(e)}function iW(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const fF=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),rW=e=>fF(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function tv(){let e="",t="",n="";const i=[],r=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},s=(u,l)=>(l!=null&&(t+=` ${u}="${rW(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=fF(u),a),toString:()=>e};return a}const dF=e=>hF(tv(),e)+"";function hF(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):hF(e,i)}return e.close()}const ap={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},up={blend:"mix-blend-mode"},pF={fill:"none","stroke-miterlimit":10},Rc=0,gF="http://www.w3.org/2000/xmlns/",at=kc.xmlns;class nv extends Tc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,o){return this._defs={},this._clearDefs(),t&&(this._svg=st(t,0,"svg",at),this._svg.setAttributeNS(gF,"xmlns",at),this._svg.setAttributeNS(gF,"xmlns:xlink",kc["xmlns:xlink"]),this._svg.setAttribute("version",kc.version),this._svg.setAttribute("class","marks"),Kn(t,1),this._root=st(this._svg,Rc,"g",at),Bo(this._root,pF),Kn(this._svg,Rc+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(Bo(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,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=st(t,Rc,"rect",at),Bo(i,{width:this._width,height:this._height,fill:n}));const r=dF(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Kn(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 n=++this._dirtyID;let i,r,o,s,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==o&&(o=r.marktype,s=Nn[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,mF(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){s.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(s,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=s.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,mF(i,n)):this._update(s,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Nn[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=yF(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return Kn(c,0),n._svg;c.setAttribute("class",HM(n));const f=uF(n);for(const g in f)Kt(c,g,f[g]);l||Kt(c,"pointer-events",u),Kt(c,"clip-path",n.clip?wb(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=yF(g,c,d,a.tag,o);m&&(this._update(a,y,g),l&&aW(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):pi(n,p),Kn(c,h),c}_update(t,n,i){Ir=n,jt=n.__values__,aF(Pc,i),t.attr(Pc,i,this);const r=lW[t.type];r&&r.call(this,t,n,i),Ir&&this.style(Ir,i)}style(t,n){if(n!=null){for(const i in ap){let r=i==="font"?Mc(n):n[i];if(r===jt[i])continue;const o=ap[i];r==null?t.removeAttribute(o):(gb(r)&&(r=rM(r,this._defs.gradient,bF())),t.setAttribute(o,r+"")),jt[i]=r}for(const i in up)lp(t,up[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=st(t,Rc+1,"defs",at)),r=oW(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=st(t,Rc+1,"defs",at)),r=sW(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):Kn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function mF(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function oW(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=st(e,n++,"pattern",at);Bo(s,{id:Oh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=st(s,0,"rect",at),Bo(s,{width:1,height:1,fill:`url(${bF()}#${t.id})`}),e=st(e,n++,"radialGradient",at),Bo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=st(e,n++,"linearGradient",at),Bo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=st(e,i,"stop",at),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return Kn(e,i),n}function sW(e,t,n){let i;return e=st(e,n,"clipPath",at),e.setAttribute("id",t.id),t.path?(i=st(e,0,"path",at),i.setAttribute("d",t.path)):(i=st(e,0,"rect",at),Bo(i,{x:0,y:0,width:t.width,height:t.height})),Kn(e,1),n+1}function aW(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;pi(n,s=>{r=e.mark(t,s,r,i),++o}),Kn(t,1+o)}function yF(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=zo(s,i,at),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=zo(s,"path",at);o.appendChild(a),a.__data__=e;const u=zo(s,"g",at);o.appendChild(u),u.__data__=e;const l=zo(s,"path",at);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||uW(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function uW(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Ir=null,jt=null;const lW={group(e,t,n){const i=Ir=t.childNodes[2];jt=i.__values__,e.foreground(Pc,n,this),jt=t.__values__,Ir=t.childNodes[1],e.content(Pc,n,this);const r=Ir=t.childNodes[0];e.background(Pc,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==jt.events&&(Kt(i,"pointer-events",o),Kt(r,"pointer-events",o),jt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Kt(i,"display",null),this.style(r,n),Kt(r,"stroke",null),s&&(n.fill=null),jt=i.__values__,this.style(i,n),s&&(n.fill=s),Ir=null}else Kt(i,"display","none")},image(e,t,n){n.smooth===!1?(lp(t,"image-rendering","optimizeSpeed"),lp(t,"image-rendering","pixelated")):lp(t,"image-rendering",null)},text(e,t,n){const i=Cc(n);let r,o,s,a;L(i)?(o=i.map(u=>Io(n,u)),r=o.join(`
48
- `),r!==jt.text&&(Kn(t,0),s=t.ownerDocument,a=Lo(n),o.forEach((u,l)=>{const c=zo(s,"tspan",at);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),jt.text=r)):(o=Io(n,i),o!==jt.text&&(t.textContent=o,jt.text=o)),Kt(t,"font-family",Mc(n)),Kt(t,"font-size",Qi(n)+"px"),Kt(t,"font-style",n.fontStyle),Kt(t,"font-variant",n.fontVariant),Kt(t,"font-weight",n.fontWeight)}};function Pc(e,t,n){t!==jt[e]&&(n?cW(Ir,e,t,n):Kt(Ir,e,t),jt[e]=t)}function lp(e,t,n){n!==jt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),jt[t]=n)}function Bo(e,t){for(const n in t)Kt(e,n,t[n])}function Kt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function cW(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function bF(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class vF extends Tc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=tv();n.open("svg",fe({},kc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",pF,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Nn[n.marktype],r=i.tag,o=[aF,i.attr];t.open("g",{class:HM(n),"clip-path":n.clip?wb(this,n,n.group):null},uF(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Cc(a);if(L(l)){const c={x:0,dy:Lo(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Io(a,l[f])).close()}else t.text(Io(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),pi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):pi(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&fW(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Oh+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function fW(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Mc(t),e["font-size"]=Qi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in ap){let a=t[s];const u=ap[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(gb(a)&&(a=rM(a,r.gradient,"")),e[u]=a)}for(const s in up){const a=t[s];a!=null&&(o=o||[],o.push(`${up[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const gi={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function dW(e){gi.svgMarkTypes=e.svgMarkTypes??["text"],gi.svgOnTop=e.svgOnTop??!0,gi.debug=e.debug??!1}class iv extends Tc{constructor(t){super(t),this._svgRenderer=new nv(t),this._canvasRenderer=new sp(t)}initialize(t,n,i,r,o){this._root_el=st(t,0,"div");const s=st(this._root_el,0,"div"),a=st(this._root_el,1,"div");return this._root_el.style.position="relative",gi.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=gi.svgOnTop?a:s,this._canvasEl=gi.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return gi.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!gi.svgMarkTypes.includes(o));this._svgRenderer.render(t,gi.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return gi.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class xF extends Nc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=st(st(t,0,"div"),gi.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const wF="canvas",EF="hybrid",_F="png",$F="svg",SF="none",Uo={Canvas:wF,PNG:_F,SVG:$F,Hybrid:EF,None:SF},Hs={};Hs[wF]=Hs[_F]={renderer:sp,headless:sp,handler:Nc},Hs[$F]={renderer:nv,headless:vF,handler:tF},Hs[EF]={renderer:iv,headless:iv,handler:xF},Hs[SF]={};function cp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Hs[e]=t,this):Hs[e]}function AF(e,t,n){const i=[],r=new nt().union(t),o=e.marktype;return o?kF(e,r,n,i):o==="group"?CF(e,r,n,i):R("Intersect scene must be mark node or group item.")}function kF(e,t,n,i){if(hW(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)CF(r[a],t,n,i);else for(const u=Nn[o].isect;a<s;++a){const l=r[a];MF(l,t,u)&&i.push(l)}}return i}function hW(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function CF(e,t,n,i){n&&n(e.mark)&&MF(e,t,Nn.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)kF(r[u],t,n,i);t.translate(s,a)}return i}function MF(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const rv=new nt;function FF(e){const t=e.clip;if(ce(t))t($c(rv.clear()));else if(t)rv.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(rv)}const pW=1e-9;function ov(e,t,n){return e===t?!0:n==="path"?TF(e,t):e instanceof Date&&t instanceof Date?+e==+t:_e(e)&&_e(t)?Math.abs(e-t)<=pW:!e||!t||!Y(e)&&!Y(t)?e==t:gW(e,t)}function TF(e,t){return ov(bu(e),bu(t))}function gW(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!ov(e[r],t[r],r))return!1;return typeof e==typeof t}function mW(){gM(),BU()}const $u="top",mi="left",yi="right",jo="bottom",yW="top-left",bW="top-right",vW="bottom-left",xW="bottom-right",sv="start",av="middle",Zt="end",wW="x",EW="y",fp="group",uv="axis",lv="title",_W="frame",$W="scope",cv="legend",OF="row-header",NF="row-footer",DF="row-title",RF="column-header",PF="column-footer",LF="column-title",SW="padding",AW="symbol",IF="fit",zF="fit-x",BF="fit-y",kW="pad",fv="none",dp="all",dv="each",hv="flush",qo="column",Wo="row";function UF(e){O.call(this,null,e)}G(UF,O,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Nn[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=hp(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===fp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(hp(l,s))),i.role){case uv:case cv:case lv:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(hp(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(hp(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return FF(i),t.modifies("bounds")}});function hp(e,t,n){return t(e.bounds.clear(),e,n)}const jF=":vega_identifier:";function pv(e){O.call(this,0,e)}pv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},G(pv,O,{transform(e,t){const n=CW(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function CW(e){return e._signals[jF]||(e._signals[jF]=e.add(0))}function qF(e){O.call(this,null,e)}G(qF,O,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,MW(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 i=n.marktype===fp?Ph:Rh;return t.visit(t.ADD,r=>i.call(r,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}});function MW(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function WF(e){O.call(this,null,e)}const HF={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!GF(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},GF=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),VF=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(GF(r,o=e[n].bounds,t))return!0},FW=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},TW=(e,t,n)=>{var i=e.range(),r=new nt;return t===$u||t===jo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},YF=e=>(e.forEach(t=>t.opacity=1),e),XF=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(WF,O,{transform(e,t){const n=HF[e.method]||HF.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(YF(r),t=XF(t,e)),t;if(r=r.filter(FW),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=YF(r),t=XF(t,e),o.length>=3&&VF(o,i)){do o=n(o,i);while(o.length>=3&&VF(o,i));o.length<3&&!ve(r).opacity&&(o.length>1&&(ve(o).opacity=0),ve(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=TW(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function KF(e){O.call(this,null,e)}G(KF,O,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const qt=new nt;function Su(e,t,n){return e[t]===n?0:(e[t]=n,1)}function OW(e){var t=e.items[0].orient;return t===mi||t===yi}function NW(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function DW(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=NW(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=o.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&Bb(p),b=0,v=0,x,w;switch(qt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case $u:b=f||0,v=-c,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(l,0),p&&pp(e,p,w,g,y,0,-1,m);break;case mi:b=-c,v=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,l),p&&pp(e,p,w,g,y,1,-1,m);break;case yi:b=n+c,v=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,l),p&&pp(e,p,w,g,y,1,1,m);break;case jo:b=f||0,v=i+c,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,w),p&&pp(e,p,w,g,0,0,1,m);break;default:b=r.x,v=r.y}return Lr(m.translate(b,v),r),Su(r,"x",b+s)|Su(r,"y",v+s)&&(r.bounds=qt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function pp(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const ZF=(e,t)=>Math.floor(Math.min(e,t)),JF=(e,t)=>Math.ceil(Math.max(e,t));function RW(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===fp)switch(r.role){case uv:case cv:case lv:break;case OF:s.rowheaders.push(...o);break;case NF:s.rowfooters.push(...o);break;case RF:s.colheaders.push(...o);break;case PF:s.colfooters.push(...o);break;case DF:s.rowtitle=o[0];break;case LF:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function PW(e){return new nt().set(0,0,e.width||0,e.height||0)}function LW(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 i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function QF(e){return e<0?Math.ceil(-e):0}function e3(e,t,n){var i=!n.nodirty,r=n.bounds===hv?PW:LW,o=qt.set(0,0,0,0),s=je(n.align,qo),a=je(n.align,Wo),u=je(n.padding,qo),l=je(n.padding,Wo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),w=Array(d),_,E,$,S,M,k,N,A,F,C,T;for(E=0;E<c;++E)p[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)k=t[E],M=w[E]=r(k),k.x=k.x||0,v[E]=0,k.y=k.y||0,x[E]=0,$=E%c,S=~~(E/c),g=Math.max(g,N=Math.ceil(M.x2)),b=Math.max(b,A=Math.ceil(M.y2)),p[$]=Math.max(p[$],N),y[S]=Math.max(y[S],A),h[E]=u+QF(M.x1),m[E]=l+QF(M.y1),i&&e.dirty(t[E]);for(E=0;E<d;++E)E%c===0&&(h[E]=0),E<c&&(m[E]=0);if(s===dv)for($=1;$<c;++$){for(T=0,E=$;E<d;E+=c)T<h[E]&&(T=h[E]);for(E=$;E<d;E+=c)h[E]=T+p[$-1]}else if(s===dp){for(T=0,E=0;E<d;++E)E%c&&T<h[E]&&(T=h[E]);for(E=0;E<d;++E)E%c&&(h[E]=T+g)}else for(s=!1,$=1;$<c;++$)for(E=$;E<d;E+=c)h[E]+=p[$-1];if(a===dv)for(S=1;S<f;++S){for(T=0,E=S*c,_=E+c;E<_;++E)T<m[E]&&(T=m[E]);for(E=S*c;E<_;++E)m[E]=T+y[S-1]}else if(a===dp){for(T=0,E=c;E<d;++E)T<m[E]&&(T=m[E]);for(E=c;E<d;++E)m[E]=T+b}else for(a=!1,S=1;S<f;++S)for(E=S*c,_=E+c;E<_;++E)m[E]+=y[S-1];for(F=0,E=0;E<d;++E)F=h[E]+(E%c?F:0),v[E]+=F-t[E].x;for($=0;$<c;++$)for(C=0,E=$;E<d;E+=c)C+=m[E],x[E]+=C-t[E].y;if(s&&je(n.center,qo)&&f>1)for(E=0;E<d;++E)M=s===dp?g:p[E%c],F=M-w[E].x2-t[E].x-v[E],F>0&&(v[E]+=F/2);if(a&&je(n.center,Wo)&&c!==1)for(E=0;E<d;++E)M=a===dp?b:y[~~(E/c)],C=M-w[E].y2-t[E].y-x[E],C>0&&(x[E]+=C/2);for(E=0;E<d;++E)o.union(w[E].translate(v[E],x[E]));switch(F=je(n.anchor,wW),C=je(n.anchor,EW),je(n.anchor,qo)){case Zt:F-=o.width();break;case av:F-=o.width()/2}switch(je(n.anchor,Wo)){case Zt:C-=o.height();break;case av:C-=o.height()/2}for(F=Math.round(F),C=Math.round(C),o.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)k=t[E],k.x+=v[E]+=F,k.y+=x[E]+=C,o.union(k.mark.bounds.union(k.bounds.translate(v[E],x[E]))),i&&e.dirty(k);return o}function IW(e,t,n){var i=RW(t),r=i.marks,o=n.bounds===hv?zW:BW,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=e3(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=je(n.headerBand,Wo,null),c=gp(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),ZF,0,o,"x1",0,a,1,g)),i.colheaders&&(g=je(n.headerBand,qo,null),f=gp(e,i.colheaders,r,a,a,-je(s,"columnHeader"),ZF,1,o,"y1",0,1,a,g)),i.rowfooters&&(g=je(n.footerBand,Wo,null),d=gp(e,i.rowfooters,r,a,u,je(s,"rowFooter"),JF,0,o,"x2",a-1,a,1,g)),i.colfooters&&(g=je(n.footerBand,qo,null),h=gp(e,i.colfooters,r,a,a,je(s,"columnFooter"),JF,1,o,"y2",l-a,1,a,g)),i.rowtitle&&(p=je(n.titleAnchor,Wo),m=je(s,"rowTitle"),m=p===Zt?d+m:c-m,g=je(n.titleBand,Wo,.5),t3(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=je(n.titleAnchor,qo),m=je(s,"columnTitle"),m=p===Zt?h+m:f-m,g=je(n.titleBand,qo,.5),t3(e,i.coltitle,m,1,y,g))}function zW(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function BW(e,t){return e.bounds[t]}function gp(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,w,_,E,$,S;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=s(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=o,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(_=t[b],w=_.mark.bounds,v=y;v>=0&&(E=n[v])==null;v-=d);a?($=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),S=g):($=g,S=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),w.union(_.bounds.translate($-(_.x||0),S-(_.y||0))),_.x=$,_.y=S,e.dirty(_),m=s(m,w[l])}return m}function t3(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function UW(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function jW(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function qW(e,t,n,i,r,o,s){const a=UW(n,t),u=jW(e,a("offset",0)),l=a("anchor",sv),c=l===Zt?1:l===av?.5:0,f={align:dv,bounds:a("bounds",hv),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case mi:f.anchor={x:Math.floor(i.x1)-u,column:Zt,y:c*(s||i.height()+2*i.y1),row:l};break;case yi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case $u:f.anchor={y:Math.floor(r.y1)-u,row:Zt,x:c*(o||r.width()+2*r.x1),column:l};break;case jo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case yW:f.anchor={x:u,y:u};break;case bW:f.anchor={x:o-u,y:u,column:Zt};break;case vW:f.anchor={x:u,y:s-u,row:Zt};break;case xW:f.anchor={x:o-u,y:s-u,column:Zt,row:Zt};break}return f}function WW(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),GW(e,n,n.items[0].items[0]),o=HW(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===AW&&VW(n.items[0].items[0].items[0].items),r!==fv&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Lr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function HW(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function GW(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&Lc(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case mi:r+=Math.ceil(s.bounds.width())+u;break;case yi:case jo:break;default:o+=s.bounds.height()+u}switch((r||o)&&Lc(e,n,r,o),s.orient){case mi:c+=Au(t,n,s,a,1,1);break;case yi:l+=Au(t,n,s,Zt,0,0)+u,c+=Au(t,n,s,a,1,1);break;case jo:l+=Au(t,n,s,a,0,0),c+=Au(t,n,s,Zt,-1,0,1)+u;break;default:l+=Au(t,n,s,a,0,0)}(l||c)&&Lc(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(Lc(e,n,-l,0),Lc(e,s,-l,0))}}function Au(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:Bb(n);return Math.round(i===sv?f:i===Zt?d-h:.5*(c-h))}function Lc(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function VW(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function YW(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===mi||a===yi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(s!==fp?a===mi?(p=r.y2,h=r.y1):a===yi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===mi&&(p=i,h=0),v=u===sv?p:u===Zt?h:(p+h)/2,d&&d.text){switch(a){case $u:case jo:b=f.bounds.height()+c;break;case mi:y=f.bounds.width()+c;break;case yi:y=-f.bounds.width()-c;break}qt.clear().union(d.bounds),qt.translate(y-(d.x||0),b-(d.y||0)),Su(d,"x",y)|Su(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(qt),d.mark.bounds.clear().union(qt),e.dirty(d)),qt.clear().union(d.bounds)}else qt.clear();switch(qt.union(f.bounds),a){case $u:g=v,m=r.y1-qt.height()-l;break;case mi:g=r.x1-qt.width()-l,m=v;break;case yi:g=r.x2+qt.width()+l,m=v;break;case jo:g=v,m=r.y2+l;break;default:g=o.x,m=o.y}return Su(o,"x",g)|Su(o,"y",m)&&(qt.translate(g,m),e.dirty(o),o.bounds.clear().union(qt),t.bounds.clear().union(qt),e.dirty(o)),o.bounds}function n3(e){O.call(this,null,e)}G(n3,O,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&IW(n,i,e.layout),KW(n,i,e)}),XW(e.mark.group)?t.reflow():t}});function XW(e){return e&&e.mark.role!=="legend-entry"}function KW(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new nt().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case uv:h=OW(f)?a:u,h.union(DW(e,f,r,o));break;case lv:c=f;break;case cv:l.push(WW(e,f));break;case _W:case $W:case OF:case NF:case DF:case RF:case PF:case LF:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||yi,d!==fv&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];e3(e,b,qW(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===IF||n.autosize.type===zF||n.autosize.type===BF))switch(y.orient){case mi:case yi:s.add(b.x1,0).add(b.x2,0);break;case $u:case jo:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(YW(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),ZW(e,t,s,n)}function ZW(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=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-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===SW){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===fv?(l=0,f=0,u=s,c=a):o===IF?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===zF?(u=Math.max(0,s-l-d),a=c+f+h):o===BF?(s=u+l+d,c=Math.max(0,a-f-h)):o===kW&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const JW=Object.freeze(Object.defineProperty({__proto__:null,bound:UF,identifier:pv,mark:qF,overlap:WF,render:KF,viewlayout:n3},Symbol.toStringTag,{value:"Module"}));function i3(e){O.call(this,null,e)}G(i3,O,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=db(o,s,e.minstep),u=e.format||XC(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?YC(o,e.values,a):hb(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function r3(e){O.call(this,null,e)}function QW(){return Ce({})}function eH(e){const t=Ga().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(r3,O,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||QW,o=e.key||ie,s=this.value;return L(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&R("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=eH(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function o3(e){O.call(this,null,e)}G(o3,O,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(L(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||go,u=r.enter||go,l=r.exit||go,c=(o&&!s?r[o]:a)||go;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==go&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==go&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==go){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function s3(e){O.call(this,[],e)}G(s3,O,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||Th,s=e.scale,a=+e.limit,u=db(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===Th,c=e.format||QC(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||JC(s,u),d,h,p,g,m;return r&&(i.rem=r),o===Th?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ce(p=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Lt(g=p||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):o===kU?(d=s.domain(),h=WC(s,d[0],ve(d)),f.length<3&&!e.values&&d[0]!==ve(d)&&(f=[d[0],ve(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=IU(s),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const tH=e=>e.source.x,nH=e=>e.source.y,iH=e=>e.target.x,rH=e=>e.target.y;function gv(e){O.call(this,{},e)}gv.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"}]},G(gv,O,{transform(e,t){var n=e.sourceX||tH,i=e.sourceY||nH,r=e.targetX||iH,o=e.targetY||rH,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=c3.get(u+"-"+a)||c3.get(u);return l||R("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const a3=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,oH=(e,t,n,i)=>a3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),u3=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},sH=(e,t,n,i)=>u3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),l3=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},c3=Ga({line:a3,"line-radial":oH,arc:u3,"arc-radial":sH,curve:l3,"curve-radial":(e,t,n,i)=>l3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a}});function mv(e){O.call(this,null,e)}mv.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"]}]},G(mv,O,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||qa,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/I$(l),h=Mn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const aH=5;function uH(e){const t=e.type;return!e.bins&&(t===pu||t===gc||t===mc)}function f3(e){return ub(e)&&e!==Ki}const lH=li(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function d3(e){O.call(this,null,e),this.modified(!0)}G(d3,O,{transform(e,t){var n=t.dataflow,i=this.value,r=cH(e);(!i||r!==i.type)&&(this.value=i=Se(r)());for(r in e)if(!lH[r]){if(r==="padding"&&f3(i.type))continue;ce(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return mH(i,e,gH(i,e,dH(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function cH(e){var t=e.type,n="",i;return t===Ki?Ki+"-"+pu:(fH(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Ki+"-":i===3?gu+"-":""),(n+t||pu).toLowerCase())}function fH(e){const t=e.type;return ub(t)&&t!==Ls&&t!==Is&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function dH(e,t,n){const i=hH(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&uH(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return f3(o)&&t.padding&&r[0]!==ve(r)&&(r=pH(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(h3(o,r,n)),o===ib&&e.unknown(t.domainImplicit?My:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&db(e,t.nice)||null),r.length}function hH(e,t,n){return t?(e.domain(h3(e.type,t,n)),t.length):-1}function pH(e,t,n,i,r,o){var s=Math.abs(ve(n)-n[0]),a=s/(s-2*i),u=e===Rr?R0(t,null,a):e===mc?Ed(t,null,a,.5):e===gc?Ed(t,null,a,r||1):e===Ah?P0(t,null,a,o||1):D0(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function h3(e,t,n){if(zC(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function gH(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),o=r[0],s=ve(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||R("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Mn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===ob&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function mH(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=yH(i,t,n);else if(t.scheme&&(o=bH(i,t,n),ce(o))){if(e.interpolator)return e.interpolator(o);R(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&BC(i))return e.interpolator(Fh(yv(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(cb(t.interpolate,t.interpolateGamma)):ce(e.round)?e.round(r):ce(e.rangeRound)&&e.interpolate(r?hc:To),o&&e.range(yv(o,t.reverse))}function yH(e,t,n){e!==NC&&e!==rb&&R("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===rb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*nb(n,r,i)]}function bH(e,t,n){var i=t.schemeExtent,r,o;return L(t.scheme)?o=Fh(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=fb(r),o||R(`Unrecognized scheme name: ${t.scheme}`)),n=e===Ch?n+1:e===ob?n-1:e===mu||e===kh?+t.schemeCount||aH:n,BC(e)?p3(o,i,t.reverse):ce(o)?qC(p3(o,i),n):e===ib?o:o.slice(0,n)}function p3(e,t,n){return ce(e)&&(t||n)?jC(e,yv(t||[0,1],n)):e}function yv(e,t){return t?e.slice().reverse():e}function g3(e){O.call(this,null,e)}G(g3,O,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ks(e.sort)),this.modified(n),t}});const m3="zero",y3="center",b3="normalize",v3=["y0","y1"];function bv(e){O.call(this,null,e)}bv.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:m3,values:[m3,y3,b3]},{name:"as",type:"string",array:!0,length:2,default:v3}]},G(bv,O,{transform(e,t){var n=e.as||v3,i=n[0],r=n[1],o=ks(e.sort),s=e.field||qa,a=e.offset===y3?vH:e.offset===b3?xH:wH,u,l,c,f;for(u=EH(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function vH(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function xH(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function wH(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function EH(e,t,n,i){var r=[],o=g=>g(c),s,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const _H=Object.freeze(Object.defineProperty({__proto__:null,axisticks:i3,datajoin:r3,encode:o3,legendentries:s3,linkpath:gv,pie:mv,scale:d3,sortitems:g3,stack:bv},Symbol.toStringTag,{value:"Module"}));var se=1e-6,mp=1e-12,ge=Math.PI,Xe=ge/2,yp=ge/4,Jt=ge*2,Je=180/ge,pe=ge/180,xe=Math.abs,ku=Math.atan,Zn=Math.atan2,ae=Math.cos,bp=Math.ceil,x3=Math.exp,vv=Math.hypot,vp=Math.log,xv=Math.pow,re=Math.sin,Jn=Math.sign||function(e){return e>0?1:e<0?-1:0},Qt=Math.sqrt,wv=Math.tan;function w3(e){return e>1?0:e<-1?ge:Math.acos(e)}function bn(e){return e>1?Xe:e<-1?-Xe:Math.asin(e)}function $t(){}function xp(e,t){e&&_3.hasOwnProperty(e.type)&&_3[e.type](e,t)}var E3={Feature:function(e,t){xp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)xp(n[i].geometry,t)}},_3={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ev(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Ev(n[i],t,0)},Polygon:function(e,t){$3(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)$3(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)xp(n[i],t)}};function Ev(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function $3(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Ev(e[n],t,1);t.polygonEnd()}function zr(e,t){e&&E3.hasOwnProperty(e.type)?E3[e.type](e,t):xp(e,t)}var wp=new Xt,Ep=new Xt,S3,A3,_v,$v,Sv,er={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){wp=new Xt,er.lineStart=$H,er.lineEnd=SH},polygonEnd:function(){var e=+wp;Ep.add(e<0?Jt+e:e),this.lineStart=this.lineEnd=this.point=$t},sphere:function(){Ep.add(Jt)}};function $H(){er.point=AH}function SH(){k3(S3,A3)}function AH(e,t){er.point=k3,S3=e,A3=t,e*=pe,t*=pe,_v=e,$v=ae(t=t/2+yp),Sv=re(t)}function k3(e,t){e*=pe,t*=pe,t=t/2+yp;var n=e-_v,i=n>=0?1:-1,r=i*n,o=ae(t),s=re(t),a=Sv*s,u=$v*o+a*ae(r),l=a*i*re(r);wp.add(Zn(l,u)),_v=e,$v=o,Sv=s}function kH(e){return Ep=new Xt,zr(e,er),Ep*2}function _p(e){return[Zn(e[1],e[0]),bn(e[2])]}function Gs(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*re(t),re(n)]}function $p(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cu(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 Av(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Sp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ap(e){var t=Qt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,vn,Ke,Dn,Vs,C3,M3,Mu,Ic,Ho,Br,Ur={point:kv,lineStart:T3,lineEnd:O3,polygonStart:function(){Ur.point=N3,Ur.lineStart=CH,Ur.lineEnd=MH,Ic=new Xt,er.polygonStart()},polygonEnd:function(){er.polygonEnd(),Ur.point=kv,Ur.lineStart=T3,Ur.lineEnd=O3,wp<0?(He=-(Ke=180),vn=-(Dn=90)):Ic>se?Dn=90:Ic<-se&&(vn=-90),Br[0]=He,Br[1]=Ke},sphere:function(){He=-(Ke=180),vn=-(Dn=90)}};function kv(e,t){Ho.push(Br=[He=e,Ke=e]),t<vn&&(vn=t),t>Dn&&(Dn=t)}function F3(e,t){var n=Gs([e*pe,t*pe]);if(Mu){var i=Cu(Mu,n),r=[i[1],-i[0],0],o=Cu(r,i);Ap(o),o=_p(o);var s=e-Vs,a=s>0?1:-1,u=o[0]*Je*a,l,c=xe(s)>180;c^(a*Vs<u&&u<a*e)?(l=o[1]*Je,l>Dn&&(Dn=l)):(u=(u+360)%360-180,c^(a*Vs<u&&u<a*e)?(l=-o[1]*Je,l<vn&&(vn=l)):(t<vn&&(vn=t),t>Dn&&(Dn=t))),c?e<Vs?Rn(He,e)>Rn(He,Ke)&&(Ke=e):Rn(e,Ke)>Rn(He,Ke)&&(He=e):Ke>=He?(e<He&&(He=e),e>Ke&&(Ke=e)):e>Vs?Rn(He,e)>Rn(He,Ke)&&(Ke=e):Rn(e,Ke)>Rn(He,Ke)&&(He=e)}else Ho.push(Br=[He=e,Ke=e]);t<vn&&(vn=t),t>Dn&&(Dn=t),Mu=n,Vs=e}function T3(){Ur.point=F3}function O3(){Br[0]=He,Br[1]=Ke,Ur.point=kv,Mu=null}function N3(e,t){if(Mu){var n=e-Vs;Ic.add(xe(n)>180?n+(n>0?360:-360):n)}else C3=e,M3=t;er.point(e,t),F3(e,t)}function CH(){er.lineStart()}function MH(){N3(C3,M3),er.lineEnd(),xe(Ic)>se&&(He=-(Ke=180)),Br[0]=He,Br[1]=Ke,Mu=null}function Rn(e,t){return(t-=e)<0?t+360:t}function FH(e,t){return e[0]-t[0]}function D3(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function TH(e){var t,n,i,r,o,s,a;if(Dn=Ke=-(He=vn=1/0),Ho=[],zr(e,Ur),n=Ho.length){for(Ho.sort(FH),t=1,i=Ho[0],o=[i];t<n;++t)r=Ho[t],D3(i,r[0])||D3(i,r[1])?(Rn(i[0],r[1])>Rn(i[0],i[1])&&(i[1]=r[1]),Rn(r[0],i[1])>Rn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Rn(i[1],r[0]))>s&&(s=a,He=r[0],Ke=i[1])}return Ho=Br=null,He===1/0||vn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,vn],[Ke,Dn]]}var zc,kp,Cp,Mp,Fp,Tp,Op,Np,Cv,Mv,Fv,R3,P3,en,tn,nn,bi={sphere:$t,point:Tv,lineStart:L3,lineEnd:I3,polygonStart:function(){bi.lineStart=DH,bi.lineEnd=RH},polygonEnd:function(){bi.lineStart=L3,bi.lineEnd=I3}};function Tv(e,t){e*=pe,t*=pe;var n=ae(t);Bc(n*ae(e),n*re(e),re(t))}function Bc(e,t,n){++zc,Cp+=(e-Cp)/zc,Mp+=(t-Mp)/zc,Fp+=(n-Fp)/zc}function L3(){bi.point=OH}function OH(e,t){e*=pe,t*=pe;var n=ae(t);en=n*ae(e),tn=n*re(e),nn=re(t),bi.point=NH,Bc(en,tn,nn)}function NH(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*re(e),o=re(t),s=Zn(Qt((s=tn*o-nn*r)*s+(s=nn*i-en*o)*s+(s=en*r-tn*i)*s),en*i+tn*r+nn*o);kp+=s,Tp+=s*(en+(en=i)),Op+=s*(tn+(tn=r)),Np+=s*(nn+(nn=o)),Bc(en,tn,nn)}function I3(){bi.point=Tv}function DH(){bi.point=PH}function RH(){z3(R3,P3),bi.point=Tv}function PH(e,t){R3=e,P3=t,e*=pe,t*=pe,bi.point=z3;var n=ae(t);en=n*ae(e),tn=n*re(e),nn=re(t),Bc(en,tn,nn)}function z3(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*re(e),o=re(t),s=tn*o-nn*r,a=nn*i-en*o,u=en*r-tn*i,l=vv(s,a,u),c=bn(l),f=l&&-c/l;Cv.add(f*s),Mv.add(f*a),Fv.add(f*u),kp+=c,Tp+=c*(en+(en=i)),Op+=c*(tn+(tn=r)),Np+=c*(nn+(nn=o)),Bc(en,tn,nn)}function LH(e){zc=kp=Cp=Mp=Fp=Tp=Op=Np=0,Cv=new Xt,Mv=new Xt,Fv=new Xt,zr(e,bi);var t=+Cv,n=+Mv,i=+Fv,r=vv(t,n,i);return r<mp&&(t=Tp,n=Op,i=Np,kp<se&&(t=Cp,n=Mp,i=Fp),r=vv(t,n,i),r<mp)?[NaN,NaN]:[Zn(n,t)*Je,bn(i/r)*Je]}function Ov(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function Nv(e,t){return xe(e)>ge&&(e-=Math.round(e/Jt)*Jt),[e,t]}Nv.invert=Nv;function B3(e,t,n){return(e%=Jt)?t||n?Ov(j3(e),q3(t,n)):j3(e):t||n?q3(t,n):Nv}function U3(e){return function(t,n){return t+=e,xe(t)>ge&&(t-=Math.round(t/Jt)*Jt),[t,n]}}function j3(e){var t=U3(e);return t.invert=U3(-e),t}function q3(e,t){var n=ae(e),i=re(e),r=ae(t),o=re(t);function s(a,u){var l=ae(u),c=ae(a)*l,f=re(a)*l,d=re(u),h=d*n+c*i;return[Zn(f*r-h*o,c*n-d*i),bn(h*r+f*o)]}return s.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=re(a)*l,d=re(u),h=d*r-f*o;return[Zn(f*r+d*o,c*n+h*i),bn(h*n-c*i)]},s}function IH(e){e=B3(e[0]*pe,e[1]*pe,e.length>2?e[2]*pe:0);function t(n){return n=e(n[0]*pe,n[1]*pe),n[0]*=Je,n[1]*=Je,n}return t.invert=function(n){return n=e.invert(n[0]*pe,n[1]*pe),n[0]*=Je,n[1]*=Je,n},t}function zH(e,t,n,i,r,o){if(n){var s=ae(t),a=re(t),u=i*n;r==null?(r=t+i*Jt,o=t-u/2):(r=W3(s,r),o=W3(s,o),(i>0?r<o:r>o)&&(r+=i*Jt));for(var l,c=r;i>0?c>o:c<o;c-=u)l=_p([s,-a*ae(c),-a*re(c)]),e.point(l[0],l[1])}}function W3(e,t){t=Gs(t),t[0]-=e,Ap(t);var n=w3(-t[1]);return((-t[2]<0?-n:n)+Jt-se)%Jt}function H3(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:$t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Dp(e,t){return xe(e[0]-t[0])<se&&xe(e[1]-t[1])<se}function Rp(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function G3(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Dp(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*se}o.push(b=new Rp(m,p,null,!0)),s.push(b.o=new Rp(m,null,b,!1)),o.push(b=new Rp(y,p,null,!1)),s.push(b.o=new Rp(y,null,b,!0))}}),!!o.length){for(s.sort(t),V3(o),V3(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function V3(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Dv(e){return xe(e[0])<=ge?e[0]:Jn(e[0])*((xe(e[0])+ge)%Jt-ge)}function BH(e,t){var n=Dv(t),i=t[1],r=re(i),o=[re(n),-ae(n),0],s=0,a=0,u=new Xt;r===1?i=Xe+se:r===-1&&(i=-Xe-se);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Dv(h),g=h[1]/2+yp,m=re(g),y=ae(g),b=0;b<d;++b,p=x,m=_,y=E,h=v){var v=f[b],x=Dv(v),w=v[1]/2+yp,_=re(w),E=ae(w),$=x-p,S=$>=0?1:-1,M=S*$,k=M>ge,N=m*_;if(u.add(Zn(N*S*re(M),y*E+N*ae(M))),s+=k?$+S*Jt:$,k^p>=n^x>=n){var A=Cu(Gs(h),Gs(v));Ap(A);var F=Cu(o,A);Ap(F);var C=(k^$>=0?-1:1)*bn(F[2]);(i>C||i===C&&(A[0]||A[1]))&&(a+=k^$>=0?1:-1)}}return(s<-se||s<se&&u<-mp)^a&1}function Y3(e,t,n,i){return function(r){var o=t(r),s=H3(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=L$(c);var x=BH(l,i);c.length?(u||(r.polygonStart(),u=!0),G3(c,jH,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,w){e(x,w)&&r.point(x,w)}function p(x,w){o.point(x,w)}function g(){d.point=p,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(x,w){f.push([x,w]),a.point(x,w)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),w=s.result(),_,E=w.length,$,S,M;if(f.pop(),l.push(f),f=null,!!E){if(x&1){if(S=w[0],($=S.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),_=0;_<$;++_)r.point((M=S[_])[0],M[1]);r.lineEnd()}return}E>1&&x&2&&w.push(w.pop().concat(w.shift())),c.push(w.filter(UH))}}return d}}function UH(e){return e.length>1}function jH(e,t){return((e=e.x)[0]<0?e[1]-Xe-se:Xe-e[1])-((t=t.x)[0]<0?t[1]-Xe-se:Xe-t[1])}const X3=Y3(function(){return!0},qH,HH,[-ge,-Xe]);function qH(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?ge:-ge,u=xe(o-t);xe(u-ge)<se?(e.point(t,n=(n+s)/2>0?Xe:-Xe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=ge&&(xe(t-i)<se&&(t-=i*se),xe(o-a)<se&&(o-=a*se),n=WH(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function WH(e,t,n,i){var r,o,s=re(e-n);return xe(s)>se?ku((re(t)*(o=ae(i))*re(n)-re(i)*(r=ae(t))*re(e))/(r*o*s)):(t+i)/2}function HH(e,t,n,i){var r;if(e==null)r=n*Xe,i.point(-ge,r),i.point(0,r),i.point(ge,r),i.point(ge,0),i.point(ge,-r),i.point(0,-r),i.point(-ge,-r),i.point(-ge,0),i.point(-ge,r);else if(xe(e[0]-t[0])>se){var o=e[0]<t[0]?ge:-ge;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function GH(e){var t=ae(e),n=2*pe,i=t>0,r=xe(t)>se;function o(c,f,d,h){zH(h,e,n,d,c,f)}function s(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=s(m,y),w=i?x?0:l(m,y):x?l(m+(m<0?ge:-ge),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||Dp(f,v)||Dp(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var _;!(w&d)&&(_=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(_[0][0],_[0][1]),c.point(_[1][0],_[1][1]),c.lineEnd()):(c.point(_[1][0],_[1][1]),c.lineEnd(),c.lineStart(),c.point(_[0][0],_[0][1],3)))}x&&(!f||!Dp(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=w},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Gs(c),p=Gs(f),g=[1,0,0],m=Cu(h,p),y=$p(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,w=-t*b/v,_=Cu(g,m),E=Sp(g,x),$=Sp(m,w);Av(E,$);var S=_,M=$p(E,S),k=$p(S,S),N=M*M-k*($p(E,E)-1);if(!(N<0)){var A=Qt(N),F=Sp(S,(-M-A)/k);if(Av(F,E),F=_p(F),!d)return F;var C=c[0],T=f[0],P=c[1],I=f[1],z;T<C&&(z=C,C=T,T=z);var te=T-C,ne=xe(te-ge)<se,de=ne||te<se;if(!ne&&I<P&&(z=P,P=I,I=z),de?ne?P+I>0^F[1]<(xe(F[0]-C)<se?P:I):P<=F[1]&&F[1]<=I:te>ge^(C<=F[0]&&F[0]<=T)){var ke=Sp(S,(-M+A)/k);return Av(ke,E),[F,_p(ke)]}}}function l(c,f){var d=i?e:ge-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return Y3(s,a,o,i?[0,-e]:[-ge,e-ge])}function VH(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var Uc=1e9,Pp=-Uc;function K3(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,p=0;if(l==null||(h=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function s(l,c){return xe(l[0]-e)<se?c>0?0:3:xe(l[0]-n)<se?c>0?2:1:xe(l[1]-t)<se?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=H3(),d,h,p,g,m,y,b,v,x,w,_,E={point:$,lineStart:N,lineEnd:A,polygonStart:M,polygonEnd:k};function $(C,T){r(C,T)&&c.point(C,T)}function S(){for(var C=0,T=0,P=h.length;T<P;++T)for(var I=h[T],z=1,te=I.length,ne=I[0],de,ke,Ee=ne[0],Ie=ne[1];z<te;++z)de=Ee,ke=Ie,ne=I[z],Ee=ne[0],Ie=ne[1],ke<=i?Ie>i&&(Ee-de)*(i-ke)>(Ie-ke)*(e-de)&&++C:Ie<=i&&(Ee-de)*(i-ke)<(Ie-ke)*(e-de)&&--C;return C}function M(){c=f,d=[],h=[],_=!0}function k(){var C=S(),T=_&&C,P=(d=L$(d)).length;(T||P)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&G3(d,a,C,o,l),l.polygonEnd()),c=l,d=h=p=null}function N(){E.point=F,h&&h.push(p=[]),w=!0,x=!1,b=v=NaN}function A(){d&&(F(g,m),y&&x&&f.rejoin(),d.push(f.result())),E.point=$,x&&c.lineEnd()}function F(C,T){var P=r(C,T);if(h&&p.push([C,T]),w)g=C,m=T,y=P,w=!1,P&&(c.lineStart(),c.point(C,T));else if(P&&x)c.point(C,T);else{var I=[b=Math.max(Pp,Math.min(Uc,b)),v=Math.max(Pp,Math.min(Uc,v))],z=[C=Math.max(Pp,Math.min(Uc,C)),T=Math.max(Pp,Math.min(Uc,T))];VH(I,z,e,t,n,i)?(x||(c.lineStart(),c.point(I[0],I[1])),c.point(z[0],z[1]),P||c.lineEnd(),_=!1):P&&(c.lineStart(),c.point(C,T),_=!1)}b=C,v=T,x=P}return E}}function Z3(e,t,n){var i=Mn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function J3(e,t,n){var i=Mn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function YH(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Mn(bp(i/c)*c,n,c).map(p).concat(Mn(bp(a/f)*f,s,f).map(g)).concat(Mn(bp(t/u)*u,e,u).filter(function(v){return xe(v%c)>se}).map(d)).concat(Mn(bp(o/l)*l,r,l).filter(function(v){return xe(v%f)>se}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],s=+v[1][1],i>n&&(v=i,i=n,n=v),a>s&&(v=a,a=s,s=v),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),o>r&&(v=o,o=r,r=v),y.precision(m)):[[t,o],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=Z3(o,r,90),h=J3(t,e,m),p=Z3(a,s,90),g=J3(i,n,m),y):m},y.extentMajor([[-180,-90+se],[180,90-se]]).extentMinor([[-180,-80-se],[180,80+se]])}const jc=e=>e;var Rv=new Xt,Pv=new Xt,Q3,eT,Lv,Iv,jr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){jr.lineStart=XH,jr.lineEnd=ZH},polygonEnd:function(){jr.lineStart=jr.lineEnd=jr.point=$t,Rv.add(xe(Pv)),Pv=new Xt},result:function(){var e=Rv/2;return Rv=new Xt,e}};function XH(){jr.point=KH}function KH(e,t){jr.point=tT,Q3=Lv=e,eT=Iv=t}function tT(e,t){Pv.add(Iv*e-Lv*t),Lv=e,Iv=t}function ZH(){tT(Q3,eT)}var Fu=1/0,Lp=Fu,qc=-Fu,Ip=qc,zp={point:JH,lineStart:$t,lineEnd:$t,polygonStart:$t,polygonEnd:$t,result:function(){var e=[[Fu,Lp],[qc,Ip]];return qc=Ip=-(Lp=Fu=1/0),e}};function JH(e,t){e<Fu&&(Fu=e),e>qc&&(qc=e),t<Lp&&(Lp=t),t>Ip&&(Ip=t)}var zv=0,Bv=0,Wc=0,Bp=0,Up=0,Tu=0,Uv=0,jv=0,Hc=0,nT,iT,tr,nr,Qn={point:Ys,lineStart:rT,lineEnd:oT,polygonStart:function(){Qn.lineStart=tG,Qn.lineEnd=nG},polygonEnd:function(){Qn.point=Ys,Qn.lineStart=rT,Qn.lineEnd=oT},result:function(){var e=Hc?[Uv/Hc,jv/Hc]:Tu?[Bp/Tu,Up/Tu]:Wc?[zv/Wc,Bv/Wc]:[NaN,NaN];return zv=Bv=Wc=Bp=Up=Tu=Uv=jv=Hc=0,e}};function Ys(e,t){zv+=e,Bv+=t,++Wc}function rT(){Qn.point=QH}function QH(e,t){Qn.point=eG,Ys(tr=e,nr=t)}function eG(e,t){var n=e-tr,i=t-nr,r=Qt(n*n+i*i);Bp+=r*(tr+e)/2,Up+=r*(nr+t)/2,Tu+=r,Ys(tr=e,nr=t)}function oT(){Qn.point=Ys}function tG(){Qn.point=iG}function nG(){sT(nT,iT)}function iG(e,t){Qn.point=sT,Ys(nT=tr=e,iT=nr=t)}function sT(e,t){var n=e-tr,i=t-nr,r=Qt(n*n+i*i);Bp+=r*(tr+e)/2,Up+=r*(nr+t)/2,Tu+=r,r=nr*e-tr*t,Uv+=r*(tr+e),jv+=r*(nr+t),Hc+=r*3,Ys(tr=e,nr=t)}function aT(e){this._context=e}aT.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(){this._line===0&&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,Jt);break}}},result:$t};var qv=new Xt,Wv,uT,lT,Gc,Vc,Yc={point:$t,lineStart:function(){Yc.point=rG},lineEnd:function(){Wv&&cT(uT,lT),Yc.point=$t},polygonStart:function(){Wv=!0},polygonEnd:function(){Wv=null},result:function(){var e=+qv;return qv=new Xt,e}};function rG(e,t){Yc.point=cT,uT=Gc=e,lT=Vc=t}function cT(e,t){Gc-=e,Vc-=t,qv.add(Qt(Gc*Gc+Vc*Vc)),Gc=e,Vc=t}let fT,jp,dT,hT;class pT{constructor(t){this._append=t==null?gT:oG(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==dT||this._append!==jp){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,dT=i,jp=this._append,hT=this._,this._=r}this._+=hT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function gT(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function oG(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return gT;if(t!==fT){const n=10**t;fT=t,jp=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return jp}function mT(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),zr(a,r(o))),o.result()}return s.area=function(a){return zr(a,r(jr)),jr.result()},s.measure=function(a){return zr(a,r(Yc)),Yc.result()},s.bounds=function(a){return zr(a,r(zp)),zp.result()},s.centroid=function(a){return zr(a,r(Qn)),Qn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,jc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new pT(n)):new aT(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new pT(n)),s},s.projection(e).digits(n).context(t)}function qp(e){return function(t){var n=new Hv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Hv(){}Hv.prototype={constructor:Hv,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()}};function Gv(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),zr(n,e.stream(zp)),t(zp.result()),i!=null&&e.clipExtent(i),e}function Wp(e,t,n){return Gv(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function Vv(e,t,n){return Wp(e,[[0,0],t],n)}function Yv(e,t,n){return Gv(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function Xv(e,t,n){return Gv(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var yT=16,sG=ae(30*pe);function bT(e,t){return+t?uG(e,t):aG(e)}function aG(e){return qp({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function uG(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=s+d,w=a+h,_=u+p,E=Qt(x*x+w*w+_*_),$=bn(_/=E),S=xe(xe(_)-1)<se||xe(o-f)<se?(o+f)/2:Zn(w,x),M=e(S,$),k=M[0],N=M[1],A=k-i,F=N-r,C=b*A-y*F;(C*C/v>t||xe((y*A+b*F)/v-.5)>.3||s*d+a*h+u*p<sG)&&(n(i,r,o,s,a,u,k,N,S,x/=E,w/=E,_,g,m),m.point(k,N),n(k,N,S,x,w,_,l,c,f,d,h,p,g,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=w},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y($,S){$=e($,S),i.point($[0],$[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v($,S){var M=Gs([$,S]),k=e($,S);n(f,d,c,h,p,g,f=k[0],d=k[1],c=$,h=M[0],p=M[1],g=M[2],yT,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function w(){b(),m.point=_,m.lineEnd=E}function _($,S){v(r=$,S),o=f,s=d,a=h,u=p,l=g,m.point=v}function E(){n(f,d,c,h,p,g,o,s,r,a,u,l,yT,i),m.lineEnd=x,x()}return m}}var lG=qp({point:function(e,t){this.stream.point(e*pe,t*pe)}});function cG(e){return qp({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function fG(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function vT(e,t,n,i,r,o){if(!o)return fG(e,t,n,i,r);var s=ae(o),a=re(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function ir(e){return xT(function(){return e})()}function xT(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=X3,m=null,y,b,v,x=jc,w=.5,_,E,$,S,M;function k(C){return $(C[0]*pe,C[1]*pe)}function N(C){return C=$.invert(C[0],C[1]),C&&[C[0]*Je,C[1]*Je]}k.stream=function(C){return S&&M===C?S:S=lG(cG(c)(g(_(x(M=C)))))},k.preclip=function(C){return arguments.length?(g=C,p=void 0,F()):g},k.postclip=function(C){return arguments.length?(x=C,m=y=b=v=null,F()):x},k.clipAngle=function(C){return arguments.length?(g=+C?GH(p=C*pe):(p=null,X3),F()):p*Je},k.clipExtent=function(C){return arguments.length?(x=C==null?(m=y=b=v=null,jc):K3(m=+C[0][0],y=+C[0][1],b=+C[1][0],v=+C[1][1]),F()):m==null?null:[[m,y],[b,v]]},k.scale=function(C){return arguments.length?(n=+C,A()):n},k.translate=function(C){return arguments.length?(i=+C[0],r=+C[1],A()):[i,r]},k.center=function(C){return arguments.length?(o=C[0]%360*pe,s=C[1]%360*pe,A()):[o*Je,s*Je]},k.rotate=function(C){return arguments.length?(a=C[0]%360*pe,u=C[1]%360*pe,l=C.length>2?C[2]%360*pe:0,A()):[a*Je,u*Je,l*Je]},k.angle=function(C){return arguments.length?(f=C%360*pe,A()):f*Je},k.reflectX=function(C){return arguments.length?(d=C?-1:1,A()):d<0},k.reflectY=function(C){return arguments.length?(h=C?-1:1,A()):h<0},k.precision=function(C){return arguments.length?(_=bT(E,w=C*C),F()):Qt(w)},k.fitExtent=function(C,T){return Wp(k,C,T)},k.fitSize=function(C,T){return Vv(k,C,T)},k.fitWidth=function(C,T){return Yv(k,C,T)},k.fitHeight=function(C,T){return Xv(k,C,T)};function A(){var C=vT(n,0,0,d,h,f).apply(null,t(o,s)),T=vT(n,i-C[0],r-C[1],d,h,f);return c=B3(a,u,l),E=Ov(t,T),$=Ov(c,E),_=bT(E,w),F()}function F(){return S=M=null,k}return function(){return t=e.apply(this,arguments),k.invert=t.invert&&N,A()}}function Kv(e){var t=0,n=ge/3,i=xT(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*pe,n=o[1]*pe):[t*Je,n*Je]},r}function dG(e){var t=ae(e);function n(i,r){return[i*t,re(r)/t]}return n.invert=function(i,r){return[i/t,bn(r*t)]},n}function hG(e,t){var n=re(e),i=(n+re(t))/2;if(xe(i)<se)return dG(e);var r=1+n*(2*i-n),o=Qt(r)/i;function s(a,u){var l=Qt(r-2*i*re(u))/i;return[l*re(a*=i),o-l*ae(a)]}return s.invert=function(a,u){var l=o-u,c=Zn(a,xe(l))*Jn(l);return l*i<0&&(c-=ge*Jn(a)*Jn(l)),[c/i,bn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Hp(){return Kv(hG).scale(155.424).center([0,33.6442])}function wT(){return Hp().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function pG(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function gG(){var e,t,n=wT(),i,r=Hp().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Hp().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(o.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=pG([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),o=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+se,g+.12*h+se],[p-.214*h-se,g+.234*h-se]]).stream(l),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+se,g+.166*h+se],[p-.115*h-se,g+.234*h-se]]).stream(l),f()},c.fitExtent=function(d,h){return Wp(c,d,h)},c.fitSize=function(d,h){return Vv(c,d,h)},c.fitWidth=function(d,h){return Yv(c,d,h)},c.fitHeight=function(d,h){return Xv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function ET(e){return function(t,n){var i=ae(t),r=ae(n),o=e(i*r);return o===1/0?[2,0]:[o*r*re(t),o*re(n)]}}function Xc(e){return function(t,n){var i=Qt(t*t+n*n),r=e(i),o=re(r),s=ae(r);return[Zn(t*o,i*s),bn(i&&n*o/i)]}}var _T=ET(function(e){return Qt(2/(1+e))});_T.invert=Xc(function(e){return 2*bn(e/2)});function mG(){return ir(_T).scale(124.75).clipAngle(180-.001)}var $T=ET(function(e){return(e=w3(e))&&e/re(e)});$T.invert=Xc(function(e){return e});function yG(){return ir($T).scale(79.4188).clipAngle(180-.001)}function Gp(e,t){return[e,vp(wv((Xe+t)/2))]}Gp.invert=function(e,t){return[e,2*ku(x3(t))-Xe]};function bG(){return ST(Gp).scale(961/Jt)}function ST(e){var t=ir(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=ge*i(),d=t(IH(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Gp?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function Vp(e){return wv((Xe+e)/2)}function vG(e,t){var n=ae(e),i=e===t?re(e):vp(n/ae(t))/vp(Vp(t)/Vp(e)),r=n*xv(Vp(e),i)/i;if(!i)return Gp;function o(s,a){r>0?a<-Xe+se&&(a=-Xe+se):a>Xe-se&&(a=Xe-se);var u=r/xv(Vp(a),i);return[u*re(i*s),r-u*ae(i*s)]}return o.invert=function(s,a){var u=r-a,l=Jn(i)*Qt(s*s+u*u),c=Zn(s,xe(u))*Jn(u);return u*i<0&&(c-=ge*Jn(s)*Jn(u)),[c/i,2*ku(xv(r/l,1/i))-Xe]},o}function xG(){return Kv(vG).scale(109.5).parallels([30,30])}function Yp(e,t){return[e,t]}Yp.invert=Yp;function wG(){return ir(Yp).scale(152.63)}function EG(e,t){var n=ae(e),i=e===t?re(e):(n-ae(t))/(t-e),r=n/i+e;if(xe(i)<se)return Yp;function o(s,a){var u=r-a,l=i*s;return[u*re(l),r-u*ae(l)]}return o.invert=function(s,a){var u=r-a,l=Zn(s,xe(u))*Jn(u);return u*i<0&&(l-=ge*Jn(s)*Jn(u)),[l/i,r-Jn(i)*Qt(s*s+u*u)]},o}function _G(){return Kv(EG).scale(131.154).center([0,13.9389])}var Kc=1.340264,Zc=-.081106,Jc=893e-6,Qc=.003796,Xp=Qt(3)/2,$G=12;function AT(e,t){var n=bn(Xp*re(t)),i=n*n,r=i*i*i;return[e*ae(n)/(Xp*(Kc+3*Zc*i+r*(7*Jc+9*Qc*i))),n*(Kc+Zc*i+r*(Jc+Qc*i))]}AT.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<$G&&(a=n*(Kc+Zc*i+r*(Jc+Qc*i))-t,u=Kc+3*Zc*i+r*(7*Jc+9*Qc*i),n-=s=a/u,i=n*n,r=i*i*i,!(xe(s)<mp));++o);return[Xp*e*(Kc+3*Zc*i+r*(7*Jc+9*Qc*i))/ae(n),bn(re(n)/Xp)]};function SG(){return ir(AT).scale(177.158)}function kT(e,t){var n=ae(t),i=ae(e)*n;return[n*re(e)/i,re(t)/i]}kT.invert=Xc(ku);function AG(){return ir(kT).scale(144.049).clipAngle(60)}function kG(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,p=qp({point:function(x,w){var _=v([x,w]);this.stream.point(_[0],_[1])}}),g=jc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var w=x[0]*d,_=x[1]*h;if(o){var E=_*s-w*a;w=w*s+_*a,_=E}return[w+t,_+n]}return v.invert=function(x){var w=x[0]-t,_=x[1]-n;if(o){var E=_*s+w*a;w=w*s-_*a,_=E}return[w/d,_/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,jc):K3(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*pe,a=re(o),s=ae(o),b()):o*Je},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,w){return Wp(v,x,w)},v.fitSize=function(x,w){return Vv(v,x,w)},v.fitWidth=function(x,w){return Yv(v,x,w)},v.fitHeight=function(x,w){return Xv(v,x,w)},v}function CT(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}CT.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(xe(r)>se&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function CG(){return ir(CT).scale(175.295)}function MT(e,t){return[ae(t)*re(e),re(t)]}MT.invert=Xc(bn);function MG(){return ir(MT).scale(249.5).clipAngle(90+se)}function FT(e,t){var n=ae(t),i=1+ae(e)*n;return[n*re(e)/i,re(t)/i]}FT.invert=Xc(function(e){return 2*ku(e)});function FG(){return ir(FT).scale(250).clipAngle(142)}function TT(e,t){return[vp(wv((Xe+t)/2)),-e]}TT.invert=function(e,t){return[-t,2*ku(x3(e))-Xe]};function TG(){var e=ST(TT),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var OG=Math.abs,Zv=Math.cos,Kp=Math.sin,NG=1e-6,OT=Math.PI,Jv=OT/2,NT=DG(2);function DT(e){return e>1?Jv:e<-1?-Jv:Math.asin(e)}function DG(e){return e>0?Math.sqrt(e):0}function RG(e,t){var n=e*Kp(t),i=30,r;do t-=r=(t+Kp(t)-n)/(1+Zv(t));while(OG(r)>NG&&--i>0);return t/2}function PG(e,t,n){function i(r,o){return[e*r*Zv(o=RG(n,o)),t*Kp(o)]}return i.invert=function(r,o){return o=DT(o/t),[r/(e*Zv(o)),DT((2*o+Kp(2*o))/n)]},i}var LG=PG(NT/Jv,NT,OT);function IG(){return ir(LG).scale(169.529)}const zG=mT(),Qv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function BG(e,t){return function n(){const i=t();return i.type=e,i.path=mT().projection(i),i.copy=i.copy||function(){const r=n();return Qv.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},LC(i)}}function ex(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Zp[e]=BG(e,t),this):Zp[e]||null}function RT(e){return e&&e.path||zG}const Zp={albers:wT,albersusa:gG,azimuthalequalarea:mG,azimuthalequidistant:yG,conicconformal:xG,conicequalarea:Hp,conicequidistant:_G,equalEarth:SG,equirectangular:wG,gnomonic:AG,identity:kG,mercator:bG,mollweide:IG,naturalEarth1:CG,orthographic:MG,stereographic:FG,transversemercator:TG};for(const e in Zp)ex(e,Zp[e]);function UG(){}const qr=[[],[[[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 PT(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),jG(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(qG((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,qr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,qr[g|m<<1].forEach(v);for(qr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,qr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,qr[g|m<<1|y<<2|b<<3].forEach(v);qr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,qr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,qr[y<<2|b<<3].forEach(v);qr[y<<3].forEach(v);function v(x){var w=[x[0][0]+h,x[0][1]+p],_=[x[1][0]+h,x[1][1]+p],E=s(w),$=s(_),S,M;(S=d[E])?(M=f[$])?(delete d[S.end],delete f[M.start],S===M?(S.ring.push(_),c(S.ring)):f[S.start]=d[M.end]={start:S.start,end:M.end,ring:S.ring.concat(M.ring)}):(delete d[S.end],S.ring.push(_),d[S.end=$]=S):(S=f[$])?(M=d[E])?(delete f[S.start],delete d[M.end],S===M?(S.ring.push(_),c(S.ring)):f[M.start]=d[S.end]={start:M.start,end:S.end,ring:M.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(w),f[S.start=E]=S):f[E]=d[$]={start:E,end:$,ring:[w,_]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||R("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:UG,i):n===a},i}function jG(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function qG(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=WG(e,t[n]))return r;return 0}function WG(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(HG(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function HG(e,t,n){var i;return GG(e,t,n)&&VG(e[i=+(e[0]===t[0])],n[i],t[i])}function GG(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function VG(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function LT(e,t,n){return function(i){var r=Bi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?xo(o,s,e):a/(e+1);return Mn(o+u,s,u)}}function tx(e){O.call(this,null,e)}tx.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"}]},G(tx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Rt,o=PT().smooth(e.smooth!==!1),s=e.thresholds||YG(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,L(s)?s:s(c.values));XG(f,c,l,e),f.forEach(d=>{u.push(Wd(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function YG(e,t,n){const i=LT(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Es(t(r).values)))}function XG(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ce(r)&&(r=r(n,i)),ce(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(_e(r)?r:r[0])||1,a=(_e(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(IT(t,s,a,u,l))}function IT(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function zT(e,t,n){const i=e>=0?e:F1(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function nx(e){return ce(e)?e:Lt(+e)}function BT(){var e=u=>u[0],t=u=>u[1],n=qa,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=zT(i[0],u,e)>>s,f=zT(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>s),g=2*h+(o>>s),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const w=d+(+e(x)>>s),_=h+(+t(x)>>s);w>=0&&w<p&&_>=0&&_<g&&(m[w+_*p]+=+n(x))}),c>0&&f>0?(Ou(p,g,m,y,c),Nu(p,g,y,m,f),Ou(p,g,m,y,c),Nu(p,g,y,m,f),Ou(p,g,m,y,c),Nu(p,g,y,m,f)):c>0?(Ou(p,g,m,y,c),Ou(p,g,y,m,c),Ou(p,g,m,y,c),b=y):f>0&&(Nu(p,g,m,y,f),Nu(p,g,y,m,f),Nu(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*s):1/I$(b);for(let x=0,w=p*g;x<w;++x)b[x]*=v;return{values:b,scale:1<<s,width:p,height:g,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=nx(u),a):e},a.y=function(u){return arguments.length?(t=nx(u),a):t},a.weight=function(u){return arguments.length?(n=nx(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||R("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||R("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&R("invalid bandwidth"),i=u,a):i},a}function Ou(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function Nu(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function ix(e){O.call(this,null,e)}ix.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 KG=["x","y","weight","size","cellSize","bandwidth"];function UT(e,t){return KG.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(ix,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=ZG(i,e.groupby),o=(e.groupby||[]).map(Ye),s=UT(BT(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function ZG(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function rx(e){O.call(this,null,e)}rx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},G(rx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=PT().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||LT(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=UT(BT(),e)(r,!0),u=IT(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=L(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const ox="Feature",sx="FeatureCollection",JG="MultiPoint";function ax(e){O.call(this,null,e)}ax.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},G(ax,O,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&Rt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Dt(a))||o&&t.modified(Dt(o))||s&&t.modified(Dt(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:ox,geometry:{type:JG,coordinates:i}})),this.value={type:sx,features:n}}});function ux(e){O.call(this,null,e)}ux.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"}]},G(ux,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Rt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=RT(e.projection),n.materialize().reflow()):s=r===Rt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=QG(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function QG(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function lx(e){O.call(this,null,e)}lx.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"]}]},G(lx,O,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function cx(e){O.call(this,null,e)}cx.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"}]},G(cx,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=eV(RT(e.projection),e.field||qn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function eV(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function fx(e){O.call(this,[],e),this.generator=YH()}fx.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}]},G(fx,O,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ce(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(eA(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function dx(e){O.call(this,null,e)}dx.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"}]},G(dx,O,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Rt,o=nV(e.opacity,e),s=tV(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Es(n.map(l=>Es(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=fe({},l,u);i||(f.$max=Es(c.values||[])),l[a]=iV(c,f,s.dep?s:Lt(s(f)),o.dep?o:Lt(o(f)))}),t.reflow(!0).modifies(a)}});function tV(e,t){let n;return ce(e)?(n=i=>Fo(e(i,t)),n.dep=jT(e)):n=Lt(Fo(e||"#888")),n}function nV(e,t){let n;return ce(e)?(n=i=>e(i,t),n.dep=jT(e)):e?n=Lt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function jT(e){if(!ce(e))return!1;const t=li(Dt(e));return t.$x||t.$y||t.$value||t.$max}function iV(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:po,d=ko(u-s,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-s,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,v=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function qT(e){O.call(this,null,e),this.modified(!0)}G(qT,O,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=oV(e.type),Qv.forEach(i=>{e[i]!=null&&WT(n,i,e[i])})):Qv.forEach(i=>{e.modified(i)&&WT(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&rV(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function rV(e,t){const n=sV(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function oV(e){const t=ex((e||"mercator").toLowerCase());return t||R("Unrecognized projection type: "+e),t()}function WT(e,t,n){ce(e[t])&&e[t](n)}function sV(e){return e=X(e),e.length===1?e[0]:{type:sx,features:e.reduce((t,n)=>t.concat(aV(n)),[])}}function aV(e){return e.type===sx?e.features:X(e).filter(t=>t!=null).map(t=>t.type===ox?t:{type:ox,geometry:t})}const uV=Object.freeze(Object.defineProperty({__proto__:null,contour:rx,geojson:ax,geopath:ux,geopoint:lx,geoshape:cx,graticule:fx,heatmap:dx,isocontour:tx,kde2d:ix,projection:qT},Symbol.toStringTag,{value:"Module"}));function lV(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function cV(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return HT(this.cover(t,n),t,n,e)}function HT(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|g]))return r[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function fV(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)HT(this,s[n],a[n],e[n]);return this}function dV(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function hV(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function pV(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function rn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function gV(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new rn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(s=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new rn(h[3],m,y,u,l),new rn(h[2],s,y,m,l),new rn(h[1],m,a,u,y),new rn(h[0],s,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var w=Math.sqrt(n=x);r=e-w,o=t-w,c=e+w,f=t+w,i=h.data}}return i}function mV(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(s+u)/2))?s=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function yV(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function bV(){return this._root}function vV(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function xV(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new rn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new rn(r,l,c,a,u)),(r=i[2])&&t.push(new rn(r,o,c,l,u)),(r=i[1])&&t.push(new rn(r,l,s,a,c)),(r=i[0])&&t.push(new rn(r,o,s,l,c))}return this}function wV(e){var t=[],n=[],i;for(this._root&&t.push(new rn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new rn(o,s,a,c,f)),(o=r[1])&&t.push(new rn(o,c,a,u,f)),(o=r[2])&&t.push(new rn(o,s,f,c,l)),(o=r[3])&&t.push(new rn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function EV(e){return e[0]}function _V(e){return arguments.length?(this._x=e,this):this._x}function $V(e){return e[1]}function SV(e){return arguments.length?(this._y=e,this):this._y}function hx(e,t,n){var i=new px(t??EV,n??$V,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function px(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function GT(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var on=hx.prototype=px.prototype;on.copy=function(){var e=new px(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=GT(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=GT(i));return e},on.add=cV,on.addAll=fV,on.cover=dV,on.data=hV,on.extent=pV,on.find=gV,on.remove=mV,on.removeAll=yV,on.root=bV,on.size=vV,on.visit=xV,on.visitAfter=wV,on.x=_V,on.y=SV;function sn(e){return function(){return e}}function Go(e){return(e()-.5)*1e-6}function AV(e){return e.x+e.vx}function kV(e){return e.y+e.vy}function CV(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=sn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<o;++y)for(f=hx(t,AV,kV).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,w,_,E){var $=v.data,S=v.r,M=g+S;if($){if($.index>d.index){var k=h-$.x-$.vx,N=p-$.y-$.vy,A=k*k+N*N;A<M*M&&(k===0&&(k=Go(i),A+=k*k),N===0&&(N=Go(i),A+=N*N),A=(M-(A=Math.sqrt(A)))/A*r,d.vx+=(k*=A)*(M=(S*=S)/(m+S)),d.vy+=(N*=A)*M,$.vx-=k*(M=1-M),$.vy-=N*M)}return}return x>h+M||_<h-M||w>p+M||E<p-M}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:sn(+l),u(),s):e},s}function MV(e){return e.index}function VT(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function FV(e){var t=MV,n=f,i,r=sn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,w,_,E,$,S,M;v<b;++v)x=e[v],w=x.source,_=x.target,E=_.x+_.vx-w.x-w.vx||Go(l),$=_.y+_.vy-w.y-w.vy||Go(l),S=Math.sqrt(E*E+$*$),S=(S-o[v])/S*m*i[v],E*=S,$*=S,_.vx-=E*(M=u[v]),_.vy-=$*M,w.vx+=E*(M=1-M),w.vy+=$*M}function h(){if(s){var m,y=s.length,b=e.length,v=new Map(s.map((w,_)=>[t(w,_,s),w])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=VT(v,x.source)),typeof x.target!="object"&&(x.target=VT(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),o=new Array(b),g()}}function p(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:sn(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:sn(+m),g(),d):r},d}var TV={value:()=>{}};function YT(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Jp(n)}function Jp(e){this._=e}function OV(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Jp.prototype=YT.prototype={constructor:Jp,on:function(e,t){var n=this._,i=OV(e+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((r=(e=i[o]).type)&&(r=NV(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(r=(e=i[o]).type)n[r]=XT(n[r],e.name,t);else if(t==null)for(r in n)n[r]=XT(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Jp(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};function NV(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function XT(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=TV,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Du=0,ef=0,tf=0,KT=1e3,Qp,nf,eg=0,Xs=0,tg=0,rf=typeof performance=="object"&&performance.now?performance:Date,ZT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function gx(){return Xs||(ZT(DV),Xs=rf.now()+tg)}function DV(){Xs=0}function ng(){this._call=this._time=this._next=null}ng.prototype=JT.prototype={constructor:ng,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?gx():+n)+(t==null?0:+t),!this._next&&nf!==this&&(nf?nf._next=this:Qp=this,nf=this),this._call=e,this._time=n,mx()},stop:function(){this._call&&(this._call=null,this._time=1/0,mx())}};function JT(e,t,n){var i=new ng;return i.restart(e,t,n),i}function RV(){gx(),++Du;for(var e=Qp,t;e;)(t=Xs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Du}function QT(){Xs=(eg=rf.now())+tg,Du=ef=0;try{RV()}finally{Du=0,LV(),Xs=0}}function PV(){var e=rf.now(),t=e-eg;t>KT&&(tg-=t,eg=e)}function LV(){for(var e,t=Qp,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Qp=n);nf=e,mx(i)}function mx(e){if(!Du){ef&&(ef=clearTimeout(ef));var t=e-Xs;t>24?(e<1/0&&(ef=setTimeout(QT,e-rf.now()-tg)),tf&&(tf=clearInterval(tf))):(tf||(eg=rf.now(),tf=setInterval(PV,KT)),Du=1,ZT(QT))}}function IV(e,t,n){var i=new ng,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?gx():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const zV=1664525,BV=1013904223,eO=4294967296;function UV(){let e=1;return()=>(e=(zV*e+BV)%eO)/eO}function jV(e){return e.x}function qV(e){return e.y}var WV=10,HV=Math.PI*(3-Math.sqrt(5));function GV(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=JT(f),l=YT("tick","end"),c=UV();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(o-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=WV*Math.sqrt(.5+g),v=g*HV;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(o=+g,t):o},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,w,_,E,$;for(y==null?y=1/0:y*=y,b=0;b<v;++b)E=e[b],x=g-E.x,w=m-E.y,_=x*x+w*w,_<y&&($=E,y=_);return $},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function VV(){var e,t,n,i,r=sn(-30),o,s=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=hx(e,jV,qV).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(o=new Array(p),h=0;h<p;++h)g=e[h],o[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=o[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=Go(n),x+=y*y),b===0&&(b=Go(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=Go(n),x+=y*y),b===0&&(b=Go(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)));do h.data!==t&&(v=o[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:sn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function YV(e){var t=sn(.1),n,i,r;typeof e!="function"&&(e=sn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:sn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:sn(+a),s(),o):e},o}function XV(e){var t=sn(.1),n,i,r;typeof e!="function"&&(e=sn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:sn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:sn(+a),s(),o):e},o}const tO={center:lV,collide:CV,nbody:VV,link:FV,x:YV,y:XV},of="forces",yx=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],KV=["static","iterations"],nO=["x","y","vx","vy"];function bx(e){O.call(this,null,e)}bx.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:nO}]},G(bx,O,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(yx),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&iO(n,e,0,t)):(this.value=n=JV(t.source,e),n.on("tick",ZV(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(KV)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==of||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(nO)}});function ZV(e,t){return()=>e.touch(t).run()}function JV(e,t){const n=GV(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),iO(n,t,!0).on("end",()=>o=!0)}function iO(e,t,n,i){var r=X(t.forces),o,s,a,u;for(o=0,s=yx.length;o<s;++o)a=yx[o],a!==of&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=of+o,a=n||t.modified(of,o)?eY(r[o]):i&&QV(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(of+o,null);return e.numForces=r.length,e}function QV(e,t){var n,i;for(n in e)if(ce(i=e[n])&&t.modified(Dt(i)))return 1;return 0}function eY(e){var t,n;Z(tO,e.force)||R("Unrecognized force: "+e.force),t=tO[e.force]();for(n in e)ce(t[n])&&tY(t[n],e[n],e);return t}function tY(e,t,n){e(ce(t)?i=>t(i,n):t)}const nY=Object.freeze(Object.defineProperty({__proto__:null,force:bx},Symbol.toStringTag,{value:"Module"}));function iY(e,t){return e.parent===t.parent?1:2}function rY(e){return e.reduce(oY,0)/e.length}function oY(e,t){return e+t.x}function sY(e){return 1+e.reduce(aY,0)}function aY(e,t){return Math.max(e,t.y)}function uY(e){for(var t;t=e.children;)e=t[0];return e}function lY(e){for(var t;t=e.children;)e=t[t.length-1];return e}function cY(){var e=iY,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=rY(h),d.y=sY(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=uY(o),l=lY(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function fY(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function dY(){return this.eachAfter(fY)}function hY(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function pY(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function gY(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function mY(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function yY(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function bY(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function vY(e){for(var t=this,n=xY(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function xY(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function wY(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function EY(){return Array.from(this)}function _Y(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function $Y(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*SY(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function vx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=CY)):t===void 0&&(t=kY);for(var n=new Ru(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new Ru(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(rO)}function AY(){return vx(this).eachBefore(MY)}function kY(e){return e.children}function CY(e){return Array.isArray(e)?e[1]:null}function MY(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function rO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ru(e){this.data=e,this.depth=this.height=0,this.parent=null}Ru.prototype=vx.prototype={constructor:Ru,count:dY,each:hY,eachAfter:gY,eachBefore:pY,find:mY,sum:yY,sort:bY,path:vY,ancestors:wY,descendants:EY,leaves:_Y,links:$Y,copy:AY,[Symbol.iterator]:SY};function ig(e){return e==null?null:oO(e)}function oO(e){if(typeof e!="function")throw new Error;return e}function Ks(){return 0}function Pu(e){return function(){return e}}const FY=1664525,TY=1013904223,sO=4294967296;function OY(){let e=1;return()=>(e=(FY*e+TY)%sO)/sO}function NY(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DY(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function RY(e,t){for(var n=0,i=(e=DY(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&aO(s,o)?++n:(s=LY(r=PY(r,o)),n=0);return s}function PY(e,t){var n,i;if(xx(t,e))return[t];for(n=0;n<e.length;++n)if(rg(t,e[n])&&xx(sf(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(rg(sf(e[n],e[i]),t)&&rg(sf(e[n],t),e[i])&&rg(sf(e[i],t),e[n])&&xx(uO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function rg(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function aO(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function xx(e,t){for(var n=0;n<t.length;++n)if(!aO(e,t[n]))return!1;return!0}function LY(e){switch(e.length){case 1:return IY(e[0]);case 2:return sf(e[0],e[1]);case 3:return uO(e[0],e[1],e[2])}}function IY(e){return{x:e.x,y:e.y,r:e.r}}function sf(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function uO(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,p=r-a,g=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,v=b-s*s-a*a+u*u,x=b-l*l-c*c+f*f,w=h*p-d*g,_=(p*x-g*v)/(w*2)-i,E=(g*m-p*y)/w,$=(h*v-d*x)/(w*2)-r,S=(d*y-h*m)/w,M=E*E+S*S-1,k=2*(o+_*E+$*S),N=_*_+$*$-o*o,A=-(Math.abs(M)>1e-6?(k+Math.sqrt(k*k-4*M*N))/(2*M):N/k);return{x:i+_+E*A,y:r+$+S*A,r:A}}function lO(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function cO(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function fO(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function og(e){this._=e,this.next=null,this.previous=null}function zY(e,t){if(!(o=(e=NY(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;lO(i,n,r=e[2]),n=new og(n),i=new og(i),r=new og(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){lO(n._,i._,r=e[u]),r=new og(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(cO(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(cO(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=fO(n);(r=r.next)!==i;)(a=fO(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=RY(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function BY(e){return Math.sqrt(e.value)}function UY(){var e=null,t=1,n=1,i=Ks;function r(o){const s=OY();return o.x=t/2,o.y=n/2,e?o.eachBefore(dO(e)).eachAfter(wx(i,.5,s)).eachBefore(hO(1)):o.eachBefore(dO(BY)).eachAfter(wx(Ks,1,s)).eachAfter(wx(i,o.r/Math.min(t,n),s)).eachBefore(hO(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=ig(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:Pu(+o),r):i},r}function dO(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function wx(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=zY(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function hO(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function pO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function af(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function jY(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(pO),s}function o(s,a){return function(u){u.children&&af(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var qY={depth:-1},gO={},Ex={};function WY(e){return e.id}function HY(e){return e.parentId}function mO(){var e=WY,t=HY,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=o.map((x,w)=>GY(n(x,w,r))),b=y.map(yO),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(yO(x)),o.push(Ex));s=(x,w)=>y[w],a=(x,w)=>b[w]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new Ru(l),(p=s(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?gO:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=o[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===gO)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Ex&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Ex);--y)h.data=null}if(f.parent=qY,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(rO),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=ig(r),i):e},i.parentId=function(r){return arguments.length?(t=ig(r),i):t},i.path=function(r){return arguments.length?(n=ig(r),i):n},i}function GY(e){e=`${e}`;let t=e.length;return _x(e,t-1)&&!_x(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function yO(e){let t=e.length;if(t<2)return"";for(;--t>1&&!_x(e,t););return e.slice(0,t)}function _x(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function VY(e,t){return e.parent===t.parent?1:2}function $x(e){var t=e.children;return t?t[0]:e.t}function Sx(e){var t=e.children;return t?t[t.length-1]:e.t}function YY(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function XY(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function KY(e,t,n){return e.a.parent===t.parent?e.a:n}function sg(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}sg.prototype=Object.create(Ru.prototype);function ZY(e){for(var t=new sg(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new sg(o[s],s)),r.parent=n;return(t.parent=new sg(null,0)).children=[t],t}function JY(){var e=VY,t=1,n=1,i=null;function r(l){var c=ZY(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){XY(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=Sx(p),d=$x(d),p&&d;)g=$x(g),h=Sx(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(YY(KY(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!Sx(h)&&(h.t=p,h.m+=b-y),d&&!$x(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function ag(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var bO=(1+Math.sqrt(5))/2;function vO(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,v,x,w,_;c<d;){h=r-n,p=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,w=Math.max(p/h,h/p)/(g*e),_=m*m*w,x=Math.max(b/_,_/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),_=m*m*w,v=Math.max(b/_,_/y),v>x){m-=l;break}x=v}s.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?af(u,n,i,r,g?i+=p*m/g:o):ag(u,n,i,g?n+=h*m/g:r,o),g-=m,c=f}return s}const xO=function e(t){function n(i,r,o,s,a){vO(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bO);function QY(){var e=xO,t=!1,n=1,i=1,r=[0],o=Ks,s=Ks,a=Ks,u=Ks,l=Ks;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(pO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,p+=l(d)-h,g+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=oO(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Pu(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Pu(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Pu(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Pu(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Pu(+d),c):l},c}function eX(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=o[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,w=f+1,_=d-1;w<_;){var E=w+_>>>1;l[E]<x?w=E+1:_=E}x-l[w-1]<l[w]-x&&f+1<w&&--w;var $=l[w]-v,S=h-$;if(m-p>y-g){var M=h?(p*S+m*$)/h:m;c(f,w,$,p,g,M,y),c(w,d,S,M,g,m,y)}else{var k=h?(g*S+y*$)/h:y;c(f,w,$,p,g,m,k),c(w,d,S,p,k,m,y)}}}function tX(e,t,n,i,r){(e.depth&1?ag:af)(e,t,n,i,r)}const nX=function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?af(l,r,o,s,g?o+=(a-o)*l.value/g:a):ag(l,r,o,g?r+=(s-r)*l.value/g:s,a),g-=l.value}else i._squarify=u=vO(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bO);function Ax(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function kx(e){O.call(this,null,e)}kx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const iX=e=>e.values;G(kx,O,{transform(e,t){t.source||R("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&qd(s.data)&&r.rem.push(s.data)}),this.value=o=vx({values:X(e.keys).reduce((s,a)=>(s.key(a),s),rX()).entries(r.source)},iX),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),Ax(o,ie,ie)),r.source.root=o,r}});function rX(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function Wr(e){O.call(this,null,e)}const oX=(e,t)=>e.parent===t.parent?1:2;G(Wr,O,{transform(e,t){(!t.source||!t.source.root)&&R(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ks(e.sort,s=>s.data)),sX(n,this.params,e),n.separation&&n.separation(e.separation!==!1?oX:qa);try{this.value=n(r)}catch(s){R(s)}return r.each(s=>aX(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function sX(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function aX(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const Cx=["x","y","r","depth","children"];function Mx(e){Wr.call(this,e)}Mx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Cx.length,default:Cx}]},G(Mx,Wr,{layout:UY,params:["radius","size","padding"],fields:Cx});const Fx=["x0","y0","x1","y1","depth","children"];function Tx(e){Wr.call(this,e)}Tx.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:Fx.length,default:Fx}]},G(Tx,Wr,{layout:jY,params:["size","round","padding"],fields:Fx});function Ox(e){O.call(this,null,e)}Ox.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},G(Ox,O,{transform(e,t){t.source||R("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?Ax(mO().id(e.key).parentId(e.parentKey)(r.source),e.key,Wn):Ax(mO()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const wO={tidy:JY,cluster:cY},Nx=["x","y","depth","children"];function Dx(e){Wr.call(this,e)}Dx.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:Nx.length,default:Nx}]},G(Dx,Wr,{layout(e){const t=e||"tidy";if(Z(wO,t))return wO[t]();R("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Nx});function Rx(e){O.call(this,[],e)}Rx.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},G(Rx,O,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||R("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ie(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ie(a)]&&o[ie(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ie(s)]=1),n.forEach(s=>{(o[ie(s.source)]||o[ie(s.target)])&&r.mod.push(s)})),r}});const EO={binary:eX,dice:af,slice:ag,slicedice:tX,squarify:xO,resquarify:nX},Px=["x0","y0","x1","y1","depth","children"];function Lx(e){Wr.call(this,e)}Lx.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:Px.length,default:Px}]},G(Lx,Wr,{layout(){const e=QY();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Z(EO,t)?e.tile(EO[t]):R("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Px});const uX=Object.freeze(Object.defineProperty({__proto__:null,nest:kx,pack:Mx,partition:Tx,stratify:Ox,tree:Dx,treelinks:Rx,treemap:Lx},Symbol.toStringTag,{value:"Module"})),Ix=4278190080;function lX(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function cX(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=ko(o,s).getContext("2d"),l=ko(o,s).getContext("2d"),c=a&&ko(o,s).getContext("2d");n.forEach($=>ug(u,$,!1)),ug(l,t,!1),a&&ug(c,t,!0);const f=zx(u,o,s),d=zx(l,o,s),h=a&&zx(c,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,w,_,E;for(y=0;y<s;++y)for(m=0;m<o;++m)x=y*o+m,w=f[x]&Ix,E=d[x]&Ix,_=a&&h[x]&Ix,(w||_||E)&&(b=e(m),v=e(y),!r&&(w||E)&&p.set(b,v),a&&(w||_)&&g.set(b,v));return[p,g]}function zx(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function ug(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>ug(e,o.items,n))}):Nn[i].draw(e,{items:n?t.map(fX):t})}function fX(e){const t=Wd(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Hr=5,an=31,uf=32,Vo=new Uint32Array(uf+1),vi=new Uint32Array(uf+1);vi[0]=0,Vo[0]=~vi[0];for(let e=1;e<=uf;++e)vi[e]=vi[e-1]<<1|1,Vo[e]=~vi[e];function dX(e,t){const n=new Uint32Array(~~((e*t+uf)/uf));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Hr]&1<<(a&an)},set:(o,s)=>{const a=s*e+o;i(a>>>Hr,1<<(a&an))},clear:(o,s)=>{const a=s*e+o;r(a>>>Hr,~(1<<(a&an)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>Hr,h=f>>>Hr,d===h){if(n[d]&Vo[c&an]&vi[(f&an)+1])return!0}else{if(n[d]&Vo[c&an]||n[h]&vi[(f&an)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>Hr,d=c>>>Hr,f===d)i(f,Vo[l&an]&vi[(c&an)+1]);else for(i(f,Vo[l&an]),i(d,vi[(c&an)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>Hr,d=c>>>Hr,f===d)r(f,vi[l&an]|Vo[(c&an)+1]);else for(r(f,vi[l&an]),r(d,Vo[(c&an)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function hX(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>dX(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function pX(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=On.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",p<0&&g<=o?s.baseline="top":0<=p&&o<g&&(s.baseline="bottom"),!0}}function lg(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function Yo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function gX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=o,b;if(!lg(p,g,d,h,r,o)&&!Yo(e,p,g,h,d,m,s,a)&&!Yo(e,p,g,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,Yo(e,p,g,h,d,b,s,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=On.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,w,_,E,$,S,M,k,N,A,F,C,T,P,I;for(let z=0;z<f;++z){for(b=c[z].x,x=c[z].y,v=c[z].x2===void 0?b:c[z].x2,w=c[z].y2===void 0?x:c[z].y2,b>v&&(I=b,b=v,v=I),x>w&&(I=x,x=w,w=I),M=e(b),N=e(v),k=~~((M+N)/2),A=e(x),C=e(w),F=~~((A+C)/2),$=k;$>=M;--$)for(S=F;S>=A;--S)P=u($,S,p,h,d),P&&([l.x,l.y,p,g]=P);for($=k;$<=N;++$)for(S=F;S<=C;++S)P=u($,S,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(T=Math.abs(v-b+w-x),_=(b+v)/2,E=(x+w)/2,T>=y&&!lg(_,E,h,d,r,o)&&!Yo(e,_,E,d,h,d,s,null)&&(y=T,l.x=_,l.y=E,m=!0))}return g||m?(_=h/2,E=d/2,s.setRange(e(l.x-_),e(l.y-E),e(l.x+_),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const mX=[-1,-1,1,1],yX=[-1,1,-1,1];function bX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=On.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,w,_,E,$,S,M,k,N,A,F;for(let C=0;C<f;++C){for(v=c[C].x,w=c[C].y,x=c[C].x2===void 0?v:c[C].x2,_=c[C].y2===void 0?w:c[C].y2,p.push([e((v+x)/2),e((w+_)/2)]);p.length;)if([S,M]=p.pop(),!(s.get(S,M)||a.get(S,M)||u.get(S,M))){u.set(S,M);for(let T=0;T<4;++T)E=S+mX[T],$=M+yX[T],u.outOfBounds(E,$,E,$)||p.push([E,$]);if(E=e.invert(S),$=e.invert(M),k=g,N=o,!lg(E,$,h,d,r,o)&&!Yo(e,E,$,d,h,k,s,a)&&!Yo(e,E,$,d,h,d,s,null)){for(;N-k>=1;)A=(k+N)/2,Yo(e,E,$,d,h,A,s,a)?N=A:k=A;k>g&&(l.x=E,l.y=$,g=k,m=!0)}}!m&&!n&&(F=Math.abs(x-v+_-w),E=(v+x)/2,$=(w+_)/2,F>=b&&!lg(E,$,h,d,r,o)&&!Yo(e,E,$,d,h,d,s,null)&&(b=F,l.x=E,l.y=$,y=!0))}return m||y?(E=h/2,$=d/2,s.setRange(e(l.x-E),e(l.y-$),e(l.x+E),e(l.y+$)),l.align="center",l.baseline="middle",!0):!1}}const vX=["right","center","left"],xX=["bottom","middle","top"];function wX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,w,_,E,$,S,M,k;for(let N=0;N<u;++N){if(h=(n[N]&3)-1,p=(n[N]>>>2&3)-1,g=h===0&&p===0||i[N]<0,m=h&&p?Math.SQRT1_2:1,y=i[N]<0?-1:1,b=c[1+h]+i[N]*h*m,E=c[4+p]+y*f*p/2+i[N]*p*m,x=E-f/2,w=E+f/2,$=e(b),M=e(x),k=e(w),!d)if(_O($,$,M,k,s,a,b,b,x,w,c,g))d=On.width(l.datum,l.datum.text);else continue;if(_=b+y*d*h/2,b=_-d/2,v=_+d/2,$=e(b),S=e(v),_O($,S,M,k,s,a,b,v,x,w,c,g))return l.x=h?h*y<0?v:b:_,l.y=p?p*y<0?w:x:E,l.align=vX[h*y+1],l.baseline=xX[p*y+1],s.setRange($,M,S,k),!0}return!1}}function _O(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Bx=0,Ux=4,jx=8,qx=0,Wx=1,Hx=2,EX={"top-left":Bx+qx,top:Bx+Wx,"top-right":Bx+Hx,left:Ux+qx,middle:Ux+Wx,right:Ux+Hx,"bottom-left":jx+qx,bottom:jx+Wx,"bottom-right":jx+Hx},_X={naive:pX,"reduced-search":gX,floodfill:bX};function $X(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=SX(i,f),h=AX(r,f),p=kX(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=CX(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,w=-1;const _=e.map(M=>{const k=b?On.width(M,M.text):void 0;return x=Math.max(x,k),w=Math.max(w,M.fontSize),{datum:M,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(M),textWidth:k}});l=l===null||l===1/0?Math.max(x,w)+Math.max(...i):l;const E=hX(t[0],t[1],l);let $;if(!v){n&&_.sort((N,A)=>n(N.datum,A.datum));let M=!1;for(let N=0;N<h.length&&!M;++N)M=h[N]===5||d[N]<0;const k=(p&&s||m)&&e.map(N=>N.datum);$=o.length||k?cX(E,k||[],o,M,m):lX(E,s&&_)}const S=m?_X[c](E,$,s,u):wX(E,$,h,d);return _.forEach(M=>M.opacity=+S(M)),_}function SX(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function AX(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=EX[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function kX(e){return e&&e.mark&&e.mark.marktype}function CX(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const Gx=["x","y","opacity","align","baseline"],$O=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Vx(e){O.call(this,null,e)}Vx.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:$O},{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:Gx.length,default:Gx}]},G(Vx,O,{transform(e,t){function n(o){const s=e[o];return ce(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&R("Size parameter should be specified as a [width, height] array.");const r=e.as||Gx;return $X(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||$O),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const MX=Object.freeze(Object.defineProperty({__proto__:null,label:Vx},Symbol.toStringTag,{value:"Module"}));function SO(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Yx(e){O.call(this,null,e)}Yx.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},G(Yx,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=SO(i,e.groupby),o=(e.groupby||[]).map(Ye),s=o.length,a=e.as||[Ye(e.x),Ye(e.y)],u=[];r.forEach(l=>{AA(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const Xx={constant:j1,linear:q1,log:xA,exp:wA,pow:EA,quad:W1,poly:_A},FX=(e,t)=>e==="poly"?t:e==="quad"?2:1;function Kx(e){O.call(this,null,e)}Kx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(Xx)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},G(Kx,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=SO(i,e.groupby),o=(e.groupby||[]).map(Ye),s=e.method||"linear",a=e.order==null?3:e.order,u=FX(s,a),l=e.as||[Ye(e.x),Ye(e.y)],c=Xx[s],f=[];let d=e.extent;Z(Xx,s)||R("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Bi(h,e.x),y=b=>{const v={};for(let x=0;x<o.length;++x)v[o[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};s==="linear"||s==="constant"?m.forEach(b=>y([b,g.predict(b)])):eh(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const TX=Object.freeze(Object.defineProperty({__proto__:null,loess:Yx,regression:Kx},Symbol.toStringTag,{value:"Module"})),Gr=11102230246251565e-32,Wt=134217729,OX=(3+8*Gr)*Gr;function Zx(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function NX(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function lf(e){return new Float64Array(e)}const DX=(3+16*Gr)*Gr,RX=(2+12*Gr)*Gr,PX=(9+64*Gr)*Gr*Gr,Lu=lf(4),AO=lf(8),kO=lf(12),CO=lf(16),un=lf(4);function LX(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,w,_,E,$;const S=e-r,M=n-r,k=t-o,N=i-o;x=S*N,d=Wt*S,h=d-(d-S),p=S-h,d=Wt*N,g=d-(d-N),m=N-g,w=p*m-(x-h*g-p*g-h*m),_=k*M,d=Wt*k,h=d-(d-k),p=k-h,d=Wt*M,g=d-(d-M),m=M-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,Lu[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Lu[1]=v-(y+f)+(f-_),$=b+y,f=$-b,Lu[2]=b-($-f)+(y-f),Lu[3]=$;let A=NX(4,Lu),F=RX*s;if(A>=F||-A>=F||(f=e-S,a=e-(S+f)+(f-r),f=n-M,l=n-(M+f)+(f-r),f=t-k,u=t-(k+f)+(f-o),f=i-N,c=i-(N+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=PX*s+OX*Math.abs(A),A+=S*c+N*a-(k*l+M*u),A>=F||-A>=F))return A;x=a*N,d=Wt*a,h=d-(d-a),p=a-h,d=Wt*N,g=d-(d-N),m=N-g,w=p*m-(x-h*g-p*g-h*m),_=u*M,d=Wt*u,h=d-(d-u),p=u-h,d=Wt*M,g=d-(d-M),m=M-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const C=Zx(4,Lu,4,un,AO);x=S*c,d=Wt*S,h=d-(d-S),p=S-h,d=Wt*c,g=d-(d-c),m=c-g,w=p*m-(x-h*g-p*g-h*m),_=k*l,d=Wt*k,h=d-(d-k),p=k-h,d=Wt*l,g=d-(d-l),m=l-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const T=Zx(C,AO,4,un,kO);x=a*c,d=Wt*a,h=d-(d-a),p=a-h,d=Wt*c,g=d-(d-c),m=c-g,w=p*m-(x-h*g-p*g-h*m),_=u*l,d=Wt*u,h=d-(d-u),p=u-h,d=Wt*l,g=d-(d-l),m=l-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const P=Zx(T,kO,4,un,CO);return CO[P-1]}function cg(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=DX*l?u:-LX(e,t,n,i,r,o,l)}const MO=Math.pow(2,-52),fg=new Uint32Array(512);class dg{static from(t,n=jX,i=qX){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new dg(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let S=0;S<s;S++){const M=t[2*S],k=t[2*S+1];M<a&&(a=M),k<u&&(u=k),M>l&&(l=M),k>c&&(c=k),this._ids[S]=S}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let S=0,M=1/0;S<s;S++){const k=Jx(f,d,t[2*S],t[2*S+1]);k<M&&(h=S,M=k)}const m=t[2*h],y=t[2*h+1];for(let S=0,M=1/0;S<s;S++){if(S===h)continue;const k=Jx(m,y,t[2*S],t[2*S+1]);k<M&&k>0&&(p=S,M=k)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let S=0;S<s;S++){if(S===h||S===p)continue;const M=BX(m,y,b,v,t[2*S],t[2*S+1]);M<x&&(g=S,x=M)}let w=t[2*g],_=t[2*g+1];if(x===1/0){for(let k=0;k<s;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];Iu(this._ids,this._dists,0,s-1);const S=new Uint32Array(s);let M=0;for(let k=0,N=-1/0;k<s;k++){const A=this._ids[k],F=this._dists[A];F>N&&(S[M++]=A,N=F)}this.hull=S.subarray(0,M),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(cg(m,y,b,v,w,_)<0){const S=p,M=b,k=v;p=g,b=w,v=_,g=S,w=M,_=k}const E=UX(m,y,b,v,w,_);this._cx=E.x,this._cy=E.y;for(let S=0;S<s;S++)this._dists[S]=Jx(t[2*S],t[2*S+1],E.x,E.y);Iu(this._ids,this._dists,0,s-1),this._hullStart=h;let $=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,v)]=p,o[this._hashKey(w,_)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let S=0,M,k;S<this._ids.length;S++){const N=this._ids[S],A=t[2*N],F=t[2*N+1];if(S>0&&Math.abs(A-M)<=MO&&Math.abs(F-k)<=MO||(M=A,k=F,N===h||N===p||N===g))continue;let C=0;for(let te=0,ne=this._hashKey(A,F);te<this._hashSize&&(C=o[(ne+te)%this._hashSize],!(C!==-1&&C!==i[C]));te++);C=n[C];let T=C,P;for(;P=i[T],cg(A,F,t[2*T],t[2*T+1],t[2*P],t[2*P+1])>=0;)if(T=P,T===C){T=-1;break}if(T===-1)continue;let I=this._addTriangle(T,N,i[T],-1,-1,r[T]);r[N]=this._legalize(I+2),r[T]=I,$++;let z=i[T];for(;P=i[z],cg(A,F,t[2*z],t[2*z+1],t[2*P],t[2*P+1])<0;)I=this._addTriangle(z,N,P,r[N],-1,r[z]),r[N]=this._legalize(I+2),i[z]=z,$--,z=P;if(T===C)for(;P=n[T],cg(A,F,t[2*P],t[2*P+1],t[2*T],t[2*T+1])<0;)I=this._addTriangle(P,N,T,-1,r[T],r[P]),this._legalize(I+2),r[P]=I,i[T]=T,$--,T=P;this._hullStart=n[N]=T,i[T]=n[z]=N,i[N]=z,o[this._hashKey(A,F)]=N,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array($);for(let S=0,M=this._hullStart;S<$;S++)this.hull[S]=M,M=i[M];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(IX(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=fg[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],p=n[c],g=n[f];if(zX(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<fg.length&&(fg[o++]=b)}else{if(o===0)break;t=fg[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function IX(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Jx(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function zX(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function BX(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,p=(s*f-u*c)*d;return h*h+p*p}function UX(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,p=t+(s*f-u*c)*d;return{x:h,y:p}}function Iu(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;cf(e,r,o),t[e[n]]>t[e[i]]&&cf(e,n,i),t[e[o]]>t[e[i]]&&cf(e,o,i),t[e[n]]>t[e[o]]&&cf(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;cf(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(Iu(e,t,o,i),Iu(e,t,n,s-1)):(Iu(e,t,n,s-1),Iu(e,t,o,i))}}function cf(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function jX(e){return e[0]}function qX(e){return e[1]}const FO=1e-6;class Zs{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>FO||Math.abs(this._y1-o)>FO)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Qx{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let WX=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,w=i[g+1]*2,_=i[g+2]*2,E=t[x],$=t[x+1],S=t[w],M=t[w+1],k=t[_],N=t[_+1],A=S-E,F=M-$,C=k-E,T=N-$,P=(A*T-F*C)*2;if(Math.abs(P)<1e-9){if(o===void 0){o=s=0;for(const z of n)o+=t[z*2],s+=t[z*2+1];o/=n.length,s/=n.length}const I=1e9*Math.sign((o-E)*T-(s-$)*C);b=(E+k)/2-I*T,v=($+N)/2+I*C}else{const I=1/P,z=A*A+F*F,te=C*C+T*T;b=E+(T*z-F*te)*I,v=$+(A*te-C*z)*I}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Zs:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=s[h],m=s[h+1],y=s[p],b=s[p+1];this._renderSegment(g,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Zs:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Zs:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new Qx;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(o,s,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const HX=2*Math.PI,zu=Math.pow;function GX(e){return e[0]}function VX(e){return e[1]}function YX(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function XX(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class e2{static from(t,n=GX,i=VX,r){return new e2("length"in t?KX(t,n,i,r):Float64Array.from(ZX(t,n,i,r)))}constructor(t){this._delaunator=new dg(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&YX(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=XX(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new dg(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new WX(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=zu(n-l[t*2],2)+zu(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=zu(n-l[p*2],2)+zu(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&zu(n-l[h*2],2)+zu(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Zs:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Zs:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,HX)}return i&&i.value()}renderHull(t){const n=t==null?t=new Zs:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Qx;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Zs:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Qx;return this.renderTriangle(t,n),n.value()}}function KX(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*ZX(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function t2(e){O.call(this,null,e)}t2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const JX=[-1e5,-1e5,1e5,1e5];G(t2,O,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:JX;const o=this.value=e2.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!eK(u)?QX(u):null}return t.reflow(e.modified()).modifies(n)}});function QX(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function eK(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const tK=Object.freeze(Object.defineProperty({__proto__:null,voronoi:t2},Symbol.toStringTag,{value:"Module"}));var n2=Math.PI/180,ff=64,hg=2048;function nK(){var e=[256,256],t,n,i,r,o,s,a,u=TO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(ko()),g=uK((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(_=>({text:t(_),font:n(_),style:r(_),weight:o(_),rotate:s(_),size:~~(i(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,E)=>E.size-_.size);++b<y;){var w=x[b];w.x=e[0]*(c()+.5)>>1,w.y=e[1]*(c()+.5)>>1,iK(p,w,x,b),w.hasText&&h(g,w,m)&&(v.push(w),m?oK(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(ff<<5)/g,p.height=hg/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),w=c()<.5?1:-1,_=-w,E,$,S;(E=x(_+=w))&&($=~~E[0],S=~~E[1],!(Math.min(Math.abs($),Math.abs(S))>=v));)if(g.x=y+$,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!rK(g,p,e[0]))&&(!m||sK(g,m))){for(var M=g.sprite,k=g.width>>5,N=e[0]>>5,A=g.x-(k<<4),F=A&127,C=32-F,T=g.y1-g.y0,P=(g.y+g.y0)*N+(A>>5),I,z=0;z<T;z++){I=0;for(var te=0;te<=k;te++)p[P+te]|=I<<C|(te<k?(I=M[z*k+te])>>>F:0);P+=N}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Js(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Js(p),f):r},f.fontWeight=function(p){return arguments.length?(o=Js(p),f):o},f.rotate=function(p){return arguments.length?(s=Js(p),f):s},f.text=function(p){return arguments.length?(t=Js(p),f):t},f.spiral=function(p){return arguments.length?(u=lK[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=Js(p),f):i},f.padding=function(p){return arguments.length?(a=Js(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function iK(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(ff<<5)/o,hg/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*n2),m=Math.cos(t.rotate*n2),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=ff<<5&&(s=0,a+=u,u=0),a+d>=hg)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*n2),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var w=r.getImageData(0,0,(ff<<5)/o,hg/o).data,_=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)_[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var E=0,$=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var S=f*p+(h>>5),M=w[(a+p)*(ff<<5)+(s+h)<<2]?1<<31-h%32:0;_[S]|=M,E|=M}E?$=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+$,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function rK(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function oK(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function sK(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function TO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function aK(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function uK(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Js(e){return typeof e=="function"?e:function(){return e}}var lK={archimedean:TO,rectangular:aK};const OO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],cK=["text","font","rotate","fontSize","fontStyle","fontWeight"];function i2(e){O.call(this,nK(),e)}i2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:OO}]},G(i2,O,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&R("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return ce(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||cK.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||OO;let a=e.fontSize||14,u;if(ce(a)?u=e.fontSizeRange:a=Lt(a),u){const p=a,g=Se("sqrt")().domain(Bi(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const l=o.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(a).random(Vn).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[s[0]]=g.x+f,m[s[1]]=g.y+d,m[s[2]]=g.font,m[s[3]]=g.size,m[s[4]]=g.style,m[s[5]]=g.weight,m[s[6]]=g.rotate;return t.reflow(i).modifies(s)}});const fK=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:i2},Symbol.toStringTag,{value:"Module"})),dK=e=>new Uint8Array(e),hK=e=>new Uint16Array(e),df=e=>new Uint32Array(e);function pK(){let e=8,t=[],n=df(0),i=pg(0,e),r=pg(0,e);return{data:()=>t,seen:()=>n=gK(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=pg(o,e,i),r=pg(o,e))}}}function gK(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function pg(e,t,n){const i=(t<257?dK:t<65537?hK:df)(e);return n&&i.set(n),i}function NO(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function DO(){let e=df(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=df(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=mK(h,d),c)p=t,g=e,t=Array(c+f),e=df(c+f),yK(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[CI(u,a[0],0,l),vo(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function mK(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),TI(e,t)}function yK(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function r2(e){O.call(this,pK(),e),this._indices=null,this._dims=null}r2.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}}]},G(r2,O,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=DO()),o.push(NO(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,w,_,E;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,w=0,_=b.length;w<_;++w)x[b[w]._index]=1;for(w=0;w<h;++w)E=i[w],(!s[w]||e.modified("fields",w)||t.modified(E.fields))&&(y=E.fname,(g=p[y])||(o[y]=m=DO(),p[y]=g=m.insert(E,t.source,0)),s[w]=NO(m,w,r[w]).onAdd(g,u));for(w=0,_=a.data().length;w<_;++w)v[w]||(l[w]!==u[w]?f.push(w):x[w]&&u[w]!==c&&d.push(w));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=s[p].insert(a[h],i,d)),o[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=p=o[h],o[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=s[p],o[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=s[p],o[m]^=h,i.push(m);e.range=t.slice()}});function o2(e){O.call(this,null,e)}o2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},G(o2,O,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const bK=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:r2,resolvefilter:o2},Symbol.toStringTag,{value:"Module"})),vK="RawCode",Qs="Literal",xK="Property",wK="Identifier",EK="ArrayExpression",_K="BinaryExpression",RO="CallExpression",$K="ConditionalExpression",SK="LogicalExpression",AK="MemberExpression",kK="ObjectExpression",CK="UnaryExpression";function xi(e){this.type=e}xi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=MK(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function MK(e){switch(e.type){case EK:return e.elements;case _K:case SK:return[e.left,e.right];case RO:return[e.callee].concat(e.arguments);case $K:return[e.test,e.consequent,e.alternate];case AK:return[e.object,e.property];case kK:return e.properties;case xK:return[e.key,e.value];case CK:return[e.argument];case wK:case Qs:case vK:default:return[]}}var rr,Q,D,Ht,Fe,gg=1,hf=2,ea=3,Xo=4,mg=5,ta=6,xn=7,pf=8,FK=9;rr={},rr[gg]="Boolean",rr[hf]="<end>",rr[ea]="Identifier",rr[Xo]="Keyword",rr[mg]="Null",rr[ta]="Numeric",rr[xn]="Punctuator",rr[pf]="String",rr[FK]="RegularExpression";var TK="ArrayExpression",OK="BinaryExpression",NK="CallExpression",DK="ConditionalExpression",PO="Identifier",RK="Literal",PK="LogicalExpression",LK="MemberExpression",IK="ObjectExpression",zK="Property",BK="UnaryExpression",pt="Unexpected token %0",UK="Unexpected number",jK="Unexpected string",qK="Unexpected identifier",WK="Unexpected reserved word",HK="Unexpected end of input",s2="Invalid regular expression",a2="Invalid regular expression: missing /",LO="Octal literals are not allowed in strict mode.",GK="Duplicate data property in object literal not allowed in strict mode",St="ILLEGAL",gf="Disabled.",VK=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]"),YK=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 yg(e,t){if(!e)throw new Error("ASSERT: "+t)}function Vr(e){return e>=48&&e<=57}function u2(e){return"0123456789abcdefABCDEF".includes(e)}function mf(e){return"01234567".includes(e)}function XK(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function yf(e){return e===10||e===13||e===8232||e===8233}function bf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&VK.test(String.fromCharCode(e))}function bg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&YK.test(String.fromCharCode(e))}const KK={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 IO(){for(;D<Ht;){const e=Q.charCodeAt(D);if(XK(e)||yf(e))++D;else break}}function l2(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)D<Ht&&u2(Q[D])?(i=Q[D++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):Ae({},pt,St);return String.fromCharCode(r)}function ZK(){var e,t,n,i;for(e=Q[D],t=0,e==="}"&&Ae({},pt,St);D<Ht&&(e=Q[D++],!!u2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ae({},pt,St),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function zO(){var e,t;for(e=Q.charCodeAt(D++),t=String.fromCharCode(e),e===92&&(Q.charCodeAt(D)!==117&&Ae({},pt,St),++D,e=l2("u"),(!e||e==="\\"||!bf(e.charCodeAt(0)))&&Ae({},pt,St),t=e);D<Ht&&(e=Q.charCodeAt(D),!!bg(e));)++D,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Q.charCodeAt(D)!==117&&Ae({},pt,St),++D,e=l2("u"),(!e||e==="\\"||!bg(e.charCodeAt(0)))&&Ae({},pt,St),t+=e);return t}function JK(){var e,t;for(e=D++;D<Ht;){if(t=Q.charCodeAt(D),t===92)return D=e,zO();if(bg(t))++D;else break}return Q.slice(e,D)}function QK(){var e,t,n;return e=D,t=Q.charCodeAt(D)===92?zO():JK(),t.length===1?n=ea:KK.hasOwnProperty(t)?n=Xo:t==="null"?n=mg:t==="true"||t==="false"?n=gg:n=ea,{type:n,value:t,start:e,end:D}}function c2(){var e=D,t=Q.charCodeAt(D),n,i=Q[D],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++D,{type:xn,value:String.fromCharCode(t),start:e,end:D};default:if(n=Q.charCodeAt(D+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return D+=2,{type:xn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:D};case 33:case 61:return D+=2,Q.charCodeAt(D)===61&&++D,{type:xn,value:Q.slice(e,D),start:e,end:D}}}if(s=Q.substr(D,4),s===">>>=")return D+=4,{type:xn,value:s,start:e,end:D};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return D+=3,{type:xn,value:o,start:e,end:D};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return D+=2,{type:xn,value:r,start:e,end:D};if(r==="//"&&Ae({},pt,St),"<>=!+-*%&|^/".includes(i))return++D,{type:xn,value:i,start:e,end:D};Ae({},pt,St)}function eZ(e){let t="";for(;D<Ht&&u2(Q[D]);)t+=Q[D++];return t.length===0&&Ae({},pt,St),bf(Q.charCodeAt(D))&&Ae({},pt,St),{type:ta,value:parseInt("0x"+t,16),start:e,end:D}}function tZ(e){let t="0"+Q[D++];for(;D<Ht&&mf(Q[D]);)t+=Q[D++];return(bf(Q.charCodeAt(D))||Vr(Q.charCodeAt(D)))&&Ae({},pt,St),{type:ta,value:parseInt(t,8),octal:!0,start:e,end:D}}function BO(){var e,t,n;if(n=Q[D],yg(Vr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=D,e="",n!=="."){if(e=Q[D++],n=Q[D],e==="0"){if(n==="x"||n==="X")return++D,eZ(t);if(mf(n))return tZ(t);n&&Vr(n.charCodeAt(0))&&Ae({},pt,St)}for(;Vr(Q.charCodeAt(D));)e+=Q[D++];n=Q[D]}if(n==="."){for(e+=Q[D++];Vr(Q.charCodeAt(D));)e+=Q[D++];n=Q[D]}if(n==="e"||n==="E")if(e+=Q[D++],n=Q[D],(n==="+"||n==="-")&&(e+=Q[D++]),Vr(Q.charCodeAt(D)))for(;Vr(Q.charCodeAt(D));)e+=Q[D++];else Ae({},pt,St);return bf(Q.charCodeAt(D))&&Ae({},pt,St),{type:ta,value:parseFloat(e),start:t,end:D}}function nZ(){var e="",t,n,i,r,o=!1;for(t=Q[D],yg(t==="'"||t==='"',"String literal must starts with a quote"),n=D,++D;D<Ht;)if(i=Q[D++],i===t){t="";break}else if(i==="\\")if(i=Q[D++],!i||!yf(i.charCodeAt(0)))switch(i){case"u":case"x":Q[D]==="{"?(++D,e+=ZK()):e+=l2(i);break;case"n":e+=`
49
- `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:mf(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),D<Ht&&mf(Q[D])&&(o=!0,r=r*8+"01234567".indexOf(Q[D++]),"0123".includes(i)&&D<Ht&&mf(Q[D])&&(r=r*8+"01234567".indexOf(Q[D++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Q[D]===`
50
- `&&++D;else{if(yf(i.charCodeAt(0)))break;e+=i}return t!==""&&Ae({},pt,St),{type:pf,value:e,octal:o,start:n,end:D}}function iZ(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Ae({},s2)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ae({},s2)}try{return new RegExp(e,t)}catch{return null}}function rZ(){var e,t,n,i,r;for(e=Q[D],yg(e==="/","Regular expression literal must start with a slash"),t=Q[D++],n=!1,i=!1;D<Ht;)if(e=Q[D++],t+=e,e==="\\")e=Q[D++],yf(e.charCodeAt(0))&&Ae({},a2),t+=e;else if(yf(e.charCodeAt(0)))Ae({},a2);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||Ae({},a2),r=t.substr(1,t.length-2),{value:r,literal:t}}function oZ(){var e,t,n;for(t="",n="";D<Ht&&(e=Q[D],!!bg(e.charCodeAt(0)));)++D,e==="\\"&&D<Ht?Ae({},pt,St):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ae({},s2,n),{value:n,literal:t}}function sZ(){var e,t,n,i;return Fe=null,IO(),e=D,t=rZ(),n=oZ(),i=iZ(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:D}}function aZ(e){return e.type===ea||e.type===Xo||e.type===gg||e.type===mg}function UO(){if(IO(),D>=Ht)return{type:hf,start:D,end:D};const e=Q.charCodeAt(D);return bf(e)?QK():e===40||e===41||e===59?c2():e===39||e===34?nZ():e===46?Vr(Q.charCodeAt(D+1))?BO():c2():Vr(e)?BO():c2()}function wn(){const e=Fe;return D=e.end,Fe=UO(),D=e.end,e}function jO(){const e=D;Fe=UO(),D=e}function uZ(e){const t=new xi(TK);return t.elements=e,t}function qO(e,t,n){const i=new xi(e==="||"||e==="&&"?PK:OK);return i.operator=e,i.left=t,i.right=n,i}function lZ(e,t){const n=new xi(NK);return n.callee=e,n.arguments=t,n}function cZ(e,t,n){const i=new xi(DK);return i.test=e,i.consequent=t,i.alternate=n,i}function f2(e){const t=new xi(PO);return t.name=e,t}function vf(e){const t=new xi(RK);return t.value=e.value,t.raw=Q.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function WO(e,t,n){const i=new xi(LK);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function fZ(e){const t=new xi(IK);return t.properties=e,t}function HO(e,t,n){const i=new xi(zK);return i.key=t,i.value=n,i.kind=e,i}function dZ(e,t){const n=new xi(BK);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ae(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(yg(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=D,n.description=r,n}function vg(e){e.type===hf&&Ae(e,HK),e.type===ta&&Ae(e,UK),e.type===pf&&Ae(e,jK),e.type===ea&&Ae(e,qK),e.type===Xo&&Ae(e,WK),Ae(e,pt,e.value)}function Gt(e){const t=wn();(t.type!==xn||t.value!==e)&&vg(t)}function Be(e){return Fe.type===xn&&Fe.value===e}function d2(e){return Fe.type===Xo&&Fe.value===e}function hZ(){const e=[];for(D=Fe.start,Gt("[");!Be("]");)Be(",")?(wn(),e.push(null)):(e.push(na()),Be("]")||Gt(","));return wn(),uZ(e)}function GO(){D=Fe.start;const e=wn();return e.type===pf||e.type===ta?(e.octal&&Ae(e,LO),vf(e)):f2(e.value)}function pZ(){var e,t,n,i;if(D=Fe.start,e=Fe,e.type===ea)return n=GO(),Gt(":"),i=na(),HO("init",n,i);if(e.type===hf||e.type===xn)vg(e);else return t=GO(),Gt(":"),i=na(),HO("init",t,i)}function gZ(){var e=[],t,n,i,r={},o=String;for(D=Fe.start,Gt("{");!Be("}");)t=pZ(),t.key.type===PO?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?Ae({},GK):r[i]=!0,e.push(t),Be("}")||Gt(",");return Gt("}"),fZ(e)}function mZ(){Gt("(");const e=h2();return Gt(")"),e}const yZ={if:1};function bZ(){var e,t,n;if(Be("("))return mZ();if(Be("["))return hZ();if(Be("{"))return gZ();if(e=Fe.type,D=Fe.start,e===ea||yZ[Fe.value])n=f2(wn().value);else if(e===pf||e===ta)Fe.octal&&Ae(Fe,LO),n=vf(wn());else{if(e===Xo)throw new Error(gf);e===gg?(t=wn(),t.value=t.value==="true",n=vf(t)):e===mg?(t=wn(),t.value=null,n=vf(t)):Be("/")||Be("/=")?(n=vf(sZ()),jO()):vg(wn())}return n}function vZ(){const e=[];if(Gt("("),!Be(")"))for(;D<Ht&&(e.push(na()),!Be(")"));)Gt(",");return Gt(")"),e}function xZ(){D=Fe.start;const e=wn();return aZ(e)||vg(e),f2(e.value)}function wZ(){return Gt("."),xZ()}function EZ(){Gt("[");const e=h2();return Gt("]"),e}function _Z(){var e,t,n;for(e=bZ();;)if(Be("."))n=wZ(),e=WO(".",e,n);else if(Be("("))t=vZ(),e=lZ(e,t);else if(Be("["))n=EZ(),e=WO("[",e,n);else break;return e}function VO(){const e=_Z();if(Fe.type===xn&&(Be("++")||Be("--")))throw new Error(gf);return e}function xg(){var e,t;if(Fe.type!==xn&&Fe.type!==Xo)t=VO();else{if(Be("++")||Be("--"))throw new Error(gf);if(Be("+")||Be("-")||Be("~")||Be("!"))e=wn(),t=xg(),t=dZ(e.value,t);else{if(d2("delete")||d2("void")||d2("typeof"))throw new Error(gf);t=VO()}}return t}function YO(e){let t=0;if(e.type!==xn&&e.type!==Xo)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":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;break}return t}function $Z(){var e,t,n,i,r,o,s,a,u,l;if(e=Fe,u=xg(),i=Fe,r=YO(i),r===0)return u;for(i.prec=r,wn(),t=[e,Fe],s=xg(),o=[u,i,s];(r=YO(Fe))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=qO(a,u,s),o.push(n);i=wn(),i.prec=r,o.push(i),t.push(Fe),n=xg(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=qO(o[l-1].value,o[l-2],n),l-=2;return n}function na(){var e,t,n;return e=$Z(),Be("?")&&(wn(),t=na(),Gt(":"),n=na(),e=cZ(e,t,n)),e}function h2(){const e=na();if(Be(","))throw new Error(gf);return e}function p2(e){Q=e,D=0,Ht=Q.length,Fe=null,jO();const t=h2();if(Fe.type!==hf)throw new Error("Unexpect token after expression.");return t}var XO={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 KO(e){function t(s,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,u){return l=>t(s,l,a,u)}const i="new Date",r="String",o="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(s){s.length<3&&R("Missing arguments to clamp function."),s.length>3&&R("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&R("Missing arguments to if function."),s.length>3&&R("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function SZ(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function ZO(e){e=e||{};const t=e.allowed?li(e.allowed):{},n=e.forbidden?li(e.forbidden):{},i=e.constants||XO,r=(e.functions||KO)(f),o=e.globalvar,s=e.fieldvar,a=ce(o)?o:p=>`${o}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&R("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:Z(n,g)?R("Illegal identifier: "+g):Z(i,g)?i[g]:Z(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===s&&(l[SZ(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&R("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=Z(r,g)&&r[g];return y||R("Unrecognized function: "+g),ce(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const JO=Symbol("vega_selection_getter");function QO(e){return(!e.getter||!e.getter[JO])&&(e.getter=qn(e.field),e.getter[JO]=!0),e.getter}const g2="intersect",eN="union",AZ="vlMulti",kZ="vlPoint",tN="or",CZ="and",or="_vgsid_",xf=qn(or),MZ="E",FZ="R",TZ="R-E",OZ="R-LE",NZ="R-RE",wg="index:unit";function nN(e,t){for(var n=t.fields,i=t.values,r=n.length,o=0,s,a;o<r;++o)if(a=n[o],s=QO(a)(e),yo(s)&&(s=Pt(s)),yo(i[o])&&(i[o]=Pt(i[o])),L(i[o])&&yo(i[o][0])&&(i[o]=i[o].map(Pt)),a.type===MZ){if(L(i[o])?i[o].indexOf(s)<0:s!==i[o])return!1}else if(a.type===FZ){if(!Va(s,i[o]))return!1}else if(a.type===NZ){if(!Va(s,i[o],!0,!1))return!1}else if(a.type===TZ){if(!Va(s,i[o],!1,!1))return!1}else if(a.type===OZ&&!Va(s,i[o],!1,!0))return!1;return!0}function DZ(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[wg]&&i[wg].value:void 0,s=n===g2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],o&&s){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=nN(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=nN(t,l),s^h)return h;return a&&s}const iN=Ya(xf),RZ=iN.left,PZ=iN.right;function LZ(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[wg]&&i[wg].value:void 0,s=n===g2,a=xf(t),u=RZ(r,a);if(u===r.length||xf(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(PZ(r,a)-u<o.size)return!1}return!0}function IZ(e,t){return e.map(n=>fe(t.fields?{values:t.fields.map(i=>QO(i)(n.datum))}:{[or]:xf(n.datum)},t))}function zZ(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=o.length,x=0,w,_;x<v;++x)if(l=o[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(w=0,_=c.length;w<_;++w)h=c[w],g=s[h.field]||(s[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=m2[`${y}_union`],g[d]=b(m,X(f[w]));n&&(m=a[d]||(a[d]=[]),m.push(X(f).reduce((E,$,S)=>(E[c[S].field]=$,E),{})))}else h=or,p=xf(l),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[or]:p}));if(t=t||eN,s[or]?s[or]=m2[`${or}_${t}`](...Object.values(s[or])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map($=>s[E][$]).reduce(($,S)=>$===void 0?S:m2[`${u[E]}_${t}`]($,S))}),o=Object.keys(a),n&&o.length){const E=i?kZ:AZ;s[E]=t===eN?{[tN]:o.reduce(($,S)=>($.push(...a[S]),$),[])}:{[CZ]:o.map($=>({[tN]:a[$]}))}}return s}var m2={[`${or}_union`]:BI,[`${or}_intersect`]:II,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=Pt(t[0]),i=Pt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=Pt(t[0]),i=Pt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const BZ=":",UZ="@";function y2(e,t,n,i){t[0].type!==Qs&&R("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&ve(t).value,s="unit",a=UZ+s,u=BZ+r;o===g2&&!Z(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),Z(i,u)||(i[u]=n.getData(r).tuplesRef())}function rN(e){const t=this.context.data[e];return t?t.values.value:[]}function jZ(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function qZ(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Wn).insert(t)),1}function WZ(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const wf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},HZ=wf("format"),oN=wf("timeFormat"),GZ=wf("utcFormat"),VZ=wf("timeParse"),YZ=wf("utcParse"),Eg=new Date(2e3,0,1);function _g(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Eg.setYear(2e3),Eg.setMonth(e),Eg.setDate(t),oN.call(this,Eg,n))}function XZ(e){return _g.call(this,e,1,"%B")}function KZ(e){return _g.call(this,e,1,"%b")}function ZZ(e){return _g.call(this,0,2+e,"%A")}function JZ(e){return _g.call(this,0,2+e,"%a")}const QZ=":",eJ="@",b2="%",sN="$";function v2(e,t,n,i){t[0].type!==Qs&&R("First argument to data functions must be a string literal.");const r=t[0].value,o=QZ+r;if(!Z(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function tJ(e,t,n,i){t[0].type!==Qs&&R("First argument to indata must be a string literal."),t[1].type!==Qs&&R("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=eJ+o;Z(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function ln(e,t,n,i){if(t[0].type===Qs)aN(n,i,t[0].value);else for(e in n.scales)aN(n,i,e)}function aN(e,t,n){const i=b2+n;if(!Z(t,i))try{t[i]=e.scaleRef(n)}catch{}}function sr(e,t){if(ce(e))return e;if(K(e)){const n=t.scales[e];return n&&vU(n.value)?n.value:void 0}}function nJ(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=ln,n._range=ln,n._scale=ln;const i=r=>"_["+(r.type===Qs?H(b2+r.value):H(b2)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function x2(e,t){return function(n,i,r){if(n){const o=sr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const iJ=x2("area",kH),rJ=x2("bounds",TH),oJ=x2("centroid",LH);function sJ(e,t){const n=sr(e,(t||this).context);return n&&n.scale()}function aJ(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}function w2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function uJ(){return w2(this.context.dataflow,"warn",arguments)}function lJ(){return w2(this.context.dataflow,"info",arguments)}function cJ(){return w2(this.context.dataflow,"debug",arguments)}function E2(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _2(e){const t=Fo(e),n=E2(t.r),i=E2(t.g),r=E2(t.b);return .2126*n+.7152*i+.0722*r}function fJ(e,t){const n=_2(e),i=_2(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function dJ(){const e=[].slice.call(arguments);return e.unshift({}),fe(...e)}function uN(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?hJ(e,t):!1:Y(e)&&Y(t)?lN(e,t):!1}function hJ(e,t){for(let n=0,i=e.length;n<i;++n)if(!uN(e[n],t[n]))return!1;return!0}function lN(e,t){for(const n in e)if(!uN(e[n],t[n]))return!1;return!0}function cN(e){return t=>lN(e,t)}function pJ(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,l=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=s.changeset(),c.stamp=l,s.runAfter(()=>{a.modified=!0,s.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Wn:L(n)||qd(n)?n:cN(n),c.remove(f)),t&&c.insert(t),i&&(f=cN(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function gJ(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function mJ(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const fN={};function yJ(e,t){const n=fN[t]||(fN[t]=qn(t));return L(e)?e.map(n):n(e)}function $2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function S2(e){return $2(e)||(K(e)?e:null)}function bJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return $2(e).join(...n)}function vJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).indexOf(...n)}function xJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).lastIndexOf(...n)}function wJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).slice(...n)}function EJ(e,t,n){return ce(n)&&R("Function argument passed to replace."),String(e).replace(t,n)}function _J(e){return $2(e).slice().reverse()}function $J(e,t,n){return nb(e||0,t||0,n||0)}function SJ(e,t){const n=sr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function AJ(e,t){const n=sr(e,(t||this).context);return n?n.copy():void 0}function kJ(e,t){const n=sr(e,(t||this).context);return n?n.domain():[]}function CJ(e,t,n){const i=sr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function MJ(e,t){const n=sr(e,(t||this).context);return n&&n.range?n.range():[]}function FJ(e,t,n){const i=sr(e,(n||this).context);return i?i(t):void 0}function TJ(e,t,n,i,r){e=sr(e,(r||this).context);const o=oM(t,n);let s=e.domain(),a=s[0],u=ve(s),l=Rt;return u-a?l=WC(e,a,u):e=(e.interpolator?Se("sequential")().interpolator(e.interpolator()):Se("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(s=e.ticks(+i||15),a!==s[0]&&s.unshift(a),u!==ve(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function OJ(e,t,n){const i=sr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function NJ(e){let t=null;return function(n){return n?vc(n,t=t||bu(e)):e}}const dN=e=>e.data;function hN(e,t){const n=rN.call(t,e);return n.root&&n.root.lookup||{}}function DJ(e,t,n){const i=hN(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(dN):void 0}function RJ(e,t){const n=hN(e,this)[t];return n?n.ancestors().map(dN):void 0}const pN=()=>typeof window<"u"&&window||null;function PJ(){const e=pN();return e?e.screen:{}}function LJ(){const e=pN();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function IJ(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function gN(e,t,n){if(!e)return[];const[i,r]=e,o=new nt().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return AF(s,o,zJ(t))}function zJ(e){let t=null;if(e){const n=X(e.marktype),i=X(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function BJ(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=X(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function UJ(e){return X(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function jJ(e,t,n){const{x:i,y:r,mark:o}=n,s=new nt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<s.x1&&(s.x1=u),u>s.x2&&(s.x2=u),l<s.y1&&(s.y1=l),l>s.y2&&(s.y2=l);return s.translate(i,r),gN([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>qJ(u.x,u.y,t))}function qJ(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[s,a]=n[o],[u,l]=n[r];l>t!=a>t&&e<(s-u)*(t-l)/(a-l)+u&&i++}return i&1}const Ef={random(){return Vn()},cumulativeNormal:Zd,cumulativeLogNormal:P1,cumulativeUniform:B1,densityNormal:T1,densityLogNormal:R1,densityUniform:z1,quantileNormal:Jd,quantileLogNormal:L1,quantileUniform:U1,sampleNormal:Kd,sampleLogNormal:D1,sampleUniform:I1,isArray:L,isBoolean:mo,isDate:yo,isDefined(e){return e!==void 0},isNumber:_e,isObject:Y,isRegExp:m$,isString:K,isTuple:qd,isValid(e){return e!=null&&e===e},toBoolean:B0,toDate(e){return U0(e)},toNumber:Pt,toString:j0,indexof:vJ,join:bJ,lastindexof:xJ,replace:EJ,reverse:_J,slice:wJ,flush:p$,lerp:y$,merge:dJ,pad:x$,peek:ve,pluck:yJ,span:Il,inrange:Va,truncate:w$,rgb:Fo,lab:yh,hcl:bh,hsl:ph,luminance:_2,contrast:fJ,sequence:Mn,format:HZ,utcFormat:GZ,utcParse:YZ,utcOffset:cS,utcSequence:hS,timeFormat:oN,timeParse:VZ,timeOffset:lS,timeSequence:dS,timeUnitSpecifier:J$,monthFormat:XZ,monthAbbrevFormat:KZ,dayFormat:ZZ,dayAbbrevFormat:JZ,quarter:c$,utcquarter:f$,week:eS,utcweek:iS,dayofyear:Q$,utcdayofyear:nS,warn:uJ,info:lJ,debug:cJ,extent(e){return Bi(e)},inScope:aJ,intersect:gN,clampRange:d$,pinchDistance:gJ,pinchAngle:mJ,screen:PJ,containerSize:IJ,windowSize:LJ,bandspace:$J,setdata:qZ,pathShape:NJ,panLinear:s$,panLog:a$,panPow:u$,panSymlog:l$,zoomLinear:D0,zoomLog:R0,zoomPow:Ed,zoomSymlog:P0,encode:WZ,modify:pJ,lassoAppend:BJ,lassoPath:UJ,intersectLasso:jJ},WJ=["view","item","group","xy","x","y"],HJ="event.vega.",mN="this.",A2={},yN={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(sN+e)}]`,functions:GJ,constants:XO,visitors:A2},k2=ZO(yN);function GJ(e){const t=KO(e);WJ.forEach(n=>t[n]=HJ+n);for(const n in Ef)t[n]=mN+n;return fe(t,nJ(e,Ef,A2)),t}function Qe(e,t,n){return arguments.length===1?Ef[e]:(Ef[e]=t,n&&(A2[e]=n),k2&&(k2.functions[e]=mN+e),this)}Qe("bandwidth",SJ,ln),Qe("copy",AJ,ln),Qe("domain",kJ,ln),Qe("range",MJ,ln),Qe("invert",CJ,ln),Qe("scale",FJ,ln),Qe("gradient",TJ,ln),Qe("geoArea",iJ,ln),Qe("geoBounds",rJ,ln),Qe("geoCentroid",oJ,ln),Qe("geoShape",OJ,ln),Qe("geoScale",sJ,ln),Qe("indata",jZ,tJ),Qe("data",rN,v2),Qe("treePath",DJ,v2),Qe("treeAncestors",RJ,v2),Qe("vlSelectionTest",DZ,y2),Qe("vlSelectionIdTest",LZ,y2),Qe("vlSelectionResolve",zZ,y2),Qe("vlSelectionTuples",IZ);function ar(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=p2(e)}catch{R("Expression parse error: "+e)}i.visit(o=>{if(o.type!==RO)return;const s=o.callee.name,a=yN.visitors[s];a&&a(s,o.arguments,t,n)});const r=k2(i);return r.globals.forEach(o=>{const s=sN+o;!Z(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:fe({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function VJ(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(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const YJ=li(["rule"]),bN=li(["group","image","rect"]);function XJ(e,t){let n="";return YJ[t]||(e.x2&&(e.x?(bN[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?(bN[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}function C2(e){return(e+"").toLowerCase()}function KJ(e){return C2(e)==="operator"}function ZJ(e){return C2(e)==="collect"}function _f(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function JJ(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
46
+ `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?pI(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function mI(e){return e}function yI(e){if(e==null)return mI;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+o,f[1]=(n+=a[1])*r+s;l<c;)f[l]=a[l],++l;return f}}function bI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function vI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return S$(e,n)})}:S$(e,t)}function S$(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=A$(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function A$(e,t){var n=yI(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&bI(f,p)}function o(c){return n(c)}function s(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=s(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=s(c.arcs);break;case"MultiLineString":d=c.arcs.map(s);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function xI(e,t){var n={},i={},r={},o=[],s=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function wI(e){return A$(e,EI.apply(this,arguments))}function EI(e,t,n){var i,r,o;if(arguments.length>1)i=_I(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:xI(e,i)}}function _I(e,t,n){var i=[],r=[],o;function s(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function kr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $I(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ya(e){let t,n,i;e.length!==2?(t=kr,n=(a,u)=>kr(e(a),u),i=(a,u)=>e(a)-u):(t=e===kr||e===$I?e:SI,n=e,i=e);function r(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function s(a,u,l=0,c=a.length){const f=r(a,u,l,c-1);return f>l&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:s,right:o}}function SI(){return 0}function k$(e){return e===null?NaN:+e}function*AI(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const C$=Ya(kr),vo=C$.right,kI=C$.left;Ya(k$).center;function CI(e,t){let n=0,i,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(i=s-r,r+=i/++n,o+=i*(s-r));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,o+=i*(a-r))}if(n>1)return o/(n-1)}function MI(e,t){const n=CI(e,t);return n&&Math.sqrt(n)}class Xt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[i++]=a),t=s}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,o,s=0;if(n>0){for(s=t[--n];n>0&&(i=s,r=t[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class M$ extends Map{constructor(t,n=O$){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(G0(this,t))}has(t){return super.has(G0(this,t))}set(t,n){return super.set(F$(this,t),n)}delete(t){return super.delete(T$(this,t))}}class Ad extends Set{constructor(t,n=O$){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(G0(this,t))}add(t){return super.add(F$(this,t))}delete(t){return super.delete(T$(this,t))}}function G0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function F$({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function T$({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function O$(e){return e!==null&&typeof e=="object"?e.valueOf():e}function FI(e,t){return Array.from(t,n=>e[n])}function TI(e=kr){if(e===kr)return D$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function D$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const OI=Math.sqrt(50),DI=Math.sqrt(10),NI=Math.sqrt(2);function kd(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=OI?10:o>=DI?5:o>=NI?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/s,a=Math.round(e*l),u=Math.round(t*l),a/l<e&&++a,u/l>t&&--u,l=-l):(l=Math.pow(10,r)*s,a=Math.round(e/l),u=Math.round(t/l),a*l<e&&++a,u*l>t&&--u),u<a&&.5<=n&&n<2?kd(e,t,n*2):[a,u,l]}function V0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,o,s]=i?kd(t,e,n):kd(e,t,n);if(!(o>=r))return[];const a=o-r+1,u=new Array(a);if(i)if(s<0)for(let l=0;l<a;++l)u[l]=(o-l)/-s;else for(let l=0;l<a;++l)u[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)u[l]=(r+l)/-s;else for(let l=0;l<a;++l)u[l]=(r+l)*s;return u}function Y0(e,t,n){return t=+t,e=+e,n=+n,kd(e,t,n)[2]}function xo(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?Y0(t,e,n):Y0(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function Es(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function X0(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function N$(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?D$:TI(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));N$(e,t,h,p,r)}const o=e[t];let s=n,a=i;for(Ul(e,n,t),r(e[i],o)>0&&Ul(e,n,i);s<a;){for(Ul(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Ul(e,n,a):(++a,Ul(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Ul(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function K0(e,t,n){if(e=Float64Array.from(AI(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return X0(e);if(t>=1)return Es(e);var i,r=(i-1)*t,o=Math.floor(r),s=Es(N$(e,o).subarray(0,o+1)),a=X0(e.subarray(o+1));return s+(a-s)*(r-o)}}function R$(e,t,n=k$){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}}function RI(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function P$(e,t){return K0(e,.5,t)}function*PI(e){for(const t of e)yield*t}function L$(e){return Array.from(PI(e))}function Mn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++i<r;)o[i]=e+i*n;return o}function I$(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function LI(e,...t){e=new Ad(e),t=t.map(II);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function II(e){return e instanceof Ad?e:new Ad(e)}function zI(...e){const t=new Ad;for(const n of e)for(const i of n)t.add(i);return t}function BI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Cd(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Xa(e){return e=Cd(Math.abs(e)),e?e[1]:NaN}function UI(e,t){return function(n,i){for(var r=n.length,o=[],s=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),o.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function jI(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var qI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _s(e){if(!(t=qI.exec(e)))throw new Error("invalid format: "+e);var t;return new Z0({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]})}_s.prototype=Z0.prototype;function Z0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Z0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function WI(e){e:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var z$;function HI(e,t){var n=Cd(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(z$=Math.max(-8,Math.min(8,Math.floor(r/3)))*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")+Cd(e,Math.max(0,t+o-1))[0]}function B$(e,t){var n=Cd(e,t);if(!n)return e+"";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")}const U$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:BI,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)=>B$(e*100,t),r:B$,s:HI,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function j$(e){return e}var q$=Array.prototype.map,W$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function H$(e){var t=e.grouping===void 0||e.thousands===void 0?j$:UI(q$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?j$:jI(q$.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=_s(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,w=f.type;w==="n"?(b=!0,w="g"):U$[w]||(v===void 0&&(v=12),x=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",E=g==="$"?i:/[%p]/.test(w)?s:"",$=U$[w],S=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function M(k){var D=_,A=E,F,C,T;if(w==="c")A=$(k)+A,k="";else{k=+k;var P=k<0||1/k<0;if(k=isNaN(k)?u:$(Math.abs(k),v),x&&(k=WI(k)),P&&+k==0&&p!=="+"&&(P=!1),D=(P?p==="("?p:a:p==="-"||p==="("?"":p)+D,A=(w==="s"?W$[8+z$/3]:"")+A+(P&&p==="("?")":""),S){for(F=-1,C=k.length;++F<C;)if(T=k.charCodeAt(F),48>T||T>57){A=(T===46?r+k.slice(F+1):k.slice(F))+A,k=k.slice(0,F);break}}}b&&!m&&(k=t(k,1/0));var I=D.length+k.length+A.length,z=I<y?new Array(y-I+1).join(d):"";switch(b&&m&&(k=t(z+k,z.length?y-A.length:1/0),z=""),h){case"<":k=D+k+A+z;break;case"=":k=D+z+k+A;break;case"^":k=z.slice(0,I=z.length>>1)+D+k+A+z.slice(I);break;default:k=z+D+k+A;break}return o(k)}return M.toString=function(){return f+""},M}function c(f,d){var h=l((f=_s(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Xa(d)/3)))*3,g=Math.pow(10,-p),m=W$[8+p/3];return function(y){return h(g*y)+m}}return{format:l,formatPrefix:c}}var Md,Fd,J0;GI({thousands:",",grouping:[3],currency:["$",""]});function GI(e){return Md=H$(e),Fd=Md.format,J0=Md.formatPrefix,Md}function G$(e){return Math.max(0,-Xa(Math.abs(e)))}function V$(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xa(t)/3)))*3-Xa(Math.abs(e)))}function Y$(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xa(t)-Xa(e))+1}const Q0=new Date,e1=new Date;function it(e,t,n,i){function r(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(e(o=new Date(+o)),o),r.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const u=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return u;let l;do u.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return u},r.filter=o=>it(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(r.count=(o,s)=>(Q0.setTime(+o),e1.setTime(+s),e(Q0),e(e1),Math.floor(n(Q0,e1))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const Ka=it(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ka.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?it(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ka),Ka.range;const Cr=1e3,Hn=Cr*60,Mr=Hn*60,Fr=Mr*24,t1=Fr*7,X$=Fr*30,n1=Fr*365,Tr=it(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCSeconds());Tr.range;const Td=it(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getMinutes());Td.range;const Od=it(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getUTCMinutes());Od.range;const Dd=it(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr-e.getMinutes()*Hn)},(e,t)=>{e.setTime(+e+t*Mr)},(e,t)=>(t-e)/Mr,e=>e.getHours());Dd.range;const Nd=it(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Mr)},(e,t)=>(t-e)/Mr,e=>e.getUTCHours());Nd.range;const Or=it(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hn)/Fr,e=>e.getDate()-1);Or.range;const wo=it(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Fr,e=>e.getUTCDate()-1);wo.range;const K$=it(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Fr,e=>Math.floor(e/Fr));K$.range;function $s(e){return it(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Hn)/t1)}const Za=$s(0),Rd=$s(1),VI=$s(2),YI=$s(3),Ja=$s(4),XI=$s(5),KI=$s(6);Za.range,Rd.range,VI.range,YI.range,Ja.range,XI.range,KI.range;function Ss(e){return it(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/t1)}const Qa=Ss(0),Pd=Ss(1),ZI=Ss(2),JI=Ss(3),eu=Ss(4),QI=Ss(5),ez=Ss(6);Qa.range,Pd.range,ZI.range,JI.range,eu.range,QI.range,ez.range;const jl=it(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());jl.range;const ql=it(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ql.range;const Ui=it(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());Ui.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:it(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)}),Ui.range;const ji=it(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());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:it(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)}),ji.range;function Z$(e,t,n,i,r,o){const s=[[Tr,1,Cr],[Tr,5,5*Cr],[Tr,15,15*Cr],[Tr,30,30*Cr],[o,1,Hn],[o,5,5*Hn],[o,15,15*Hn],[o,30,30*Hn],[r,1,Mr],[r,3,3*Mr],[r,6,6*Mr],[r,12,12*Mr],[i,1,Fr],[i,2,2*Fr],[n,1,t1],[t,1,X$],[t,3,3*X$],[e,1,n1]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){const d=Math.abs(c-l)/f,h=Ya(([,,m])=>m).right(s,d);if(h===s.length)return e.every(xo(l/n1,c/n1,f));if(h===0)return Ka.every(Math.max(xo(l,c,f),1));const[p,g]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(g)}return[a,u]}const[tz,nz]=Z$(ji,ql,Qa,K$,Nd,Od),[iz,rz]=Z$(Ui,jl,Za,Or,Dd,Td),Et="year",gn="quarter",It="month",rt="week",mn="date",zt="day",qi="dayofyear",Fn="hours",Tn="minutes",Gn="seconds",ci="milliseconds",i1=[Et,gn,It,rt,mn,zt,qi,Fn,Tn,Gn,ci],r1=i1.reduce((e,t,n)=>(e[t]=1+n,e),{});function o1(e){const t=X(e).slice(),n={};return t.length||R("Missing time unit."),t.forEach(r=>{Z(r1,r)?n[r]=1:R(`Invalid time unit: ${r}.`)}),(n[rt]||n[zt]?1:0)+(n[gn]||n[It]||n[mn]?1:0)+(n[qi]?1:0)>1&&R(`Incompatible time units: ${e}`),t.sort((r,o)=>r1[r]-r1[o]),t}const oz={[Et]:"%Y ",[gn]:"Q%q ",[It]:"%b ",[mn]:"%d ",[rt]:"W%U ",[zt]:"%a ",[qi]:"%j ",[Fn]:"%H:00",[Tn]:"00:%M",[Gn]:":%S",[ci]:".%L",[`${Et}-${It}`]:"%Y-%m ",[`${Et}-${It}-${mn}`]:"%Y-%m-%d ",[`${Fn}-${Tn}`]:"%H:%M"};function J$(e,t){const n=fe({},oz,t),i=o1(e),r=i.length;let o="",s=0,a,u;for(s=0;s<r;)for(a=i.length;a>s;--a)if(u=i.slice(s,a).join("-"),n[u]!=null){o+=n[u],s=a;break}return o.trim()}const As=new Date;function s1(e){return As.setFullYear(e),As.setMonth(0),As.setDate(1),As.setHours(0,0,0,0),As}function Q$(e){return tS(new Date(e))}function eS(e){return a1(new Date(e))}function tS(e){return Or.count(s1(e.getFullYear())-1,e)}function a1(e){return Za.count(s1(e.getFullYear())-1,e)}function u1(e){return s1(e).getDay()}function sz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);return a.setFullYear(e),a}return new Date(e,t,n,i,r,o,s)}function nS(e){return rS(new Date(e))}function iS(e){return l1(new Date(e))}function rS(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return wo.count(t-1,e)}function l1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Qa.count(t-1,e)}function c1(e){return As.setTime(Date.UTC(e,0,1)),As.getUTCDay()}function az(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,o,s))}function oS(e,t,n,i,r){const o=t||1,s=ve(e),a=(y,b,v)=>(v=v||y,uz(n[v],i[v],y===s&&o,b)),u=new Date,l=li(e),c=l[Et]?a(Et):Lt(2012),f=l[It]?a(It):l[gn]?a(gn):po,d=l[rt]&&l[zt]?a(zt,1,rt+zt):l[rt]?a(rt,1):l[zt]?a(zt,1):l[mn]?a(mn,1):l[qi]?a(qi,1):qa,h=l[Fn]?a(Fn):po,p=l[Tn]?a(Tn):po,g=l[Gn]?a(Gn):po,m=l[ci]?a(ci):po;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function uz(e,t,n,i){const r=n<=1?e:i?(o,s)=>i+n*Math.floor((e(o,s)-i)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(r(o,s),s):r}function tu(e,t,n){return t+e*7-(n+6)%7}const lz={[Et]:e=>e.getFullYear(),[gn]:e=>Math.floor(e.getMonth()/3),[It]:e=>e.getMonth(),[mn]:e=>e.getDate(),[Fn]:e=>e.getHours(),[Tn]:e=>e.getMinutes(),[Gn]:e=>e.getSeconds(),[ci]:e=>e.getMilliseconds(),[qi]:e=>tS(e),[rt]:e=>a1(e),[rt+zt]:(e,t)=>tu(a1(e),e.getDay(),u1(t)),[zt]:(e,t)=>tu(1,e.getDay(),u1(t))},cz={[gn]:e=>3*e,[rt]:(e,t)=>tu(e,0,u1(t))};function sS(e,t){return oS(e,t||1,lz,cz,sz)}const fz={[Et]:e=>e.getUTCFullYear(),[gn]:e=>Math.floor(e.getUTCMonth()/3),[It]:e=>e.getUTCMonth(),[mn]:e=>e.getUTCDate(),[Fn]:e=>e.getUTCHours(),[Tn]:e=>e.getUTCMinutes(),[Gn]:e=>e.getUTCSeconds(),[ci]:e=>e.getUTCMilliseconds(),[qi]:e=>rS(e),[rt]:e=>l1(e),[zt]:(e,t)=>tu(1,e.getUTCDay(),c1(t)),[rt+zt]:(e,t)=>tu(l1(e),e.getUTCDay(),c1(t))},dz={[gn]:e=>3*e,[rt]:(e,t)=>tu(e,0,c1(t))};function aS(e,t){return oS(e,t||1,fz,dz,az)}const hz={[Et]:Ui,[gn]:jl.every(3),[It]:jl,[rt]:Za,[mn]:Or,[zt]:Or,[qi]:Or,[Fn]:Dd,[Tn]:Td,[Gn]:Tr,[ci]:Ka},pz={[Et]:ji,[gn]:ql.every(3),[It]:ql,[rt]:Qa,[mn]:wo,[zt]:wo,[qi]:wo,[Fn]:Nd,[Tn]:Od,[Gn]:Tr,[ci]:Ka};function nu(e){return hz[e]}function iu(e){return pz[e]}function uS(e,t,n){return e?e.offset(t,n):void 0}function lS(e,t,n){return uS(nu(e),t,n)}function cS(e,t,n){return uS(iu(e),t,n)}function fS(e,t,n,i){return e?e.range(t,n,i):void 0}function dS(e,t,n,i){return fS(nu(e),t,n,i)}function hS(e,t,n,i){return fS(iu(e),t,n,i)}const Wl=1e3,Hl=Wl*60,Gl=Hl*60,Ld=Gl*24,gz=Ld*7,pS=Ld*30,f1=Ld*365,gS=[Et,It,mn,Fn,Tn,Gn,ci],Vl=gS.slice(0,-1),Yl=Vl.slice(0,-1),Xl=Yl.slice(0,-1),mz=Xl.slice(0,-1),yz=[Et,rt],mS=[Et,It],yS=[Et],Kl=[[Vl,1,Wl],[Vl,5,5*Wl],[Vl,15,15*Wl],[Vl,30,30*Wl],[Yl,1,Hl],[Yl,5,5*Hl],[Yl,15,15*Hl],[Yl,30,30*Hl],[Xl,1,Gl],[Xl,3,3*Gl],[Xl,6,6*Gl],[Xl,12,12*Gl],[mz,1,Ld],[yz,1,gz],[mS,1,pS],[mS,3,3*pS],[yS,1,f1]];function bS(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(zl(t))/n;let r=Ya(a=>a[2]).right(Kl,i),o,s;return r===Kl.length?(o=yS,s=xo(t[0]/f1,t[1]/f1,n)):r?(r=Kl[i/Kl[r-1][2]<Kl[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=gS,s=Math.max(xo(t[0],t[1],n),1)),{units:o,step:s}}function d1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function h1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function vS(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,u=e.shortMonths,l=Jl(r),c=Ql(r),f=Jl(o),d=Ql(o),h=Jl(s),p=Ql(s),g=Jl(a),m=Ql(a),y=Jl(u),b=Ql(u),v={a:P,A:I,b:z,B:te,c:null,d:SS,e:SS,f:Bz,g:Kz,G:Jz,H:Lz,I:Iz,j:zz,L:AS,m:Uz,M:jz,p:ne,q:de,Q:OS,s:DS,S:qz,u:Wz,U:Hz,V:Gz,w:Vz,W:Yz,x:null,X:null,y:Xz,Y:Zz,Z:Qz,"%":TS},x={a:ke,A:Ee,b:Ie,B:$r,c:null,d:CS,e:CS,f:i8,g:h8,G:g8,H:e8,I:t8,j:n8,L:MS,m:r8,M:o8,p:Ia,q:ms,Q:OS,s:DS,S:s8,u:a8,U:u8,V:l8,w:c8,W:f8,x:null,X:null,y:d8,Y:p8,Z:m8,"%":TS},w={a:M,A:k,b:D,B:A,c:F,d:_S,e:_S,f:Dz,g:ES,G:wS,H:$S,I:$S,j:Mz,L:Oz,m:Cz,M:Fz,p:S,q:kz,Q:Rz,s:Pz,S:Tz,u:Ez,U:_z,V:$z,w:wz,W:Sz,x:C,X:T,y:ES,Y:wS,Z:Az,"%":Nz};v.x=_(n,v),v.X=_(i,v),v.c=_(t,v),x.x=_(n,x),x.X=_(i,x),x.c=_(t,x);function _(J,he){return function(me){var W=[],Ot=-1,Oe=0,Yt=J.length,wt,Sr,m0;for(me instanceof Date||(me=new Date(+me));++Ot<Yt;)J.charCodeAt(Ot)===37&&(W.push(J.slice(Oe,Ot)),(Sr=xS[wt=J.charAt(++Ot)])!=null?wt=J.charAt(++Ot):Sr=wt==="e"?" ":"0",(m0=he[wt])&&(wt=m0(me,Sr)),W.push(wt),Oe=Ot+1);return W.push(J.slice(Oe,Ot)),W.join("")}}function E(J,he){return function(me){var W=Zl(1900,void 0,1),Ot=$(W,J,me+="",0),Oe,Yt;if(Ot!=me.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(he&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Oe=h1(Zl(W.y,0,1)),Yt=Oe.getUTCDay(),Oe=Yt>4||Yt===0?Pd.ceil(Oe):Pd(Oe),Oe=wo.offset(Oe,(W.V-1)*7),W.y=Oe.getUTCFullYear(),W.m=Oe.getUTCMonth(),W.d=Oe.getUTCDate()+(W.w+6)%7):(Oe=d1(Zl(W.y,0,1)),Yt=Oe.getDay(),Oe=Yt>4||Yt===0?Rd.ceil(Oe):Rd(Oe),Oe=Or.offset(Oe,(W.V-1)*7),W.y=Oe.getFullYear(),W.m=Oe.getMonth(),W.d=Oe.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Yt="Z"in W?h1(Zl(W.y,0,1)).getUTCDay():d1(Zl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Yt+5)%7:W.w+W.U*7-(Yt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,h1(W)):d1(W)}}function $(J,he,me,W){for(var Ot=0,Oe=he.length,Yt=me.length,wt,Sr;Ot<Oe;){if(W>=Yt)return-1;if(wt=he.charCodeAt(Ot++),wt===37){if(wt=he.charAt(Ot++),Sr=w[wt in xS?he.charAt(Ot++):wt],!Sr||(W=Sr(J,me,W))<0)return-1}else if(wt!=me.charCodeAt(W++))return-1}return W}function S(J,he,me){var W=l.exec(he.slice(me));return W?(J.p=c.get(W[0].toLowerCase()),me+W[0].length):-1}function M(J,he,me){var W=h.exec(he.slice(me));return W?(J.w=p.get(W[0].toLowerCase()),me+W[0].length):-1}function k(J,he,me){var W=f.exec(he.slice(me));return W?(J.w=d.get(W[0].toLowerCase()),me+W[0].length):-1}function D(J,he,me){var W=y.exec(he.slice(me));return W?(J.m=b.get(W[0].toLowerCase()),me+W[0].length):-1}function A(J,he,me){var W=g.exec(he.slice(me));return W?(J.m=m.get(W[0].toLowerCase()),me+W[0].length):-1}function F(J,he,me){return $(J,t,he,me)}function C(J,he,me){return $(J,n,he,me)}function T(J,he,me){return $(J,i,he,me)}function P(J){return s[J.getDay()]}function I(J){return o[J.getDay()]}function z(J){return u[J.getMonth()]}function te(J){return a[J.getMonth()]}function ne(J){return r[+(J.getHours()>=12)]}function de(J){return 1+~~(J.getMonth()/3)}function ke(J){return s[J.getUTCDay()]}function Ee(J){return o[J.getUTCDay()]}function Ie(J){return u[J.getUTCMonth()]}function $r(J){return a[J.getUTCMonth()]}function Ia(J){return r[+(J.getUTCHours()>=12)]}function ms(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var he=_(J+="",v);return he.toString=function(){return J},he},parse:function(J){var he=E(J+="",!1);return he.toString=function(){return J},he},utcFormat:function(J){var he=_(J+="",x);return he.toString=function(){return J},he},utcParse:function(J){var he=E(J+="",!0);return he.toString=function(){return J},he}}}var xS={"-":"",_:" ",0:"0"},ft=/^\s*\d+/,bz=/^%/,vz=/[\\^$*+?|[\]().{}]/g;function $e(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function xz(e){return e.replace(vz,"\\$&")}function Jl(e){return new RegExp("^(?:"+e.map(xz).join("|")+")","i")}function Ql(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function wz(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Ez(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function _z(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function $z(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Sz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function wS(e,t,n){var i=ft.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function ES(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Az(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function kz(e,t,n){var i=ft.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Cz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function _S(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Mz(e,t,n){var i=ft.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function $S(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Fz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Tz(e,t,n){var i=ft.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Oz(e,t,n){var i=ft.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Dz(e,t,n){var i=ft.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Nz(e,t,n){var i=bz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Rz(e,t,n){var i=ft.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Pz(e,t,n){var i=ft.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function SS(e,t){return $e(e.getDate(),t,2)}function Lz(e,t){return $e(e.getHours(),t,2)}function Iz(e,t){return $e(e.getHours()%12||12,t,2)}function zz(e,t){return $e(1+Or.count(Ui(e),e),t,3)}function AS(e,t){return $e(e.getMilliseconds(),t,3)}function Bz(e,t){return AS(e,t)+"000"}function Uz(e,t){return $e(e.getMonth()+1,t,2)}function jz(e,t){return $e(e.getMinutes(),t,2)}function qz(e,t){return $e(e.getSeconds(),t,2)}function Wz(e){var t=e.getDay();return t===0?7:t}function Hz(e,t){return $e(Za.count(Ui(e)-1,e),t,2)}function kS(e){var t=e.getDay();return t>=4||t===0?Ja(e):Ja.ceil(e)}function Gz(e,t){return e=kS(e),$e(Ja.count(Ui(e),e)+(Ui(e).getDay()===4),t,2)}function Vz(e){return e.getDay()}function Yz(e,t){return $e(Rd.count(Ui(e)-1,e),t,2)}function Xz(e,t){return $e(e.getFullYear()%100,t,2)}function Kz(e,t){return e=kS(e),$e(e.getFullYear()%100,t,2)}function Zz(e,t){return $e(e.getFullYear()%1e4,t,4)}function Jz(e,t){var n=e.getDay();return e=n>=4||n===0?Ja(e):Ja.ceil(e),$e(e.getFullYear()%1e4,t,4)}function Qz(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function CS(e,t){return $e(e.getUTCDate(),t,2)}function e8(e,t){return $e(e.getUTCHours(),t,2)}function t8(e,t){return $e(e.getUTCHours()%12||12,t,2)}function n8(e,t){return $e(1+wo.count(ji(e),e),t,3)}function MS(e,t){return $e(e.getUTCMilliseconds(),t,3)}function i8(e,t){return MS(e,t)+"000"}function r8(e,t){return $e(e.getUTCMonth()+1,t,2)}function o8(e,t){return $e(e.getUTCMinutes(),t,2)}function s8(e,t){return $e(e.getUTCSeconds(),t,2)}function a8(e){var t=e.getUTCDay();return t===0?7:t}function u8(e,t){return $e(Qa.count(ji(e)-1,e),t,2)}function FS(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function l8(e,t){return e=FS(e),$e(eu.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function c8(e){return e.getUTCDay()}function f8(e,t){return $e(Pd.count(ji(e)-1,e),t,2)}function d8(e,t){return $e(e.getUTCFullYear()%100,t,2)}function h8(e,t){return e=FS(e),$e(e.getUTCFullYear()%100,t,2)}function p8(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function g8(e,t){var n=e.getUTCDay();return e=n>=4||n===0?eu(e):eu.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function m8(){return"+0000"}function TS(){return"%"}function OS(e){return+e}function DS(e){return Math.floor(+e/1e3)}var ru,p1,NS,g1,RS;y8({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"]});function y8(e){return ru=vS(e),p1=ru.format,NS=ru.parse,g1=ru.utcFormat,RS=ru.utcParse,ru}function ec(e){const t={};return n=>t[n]||(t[n]=e(n))}function b8(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=v8(i,r);const s=o<i.length?i.slice(o):"";for(;--o>r;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function v8(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function PS(e){const t=ec(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=_s(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return b8(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=_s(s??",f");const a=xo(i,r,o),u=Math.max(Math.abs(i),Math.abs(r));let l;if(s.precision==null)switch(s.type){case"s":return isNaN(l=V$(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=Y$(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=G$(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let m1;LS();function LS(){return m1=PS({format:Fd,formatPrefix:J0})}function IS(e){return PS(H$(e))}function Id(e){return arguments.length?m1=IS(e):m1}function zS(e,t,n){n=n||{},Y(n)||R(`Invalid time multi-format specifier: ${n}`);const i=t(Gn),r=t(Tn),o=t(Fn),s=t(mn),a=t(rt),u=t(It),l=t(gn),c=t(Et),f=e(n[ci]||".%L"),d=e(n[Gn]||":%S"),h=e(n[Tn]||"%I:%M"),p=e(n[Fn]||"%I %p"),g=e(n[mn]||n[zt]||"%a %d"),m=e(n[rt]||"%b %d"),y=e(n[It]||"%B"),b=e(n[gn]||"%B"),v=e(n[Et]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:o(x)<x?h:s(x)<x?p:u(x)<x?a(x)<x?g:m:c(x)<x?l(x)<x?y:b:v)(x)}function BS(e){const t=ec(e.format),n=ec(e.utcFormat);return{timeFormat:i=>K(i)?t(i):zS(t,nu,i),utcFormat:i=>K(i)?n(i):zS(n,iu,i),timeParse:ec(e.parse),utcParse:ec(e.utcParse)}}let y1;US();function US(){return y1=BS({format:p1,parse:NS,utcFormat:g1,utcParse:RS})}function jS(e){return BS(vS(e))}function tc(e){return arguments.length?y1=jS(e):y1}const b1=(e,t)=>fe({},e,t);function qS(e,t){const n=e?IS(e):Id(),i=t?jS(t):tc();return b1(n,i)}function v1(e,t){const n=arguments.length;return n&&n!==2&&R("defaultLocale expects either zero or two arguments."),n?b1(Id(e),tc(t)):b1(Id(),tc())}function x8(){return LS(),US(),v1()}const w8=/^(data:|([A-Za-z]+:)?\/\/)/,E8=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,_8=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,WS="file://";function $8(e,t){return n=>({options:n||{},sanitize:A8,load:S8,fileAccess:!!t,file:k8(t),http:M8(e)})}async function S8(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function A8(e,t){t=fe({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=E8.test(e.replace(_8,""));(e==null||typeof e!="string"||!a)&&R("Sanitize failure, invalid URI: "+H(e));const u=w8.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(WS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(WS.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function k8(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):C8}async function C8(){R("No file system access.")}function M8(e){return e?async function(t,n){const i=fe({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?ce(o[r])?o[r]():o.text():R(o.status+""+o.statusText)}:F8}async function F8(){R("No HTTP fetch method available.")}const T8=e=>e!=null&&e===e,O8=e=>e==="true"||e==="false"||e===!0||e===!1,D8=e=>!Number.isNaN(Date.parse(e)),HS=e=>!Number.isNaN(+e)&&!(e instanceof Date),N8=e=>HS(e)&&Number.isInteger(+e),x1={boolean:B0,integer:Pt,number:Pt,date:U0,string:j0,unknown:Rt},zd=[O8,N8,HS,D8],R8=["boolean","integer","number","date"];function GS(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=zd.length,r=zd.map((o,s)=>s+1);for(let o=0,s=0,a,u;o<n;++o)for(u=t?e[o][t]:e[o],a=0;a<i;++a)if(r[a]&&T8(u)&&!zd[a](u)&&(r[a]=0,++s,s===zd.length))return"string";return R8[r.reduce((o,s)=>o===0?s:o,0)-1]}function VS(e,t){return t.reduce((n,i)=>(n[i]=GS(e,i),n),{})}function YS(e){const t=function(n,i){const r={delimiter:e};return w1(n,i?fe(i,r):r)};return t.responseType="text",t}function w1(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
47
+ `+e),gI(t.delimiter).parse(e+"")}w1.responseType="text";function P8(e){return typeof Buffer=="function"&&ce(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function E1(e,t){const n=t&&t.property?qn(t.property):Rt;return Y(e)&&!P8(e)?L8(n(e),t):n(JSON.parse(e))}E1.responseType="json";function L8(e,t){return!L(e)&&g$(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const I8={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function XS(e,t){let n,i,r,o;return e=E1(e,t),t&&t.feature?(n=vI,r=t.feature):t&&t.mesh?(n=wI,r=t.mesh,o=I8[t.filter]):R("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):R("Invalid TopoJSON object: "+r),i&&i.features||[i]}XS.responseType="json";const Bd={dsv:w1,csv:YS(","),tsv:YS(" "),json:E1,topojson:XS};function _1(e,t){return arguments.length>1?(Bd[e]=t,this):Z(Bd,e)?Bd[e]:null}function KS(e){const t=_1(e);return t&&t.responseType||"text"}function ZS(e,t,n,i){t=t||{};const r=_1(t.type||"json");return r||R("Unknown data format type: "+t.type),e=r(e,t),t.parse&&z8(e,t.parse,n,i),Z(e,"columns")&&delete e.columns,e}function z8(e,t,n,i){if(!e.length)return;const r=tc();n=n||r.timeParse,i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,l,c,f;t==="auto"&&(t=VS(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!x1[p])throw Error("Illegal format pattern: "+h+":"+p);return x1[p]});for(u=0,c=e.length,f=o.length;u<c;++u)for(s=e[u],l=0;l<f;++l)a=o[l],s[a]=d[l](s[a])}const Ud=$8(typeof fetch<"u"&&fetch,null);function jd(e){const t=e||Rt,n=[],i={};return n.add=r=>{const o=t(r);return i[o]||(i[o]=1,n.push(r)),n},n.remove=r=>{const o=t(r);if(i[o]){i[o]=0;const s=n.indexOf(r);s>=0&&n.splice(s,1)}return n},n}async function qd(e,t){try{await t(e)}catch(n){e.error(n)}}const JS=Symbol("vega_id");let B8=1;function Wd(e){return!!(e&&ie(e))}function ie(e){return e[JS]}function QS(e,t){return e[JS]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return ie(t)?t:QS(t,B8++)}function $1(e){return Hd(e,Ce({}))}function Hd(e,t){for(const n in e)t[n]=e[n];return t}function eA(e,t){return QS(t,ie(e))}function ks(e,t){return e?t?(n,i)=>e(n,i)||ie(t(n))-ie(t(i)):(n,i)=>e(n,i)||ie(n)-ie(i):null}function tA(e){return e&&e.constructor===Cs}function Cs(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:Cs,insert(a){const u=X(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ce(a)?i:t,l=X(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Lt(l)};return ce(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ce(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[ie(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[ie(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[ie(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=ie(g),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[ie(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,s||(c[ie(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[ie(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[ie(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[ie(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||i.length))&&a.clean(!0),a}}}const Gd="_:mod:_";function Vd(){Object.defineProperty(this,Gd,{writable:!0,value:{}})}Vd.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[Gd];return t!=null&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(r[e]=n,s[e]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[Gd];if(arguments.length){if(L(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Gd]={},this}};let U8=0;const j8="pulse",q8=new Vd,W8=1,H8=2;function Le(e,t,n,i){this.id=++U8,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function nA(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Le.prototype={targets(){return this._targets||(this._targets=jd(Ll))},set(e){return this.value!==e?(this.value=e,1):0},skip:nA(W8),modified:nA(H8),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Vd,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Le?(h!==this&&(t&&h.targets().add(this),o.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(s in e)if(a=e[s],s===j8)X(a).forEach(f=>{f instanceof Le?f!==this&&(f.targets().add(this),o.push(f)):R("Pulse parameters must be operator instances.")}),this.source=a;else if(L(a))for(i.set(s,-1,Array(u=a.length)),l=0;l<u;++l)c(s,l,a[l]);else c(s,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||q8,n=this._argops;let i,r,o,s;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],o=i.op,s=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,s);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function G8(e,t,n,i){let r=1,o;return e instanceof Le?o=e:e&&e.prototype instanceof Le?o=new e:ce(e)?o=new Le(null,e):(r=0,o=new Le(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function V8(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let Y8=0;function Yd(e,t,n){this.id=++Y8,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Eo(e,t,n){return new Yd(e,t,n)}Yd.prototype={_filter:Wn,_apply:Rt,targets(){return this._targets||(this._targets=jd(Ll))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Eo(e);return this.targets().add(t),t},apply(e){const t=Eo(null,e);return this.targets().add(t),t},merge(){const e=Eo();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Eo();return this.targets().add(Eo(null,null,I0(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(Eo(null,null,()=>n=!0)),t.targets().add(Eo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Wn,this._targets=null}};function X8(e,t,n,i){const r=this,o=Eo(n,i),s=function(l){l.dataflow=r;try{o.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=X(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function K8(e,t){const n=this.locale();return ZS(e,t,n.timeParse,n.utcParse)}function Z8(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function J8(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:KS(t&&t.type)});try{r=n.parse(r,t)}catch(o){i=-2,n.warn("Data ingestion failed",e,o)}}catch(o){i=-1,n.warn("Loading failed",e,o)}return{data:r,status:i}}async function Q8(e,t,n){const i=this,r=i._pending||e9(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Wn).insert(o.data||[])),r.done(),o}function e9(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const t9={skip:!0};function n9(e,t,n,i,r){return(e instanceof Le?r9:i9)(this,e,t,n,i,r),this}function i9(e,t,n,i,r,o){const s=fe({},o,t9);let a,u;ce(n)||(n=Lt(n)),i===void 0?a=l=>e.touch(n(l)):ce(i)?(u=new Le(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;tA(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function r9(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Le(null,o9(n,i),r,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function o9(e,t){return t=ce(t)?t:Lt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function s9(e){e.rank=++this._rank}function a9(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&R("Cycle detected in dataflow graph.")}const Xd={},Wi=1,_o=2,Dr=4,u9=Wi|_o,iA=Wi|Dr,ou=Wi|_o|Dr,rA=8,nc=16,oA=32,sA=64;function $o(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function S1(e,t){const n=[];return bo(e,t,i=>n.push(i)),n}function aA(e,t){const n={};return e.visit(t,i=>{n[ie(i)]=1}),i=>n[ie(i)]?null:i}function Kd(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}$o.prototype={StopPropagation:Xd,ADD:Wi,REM:_o,MOD:Dr,ADD_REM:u9,ADD_MOD:iA,ALL:ou,REFLOW:rA,SOURCE:nc,NO_SOURCE:oA,NO_FIELDS:sA,fork(e){return new $o(this.dataflow).init(this,e)},clone(){const e=this.fork(ou);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(ou|nc)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new $o(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&&!(t&sA)&&(n.fields=e.fields),t&Wi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&_o?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Dr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&oA?(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||ou;return t&Wi&&this.add.length||t&_o&&this.rem.length||t&Dr&&this.mod.length},reflow(e){if(e)return this.fork(ou).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Dr,aA(this,Wi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Wi&&(n.addF=Kd(n.addF,t)),e&_o&&(n.remF=Kd(n.remF,t)),e&Dr&&(n.modF=Kd(n.modF,t)),e&nc&&(n.srcF=Kd(n.srcF,t)),n},materialize(e){e=e||ou;const t=this;return e&Wi&&t.addF&&(t.add=S1(t.add,t.addF),t.addF=null),e&_o&&t.remF&&(t.rem=S1(t.rem,t.remF),t.remF=null),e&Dr&&t.modF&&(t.mod=S1(t.mod,t.modF),t.modF=null),e&nc&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&nc)return bo(n.source,n.srcF,i),n;e&Wi&&bo(n.add,n.addF,i),e&_o&&bo(n.rem,n.remF,i),e&Dr&&bo(n.mod,n.modF,i);const r=n.source;if(e&rA&&r){const o=n.add.length+n.mod.length;o===r.length||(o?bo(r,aA(n,iA),i):bo(r,n.srcF,i))}return n}};function A1(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=r.fields||(r.fields={});for(const u in s.fields)a[u]=1}s.changed(r.ADD)&&(o|=r.ADD),s.changed(r.REM)&&(o|=r.REM),s.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}G(A1,$o,{fork(e){const t=new $o(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?L(e)?e.some(i=>n[i]):n[e]:0},filter(){R("MultiPulse does not support filtering.")},materialize(){R("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});async function l9(e,t,n){const i=this,r=[];if(i._pulse)return uA(i);if(i._pending&&await i._pending,t&&await qd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new $o(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=jd(Ll);let s=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Xd),u!==Xd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++s}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${s} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await qd(i,c[f].callback)}return n&&await qd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function c9(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function f9(e,t,n){return this._pulse?uA(this):(this.evaluate(e,t,n),this)}function d9(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function uA(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function h9(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function p9(e,t){const n=e.source,i=this._clock;return n&&L(n)?new A1(this,i,n.map(r=>r.pulse),t):this._input[e.id]||g9(this._pulse,n&&n.pulse)}function g9(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Xd&&(e.source=t.source),e)}const k1={skip:!1,force:!1};function m9(e,t){const n=t||k1;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function y9(e,t,n){const i=n||k1;return(e.set(t)||i.force)&&this.touch(e,i),this}function b9(e,t,n){this.touch(e,n||k1);const i=new $o(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function v9(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),lA(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,x9(t,0,e)):i=n,i}}}function lA(e,t,n,i){let r,o;const s=e[n];for(;n>t;){if(o=n-1>>1,r=e[o],i(s,r)<0){e[n]=r,n=o;continue}break}return e[n]=s}function x9(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,lA(e,i,t,n)}function su(){this.logger(D0()),this.logLevel(T0),this._clock=0,this._rank=0,this._locale=v1();try{this._loader=Ud()}catch{}this._touched=jd(Ll),this._input={},this._pulse=null,this._heap=v9((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ic(e){return function(){return this._log[e].apply(this,arguments)}}su.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:ic("error"),warn:ic("warn"),info:ic("info"),debug:ic("debug"),logLevel:ic("level"),cleanThreshold:1e4,add:G8,connect:V8,rank:s9,rerank:a9,pulse:b9,touch:m9,update:y9,changeset:Cs,ingest:Z8,parse:K8,preload:Q8,request:J8,events:X8,on:n9,evaluate:l9,run:f9,runAsync:c9,runAfter:d9,_enqueue:h9,_getPulse:p9};function O(e,t){Le.call(this,e,null,t)}G(O,Le,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):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 au={};function cA(e){const t=fA(e);return t&&t.Definition||null}function fA(e){return e=e&&e.toLowerCase(),Z(au,e)?au[e]:null}function*dA(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function C1(e,t,n){const i=Float64Array.from(dA(e,n));return i.sort(kr),t.map(r=>R$(i,r))}function M1(e,t){return C1(e,[.25,.5,.75],t)}function F1(e,t){const n=e.length,i=MI(e,t),r=M1(e,t),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 hA(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,l,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+g)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var Vn=Math.random;function w9(e){Vn=e}function pA(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(dA(e,i)),o=r.length,s=t;let a,u,l,c;for(l=0,c=Array(s);l<s;++l){for(a=0,u=0;u<o;++u)a+=r[~~(Vn()*o)];c[l]=a/o}return c.sort(kr),[K0(c,n/2),K0(c,1-n/2)]}function gA(e,t,n,i){i=i||(d=>d);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;s<a;++s)o[s]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;s<a;++s)o[s]=l;return n?E9(o,t+t/4):o}function E9(e,t){const n=e.length;let i=0,r=1,o,s;for(;e[i]===e[r];)++r;for(;r<n;){for(o=r+1;e[r]===e[o];)++o;if(e[r]-e[r-1]<t){for(s=r+(i+o-r-r>>1);s<r;)e[s++]=e[r];for(;s>r;)e[s--]=e[i]}i=r,r=o}return e}function _9(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function $9(e,t){t==null&&(t=e,e=0);let n,i,r;const o={min(s){return arguments.length?(n=s||0,r=i-n,o):n},max(s){return arguments.length?(i=s||0,r=i-n,o):i},sample(){return n+Math.floor(r*Vn())},pdf(s){return s===Math.floor(s)&&s>=n&&s<i?1/r:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=i?1:(a-n+1)/r},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*r):NaN}};return o.min(e).max(t)}const mA=Math.sqrt(2*Math.PI),S9=Math.SQRT2;let rc=NaN;function Zd(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(rc===rc)n=rc,rc=NaN;else{do n=Vn()*2-1,i=Vn()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,rc=i*o}return e+n*t}function T1(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*mA)}function Jd(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37)o=0;else{const s=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,o=s*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,o=o/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,o=s/a/2.506628274631)}return i>0?1-o:o}function Qd(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*S9*A9(2*e-1)}function A9(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function O1(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>Zd(n,i),pdf:o=>T1(o,n,i),cdf:o=>Jd(o,n,i),icdf:o=>Qd(o,n,i)};return r.mean(e).stdev(t)}function D1(e,t){const n=O1();let i=0;const r={data(o){return arguments.length?(e=o,i=o?o.length:0,r.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=F1(e)),r):t},sample(){return e[~~(Vn()*i)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<i;++a)s+=n.pdf((o-e[a])/t);return s/t/i},cdf(o){let s=0,a=0;for(;a<i;++a)s+=n.cdf((o-e[a])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function N1(e,t){return e=e||0,t=t??1,Math.exp(e+Zd()*t)}function R1(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*mA*e)}function P1(e,t,n){return Jd(Math.log(e),t,n)}function L1(e,t,n){return Math.exp(Qd(e,t,n))}function yA(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>N1(n,i),pdf:o=>R1(o,n,i),cdf:o=>P1(o,n,i),icdf:o=>L1(o,n,i)};return r.mean(e).stdev(t)}function bA(e,t){let n=0,i;function r(s){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=s[l]==null?1:+s[l];for(l=0;l<n;++l)a[l]/=u;return a}const o={weights(s){return arguments.length?(i=r(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=Vn();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(s<u){a=e[l];break}return a.sample()},pdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(s);return a},cdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function I1(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Vn()}function z1(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function B1(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function U1(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function vA(e,t){let n,i;const r={min(o){return arguments.length?(n=o||0,r):n},max(o){return arguments.length?(i=o??1,r):i},sample:()=>I1(n,i),pdf:o=>z1(o,n,i),cdf:o=>B1(o,n,i),icdf:o=>U1(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function j1(e,t,n){let i=0,r=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(i+=(s-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function oc(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function eh(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)o[a]-=u,s[a]-=l;return[o,s,u,l]}function sc(e,t,n,i){let r=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&i(o,s,++r)}function uu(e,t,n,i,r){let o=0,s=0;return sc(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function q1(e,t,n){let i=0,r=0,o=0,s=0,a=0;sc(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=oc(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:uu(e,t,n,r,l)}}function xA(e,t,n){let i=0,r=0,o=0,s=0,a=0;sc(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=oc(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:uu(e,t,n,r,l)}}function wA(e,t,n){const[i,r,o,s]=eh(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;sc(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=oc(u/s,a/s,l/s,c/s),y=b=>Math.exp(g+m*(b-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:uu(e,t,n,s,y)}}function EA(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;sc(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,o+=(h*p-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=oc(i,r,o,s),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:uu(e,t,n,a,c)}}function W1(e,t,n){const[i,r,o,s]=eh(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,w=-v*u,_=E=>(E=E-o,v*E*E+x*E+w+s);return{coef:[w-x*o+v*o*o+s,x-2*v*o,v],predict:_,rSquared:uu(e,t,n,s,_)}}function _A(e,t,n,i){if(i===0)return j1(e,t,n);if(i===1)return q1(e,t,n);if(i===2)return W1(e,t,n);const[r,o,s,a]=eh(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*o[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=C9(c),b=v=>{v-=s;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:k9(f,y,-s,a),predict:b,rSquared:uu(e,t,n,a,b)}}function k9(e,t,n,i){const r=Array(e);let o,s,a,u;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],u=1,r[o]+=a,s=1;s<=o;++s)u*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*u;return r[0]+=i,r}function C9(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;i<t;++i){for(s=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][s])&&(s=r);for(o=i;o<t+1;++o)a=e[o][i],e[o][i]=e[o][s],e[o][s]=a;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,o=r+1;o<t;++o)a+=e[o][r]*n[o];n[r]=(e[t][r]-a)/e[r][r]}return n}const $A=2,SA=1e-12;function AA(e,t,n,i){const[r,o,s,a]=eh(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=$A;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let w=0,_=0,E=0,$=0,S=0;const M=1/Math.abs(r[x]-y||1);for(let A=b;A<=v;++A){const F=r[A],C=o[A],T=M9(Math.abs(y-F)*M)*d[A],P=F*T;w+=T,_+=P,E+=C*T,$+=C*P,S+=F*P}const[k,D]=oc(_/w,E/w,$/w,S/w);c[m]=k+D*y,f[m]=Math.abs(o[m]-c[m]),F9(r,m+1,p)}if(h===$A)break;const g=P$(f);if(Math.abs(g)<SA)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?SA:(b=1-y*y)*b}return T9(r,c,s,a)}function M9(e){return(e=1-e*e*e)*e*e}function F9(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}function T9(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],l;for(;s<r;++s)l=e[s]+n,u[0]===l?u[1]+=(t[s]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[s]],o.push(u));return u[1]+=i,o}const O9=.5*Math.PI/180;function th(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(o+g/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let g=n;--g>0;)c.push(r(o+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=D9(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&N9(f,g,d,h,p)>O9?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function D9(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const s=t[o][1];s<n&&(n=s),s>i&&(i=s)}return 1/(i-n)}function N9(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),s=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-s)}function R9(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function H1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:R9(e)}function kA(e,t,n){return n||e+(t?"_"+t:"")}const G1=()=>{},P9={init:G1,add:G1,rem:G1,idx:0},ac={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.valid?e.sum:void 0,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<e.min||e.min===void 0)&&(e.min=t)},rem:(e,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||e.max===void 0)&&(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<e.min&&(e.argmin=n)},rem:(e,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}},uc=Object.keys(ac).filter(e=>e!=="__count__");function L9(e,t){return(n,i)=>fe({name:e,aggregate_param:i,out:n||e},P9,t)}[...uc,"__count__"].forEach(e=>{ac[e]=L9(e,ac[e])});function CA(e,t,n){return ac[e](n,t)}function MA(e,t){return e.idx-t.idx}function I9(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=ac[r]())})};return e.forEach(n),Object.values(t).sort(MA)}function z9(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function B9(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function U9(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function j9(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function FA(e,t){const n=t||Rt,i=I9(e),r=e.slice().sort(MA);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=z9,o.prototype.add=B9,o.prototype.rem=U9,o.prototype.set=j9,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function V1(e){this._key=e?qn(e):ie,this.reset()}const _t=V1.prototype;_t.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},_t.add=function(e){this._add.push(e)},_t.rem=function(e){this._rem.push(e)},_t.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,l;for(a=0;a<r;++a)s[n(t[a])]=1;for(a=0,u=0;a<i;++a)s[n(l=e[a])]?s[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o},_t.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",Z(n,o)||(n[o]=1,++r);return r},_t.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=h$(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},_t.argmin=function(e){return this.extent(e)[0]||{}},_t.argmax=function(e){return this.extent(e)[1]||{}},_t.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},_t.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},_t.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=M1(this.values(),e),this._get=e),this._q},_t.q1=function(e){return this.quartile(e)[0]},_t.q2=function(e){return this.quartile(e)[1]},_t.q3=function(e){return this.quartile(e)[2]},_t.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=pA(this.values(),1e3,.05,e),this._get=e),this._ci},_t.ci0=function(e){return this.ci(e)[0]},_t.ci1=function(e){return this.ci(e)[1]};function So(e){O.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}So.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:uc},{name:"aggregate_params",type:"number",null:!0,array:!0},{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"}]},G(So,O,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}o(e._prev),o(t);function s(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?s(h,u,l):t[h]||e.cell(h,u)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=X(Nt(b)),x=v.length;let w=0,_;for(;w<x;++w)i[_=v[w]]||(i[_]=1,t.push(_))}this._dims=X(e.groupby),this._dnames=this._dims.map(b=>{const v=Ye(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:H1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,p,g,m,y;for(l!==s.length&&R("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&R("Null aggregate field specified."),g=Ye(f),m=kA(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(CA(d,h,m))}return this._measures=this._measures.map(b=>FA(b,b.field)),Object.create(null)},cellkey:H1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let o=0;o<r;++o)n.agg[o]=new i[o](n)}return n.store&&(n.data=new V1),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let s=0;s<r;++s)o[n[s]]=i[s](e);return t?eA(t.tuple,o):Ce(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,o=i.length;r<o;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,s=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&s.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?s:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const q9=1e-14;function Y1(e){O.call(this,null,e)}Y1.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"]}]},G(Y1,O,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,o=i.step,s=e.as||["bin0","bin1"],a=s[0],u=s[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Nt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+o*(1+(f-r)/o)}:c=>c[a]=i(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=hA(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;(s=e.anchor)!=null&&(a=s-(r+i*Math.floor((s-r)/i)),r+=a,o+=a);const u=function(l){let c=Pt(t(l));return c==null?null:c<r?-1/0:c>o?1/0:(c=Math.max(r,Math.min(c,o-i)),r+i*Math.floor(q9+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=hn(u,Nt(t),e.name||"bin_"+Ye(t))}});function TA(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:u=>o.push(u),remove:u=>s[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!s[i(c)]),s={},a=0),l&&u&&r.sort(u),o.length&&(r=u?v$(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function X1(e){O.call(this,[],e)}X1.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},G(X1,O,{transform(e,t){const n=t.fork(t.ALL),i=TA(ie,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(ks(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function OA(e){Le.call(this,null,W9,e)}G(OA,Le);function W9(e){return this.value&&!e.modified()?this.value:L0(e.fields,e.orders)}function K1(e){O.call(this,null,e)}K1.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"]}]};function H9(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(K1,O,{transform(e,t){const n=f=>d=>{for(var h=H9(a(d),e.case,o)||[],p,g=0,m=h.length;g<m;++g)s.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,s=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_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,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[o]=l,s.add.push(u)):l===0?(u&&s.rem.push(u),n[a]=null,i[a]=null):u[o]!==l&&(u[o]=l,s.mod.push(u));return s.modifies(t)}});function Z1(e){O.call(this,null,e)}Z1.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},G(Z1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=G9(a,r,o,e.filter||Wn)):n.mod=a,n.source=this.value,n.modifies(i)}});function G9(e,t,n,i){for(var r=[],o={},s=e.length,a=0,u,l;a<s;++a)for(o[t]=l=e[a],u=0;u<s;++u)o[n]=e[u],i(o)&&(r.push(Ce(o)),o={},o[t]=l);return r}const DA={kde:D1,mixture:bA,normal:O1,lognormal:yA,uniform:vA},V9="distributions",NA="function",Y9="field";function RA(e,t){const n=e[NA];Z(DA,n)||R("Unknown distribution function: "+n);const i=DA[n]();for(const r in e)r===Y9?i.data((e.from||t()).map(e[r])):r===V9?i[r](e[r].map(o=>RA(o,t))):typeof i[r]===NA&&i[r](e[r]);return i}function J1(e){O.call(this,null,e)}const PA=[{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}]}],X9={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:PA},{name:"weights",type:"number",array:!0}]};J1.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:PA.concat(X9)},{name:"as",type:"string",array:!0,default:["value","density"]}]},G(J1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=RA(e.distribution,K9(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&R("Invalid density method: "+s),!e.extent&&!i.data&&R("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||Bi(i.data()),l=th(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function K9(e){return()=>e.materialize(e.SOURCE).source}function LA(e,t){return e?e.map((n,i)=>t[i]||Ye(n)):null}function Q1(e,t,n){const i=[],r=f=>f(u);let o,s,a,u,l,c;if(t==null)i.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)u=e[s],l=t.map(r),c=o[l],c||(o[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const IA="bin";function ey(e){O.call(this,null,e)}ey.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:IA}]};const Z9=(e,t)=>zl(Bi(e,t))/30;G(ey,O,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Q1(t.source,e.groupby,Rt),r=e.smooth||!1,o=e.field,s=e.step||Z9(n,o),a=ks((p,g)=>o(p)-o(g)),u=e.as||IA,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of gA(p,s,r,o))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function zA(e){Le.call(this,null,J9,e),this.modified(!0)}G(zA,Le);function J9(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:hn(n=>t(n,e),Nt(t),Ye(t))}function ty(e){O.call(this,[void 0,void 0],e)}ty.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},G(ty,O,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if((r||o==null)&&(o=1/0,s=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Pt(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Ye(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function ny(e,t){Le.call(this,e),this.parent=t,this.count=0}G(ny,Le,{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}});function nh(e){O.call(this,{},e),this._keys=Ga();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(nh,O,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=Z(r,e)&&r[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=i||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new ny(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),r[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,s=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ie(u),c=o.get(l);c!==void 0&&(o.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);o.set(ie(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ie(u),c=o.get(l),f=i(u);c===f?a(f).mod(u):(o.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(o.get(ie(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=ie(u),c=o.get(l),f=i(u);c!==f&&(o.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function BA(e){Le.call(this,null,Q9,e)}G(BA,Le);function Q9(e){return this.value&&!e.modified()?this.value:L(e.name)?X(e.name).map(t=>qn(t)):qn(e.name,e.as)}function iy(e){O.call(this,Ga(),e)}iy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},G(iy,O,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ie(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(ie(f),1)});function c(f){const d=ie(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),o.push(f)):!h&&!p?(i.set(d,1),s.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function ry(e){O.call(this,[],e)}ry.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}]},G(ry,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=LA(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=$1(a),f=0;f<s;++f)d[r[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}});function oy(e){O.call(this,[],e)}oy.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},G(oy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Ye),o=e.as||["key","value"],s=o[0],a=o[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=$1(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function sy(e){O.call(this,null,e)}sy.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},G(sy,O,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,s=>s[i]=n(s,e))}});function UA(e){O.call(this,[],e)}G(UA,O,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;)s.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=r.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-o);return n.source=this.value=r,n}});const ih={value:"value",median:P$,mean:RI,min:X0,max:Es},e7=[];function ay(e){O.call(this,[],e)}ay.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}]};function t7(e){var t=e.method||ih.value,n;if(ih[t]==null)R("Unrecognized imputation method: "+t);else return t===ih.value?(n=e.value!==void 0?e.value:0,()=>n):ih[t]}function n7(e){const t=e.field;return n=>n?t(n):NaN}G(ay,O,{transform(e,t){var n=t.fork(t.ALL),i=t7(e),r=n7(e),o=Ye(e.field),s=Ye(e.key),a=(e.groupby||[]).map(Ye),u=i7(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,w;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],w={_impute:!0},y=0,x=p.length;y<x;++y)w[a[y]]=p[y];w[s]=g,w[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(w))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function i7(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=s.push(p)),c=(l=t?t.map(r):e7)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function uy(e){So.call(this,e)}uy.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:uc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},G(uy,So,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(r=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{fe(o,r[n.cellkey(o)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function ly(e){O.call(this,null,e)}ly.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},G(ly,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Q1(i,e.groupby,e.field),o=(e.groupby||[]).map(Ye),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&R("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Bi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=D1(h,s)[a],g=e.counts?h.length:1,m=c||Bi(h);th(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<o.length;++v)b[o[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function jA(e){Le.call(this,null,r7,e)}G(jA,Le);function r7(e){return this.value&&!e.modified()?this.value:z0(e.fields,e.flat)}function qA(e){O.call(this,[],e),this._pending=null}G(qA,O,{transform(e,t){const n=t.dataflow;return this._pending?cy(this,t,this._pending):o7(e)?t.StopPropagation:e.values?cy(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=X(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>cy(this,t,X(i.data)))}});function o7(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function cy(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function fy(e){O.call(this,{},e)}fy.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}]},G(fy,O,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&R('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&R('The "as" parameter has too few output field names.'),c=c||r.map(Ye),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=o;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||R("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??o}),s?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function WA(e){Le.call(this,null,s7,e)}G(WA,Le);function s7(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<i&&(i=s[0]),s[1]>r&&(r=s[1]);return[i,r]}function HA(e){Le.call(this,null,a7,e)}G(HA,Le);function a7(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function GA(e){O.call(this,null,e)}G(GA,O,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function dy(e){So.call(this,e)}dy.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:uc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},G(dy,So,{_transform:So.prototype.transform,transform(e,t){return this._transform(u7(e,t),t)}});function u7(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=Nt(n).concat(Nt(i)),s=c7(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(a=>l7(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function l7(e,t,n,i){return hn(r=>t(r)===e?n(r):NaN,i,e+"")}function c7(e,t,n){const i={},r=[];return n.visit(n.SOURCE,o=>{const s=e(o);i[s]||(i[s]=1,r.push(s))}),r.sort($d),t?r.slice(0,t):r}function VA(e){nh.call(this,e)}G(VA,nh,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(ie(o),n,t,o);return(e.modified("field")||i&&t.modified(Nt(i)))&&R("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,o=>{const s=r(o);i(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=r(o);i(o).forEach(a=>s.add(Ce(a)))}),t.visit(t.REM,o=>{const s=r(o);i(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>r(o).mod(o)),t.visit(t.ADD,o=>r(o).add(o)),t.visit(t.REM,o=>r(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function hy(e){O.call(this,null,e)}hy.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},G(hy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=LA(e.fields,e.as||[]),o=i?(a,u)=>f7(a,u,i,r):Hd;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=ie(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Ce({}));s[ie(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[ie(a)]))}),n}});function f7(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function YA(e){O.call(this,null,e)}G(YA,O,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function py(e){O.call(this,null,e)}py.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"]}]};const d7=1e-14;G(py,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=Q1(r,e.groupby,e.field),s=(e.groupby||[]).map(Ye),a=[],u=e.step||.01,l=e.probs||Mn(u/2,1-d7,u),c=l.length;return o.forEach(f=>{const d=C1(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<s.length;++g)p[s[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function XA(e){O.call(this,null,e)}G(XA,O,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const o=ie(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=$1(r);i[ie(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[ie(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function gy(e){O.call(this,[],e),this.count=0}gy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},G(gy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[ie(f)]=1,c),{});let s=this.value,a=this.count,u=0;function l(c){let f,d;s.length<r?s.push(c):(d=~~((a+1)*Vn()),d<s.length&&d>=u&&(f=s[d],o[ie(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ie(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[ie(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[ie(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[ie(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ie(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[ie(c)])),this.count=a,this.value=n.source=s,n}});function my(e){O.call(this,null,e)}my.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"}]},G(my,O,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Mn(e.start,e.stop,e.step||1).map(r=>{const o={};return o[i]=r,Ce(o)}),n.add=t.add.concat(this.value),n}});function KA(e){O.call(this,null,e),this.modified(!0)}G(KA,O,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function yy(e){O.call(this,null,e)}const ZA=["unit0","unit1"];yy.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:i1,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:ZA}]},G(yy,O,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?iu:nu)(o.unit).offset,a=e.as||ZA,u=a[0],l=a[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(Nt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=o(g),i&&(p[l]=y=s(m,c)),m<f&&(f=m),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:bS({extent:e.extent||Bi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=o1(i),s=this.value||{},a=(n?aS:sS)(o,r);return a.unit=ve(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function JA(e){O.call(this,Ga(),e)}G(JA,O,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=a=>r.set(i(a),a);let s=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function QA(e){O.call(this,null,e)}G(QA,O,{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(ks(e.sort)):t.source).map(e.field))}});function h7(e,t,n,i){const r=lc[e](t,n);return{init:r.init||po,update:function(o,s){s[i]=r.next(o)}}}const lc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||R("ntile num must be greater than zero.");const n=lc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(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,t>0||R("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=p7(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function p7(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const g7=Object.keys(lc);function ek(e){const t=X(e.ops),n=X(e.fields),i=X(e.params),r=X(e.aggregate_params),o=X(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){X(Nt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Ye(m),x=kA(p,v,o[g]);if(h(m),s.push(x),Z(lc,p))a.push(h7(p,m,y,x));else{if(m==null&&p!=="count"&&R("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let w=l[v];w||(w=l[v]=[],w.field=m,f.push(w)),w.push(CA(p,b,x))}}),(c.length||f.length)&&(this.cell=m7(f,c,d)),this.inputs=Object.keys(u)}const tk=ek.prototype;tk.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},tk.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(r[s]);for(s=e.p1;s<e.i1;++s)n.add(r[s]);n.set(t)}for(s=0;s<o;++s)i[s].update(e,t)};function m7(e,t,n){e=e.map(u=>FA(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),s=0;s<r;++s)o[s]=new e[s](i);if(i.store)var a=i.data=new V1;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)o[l].add(o[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)o[l].rem(o[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)o[u].init()},i}function by(e){O.call(this,{},e),this._mlen=0,this._mods=[]}by.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:g7.concat(uc)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},G(by,O,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ks(e.sort),r=H1(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new ek(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)y7(this._mods[a],s,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=TA(ie),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function y7(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,s=i.frame||[null,0],a=e.data(n),u=a.length,l=o?Ya(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Lt(-1)};t.init();for(let f=0;f<u;++f)b7(c,s,f,u),o&&v7(c,l),t.update(c,a[f])}function b7(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function v7(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,s=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<s&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}const x7=Object.freeze(Object.defineProperty({__proto__:null,aggregate:So,bin:Y1,collect:X1,compare:OA,countpattern:K1,cross:Z1,density:J1,dotbin:ey,expression:zA,extent:ty,facet:nh,field:BA,filter:iy,flatten:ry,fold:oy,formula:sy,generate:UA,impute:ay,joinaggregate:uy,kde:ly,key:jA,load:qA,lookup:fy,multiextent:WA,multivalues:HA,params:GA,pivot:dy,prefacet:VA,project:hy,proxy:YA,quantile:py,relay:XA,sample:gy,sequence:my,sieve:KA,subflow:ny,timeunit:yy,tupleindex:JA,values:QA,window:by},Symbol.toStringTag,{value:"Module"}));function Me(e){return function(){return e}}const nk=Math.abs,Bt=Math.atan2,Ms=Math.cos,w7=Math.max,vy=Math.min,Hi=Math.sin,Fs=Math.sqrt,Ut=1e-12,lu=Math.PI,rh=lu/2,ik=2*lu;function E7(e){return e>1?0:e<-1?lu:Math.acos(e)}function rk(e){return e>=1?rh:e<=-1?-rh:Math.asin(e)}const xy=Math.PI,wy=2*xy,Ts=1e-6,_7=wy-Ts;function ok(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $7(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ok;const n=10**t;return function(i){this._+=i[0];for(let r=1,o=i.length;r<o;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let Ey=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ok:$7(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,o,s){this._append`C${+t},${+n},${+i},${+r},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,i,r,o){if(t=+t,n=+n,i=+i,r=+r,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,u=i-t,l=r-n,c=s-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Ts)if(!(Math.abs(f*u-l*c)>Ts)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-s,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=o*Math.tan((xy-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,w=v/y;Math.abs(x-1)>Ts&&this._append`L${t+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*h>c*p)},${this._x1=t+w*u},${this._y1=n+w*l}`}}arc(t,n,i,r,o,s){if(t=+t,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^s,d=s?r-o:o-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Ts||Math.abs(this._y1-c)>Ts)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%wy+wy),d>_7?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>Ts&&this._append`A${i},${i},0,${+(d>=xy)},${f},${this._x1=t+i*Math.cos(o)},${this._y1=n+i*Math.sin(o)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function oh(){return new Ey}oh.prototype=Ey.prototype;function sh(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Ey(t)}function S7(e){return e.innerRadius}function A7(e){return e.outerRadius}function k7(e){return e.startAngle}function C7(e){return e.endAngle}function M7(e){return e&&e.padAngle}function F7(e,t,n,i,r,o,s,a){var u=n-e,l=i-t,c=s-r,f=a-o,d=f*u-c*l;if(!(d*d<Ut))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function ah(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/Fs(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,x=b*b+v*v,w=r-o,_=d*g-p*h,E=(v<0?-1:1)*Fs(w7(0,w*w*x-_*_)),$=(_*v-b*E)/x,S=(-_*b-v*E)/x,M=(_*v+b*E)/x,k=(-_*b+v*E)/x,D=$-m,A=S-y,F=M-m,C=k-y;return D*D+A*A>F*F+C*C&&($=M,S=k),{cx:$,cy:S,x01:-c,y01:-f,x11:$*(r/w-1),y11:S*(r/w-1)}}function T7(){var e=S7,t=A7,n=Me(0),i=null,r=k7,o=C7,s=M7,a=null,u=sh(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-rh,g=o.apply(this,arguments)-rh,m=nk(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Ut))a.moveTo(0,0);else if(m>ik-Ut)a.moveTo(h*Ms(p),h*Hi(p)),a.arc(0,0,h,p,g,!y),d>Ut&&(a.moveTo(d*Ms(g),d*Hi(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,w=g,_=m,E=m,$=s.apply(this,arguments)/2,S=$>Ut&&(i?+i.apply(this,arguments):Fs(d*d+h*h)),M=vy(nk(h-d)/2,+n.apply(this,arguments)),k=M,D=M,A,F;if(S>Ut){var C=rk(S/d*Hi($)),T=rk(S/h*Hi($));(_-=C*2)>Ut?(C*=y?1:-1,x+=C,w-=C):(_=0,x=w=(p+g)/2),(E-=T*2)>Ut?(T*=y?1:-1,b+=T,v-=T):(E=0,b=v=(p+g)/2)}var P=h*Ms(b),I=h*Hi(b),z=d*Ms(w),te=d*Hi(w);if(M>Ut){var ne=h*Ms(v),de=h*Hi(v),ke=d*Ms(x),Ee=d*Hi(x),Ie;if(m<lu)if(Ie=F7(P,I,ke,Ee,ne,de,z,te)){var $r=P-Ie[0],Ia=I-Ie[1],ms=ne-Ie[0],J=de-Ie[1],he=1/Hi(E7(($r*ms+Ia*J)/(Fs($r*$r+Ia*Ia)*Fs(ms*ms+J*J)))/2),me=Fs(Ie[0]*Ie[0]+Ie[1]*Ie[1]);k=vy(M,(d-me)/(he-1)),D=vy(M,(h-me)/(he+1))}else k=D=0}E>Ut?D>Ut?(A=ah(ke,Ee,P,I,h,D,y),F=ah(ne,de,z,te,h,D,y),a.moveTo(A.cx+A.x01,A.cy+A.y01),D<M?a.arc(A.cx,A.cy,D,Bt(A.y01,A.x01),Bt(F.y01,F.x01),!y):(a.arc(A.cx,A.cy,D,Bt(A.y01,A.x01),Bt(A.y11,A.x11),!y),a.arc(0,0,h,Bt(A.cy+A.y11,A.cx+A.x11),Bt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,D,Bt(F.y11,F.x11),Bt(F.y01,F.x01),!y))):(a.moveTo(P,I),a.arc(0,0,h,b,v,!y)):a.moveTo(P,I),!(d>Ut)||!(_>Ut)?a.lineTo(z,te):k>Ut?(A=ah(z,te,ne,de,d,-k,y),F=ah(P,I,ke,Ee,d,-k,y),a.lineTo(A.cx+A.x01,A.cy+A.y01),k<M?a.arc(A.cx,A.cy,k,Bt(A.y01,A.x01),Bt(F.y01,F.x01),!y):(a.arc(A.cx,A.cy,k,Bt(A.y01,A.x01),Bt(A.y11,A.x11),!y),a.arc(0,0,d,Bt(A.cy+A.y11,A.cx+A.x11),Bt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,k,Bt(F.y11,F.x11),Bt(F.y01,F.x01),!y))):a.arc(0,0,d,w,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-lu/2;return[Ms(f)*c,Hi(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Me(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Me(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Me(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Me(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Me(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Me(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Me(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function sk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ak(e){this._context=e}ak.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&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);break}}};function _y(e){return new ak(e)}function uk(e){return e[0]}function lk(e){return e[1]}function ck(e,t){var n=Me(!0),i=null,r=_y,o=null,s=sh(a);e=typeof e=="function"?e:e===void 0?uk:Me(e),t=typeof t=="function"?t:t===void 0?lk:Me(t);function a(u){var l,c=(u=sk(u)).length,f,d=!1,h;for(i==null&&(o=r(h=s())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Me(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Me(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Me(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(o=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=o=null:o=r(i=u),a):i},a}function fk(e,t,n){var i=null,r=Me(!0),o=null,s=_y,a=null,u=sh(l);e=typeof e=="function"?e:e===void 0?uk:Me(+e),t=typeof t=="function"?t:Me(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lk:Me(+n);function l(f){var d,h,p,g=(f=sk(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(o==null&&(a=s(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return ck().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Me(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Me(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Me(!!f),l):r},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}const O7={draw(e,t){const n=Fs(t/lu);e.moveTo(n,0),e.arc(0,0,n,0,ik)}};function D7(e,t){let n=null,i=sh(r);e=typeof e=="function"?e:Me(e||O7),t=typeof t=="function"?t:Me(t===void 0?64:+t);function r(){let o;if(n||(n=o=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return r.type=function(o){return arguments.length?(e=typeof o=="function"?o:Me(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Me(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function Ao(){}function uh(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 lh(e){this._context=e}lh.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:uh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function N7(e){return new lh(e)}function dk(e){this._context=e}dk.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},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:uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R7(e){return new dk(e)}function hk(e){this._context=e}hk.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||this._line!==0&&this._point===3)&&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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function P7(e){return new hk(e)}function pk(e,t){this._basis=new lh(e),this._beta=t}pk.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 i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const L7=function e(t){function n(i){return t===1?new lh(i):new pk(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function ch(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 $y(e,t){this._context=e,this._k=(1-t)/6}$y.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:ch(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:ch(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const I7=function e(t){function n(i){return new $y(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Sy(e,t){this._context=e,this._k=(1-t)/6}Sy.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},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:ch(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const z7=function e(t){function n(i){return new Sy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ay(e,t){this._context=e,this._k=(1-t)/6}Ay.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||this._line!==0&&this._point===3)&&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:ch(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const B7=function e(t){function n(i){return new Ay(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ky(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Ut){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ut){var l=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*l+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function gk(e,t){this._context=e,this._alpha=t}gk.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ky(this,e,t);break}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}};const U7=function e(t){function n(i){return t?new gk(i,t):new $y(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function mk(e,t){this._context=e,this._alpha=t}mk.prototype={areaStart:Ao,areaEnd:Ao,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);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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=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:ky(this,e,t);break}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}};const j7=function e(t){function n(i){return t?new mk(i,t):new Sy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function yk(e,t){this._context=e,this._alpha=t}yk.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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:ky(this,e,t);break}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}};const q7=function e(t){function n(i){return t?new yk(i,t):new Ay(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bk(e){this._context=e}bk.prototype={areaStart:Ao,areaEnd:Ao,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function W7(e){return new bk(e)}function vk(e){return e<0?-1:1}function xk(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(vk(o)+vk(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function wk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Cy(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function fh(e){this._context=e}fh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Cy(this,this._t0,wk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){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,Cy(this,wk(this,n=xk(this,e,t)),n);break;default:Cy(this,this._t0,n=xk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ek(e){this._context=new _k(e)}(Ek.prototype=Object.create(fh.prototype)).point=function(e,t){fh.prototype.point.call(this,t,e)};function _k(e){this._context=e}_k.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function H7(e){return new fh(e)}function G7(e){return new Ek(e)}function $k(e){this._context=e}$k.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=Sk(e),r=Sk(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Sk(e){var t,n=e.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(r[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function V7(e){return new $k(e)}function dh(e,t){this._context=e,this._t=t}dh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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)}break}}this._x=e,this._y=t}};function Y7(e){return new dh(e,.5)}function X7(e){return new dh(e,0)}function K7(e){return new dh(e,1)}function ko(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Z7=()=>typeof Image<"u"?Image:null;function Gi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Co(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const My=Symbol("implicit");function Fy(){var e=new M$,t=[],n=[],i=My;function r(o){let s=e.get(o);if(s===void 0){if(i!==My)return i;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new M$;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Fy(t,n).unknown(i)},Gi.apply(r,arguments),r}function cu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function cc(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Mo(){}var Os=.7,fu=1/Os,du="\\s*([+-]?\\d+)\\s*",fc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J7=/^#([0-9a-f]{3,8})$/,Q7=new RegExp(`^rgb\\(${du},${du},${du}\\)$`),eB=new RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),tB=new RegExp(`^rgba\\(${du},${du},${du},${fc}\\)$`),nB=new RegExp(`^rgba\\(${Vi},${Vi},${Vi},${fc}\\)$`),iB=new RegExp(`^hsl\\(${fc},${Vi},${Vi}\\)$`),rB=new RegExp(`^hsla\\(${fc},${Vi},${Vi},${fc}\\)$`),Ak={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};cu(Mo,dc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kk,formatHex:kk,formatHex8:oB,formatHsl:sB,formatRgb:Ck,toString:Ck});function kk(){return this.rgb().formatHex()}function oB(){return this.rgb().formatHex8()}function sB(){return Dk(this).formatHsl()}function Ck(){return this.rgb().formatRgb()}function dc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=J7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Mk(t):n===3?new dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Q7.exec(e))?new dt(t[1],t[2],t[3],1):(t=eB.exec(e))?new dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tB.exec(e))?hh(t[1],t[2],t[3],t[4]):(t=nB.exec(e))?hh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iB.exec(e))?Ok(t[1],t[2]/100,t[3]/100,1):(t=rB.exec(e))?Ok(t[1],t[2]/100,t[3]/100,t[4]):Ak.hasOwnProperty(e)?Mk(Ak[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function Mk(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function hh(e,t,n,i){return i<=0&&(e=t=n=NaN),new dt(e,t,n,i)}function Ty(e){return e instanceof Mo||(e=dc(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function Fo(e,t,n,i){return arguments.length===1?Ty(e):new dt(e,t,n,i??1)}function dt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}cu(dt,Fo,cc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dt(Ds(this.r),Ds(this.g),Ds(this.b),ph(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:Fk,formatHex:Fk,formatHex8:aB,formatRgb:Tk,toString:Tk}));function Fk(){return`#${Ns(this.r)}${Ns(this.g)}${Ns(this.b)}`}function aB(){return`#${Ns(this.r)}${Ns(this.g)}${Ns(this.b)}${Ns((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tk(){const e=ph(this.opacity);return`${e===1?"rgb(":"rgba("}${Ds(this.r)}, ${Ds(this.g)}, ${Ds(this.b)}${e===1?")":`, ${e})`}`}function ph(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ds(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ns(e){return e=Ds(e),(e<16?"0":"")+e.toString(16)}function Ok(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fi(e,t,n,i)}function Dk(e){if(e instanceof fi)return new fi(e.h,e.s,e.l,e.opacity);if(e instanceof Mo||(e=dc(e)),!e)return new fi;if(e instanceof fi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,u=(o+r)/2;return a?(t===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-t)/a+2:s=(t-n)/a+4,a/=u<.5?o+r:2-o-r,s*=60):a=u>0&&u<1?0:s,new fi(s,a,u,e.opacity)}function gh(e,t,n,i){return arguments.length===1?Dk(e):new fi(e,t,n,i??1)}function fi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(fi,gh,cc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new fi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new fi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dt(Oy(e>=240?e-240:e+120,r,i),Oy(e,r,i),Oy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new fi(Nk(this.h),mh(this.s),mh(this.l),ph(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=ph(this.opacity);return`${e===1?"hsl(":"hsla("}${Nk(this.h)}, ${mh(this.s)*100}%, ${mh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nk(e){return e=(e||0)%360,e<0?e+360:e}function mh(e){return Math.max(0,Math.min(1,e||0))}function Oy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Rk=Math.PI/180,Pk=180/Math.PI,yh=18,Lk=.96422,Ik=1,zk=.82521,Bk=4/29,hu=6/29,Uk=3*hu*hu,uB=hu*hu*hu;function jk(e){if(e instanceof Yi)return new Yi(e.l,e.a,e.b,e.opacity);if(e instanceof Nr)return qk(e);e instanceof dt||(e=Ty(e));var t=Py(e.r),n=Py(e.g),i=Py(e.b),r=Dy((.2225045*t+.7168786*n+.0606169*i)/Ik),o,s;return t===n&&n===i?o=s=r:(o=Dy((.4360747*t+.3850649*n+.1430804*i)/Lk),s=Dy((.0139322*t+.0971045*n+.7141733*i)/zk)),new Yi(116*r-16,500*(o-r),200*(r-s),e.opacity)}function bh(e,t,n,i){return arguments.length===1?jk(e):new Yi(e,t,n,i??1)}function Yi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}cu(Yi,bh,cc(Mo,{brighter(e){return new Yi(this.l+yh*(e??1),this.a,this.b,this.opacity)},darker(e){return new Yi(this.l-yh*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Lk*Ny(t),e=Ik*Ny(e),n=zk*Ny(n),new dt(Ry(3.1338561*t-1.6168667*e-.4906146*n),Ry(-.9787684*t+1.9161415*e+.033454*n),Ry(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Dy(e){return e>uB?Math.pow(e,1/3):e/Uk+Bk}function Ny(e){return e>hu?e*e*e:Uk*(e-Bk)}function Ry(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 lB(e){if(e instanceof Nr)return new Nr(e.h,e.c,e.l,e.opacity);if(e instanceof Yi||(e=jk(e)),e.a===0&&e.b===0)return new Nr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Pk;return new Nr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function vh(e,t,n,i){return arguments.length===1?lB(e):new Nr(e,t,n,i??1)}function Nr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function qk(e){if(isNaN(e.h))return new Yi(e.l,0,0,e.opacity);var t=e.h*Rk;return new Yi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}cu(Nr,vh,cc(Mo,{brighter(e){return new Nr(this.h,this.c,this.l+yh*(e??1),this.opacity)},darker(e){return new Nr(this.h,this.c,this.l-yh*(e??1),this.opacity)},rgb(){return qk(this).rgb()}}));var Wk=-.14861,Ly=1.78277,Iy=-.29227,xh=-.90649,hc=1.97294,Hk=hc*xh,Gk=hc*Ly,Vk=Ly*Iy-xh*Wk;function cB(e){if(e instanceof Rs)return new Rs(e.h,e.s,e.l,e.opacity);e instanceof dt||(e=Ty(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(Vk*i+Hk*t-Gk*n)/(Vk+Hk-Gk),o=i-r,s=(hc*(n-r)-Iy*o)/xh,a=Math.sqrt(s*s+o*o)/(hc*r*(1-r)),u=a?Math.atan2(s,o)*Pk-120:NaN;return new Rs(u<0?u+360:u,a,r,e.opacity)}function zy(e,t,n,i){return arguments.length===1?cB(e):new Rs(e,t,n,i??1)}function Rs(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(Rs,zy,cc(Mo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Rs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new Rs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Rk,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new dt(255*(t+n*(Wk*i+Ly*r)),255*(t+n*(Iy*i+xh*r)),255*(t+n*(hc*i)),this.opacity)}}));function Yk(e,t,n,i,r){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*i+s*r)/6}function Xk(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],o=e[i+1],s=i>0?e[i-1]:2*r-o,a=i<t-1?e[i+2]:2*o-r;return Yk((n-i/t)*t,s,r,o,a)}}function Kk(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],o=e[i%t],s=e[(i+1)%t],a=e[(i+2)%t];return Yk((n-i/t)*t,r,o,s,a)}}const wh=e=>()=>e;function Zk(e,t){return function(n){return e+n*t}}function fB(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Eh(e,t){var n=t-e;return n?Zk(e,n>180||n<-180?n-360*Math.round(n/360):n):wh(isNaN(e)?t:e)}function dB(e){return(e=+e)==1?ht:function(t,n){return n-t?fB(t,n,e):wh(isNaN(t)?n:t)}}function ht(e,t){var n=t-e;return n?Zk(e,n):wh(isNaN(e)?t:e)}const By=function e(t){var n=dB(t);function i(r,o){var s=n((r=Fo(r)).r,(o=Fo(o)).r),a=n(r.g,o.g),u=n(r.b,o.b),l=ht(r.opacity,o.opacity);return function(c){return r.r=s(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function Jk(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Fo(t[s]),i[s]=a.r||0,r[s]=a.g||0,o[s]=a.b||0;return i=e(i),r=e(r),o=e(o),a.opacity=1,function(u){return a.r=i(u),a.g=r(u),a.b=o(u),a+""}}}var hB=Jk(Xk),pB=Jk(Kk);function Uy(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=e[r]*(1-o)+t[r]*o;return i}}function Qk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gB(e,t){return(Qk(t)?Uy:eC)(e,t)}function eC(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=To(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function tC(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function di(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nC(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=To(e[r],t[r]):i[r]=t[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var jy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qy=new RegExp(jy.source,"g");function mB(e){return function(){return e}}function yB(e){return function(t){return e(t)+""}}function iC(e,t){var n=jy.lastIndex=qy.lastIndex=0,i,r,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(i=jy.exec(e))&&(r=qy.exec(t));)(o=r.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,u.push({i:s,x:di(i,r)})),n=qy.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?yB(u[0].x):mB(t):(t=u.length,function(l){for(var c=0,f;c<t;++c)a[(f=u[c]).i]=f.x(l);return a.join("")})}function To(e,t){var n=typeof t,i;return t==null||n==="boolean"?wh(t):(n==="number"?di:n==="string"?(i=dc(t))?(t=i,By):iC:t instanceof dc?By:t instanceof Date?tC:Qk(t)?Uy:Array.isArray(t)?eC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nC:di)(e,t)}function bB(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function vB(e,t){var n=Eh(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function pc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var rC=180/Math.PI,Wy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function oC(e,t,n,i,r,o){var s,a,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,u/=a),e*i<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*rC,skewX:Math.atan(u)*rC,scaleX:s,scaleY:a}}var _h;function xB(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wy:oC(t.a,t.b,t.c,t.d,t.e,t.f)}function wB(e){return e==null||(_h||(_h=document.createElementNS("http://www.w3.org/2000/svg","g")),_h.setAttribute("transform",e),!(e=_h.transform.baseVal.consolidate()))?Wy:(e=e.matrix,oC(e.a,e.b,e.c,e.d,e.e,e.f))}function sC(e,t,n,i){function r(l){return l.length?l.pop()+" ":""}function o(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push("translate(",null,t,null,n);p.push({i:g-4,x:di(l,f)},{i:g-2,x:di(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:di(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:di(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:di(l,f)},{i:g-2,x:di(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,d),s(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,g=d.length,m;++p<g;)f[(m=d[p]).i]=m.x(h);return f.join("")}}}var EB=sC(xB,"px, ","px)","deg)"),_B=sC(wB,", ",")",")"),$B=1e-12;function aC(e){return((e=Math.exp(e))+1/e)/2}function SB(e){return((e=Math.exp(e))-1/e)/2}function AB(e){return((e=Math.exp(2*e))-1)/(e+1)}const kB=function e(t,n,i){function r(o,s){var a=o[0],u=o[1],l=o[2],c=s[0],f=s[1],d=s[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<$B)y=Math.log(d/l)/t,m=function(E){return[a+E*h,u+E*p,l*Math.exp(t*E*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),w=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(x*x+1)-x);y=(_-w)/t,m=function(E){var $=E*y,S=aC(w),M=l/(n*b)*(S*AB(t*$+w)-SB(w));return[a+M*h,u+M*p,l*S/aC(t*$+w)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(o){var s=Math.max(.001,+o),a=s*s,u=a*a;return e(s,a,u)},r}(Math.SQRT2,2,4);function uC(e){return function(t,n){var i=e((t=gh(t)).h,(n=gh(n)).h),r=ht(t.s,n.s),o=ht(t.l,n.l),s=ht(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const CB=uC(Eh);var MB=uC(ht);function FB(e,t){var n=ht((e=bh(e)).l,(t=bh(t)).l),i=ht(e.a,t.a),r=ht(e.b,t.b),o=ht(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=i(s),e.b=r(s),e.opacity=o(s),e+""}}function lC(e){return function(t,n){var i=e((t=vh(t)).h,(n=vh(n)).h),r=ht(t.c,n.c),o=ht(t.l,n.l),s=ht(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const TB=lC(Eh);var OB=lC(ht);function cC(e){return function t(n){n=+n;function i(r,o){var s=e((r=zy(r)).h,(o=zy(o)).h),a=ht(r.s,o.s),u=ht(r.l,o.l),l=ht(r.opacity,o.opacity);return function(c){return r.h=s(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const DB=cC(Eh);var NB=cC(ht);function Hy(e,t){t===void 0&&(t=e,e=To);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function RB(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const PB=Object.freeze(Object.defineProperty({__proto__:null,interpolate:To,interpolateArray:gB,interpolateBasis:Xk,interpolateBasisClosed:Kk,interpolateCubehelix:DB,interpolateCubehelixLong:NB,interpolateDate:tC,interpolateDiscrete:bB,interpolateHcl:TB,interpolateHclLong:OB,interpolateHsl:CB,interpolateHslLong:MB,interpolateHue:vB,interpolateLab:FB,interpolateNumber:di,interpolateNumberArray:Uy,interpolateObject:nC,interpolateRgb:By,interpolateRgbBasis:hB,interpolateRgbBasisClosed:pB,interpolateRound:pc,interpolateString:iC,interpolateTransformCss:EB,interpolateTransformSvg:_B,interpolateZoom:kB,piecewise:Hy,quantize:RB},Symbol.toStringTag,{value:"Module"}));function LB(e){return function(){return e}}function Gy(e){return+e}var fC=[0,1];function yn(e){return e}function Vy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:LB(isNaN(t)?NaN:.5)}function IB(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function zB(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=Vy(r,i),o=n(s,o)):(i=Vy(i,r),o=n(o,s)),function(a){return o(i(a))}}function BB(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=Vy(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var u=vo(e,a,1,i)-1;return o[u](r[u](a))}}function gc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function $h(){var e=fC,t=fC,n=To,i,r,o,s=yn,a,u,l;function c(){var d=Math.min(e.length,t.length);return s!==yn&&(s=IB(e[0],e[d-1])),a=d>2?BB:zB,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(u||(u=a(e.map(i),t,n)))(i(s(d)))}return f.invert=function(d){return s(r((l||(l=a(t,e.map(i),di)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Gy),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=pc,c()},f.clamp=function(d){return arguments.length?(s=d?!0:yn,c()):s!==yn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return i=d,r=h,c()}}function dC(){return $h()(yn,yn)}function hC(e,t,n,i){var r=xo(e,t,n),o;switch(i=_s(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(o=V$(r,s))&&(i.precision=o),J0(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=Y$(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=G$(r))&&(i.precision=o-(i.type==="%")*2);break}}return Fd(i)}function Ps(e){var t=e.domain;return e.ticks=function(n){var i=t();return V0(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return hC(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,o=i.length-1,s=i[r],a=i[o],u,l,c=10;for(a<s&&(l=s,s=a,a=l,l=r,r=o,o=l);c-- >0;){if(l=Y0(s,a,n),l===u)return i[r]=s,i[o]=a,t(i);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function pC(){var e=dC();return e.copy=function(){return gc(e,pC())},Gi.apply(e,arguments),Ps(e)}function gC(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Gy),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return gC(e).unknown(t)},e=arguments.length?Array.from(e,Gy):[0,1],Ps(n)}function mC(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),e[n]=t.floor(r),e[i]=t.ceil(o),e}function yC(e){return Math.log(e)}function bC(e){return Math.exp(e)}function UB(e){return-Math.log(-e)}function jB(e){return-Math.exp(-e)}function qB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function WB(e){return e===10?qB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function HB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function vC(e){return(t,n)=>-e(-t,n)}function Yy(e){const t=e(yC,bC),n=t.domain;let i=10,r,o;function s(){return r=HB(i),o=WB(i),n()[0]<0?(r=vC(r),o=vC(o),e(UB,jB)):e(yC,bC),t}return t.base=function(a){return arguments.length?(i=+a,s()):i},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=V0(l,c,m))}else y=V0(d,h,Math.min(h-d,m)).map(o);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=_s(u)).precision==null&&(u.trim=!0),u=Fd(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/o(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(mC(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function xC(){const e=Yy($h()).domain([1,10]);return e.copy=()=>gc(e,xC()).base(e.base()),Gi.apply(e,arguments),e}function wC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function EC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Xy(e){var t=1,n=e(wC(t),EC(t));return n.constant=function(i){return arguments.length?e(wC(t=+i),EC(t)):t},Ps(n)}function _C(){var e=Xy($h());return e.copy=function(){return gc(e,_C()).constant(e.constant())},Gi.apply(e,arguments)}function $C(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function GB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function VB(e){return e<0?-e*e:e*e}function Ky(e){var t=e(yn,yn),n=1;function i(){return n===1?e(yn,yn):n===.5?e(GB,VB):e($C(n),$C(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Ps(t)}function Zy(){var e=Ky($h());return e.copy=function(){return gc(e,Zy()).exponent(e.exponent())},Gi.apply(e,arguments),e}function YB(){return Zy.apply(null,arguments).exponent(.5)}function SC(){var e=[],t=[],n=[],i;function r(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=R$(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[vo(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(kr),r()},o.range=function(s){return arguments.length?(t=Array.from(s),r()):t.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return SC().domain(e).range(t).unknown(i)},Gi.apply(o,arguments)}function AC(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[vo(i,u,0,n)]:o}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},s.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},s.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},s.unknown=function(u){return arguments.length&&(o=u),s},s.thresholds=function(){return i.slice()},s.copy=function(){return AC().domain([e,t]).range(r).unknown(o)},Gi.apply(Ps(s),arguments)}function kC(){var e=[.5],t=[0,1],n,i=1;function r(o){return o!=null&&o<=o?t[vo(e,o,0,i)]:n}return r.domain=function(o){return arguments.length?(e=Array.from(o),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(o){return arguments.length?(t=Array.from(o),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},r.unknown=function(o){return arguments.length?(n=o,r):n},r.copy=function(){return kC().domain(e).range(t).unknown(n)},Gi.apply(r,arguments)}function XB(e){return new Date(e)}function KB(e){return e instanceof Date?+e:+new Date(+e)}function Jy(e,t,n,i,r,o,s,a,u,l){var c=dC(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function w(_){return(u(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:i(_)<_?r(_)<_?y:b:n(_)<_?v:x)(_)}return c.invert=function(_){return new Date(f(_))},c.domain=function(_){return arguments.length?d(Array.from(_,KB)):d().map(XB)},c.ticks=function(_){var E=d();return e(E[0],E[E.length-1],_??10)},c.tickFormat=function(_,E){return E==null?w:l(E)},c.nice=function(_){var E=d();return(!_||typeof _.range!="function")&&(_=t(E[0],E[E.length-1],_??10)),_?d(mC(E,_)):c},c.copy=function(){return gc(c,Jy(e,t,n,i,r,o,s,a,u,l))},c}function ZB(){return Gi.apply(Jy(iz,rz,Ui,jl,Za,Or,Dd,Td,Tr,p1).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function JB(){return Gi.apply(Jy(tz,nz,ji,ql,Qa,wo,Nd,Od,Tr,g1).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Sh(){var e=0,t=1,n,i,r,o,s=yn,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:s(r===0?.5:(f=(o(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),i=o(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),l):[s(0),s(1)]}}return l.range=c(To),l.rangeRound=c(pc),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function Oo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Qy(){var e=Ps(Sh()(yn));return e.copy=function(){return Oo(e,Qy())},Co.apply(e,arguments)}function CC(){var e=Yy(Sh()).domain([1,10]);return e.copy=function(){return Oo(e,CC()).base(e.base())},Co.apply(e,arguments)}function MC(){var e=Xy(Sh());return e.copy=function(){return Oo(e,MC()).constant(e.constant())},Co.apply(e,arguments)}function eb(){var e=Ky(Sh());return e.copy=function(){return Oo(e,eb()).exponent(e.exponent())},Co.apply(e,arguments)}function QB(){return eb.apply(null,arguments).exponent(.5)}function Ah(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=yn,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-o)*(i*g<i*o?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),o=c(t=+t),s=c(n=+n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Hy(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(To),h.rangeRound=p(pc),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),o=g(t),s=g(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function FC(){var e=Ps(Ah()(yn));return e.copy=function(){return Oo(e,FC())},Co.apply(e,arguments)}function TC(){var e=Yy(Ah()).domain([.1,1,10]);return e.copy=function(){return Oo(e,TC()).base(e.base())},Co.apply(e,arguments)}function OC(){var e=Xy(Ah());return e.copy=function(){return Oo(e,OC()).constant(e.constant())},Co.apply(e,arguments)}function tb(){var e=Ky(Ah());return e.copy=function(){return Oo(e,tb()).exponent(e.exponent())},Co.apply(e,arguments)}function eU(){return tb.apply(null,arguments).exponent(.5)}function Xi(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const tU=Xi("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),nU=Xi("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),iU=Xi("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),rU=Xi("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),oU=Xi("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),sU=Xi("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),aU=Xi("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),uU=Xi("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),lU=Xi("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),cU=Xi("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function nb(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const fU="identity",pu="linear",Rr="log",mc="pow",yc="sqrt",kh="symlog",Ls="time",Is="utc",Ki="sequential",gu="diverging",mu="quantile",Ch="quantize",Mh="threshold",ib="ordinal",rb="point",DC="band",ob="bin-ordinal",ot="continuous",bc="discrete",vc="discretizing",Yn="interpolating",sb="temporal";function dU(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function hU(e){return function(t){const n=e.range();let i=t[0],r=t[1],o=-1,s,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(o<0&&(o=u),s=u);if(!(o<0))return i=e.invertExtent(n[o]),r=e.invertExtent(n[s]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function ab(){const e=Fy().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,o,s=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=nb(f,a,u);let g=i[d-0];r=(h-g)/(p||1),s&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,o=r*(1-a),s&&(g=Math.round(g),o=Math.round(o));const m=Mn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,vo(h,g)-1),b=g===m?y:vo(h,m)-1,g-h[y]>o+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return ab().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function NC(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return NC(t())},e}function pU(){return NC(ab().paddingInner(1))}var gU=Array.prototype.map;function mU(e){return gU.call(e,Pt)}const yU=Array.prototype.slice;function RC(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(vo(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=mU(i),n):e.slice()},n.range=function(i){return arguments.length?(t=yU.call(i),n):t.slice()},n.tickFormat=function(i,r){return hC(e[0],ve(e),i??10,r)},n.copy=function(){return RC().domain(n.domain()).range(n.range())},n}const Fh=new Map,PC=Symbol("vega_scale");function LC(e){return e[PC]=!0,e}function bU(e){return e&&e[PC]===!0}function vU(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?dU(o):o.invertExtent?hU(o):void 0),o.type=e,LC(o)};return i.metadata=li(X(n)),i}function Se(e,t,n){return arguments.length>1?(Fh.set(e,vU(e,t,n)),this):IC(e)?Fh.get(e):void 0}Se(fU,gC),Se(pu,pC,ot),Se(Rr,xC,[ot,Rr]),Se(mc,Zy,ot),Se(yc,YB,ot),Se(kh,_C,ot),Se(Ls,ZB,[ot,sb]),Se(Is,JB,[ot,sb]),Se(Ki,Qy,[ot,Yn]),Se(`${Ki}-${pu}`,Qy,[ot,Yn]),Se(`${Ki}-${Rr}`,CC,[ot,Yn,Rr]),Se(`${Ki}-${mc}`,eb,[ot,Yn]),Se(`${Ki}-${yc}`,QB,[ot,Yn]),Se(`${Ki}-${kh}`,MC,[ot,Yn]),Se(`${gu}-${pu}`,FC,[ot,Yn]),Se(`${gu}-${Rr}`,TC,[ot,Yn,Rr]),Se(`${gu}-${mc}`,tb,[ot,Yn]),Se(`${gu}-${yc}`,eU,[ot,Yn]),Se(`${gu}-${kh}`,OC,[ot,Yn]),Se(mu,SC,[vc,mu]),Se(Ch,AC,vc),Se(Mh,kC,vc),Se(ob,RC,[bc,vc]),Se(ib,Fy,bc),Se(DC,ab,bc),Se(rb,pU,bc);function IC(e){return Fh.has(e)}function zs(e,t){const n=Fh.get(e);return n&&n.metadata[t]}function ub(e){return zs(e,ot)}function yu(e){return zs(e,bc)}function lb(e){return zs(e,vc)}function zC(e){return zs(e,Rr)}function xU(e){return zs(e,sb)}function BC(e){return zs(e,Yn)}function UC(e){return zs(e,mu)}const wU=["clamp","base","constant","exponent"];function jC(e,t){const n=t[0],i=ve(t)-n;return function(r){return e(n+r*i)}}function Th(e,t,n){return Hy(cb(t||"rgb",n),e)}function qC(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function WC(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?Lt(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=Se(o)().domain([t,n]).range([0,1]),wU.forEach(a=>e[a]?s[a](e[a]()):0),s)}function cb(e,t){const n=PB[EU(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function EU(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const _U={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"},$U={accent:nU,category10:tU,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:iU,observable10:rU,paired:oU,pastel1:sU,pastel2:aU,set1:uU,set2:lU,set3:cU,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function HC(e){if(L(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function GC(e,t){for(const n in e)fb(n,t(e[n]))}const VC={};GC($U,HC),GC(_U,e=>Th(HC(e)));function fb(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(VC[e]=t,this):VC[e]}const Oh="symbol",SU="discrete",AU="gradient",kU=e=>L(e)?e.map(t=>String(t)):String(e),CU=(e,t)=>e[1]-t[1],MU=(e,t)=>t[1]-e[1];function db(e,t,n){let i;return _e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(zl(e.domain())/n||1)+1))),Y(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Ls?nu(t):e.type==Is?iu(t):R("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function YC(e,t,n){let i=e.range(),r=i[0],o=ve(i),s=CU;if(r>o&&(i=o,o=r,r=i,s=MU),r=Math.floor(r),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],ve(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function hb(e,t){return e.bins?YC(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function XC(e,t,n,i,r,o){const s=t.type;let a=kU;if(s===Ls||r===Ls)a=e.timeFormat(i);else if(s===Is||r===Is)a=e.utcFormat(i);else if(zC(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=KC(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function KC(e,t,n){const i=hb(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/o));return l*r<r-.5&&(l*=r),l<=s};return n?i.filter(a):a}const pb={[mu]:"quantiles",[Ch]:"thresholds",[Mh]:"domain"},ZC={[mu]:"quantiles",[Ch]:"domain"};function JC(e,t){return e.bins?OU(e.bins):e.type===Rr?KC(e,t,!0):pb[e.type]?TU(e[pb[e.type]]()):hb(e,t)}function FU(e,t,n){const i=t[ZC[t.type]](),r=i.length;let o=r>1?i[1]-i[0]:i[0],s;for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,3*10,n)}function TU(e){const t=[-1/0].concat(e);return t.max=1/0,t}function OU(e){const t=e.slice(0,-1);return t.max=ve(e),t}const DU=e=>pb[e.type]||e.bins;function QC(e,t,n,i,r,o,s){const a=ZC[t.type]&&o!==Ls&&o!==Is?FU(e,t,r):XC(e,t,n,r,o,s);return i===Oh&&DU(t)?NU(a):i===SU?RU(a):PU(a)}const NU=e=>(t,n,i)=>{const r=eM(i[n+1],eM(i.max,1/0)),o=tM(t,e),s=tM(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},eM=(e,t)=>e??t,RU=e=>(t,n)=>n?e(t):null,PU=e=>t=>e(t),tM=(e,t)=>Number.isFinite(e)?t(e):null;function LU(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ve(t),o=r-i;if(e.type===Mh){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function IU(e,t,n,i){const r=i||t.type;return K(n)&&xU(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ls?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Is?e.utcFormat("%A, %d %B %Y, %X UTC"):QC(e,t,5,null,n,i,!0)}function nM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=IU(e,t,n.format,n.formatType);if(lb(t.type)){const o=JC(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(yu(t.type)){const o=t.domain(),s=o.length,a=s>i?o.slice(0,i-2).map(r).join(", ")+", ending with "+o.slice(-1).map(r):o.map(r).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${r(o[0])} to ${r(ve(o))}`}}let iM=0;function zU(){iM=0}const Dh="p_";function gb(e){return e&&e.gradient}function rM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Dh:"";return r||(r=e.id="gradient_"+iM++,i==="radial"?(e.x1=Zi(e.x1,.5),e.y1=Zi(e.y1,.5),e.r1=Zi(e.r1,0),e.x2=Zi(e.x2,.5),e.y2=Zi(e.y2,.5),e.r2=Zi(e.r2,.5),o=Dh):(e.x1=Zi(e.x1,0),e.y1=Zi(e.y1,0),e.x2=Zi(e.x2,1),e.y2=Zi(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function Zi(e,t){return e??t}function oM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const sM={basis:{curve:N7},"basis-closed":{curve:R7},"basis-open":{curve:P7},bundle:{curve:L7,tension:"beta",value:.85},cardinal:{curve:I7,tension:"tension",value:0},"cardinal-open":{curve:B7,tension:"tension",value:0},"cardinal-closed":{curve:z7,tension:"tension",value:0},"catmull-rom":{curve:U7,tension:"alpha",value:.5},"catmull-rom-closed":{curve:j7,tension:"alpha",value:.5},"catmull-rom-open":{curve:q7,tension:"alpha",value:.5},linear:{curve:_y},"linear-closed":{curve:W7},monotone:{horizontal:G7,vertical:H7},natural:{curve:V7},step:{curve:Y7},"step-after":{curve:K7},"step-before":{curve:X7}};function mb(e,t,n){var i=Z(sM,e)&&sM[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const BU={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},UU=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,jU=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,qU=/^((\s+,?\s*)|(,\s*))/,WU=/^[01]/;function bu(e){const t=[];return(e.match(UU)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=BU[o],a=HU(o,s,i.slice(1).trim()),u=a.length;if(u<s||u&&u%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,s)]),u!==s){o==="m"&&(r=r==="M"?"L":"l");for(let l=s;l<u;l+=s)t.push([r,...a.slice(l,l+s)])}}),t}function HU(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?WU:jU,a=n.slice(r).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(qU);u!==null&&(r+=u[0].length)}return i}const Do=Math.PI/180,GU=1e-14,Bs=Math.PI/2,Ji=Math.PI*2,vu=Math.sqrt(3)/2;var yb={},bb={},aM=[].join;function VU(e,t,n,i,r,o,s,a,u){const l=aM.call(arguments);if(yb[l])return yb[l];const c=s*Do,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,w=b*a+v*u,_=m*e+y*t,E=b*e+v*t;let S=1/((_-x)*(_-x)+(E-w)*(E-w))-.25;S<0&&(S=0);let M=Math.sqrt(S);o==r&&(M=-M);const k=.5*(x+_)-M*(E-w),D=.5*(w+E)+M*(_-x),A=Math.atan2(w-D,x-k);let C=Math.atan2(E-D,_-k)-A;C<0&&o===1?C+=Ji:C>0&&o===0&&(C-=Ji);const T=Math.ceil(Math.abs(C/(Bs+.001))),P=[];for(let I=0;I<T;++I){const z=A+I*C/T,te=A+(I+1)*C/T;P[I]=[k,D,z,te,n,i,f,d]}return yb[l]=P}function YU(e){const t=aM.call(e);if(bb[t])return bb[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7];const c=l*s,f=-u*a,d=u*s,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(o),y=Math.sin(o),b=.5*(o-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),w=n+p-x*g,_=i+g+x*p,E=n+m,$=i+y,S=E+x*y,M=$-x*m;return bb[t]=[c*w+f*_,d*w+h*_,c*S+f*M,d*S+h*M,c*E+f*$,d*E+h*$]}const Xn=["l",0,0,0,0,0,0,0];function XU(e,t,n){const i=Xn[0]=e[0];if(i==="a"||i==="A")Xn[1]=t*e[1],Xn[2]=n*e[2],Xn[3]=e[3],Xn[4]=e[4],Xn[5]=e[5],Xn[6]=t*e[6],Xn[7]=n*e[7];else if(i==="h"||i==="H")Xn[1]=t*e[1];else if(i==="v"||i==="V")Xn[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)Xn[r]=(r%2==1?t:n)*e[r];return Xn}function xc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),o==null&&(o=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(s=t[b],(r!==1||o!==1)&&(s=XU(s,r,o)),s[0]){case"l":u+=s[1],l+=s[2],e.lineTo(u+n,l+i);break;case"L":u=s[1],l=s[2],e.lineTo(u+n,l+i);break;case"h":u+=s[1],e.lineTo(u+n,l+i);break;case"H":u=s[1],e.lineTo(u+n,l+i);break;case"v":l+=s[1],e.lineTo(u+n,l+i);break;case"V":l=s[1],e.lineTo(u+n,l+i);break;case"m":u+=s[1],l+=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=s[1],l=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+s[5],h=l+s[6],c=u+s[3],f=l+s[4],e.bezierCurveTo(u+s[1]+n,l+s[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=s[5],l=s[6],c=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+s[3],h=l+s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+s[1]+n,l+s[2]+i,d+n,h+i),c=u+s[1],f=l+s[2],u=d,l=h;break;case"S":d=s[3],h=s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"q":d=u+s[3],h=l+s[4],c=u+s[1],f=l+s[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"t":d=u+s[1],h=l+s[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+s[1],f=l+s[2];break;case"T":d=s[1],h=s[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":uM(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+n,s[7]+l+i]),u+=s[6],l+=s[7];break;case"A":uM(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),u=s[6],l=s[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=s}}function uM(e,t,n,i){const r=VU(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const s=YU(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const lM=.5773502691896257,cM={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Ji)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n,r=i-n*lM,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n,r=i-n*lM;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=vu*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function fM(e){return Z(cM,e)?cM[e]:KU(e)}var vb={};function KU(e){if(!Z(vb,e)){const t=bu(e);vb[e]={draw:function(n,i){xc(n,t,0,0,Math.sqrt(i)/2)}}}return vb[e]}const No=.448084975506;function ZU(e){return e.x}function JU(e){return e.y}function QU(e){return e.width}function ej(e){return e.height}function Pr(e){return typeof e=="function"?e:()=>+e}function Nh(e,t,n){return Math.max(t,Math.min(e,n))}function dM(){var e=ZU,t=JU,n=QU,i=ej,r=Pr(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Nh(+r.call(this,c),0,b),x=Nh(+o.call(this,c),0,b),w=Nh(+s.call(this,c),0,b),_=Nh(+a.call(this,c),0,b);if(u||(u=h=oh()),v<=0&&x<=0&&w<=0&&_<=0)u.rect(p,g,m,y);else{var E=p+m,$=g+y;u.moveTo(p+v,g),u.lineTo(E-x,g),u.bezierCurveTo(E-No*x,g,E,g+No*x,E,g+x),u.lineTo(E,$-_),u.bezierCurveTo(E,$-No*_,E-No*_,$,E-_,$),u.lineTo(p+w,$),u.bezierCurveTo(p+No*w,$,p,$-No*w,p,$-w),u.lineTo(p,g+v),u.bezierCurveTo(p,g+No*v,p+No*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Pr(c),l):e},l.y=function(c){return arguments.length?(t=Pr(c),l):t},l.width=function(c){return arguments.length?(n=Pr(c),l):n},l.height=function(c){return arguments.length?(i=Pr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Pr(c),o=f!=null?Pr(f):r,a=d!=null?Pr(d):r,s=h!=null?Pr(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function hM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(s-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(s+b,a+v),r.arc(s,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,Ji);r.closePath()}else o=1;s=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=oh()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(o=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function wc(e,t){return e??t}const Ec=e=>e.x||0,_c=e=>e.y||0,tj=e=>e.width||0,nj=e=>e.height||0,ij=e=>(e.x||0)+(e.width||0),rj=e=>(e.y||0)+(e.height||0),oj=e=>e.startAngle||0,sj=e=>e.endAngle||0,aj=e=>e.padAngle||0,uj=e=>e.innerRadius||0,lj=e=>e.outerRadius||0,cj=e=>e.cornerRadius||0,fj=e=>wc(e.cornerRadiusTopLeft,e.cornerRadius)||0,dj=e=>wc(e.cornerRadiusTopRight,e.cornerRadius)||0,hj=e=>wc(e.cornerRadiusBottomRight,e.cornerRadius)||0,pj=e=>wc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,gj=e=>wc(e.size,64),mj=e=>e.size||1,Rh=e=>e.defined!==!1,yj=e=>fM(e.shape||"circle"),bj=T7().startAngle(oj).endAngle(sj).padAngle(aj).innerRadius(uj).outerRadius(lj).cornerRadius(cj),vj=fk().x(Ec).y1(_c).y0(rj).defined(Rh),xj=fk().y(_c).x1(Ec).x0(ij).defined(Rh),wj=ck().x(Ec).y(_c).defined(Rh),Ej=dM().x(Ec).y(_c).width(tj).height(nj).cornerRadius(fj,dj,hj,pj),_j=D7().type(yj).size(gj),$j=hM().x(Ec).y(_c).defined(Rh).size(mj);function xb(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Sj(e,t){return bj.context(e)(t)}function Aj(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?xj:vj).curve(mb(i,n.orient,n.tension)).context(e)(t)}function kj(e,t){const n=t[0],i=n.interpolate||"linear";return wj.curve(mb(i,n.orient,n.tension)).context(e)(t)}function xu(e,t,n,i){return Ej.context(e)(t,n,i)}function Cj(e,t){return(t.mark.shape||t.shape).context(e)(t)}function Mj(e,t){return _j.context(e)(t)}function Fj(e,t){return $j.context(e)(t)}var pM=1;function gM(){pM=1}function wb(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+pM++),s=r.clipping[o]||(r.clipping[o]={id:o});return ce(i)?s.path=i(null):xb(n)?s.path=xu(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function nt(e){this.clear(),e&&this.union(e)}nt.prototype={clone(){return new nt(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,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.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 i=this.rotatedPoints(e,t,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(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*s+l,u*i+a*s+c,a*o-u*r+l,u*o+a*r+c,a*o-u*s+l,u*o+a*s+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.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<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.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.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Ph(e){this.mark=e,this.bounds=this.bounds||new nt}function Lh(e){Ph.call(this,e),this.items=this.items||[]}G(Lh,Ph);class mM{constructor(t){this._pending=0,this._loader=t||Ud()}pending(){return this._pending}sanitizeURL(t){const n=this;return yM(n),n._loader.sanitize(t,{context:"href"}).then(i=>($c(n),i)).catch(()=>($c(n),null))}loadImage(t){const n=this,i=Z7();return yM(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=Z(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>$c(n),s.onerror=()=>$c(n),s.src=o,s}).catch(r=>($c(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function yM(e){e._pending+=1}function $c(e){e._pending-=1}function Lr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?Tj(t,i):0))}return e}function Tj(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const Oj=Ji-1e-8;let Ih,zh,Bh,Us,Eb,Uh,_b,$b;const Ro=(e,t)=>Ih.add(e,t),jh=(e,t)=>Ro(zh=e,Bh=t),bM=e=>Ro(e,Ih.y1),vM=e=>Ro(Ih.x1,e),js=(e,t)=>Eb*e+_b*t,qs=(e,t)=>Uh*e+$b*t,Sb=(e,t)=>Ro(js(e,t),qs(e,t)),Ab=(e,t)=>jh(js(e,t),qs(e,t));function Sc(e,t){return Ih=e,t?(Us=t*Do,Eb=$b=Math.cos(Us),Uh=Math.sin(Us),_b=-Uh):(Eb=$b=1,Us=Uh=_b=0),Dj}const Dj={beginPath(){},closePath(){},moveTo:Ab,lineTo:Ab,rect(e,t,n,i){Us?(Sb(e+n,t),Sb(e+n,t+i),Sb(e,t+i),Ab(e,t)):(Ro(e+n,t+i),jh(e,t))},quadraticCurveTo(e,t,n,i){const r=js(e,t),o=qs(e,t),s=js(n,i),a=qs(n,i);xM(zh,r,s,bM),xM(Bh,o,a,vM),jh(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=js(e,t),a=qs(e,t),u=js(n,i),l=qs(n,i),c=js(r,o),f=qs(r,o);wM(zh,s,u,c,bM),wM(Bh,a,l,f,vM),jh(c,f)},arc(e,t,n,i,r,o){if(i+=Us,r+=Us,zh=n*Math.cos(r)+e,Bh=n*Math.sin(r)+t,Math.abs(r-i)>Oj)Ro(e-n,t-n),Ro(e+n,t+n);else{const s=l=>Ro(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%Ji,i<0&&(i+=Ji),r=r%Ji,r<0&&(r+=Ji),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=Ji,a=i-i%Bs,u=0;u<4&&a>r;++u,a-=Bs)s(a);else for(a=i-i%Bs+Bs,u=0;u<4&&a<r;++u,a=a+Bs)s(a)}}};function xM(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function wM(e,t,n,i,r){const o=i-e+3*t-3*n,s=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(o)>GU?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),u=(-s+c)/o,l=(-s-c)/o)):u=.5*a/s,0<u&&u<1&&r(EM(u,e,t,n,i)),0<l&&l<1&&r(EM(l,e,t,n,i))}function EM(e,t,n,i,r){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*i+a*e*r}var Po=(Po=ko(1,1))?Po.getContext("2d"):null;const kb=new nt;function Cb(e){return function(t,n){if(!Po)return!0;e(Po,t),kb.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=kb;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Po.isPointInPath(u,a))return!0;return!1}}function Mb(e,t){return t.contains(e.x||0,e.y||0)}function _M(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(kb.set(n,i,n+r,i+o))}function $M(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:i;return wu(t,n,i,r,o)}function wu(e,t,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(o-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(s-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function Eu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function hi(e,t){return e??t}function SM(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Nj(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+hi(t.x1,.5)*i,n.y1+hi(t.y1,.5)*r,Math.max(i,r)*hi(t.r1,0),n.x1+hi(t.x2,.5)*i,n.y1+hi(t.y2,.5)*r,Math.max(i,r)*hi(t.r2,.5));else{const s=hi(t.x1,0),a=hi(t.y1,0),u=hi(t.x2,1),l=hi(t.y2,0);if(s===u||a===l||i===r)o=e.createLinearGradient(n.x1+s*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=ko(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=SM(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return SM(o,t.stops)}function AM(e,t,n){return gb(n)?Nj(e,n,t.bounds):n}function qh(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=AM(e,t,t.fill),!0):!1}var Rj=[];function _u(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=AM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Rj),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function Pj(e,t){return e.zindex-t.zindex||e.index-t.index}function Fb(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(Pj)}function pi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=Fb(e);if(o&&o.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=o}for(i=0,r=n.length;i<r;++i)t(n[i])}function Wh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=Fb(e);for(o&&o.length&&(n=o),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===o){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Tb(e){return function(t,n,i){pi(n,r=>{(!i||i.intersects(r.bounds))&&kM(e,t,r,r)})}}function Lj(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&kM(e,t,n.items[0],n.items)}}function kM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Eu(t,n),n.fill&&qh(t,n,r)&&t.fill(),n.stroke&&_u(t,n,r)&&t.stroke()))}function Hh(e){return e=e||Wn,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Wh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Ac(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t??s.fill,u=s.stroke&&n.isPointInStroke,l,c;return u&&(l=s.strokeWidth,c=s.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function Ob(e){return Hh(Ac(e))}function Ws(e,t){return"translate("+e+","+t+")"}function Db(e){return"rotate("+e+")"}function Ij(e,t){return"scale("+e+","+t+")"}function CM(e){return Ws(e.x||0,e.y||0)}function zj(e){return Ws(e.x||0,e.y||0)+(e.angle?" "+Db(e.angle):"")}function Bj(e){return Ws(e.x||0,e.y||0)+(e.angle?" "+Db(e.angle):"")+(e.scaleX||e.scaleY?" "+Ij(e.scaleX||1,e.scaleY||1):"")}function Nb(e,t,n){function i(s,a){s("transform",zj(a)),s("d",t(null,a))}function r(s,a){return t(Sc(s,a.angle),a),Lr(s,a).translate(a.x||0,a.y||0)}function o(s,a){var u=a.x||0,l=a.y||0,c=a.angle||0;s.translate(u,l),c&&s.rotate(c*=Do),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Tb(o),pick:Ob(o),isect:n||Cb(o)}}var Uj=Nb("arc",Sj);function jj(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=1/0,s,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<o&&(o=a,s=e[r]));return s}function qj(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,o,s;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],o=e[i].y-t[1],s=r*r+o*o,s<n))return e[i];return null}function Wj(e,t){for(var n=e.length,i,r,o;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],o=i*i+r*r,i=e[n].size||1,o<i*i))return e[n];return null}function Rb(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Sc(u),c),Lr(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Ac(o);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:Lj(o),pick:a,isect:Mb,tip:n}}var Hj=Rb("area",Aj,jj);function Gj(e,t){var n=t.clip;e.save(),ce(n)?(e.beginPath(),n(e),e.clip()):MM(e,t.group)}function MM(e,t){e.beginPath(),xb(t)?xu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function FM(e){const t=hi(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function Vj(e,t){e("transform",CM(t))}function TM(e,t){const n=FM(t);e("d",xu(null,t,n,n))}function Yj(e,t){e("class","background"),e("aria-hidden",!0),TM(e,t)}function Xj(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?TM(e,t):e("d","")}function Kj(e,t,n){const i=t.clip?wb(n,t,t):null;e("clip-path",i)}function Zj(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Lr(e,t),e.translate(t.x||0,t.y||0)}function kc(e,t,n,i){const r=FM(t);e.beginPath(),xu(e,t,(n||0)+r,(i||0)+r)}const Jj=Ac(kc),Qj=Ac(kc,!1),eq=Ac(kc,!0);function tq(e,t,n,i){pi(t,r=>{const o=r.x||0,s=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(kc(e,r,o,s),Eu(e,r),r.fill&&qh(e,r,u)&&e.fill(),r.stroke&&!a&&_u(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&MM(e,r),n&&n.translate(-o,-s),pi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(o,s),e.restore(),a&&r.stroke&&u&&(kc(e,r,o,s),Eu(e,r),_u(e,r,u)&&e.stroke())})}function nq(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const s=n*e.pixelRatio,a=i*e.pixelRatio;return Wh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,g&&xb(u)&&!eq(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&Qj(e,u,s,a)?(e.restore(),u):(l=Wh(u,b=>iq(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&Jj(e,u,s,a)&&(l=u),e.restore(),l||null)})}function iq(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var rq={type:"group",tag:"g",nested:!1,attr:Vj,bound:Zj,draw:tq,pick:nq,isect:_M,content:Kj,background:Yj,foreground:Xj},Cc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Pb(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(i=>{e.image=i,e.image.url=e.url})),n}function Lb(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Ib(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Gh(e,t){return e==="center"?t/2:e==="right"?t:0}function Vh(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function oq(e,t,n){const i=Pb(t,n),r=Lb(t,i),o=Ib(t,i),s=(t.x||0)-Gh(t.align,r),a=(t.y||0)-Vh(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Cc["xmlns:xlink"],"xlink:href"),e("transform",Ws(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function sq(e,t){const n=t.image,i=Lb(t,n),r=Ib(t,n),o=(t.x||0)-Gh(t.align,i),s=(t.y||0)-Vh(t.baseline,r);return e.set(o,s,o+i,s+r)}function aq(e,t,n){pi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Pb(i,this);let o=Lb(i,r),s=Ib(i,r);if(o===0||s===0)return;let a=(i.x||0)-Gh(i.align,o),u=(i.y||0)-Vh(i.baseline,s),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(s-d)/2,s=d):(d=s*c,a+=(o-d)/2,o=d))),(r.complete||r.toDataURL)&&(Eu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var uq={type:"image",tag:"image",nested:!1,attr:oq,bound:sq,draw:aq,pick:Hh(),isect:Wn,get:Pb,xOffset:Gh,yOffset:Vh},lq=Rb("line",kj,qj);function cq(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",Bj(t)),e("d",t.path)}function Yh(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*Do,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=bu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),xc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):xc(e,u,i,r,o,s)}function fq(e,t){return Yh(Sc(e,t.angle),t)?e.set(0,0,0,0):Lr(e,t,!0)}var dq={type:"path",tag:"path",nested:!1,attr:cq,bound:fq,draw:Tb(Yh),pick:Ob(Yh),isect:Cb(Yh)};function hq(e,t){e("d",xu(null,t))}function pq(e,t){var n,i;return Lr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function OM(e,t){e.beginPath(),xu(e,t)}var gq={type:"rect",tag:"path",nested:!1,attr:hq,bound:pq,draw:Tb(OM),pick:Ob(OM),isect:_M};function mq(e,t){e("transform",CM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function yq(e,t){var n,i;return Lr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function DM(e,t,n){var i,r,o,s;return t.stroke&&_u(e,t,n)?(i=t.x||0,r=t.y||0,o=t.x2!=null?t.x2:i,s=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,s),!0):!1}function bq(e,t,n){pi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&DM(e,i,r)&&(Eu(e,i),e.stroke())}})}function vq(e,t,n,i){return e.isPointInStroke?DM(e,t,1)&&e.isPointInStroke(n,i):!1}var xq={type:"rule",tag:"line",nested:!1,attr:mq,bound:yq,draw:bq,pick:Hh(vq),isect:$M},wq=Nb("shape",Cj),Eq=Nb("symbol",Mj,Mb);const NM=b$();var On={height:Qi,measureWidth:zb,estimateWidth:Xh,width:Xh,canvas:RM};RM(!0);function RM(e){On.width=e&&Po?zb:Xh}function Xh(e,t){return PM(Io(e,t),Qi(e))}function PM(e,t){return~~(.8*e.length*t)}function zb(e,t){return Qi(e)<=0||!(t=Io(e,t))?0:LM(t,Kh(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=NM.get(n);return i===void 0&&(Po.font=t,i=Po.measureText(e).width,NM.set(n,i)),i}function Qi(e){return e.fontSize!=null?+e.fontSize||0:11}function Lo(e){return e.lineHeight!=null?e.lineHeight:Qi(e)+2}function _q(e){return L(e)?e.length>1?e:e[0]:e}function Mc(e){return _q(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function Bb(e){const t=Mc(e);return(L(t)?t.length-1:0)*Lo(e)}function Io(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?Sq(e,n):n}function $q(e){if(On.width===zb){const t=Kh(e);return n=>LM(n,t)}else if(On.width===Xh){const t=Qi(e);return n=>PM(n,t)}else return t=>On.width(e,t)}function Sq(e,t){var n=+e.limit,i=$q(e);if(i(t)<n)return t;var r=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,u;if(n-=i(r),o){for(;s<a;)u=s+a>>>1,i(t.slice(u))>n?s=u+1:a=u;return r+t.slice(s)}else{for(;s<a;)u=1+(s+a>>>1),i(t.slice(0,u))<n?s=u:a=u-1;return t.slice(0,s)+r}}function Fc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Kh(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Qi(e)+"px "+Fc(e,t)}function Ub(e){var t=e.baseline,n=Qi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Lo(e):t==="line-bottom"?.29*n-.5*Lo(e):0)}const Aq={left:"start",center:"middle",right:"end"},Tc=new nt;function Zh(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Bs,t+=i*Math.cos(r),n+=i*Math.sin(r)),Tc.x1=t,Tc.y1=n,Tc}function kq(e,t){var n=t.dx||0,i=(t.dy||0)+Ub(t),r=Zh(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",Aq[t.align]||"start"),a?(u=Ws(o,s)+" "+Db(a),(n||i)&&(u+=" "+Ws(n,i))):u=Ws(o+n,s+i),e("transform",u)}function jb(e,t,n){var i=On.height(t),r=t.align,o=Zh(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+Ub(t)-Math.round(.8*i),c=Mc(t),f;if(L(c)?(i+=Lo(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,On.width(t,h)),0)):f=On.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=s,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Do,s,a);else if(n===2)return e.rotatedPoints(t.angle*Do,s,a);return e}function Cq(e,t,n){pi(t,i=>{var r=i.opacity==null?1:i.opacity,o,s,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Kh(i),e.textAlign=i.align||"left",o=Zh(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Do),s=a=0),s+=i.dx||0,a+=(i.dy||0)+Ub(i),c=Mc(i),Eu(e,i),L(c))for(l=Lo(i),u=0;u<c.length;++u)f=Io(i,c[u]),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&_u(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=Io(i,c),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&_u(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function Mq(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Zh(t),a=s.x1,u=s.y1,l=jb(Tc,t,1),c=-t.angle*Do,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),p=d*r+f*o+(u-d*a-f*u);return l.contains(h,p)}function Fq(e,t){const n=jb(Tc,e,2);return wu(t,n[0],n[1],n[2],n[3])||wu(t,n[0],n[1],n[4],n[5])||wu(t,n[4],n[5],n[6],n[7])||wu(t,n[2],n[3],n[6],n[7])}var Tq={type:"text",tag:"text",nested:!1,attr:kq,bound:jb,draw:Cq,pick:Hh(Mq),isect:Fq},Oq=Rb("trail",Fj,Wj),Dn={arc:Uj,area:Hj,group:rq,image:uq,line:lq,path:dq,rect:gq,rule:xq,shape:wq,symbol:Eq,text:Tq,trail:Oq};function qb(e,t,n){var i=Dn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new nt),e,n)}var IM={mark:null};function zM(e,t,n){var i=Dn[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(IM.mark=e,l=IM),c=qb(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new nt,s)for(a=0,u=o.length;a<u;++a)t.union(qb(o[a],r,n));return e.bounds=t}const Dq=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function BM(e,t){return JSON.stringify(e,Dq,t)}function UM(e){const t=typeof e=="string"?JSON.parse(e):e;return jM(t)}function jM(e){var t=e.marktype,n=e.items,i,r,o;if(n)for(r=0,o=n.length;r<o;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&jM(n[r]);return t&&zM(e),e}class qM{constructor(t){arguments.length?this.root=UM(t):(this.root=WM({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Lh(this.root)])}toJSON(t){return BM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=WM(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function WM(e,t){const n={bounds:new nt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function zo(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function Wb(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function st(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=zo(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function Kn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function HM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Jh(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Nq(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=Dn[r.marktype]).tip){for(s=Jh(t,n),s[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(r.items,s)}return e}let Hb=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||Ud(),this._tooltip=n||Rq}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}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,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(t.type,t),s=zo(null,"a");for(const a in r)s.setAttribute(a,r[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=Nq(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=t.bounds,s=o.width(),a=o.height();let u=o.x1+r[0]+i.left,l=o.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:s,height:a,left:u,top:l,right:u+s,bottom:l+a}}};function Rq(e,t,n,i){e.element().setAttribute("title",i||"")}class Oc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new mM(t)}initialize(t,n,i,r,o){return this._el=t,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const Pq="keydown",Lq="keypress",Iq="keyup",GM="dragenter",Qh="dragleave",VM="dragover",Gb="pointerdown",zq="pointerup",ep="pointermove",tp="pointerout",YM="pointerover",Vb="mousedown",Bq="mouseup",XM="mousemove",np="mouseout",KM="mouseover",ip="click",Uq="dblclick",jq="wheel",ZM="mousewheel",rp="touchstart",op="touchmove",sp="touchend",qq=[Pq,Lq,Iq,GM,Qh,VM,Gb,zq,ep,tp,YM,Vb,Bq,XM,np,KM,ip,Uq,jq,ZM,rp,op,sp],Yb=ep,Dc=np,Xb=ip;class Nc extends Hb{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=qq,this.pointermove=QM([ep,XM],[YM,KM],[tp,np]),this.dragover=QM([VM],[GM],[Qh]),this.pointerout=eF([tp,np]),this.dragleave=eF([Qh])}initialize(t,n,i){return this._canvas=t&&Wb(t,"canvas"),[ip,Vb,Gb,ep,tp,Qh].forEach(r=>JM(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(ZM,t)}pointerdown(t){this._down=this._active,this.fire(Gb,t)}mousedown(t){this._down=this._active,this.fire(Vb,t)}click(t){this._down===this._active&&(this.fire(ip,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(rp,t,!0)}touchmove(t){this.fire(op,t,!0)}touchend(t){this.fire(sp,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===Xb&&r&&r.href?this.handleHref(n,r,r.href):(t===Yb||t===Dc)&&this.handleTooltip(n,r,t!==Dc),o)for(let s=0,a=o.length;s<a;++s)o[s].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(JM(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&r.splice(o,1),this}pickEvent(t){const n=Jh(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,o){const s=this.context();return Dn[t.marktype].pick.call(this,s,t,n,i,r,o)}}const Wq=e=>e===rp||e===op||e===sp?[rp,op,sp]:[e];function JM(e,t){Wq(t).forEach(n=>Hq(e,n))}function Hq(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Rc(e,t,n){t.forEach(i=>e.fire(i,n))}function QM(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?Rc(this,e,i):((!r||!r.exit)&&Rc(this,n,i),this._active=o,Rc(this,t,i),Rc(this,e,i))}}function eF(e){return function(t){Rc(this,e,t),this._active=null}}function Gq(){return typeof window<"u"&&window.devicePixelRatio||1}function Vq(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?Gq():r;e.width=t*u,e.height=n*u;for(const l in o)a[l]=o[l];return s&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class ap extends Oc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new nt,this._tempb=new nt}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:ko(1,1,this._options.type),t&&this._canvas&&(Kn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,o)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)Vq(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||R("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.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 n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,a=this._dirty,u=Yq(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):Xq(i,u.intersect(a),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=Dn[n.marktype];n.clip&&Gj(t,n),o.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,i,r))}}const Yq=(e,t,n)=>new nt().set(0,0,t,n).translate(-e[0],-e[1]);function Xq(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}class tF extends Hb{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Kb(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Kb(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Dc)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(Xb,this._hrefHandler),r.removeEventListener(Yb,this._tooltipHandler),r.removeEventListener(Dc,this._tooltipHandler)),this._svg=r=t&&Wb(t,"svg"),r&&(r.addEventListener(Xb,this._hrefHandler),r.addEventListener(Yb,this._tooltipHandler),r.addEventListener(Dc,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const s={type:t,handler:n,listener:Kb(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Kb=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},nF="aria-hidden",Zb="aria-label",Jb="role",Qb="aria-roledescription",iF="graphics-object",ev="graphics-symbol",rF=(e,t,n)=>({[Jb]:e,[Qb]:t,[Zb]:n||void 0}),Kq=li(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),oF={axis:{desc:"axis",caption:Qq},legend:{desc:"legend",caption:eW},"title-text":{desc:"title",caption:e=>`Title text '${lF(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${lF(e)}'`}},sF={ariaRole:Jb,ariaRoleDescription:Qb,description:Zb};function aF(e,t){const n=t.aria===!1;if(e(nF,n||void 0),n||t.description==null)for(const i in sF)e(sF[i],void 0);else{const i=t.mark.marktype;e(Zb,t.description),e(Jb,t.ariaRole||(i==="group"?iF:ev)),e(Qb,t.ariaRoleDescription||`${i} mark`)}}function uF(e){return e.aria===!1?{[nF]:!0}:Kq[e.role]?null:oF[e.role]?Jq(e,oF[e.role]):Zq(e)}function Zq(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return rF(n?iF:ev,`${t} mark container`,e.description)}function Jq(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return rF(t.role||ev,t.desc,n.description||i(n))}catch{return null}}function lF(e){return X(e.text).join(" ")}function Qq(e){const t=e.datum,n=e.orient,i=t.title?cF(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${yu(a)?"discrete":a} scale with ${nM(s,o,e)}`}function eW(e){const t=e.datum,n=t.title?cF(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return nW(i)+(n?` titled '${n}'`:"")+` for ${tW(o)} with ${nM(u,a,e)}`}function cF(e){try{return X(ve(e.items).items[0].text).join(" ")}catch{return null}}function tW(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ve(e)}function nW(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const fF=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),iW=e=>fF(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function tv(){let e="",t="",n="";const i=[],r=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},s=(u,l)=>(l!=null&&(t+=` ${u}="${iW(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=fF(u),a),toString:()=>e};return a}const dF=e=>hF(tv(),e)+"";function hF(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):hF(e,i)}return e.close()}const up={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},lp={blend:"mix-blend-mode"},pF={fill:"none","stroke-miterlimit":10},Pc=0,gF="http://www.w3.org/2000/xmlns/",at=Cc.xmlns;class nv extends Oc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,o){return this._defs={},this._clearDefs(),t&&(this._svg=st(t,0,"svg",at),this._svg.setAttributeNS(gF,"xmlns",at),this._svg.setAttributeNS(gF,"xmlns:xlink",Cc["xmlns:xlink"]),this._svg.setAttribute("version",Cc.version),this._svg.setAttribute("class","marks"),Kn(t,1),this._root=st(this._svg,Pc,"g",at),Bo(this._root,pF),Kn(this._svg,Pc+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(Bo(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,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=st(t,Pc,"rect",at),Bo(i,{width:this._width,height:this._height,fill:n}));const r=dF(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Kn(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 n=++this._dirtyID;let i,r,o,s,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==o&&(o=r.marktype,s=Dn[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,mF(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){s.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(s,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=s.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,mF(i,n)):this._update(s,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Dn[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=yF(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return Kn(c,0),n._svg;c.setAttribute("class",HM(n));const f=uF(n);for(const g in f)Kt(c,g,f[g]);l||Kt(c,"pointer-events",u),Kt(c,"clip-path",n.clip?wb(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=yF(g,c,d,a.tag,o);m&&(this._update(a,y,g),l&&sW(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):pi(n,p),Kn(c,h),c}_update(t,n,i){Ir=n,jt=n.__values__,aF(Lc,i),t.attr(Lc,i,this);const r=uW[t.type];r&&r.call(this,t,n,i),Ir&&this.style(Ir,i)}style(t,n){if(n!=null){for(const i in up){let r=i==="font"?Fc(n):n[i];if(r===jt[i])continue;const o=up[i];r==null?t.removeAttribute(o):(gb(r)&&(r=rM(r,this._defs.gradient,bF())),t.setAttribute(o,r+"")),jt[i]=r}for(const i in lp)cp(t,lp[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=st(t,Pc+1,"defs",at)),r=rW(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=st(t,Pc+1,"defs",at)),r=oW(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):Kn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function mF(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function rW(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=st(e,n++,"pattern",at);Bo(s,{id:Dh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=st(s,0,"rect",at),Bo(s,{width:1,height:1,fill:`url(${bF()}#${t.id})`}),e=st(e,n++,"radialGradient",at),Bo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=st(e,n++,"linearGradient",at),Bo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=st(e,i,"stop",at),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return Kn(e,i),n}function oW(e,t,n){let i;return e=st(e,n,"clipPath",at),e.setAttribute("id",t.id),t.path?(i=st(e,0,"path",at),i.setAttribute("d",t.path)):(i=st(e,0,"rect",at),Bo(i,{x:0,y:0,width:t.width,height:t.height})),Kn(e,1),n+1}function sW(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;pi(n,s=>{r=e.mark(t,s,r,i),++o}),Kn(t,1+o)}function yF(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=zo(s,i,at),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=zo(s,"path",at);o.appendChild(a),a.__data__=e;const u=zo(s,"g",at);o.appendChild(u),u.__data__=e;const l=zo(s,"path",at);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||aW(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function aW(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Ir=null,jt=null;const uW={group(e,t,n){const i=Ir=t.childNodes[2];jt=i.__values__,e.foreground(Lc,n,this),jt=t.__values__,Ir=t.childNodes[1],e.content(Lc,n,this);const r=Ir=t.childNodes[0];e.background(Lc,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==jt.events&&(Kt(i,"pointer-events",o),Kt(r,"pointer-events",o),jt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Kt(i,"display",null),this.style(r,n),Kt(r,"stroke",null),s&&(n.fill=null),jt=i.__values__,this.style(i,n),s&&(n.fill=s),Ir=null}else Kt(i,"display","none")},image(e,t,n){n.smooth===!1?(cp(t,"image-rendering","optimizeSpeed"),cp(t,"image-rendering","pixelated")):cp(t,"image-rendering",null)},text(e,t,n){const i=Mc(n);let r,o,s,a;L(i)?(o=i.map(u=>Io(n,u)),r=o.join(`
48
+ `),r!==jt.text&&(Kn(t,0),s=t.ownerDocument,a=Lo(n),o.forEach((u,l)=>{const c=zo(s,"tspan",at);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),jt.text=r)):(o=Io(n,i),o!==jt.text&&(t.textContent=o,jt.text=o)),Kt(t,"font-family",Fc(n)),Kt(t,"font-size",Qi(n)+"px"),Kt(t,"font-style",n.fontStyle),Kt(t,"font-variant",n.fontVariant),Kt(t,"font-weight",n.fontWeight)}};function Lc(e,t,n){t!==jt[e]&&(n?lW(Ir,e,t,n):Kt(Ir,e,t),jt[e]=t)}function cp(e,t,n){n!==jt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),jt[t]=n)}function Bo(e,t){for(const n in t)Kt(e,n,t[n])}function Kt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function lW(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function bF(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class vF extends Oc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=tv();n.open("svg",fe({},Cc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",pF,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Dn[n.marktype],r=i.tag,o=[aF,i.attr];t.open("g",{class:HM(n),"clip-path":n.clip?wb(this,n,n.group):null},uF(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Mc(a);if(L(l)){const c={x:0,dy:Lo(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Io(a,l[f])).close()}else t.text(Io(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),pi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):pi(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&cW(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Dh+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function cW(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Fc(t),e["font-size"]=Qi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in up){let a=t[s];const u=up[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(gb(a)&&(a=rM(a,r.gradient,"")),e[u]=a)}for(const s in lp){const a=t[s];a!=null&&(o=o||[],o.push(`${lp[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const gi={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function fW(e){gi.svgMarkTypes=e.svgMarkTypes??["text"],gi.svgOnTop=e.svgOnTop??!0,gi.debug=e.debug??!1}class iv extends Oc{constructor(t){super(t),this._svgRenderer=new nv(t),this._canvasRenderer=new ap(t)}initialize(t,n,i,r,o){this._root_el=st(t,0,"div");const s=st(this._root_el,0,"div"),a=st(this._root_el,1,"div");return this._root_el.style.position="relative",gi.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=gi.svgOnTop?a:s,this._canvasEl=gi.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return gi.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!gi.svgMarkTypes.includes(o));this._svgRenderer.render(t,gi.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return gi.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class xF extends Nc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=st(st(t,0,"div"),gi.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const wF="canvas",EF="hybrid",_F="png",$F="svg",SF="none",Uo={Canvas:wF,PNG:_F,SVG:$F,Hybrid:EF,None:SF},Hs={};Hs[wF]=Hs[_F]={renderer:ap,headless:ap,handler:Nc},Hs[$F]={renderer:nv,headless:vF,handler:tF},Hs[EF]={renderer:iv,headless:iv,handler:xF},Hs[SF]={};function fp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Hs[e]=t,this):Hs[e]}function AF(e,t,n){const i=[],r=new nt().union(t),o=e.marktype;return o?kF(e,r,n,i):o==="group"?CF(e,r,n,i):R("Intersect scene must be mark node or group item.")}function kF(e,t,n,i){if(dW(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)CF(r[a],t,n,i);else for(const u=Dn[o].isect;a<s;++a){const l=r[a];MF(l,t,u)&&i.push(l)}}return i}function dW(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function CF(e,t,n,i){n&&n(e.mark)&&MF(e,t,Dn.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)kF(r[u],t,n,i);t.translate(s,a)}return i}function MF(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const rv=new nt;function FF(e){const t=e.clip;if(ce(t))t(Sc(rv.clear()));else if(t)rv.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(rv)}const hW=1e-9;function ov(e,t,n){return e===t?!0:n==="path"?TF(e,t):e instanceof Date&&t instanceof Date?+e==+t:_e(e)&&_e(t)?Math.abs(e-t)<=hW:!e||!t||!Y(e)&&!Y(t)?e==t:pW(e,t)}function TF(e,t){return ov(bu(e),bu(t))}function pW(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!ov(e[r],t[r],r))return!1;return typeof e==typeof t}function gW(){gM(),zU()}const $u="top",mi="left",yi="right",jo="bottom",mW="top-left",yW="top-right",bW="bottom-left",vW="bottom-right",sv="start",av="middle",Zt="end",xW="x",wW="y",dp="group",uv="axis",lv="title",EW="frame",_W="scope",cv="legend",OF="row-header",DF="row-footer",NF="row-title",RF="column-header",PF="column-footer",LF="column-title",$W="padding",SW="symbol",IF="fit",zF="fit-x",BF="fit-y",AW="pad",fv="none",hp="all",dv="each",hv="flush",qo="column",Wo="row";function UF(e){O.call(this,null,e)}G(UF,O,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Dn[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=pp(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===dp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(pp(l,s))),i.role){case uv:case cv:case lv:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(pp(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(pp(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return FF(i),t.modifies("bounds")}});function pp(e,t,n){return t(e.bounds.clear(),e,n)}const jF=":vega_identifier:";function pv(e){O.call(this,0,e)}pv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},G(pv,O,{transform(e,t){const n=kW(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function kW(e){return e._signals[jF]||(e._signals[jF]=e.add(0))}function qF(e){O.call(this,null,e)}G(qF,O,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,CW(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 i=n.marktype===dp?Lh:Ph;return t.visit(t.ADD,r=>i.call(r,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}});function CW(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function WF(e){O.call(this,null,e)}const HF={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!GF(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},GF=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),VF=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(GF(r,o=e[n].bounds,t))return!0},MW=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},FW=(e,t,n)=>{var i=e.range(),r=new nt;return t===$u||t===jo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},YF=e=>(e.forEach(t=>t.opacity=1),e),XF=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(WF,O,{transform(e,t){const n=HF[e.method]||HF.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(YF(r),t=XF(t,e)),t;if(r=r.filter(MW),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=YF(r),t=XF(t,e),o.length>=3&&VF(o,i)){do o=n(o,i);while(o.length>=3&&VF(o,i));o.length<3&&!ve(r).opacity&&(o.length>1&&(ve(o).opacity=0),ve(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=FW(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function KF(e){O.call(this,null,e)}G(KF,O,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const qt=new nt;function Su(e,t,n){return e[t]===n?0:(e[t]=n,1)}function TW(e){var t=e.items[0].orient;return t===mi||t===yi}function OW(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function DW(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=OW(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=o.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&Bb(p),b=0,v=0,x,w;switch(qt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case $u:b=f||0,v=-c,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(l,0),p&&gp(e,p,w,g,y,0,-1,m);break;case mi:b=-c,v=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,l),p&&gp(e,p,w,g,y,1,-1,m);break;case yi:b=n+c,v=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,l),p&&gp(e,p,w,g,y,1,1,m);break;case jo:b=f||0,v=i+c,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,w),p&&gp(e,p,w,g,0,0,1,m);break;default:b=r.x,v=r.y}return Lr(m.translate(b,v),r),Su(r,"x",b+s)|Su(r,"y",v+s)&&(r.bounds=qt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function gp(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const ZF=(e,t)=>Math.floor(Math.min(e,t)),JF=(e,t)=>Math.ceil(Math.max(e,t));function NW(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===dp)switch(r.role){case uv:case cv:case lv:break;case OF:s.rowheaders.push(...o);break;case DF:s.rowfooters.push(...o);break;case RF:s.colheaders.push(...o);break;case PF:s.colfooters.push(...o);break;case NF:s.rowtitle=o[0];break;case LF:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function RW(e){return new nt().set(0,0,e.width||0,e.height||0)}function PW(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 i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function QF(e){return e<0?Math.ceil(-e):0}function e3(e,t,n){var i=!n.nodirty,r=n.bounds===hv?RW:PW,o=qt.set(0,0,0,0),s=je(n.align,qo),a=je(n.align,Wo),u=je(n.padding,qo),l=je(n.padding,Wo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),w=Array(d),_,E,$,S,M,k,D,A,F,C,T;for(E=0;E<c;++E)p[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)k=t[E],M=w[E]=r(k),k.x=k.x||0,v[E]=0,k.y=k.y||0,x[E]=0,$=E%c,S=~~(E/c),g=Math.max(g,D=Math.ceil(M.x2)),b=Math.max(b,A=Math.ceil(M.y2)),p[$]=Math.max(p[$],D),y[S]=Math.max(y[S],A),h[E]=u+QF(M.x1),m[E]=l+QF(M.y1),i&&e.dirty(t[E]);for(E=0;E<d;++E)E%c===0&&(h[E]=0),E<c&&(m[E]=0);if(s===dv)for($=1;$<c;++$){for(T=0,E=$;E<d;E+=c)T<h[E]&&(T=h[E]);for(E=$;E<d;E+=c)h[E]=T+p[$-1]}else if(s===hp){for(T=0,E=0;E<d;++E)E%c&&T<h[E]&&(T=h[E]);for(E=0;E<d;++E)E%c&&(h[E]=T+g)}else for(s=!1,$=1;$<c;++$)for(E=$;E<d;E+=c)h[E]+=p[$-1];if(a===dv)for(S=1;S<f;++S){for(T=0,E=S*c,_=E+c;E<_;++E)T<m[E]&&(T=m[E]);for(E=S*c;E<_;++E)m[E]=T+y[S-1]}else if(a===hp){for(T=0,E=c;E<d;++E)T<m[E]&&(T=m[E]);for(E=c;E<d;++E)m[E]=T+b}else for(a=!1,S=1;S<f;++S)for(E=S*c,_=E+c;E<_;++E)m[E]+=y[S-1];for(F=0,E=0;E<d;++E)F=h[E]+(E%c?F:0),v[E]+=F-t[E].x;for($=0;$<c;++$)for(C=0,E=$;E<d;E+=c)C+=m[E],x[E]+=C-t[E].y;if(s&&je(n.center,qo)&&f>1)for(E=0;E<d;++E)M=s===hp?g:p[E%c],F=M-w[E].x2-t[E].x-v[E],F>0&&(v[E]+=F/2);if(a&&je(n.center,Wo)&&c!==1)for(E=0;E<d;++E)M=a===hp?b:y[~~(E/c)],C=M-w[E].y2-t[E].y-x[E],C>0&&(x[E]+=C/2);for(E=0;E<d;++E)o.union(w[E].translate(v[E],x[E]));switch(F=je(n.anchor,xW),C=je(n.anchor,wW),je(n.anchor,qo)){case Zt:F-=o.width();break;case av:F-=o.width()/2}switch(je(n.anchor,Wo)){case Zt:C-=o.height();break;case av:C-=o.height()/2}for(F=Math.round(F),C=Math.round(C),o.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)k=t[E],k.x+=v[E]+=F,k.y+=x[E]+=C,o.union(k.mark.bounds.union(k.bounds.translate(v[E],x[E]))),i&&e.dirty(k);return o}function LW(e,t,n){var i=NW(t),r=i.marks,o=n.bounds===hv?IW:zW,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=e3(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=je(n.headerBand,Wo,null),c=mp(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),ZF,0,o,"x1",0,a,1,g)),i.colheaders&&(g=je(n.headerBand,qo,null),f=mp(e,i.colheaders,r,a,a,-je(s,"columnHeader"),ZF,1,o,"y1",0,1,a,g)),i.rowfooters&&(g=je(n.footerBand,Wo,null),d=mp(e,i.rowfooters,r,a,u,je(s,"rowFooter"),JF,0,o,"x2",a-1,a,1,g)),i.colfooters&&(g=je(n.footerBand,qo,null),h=mp(e,i.colfooters,r,a,a,je(s,"columnFooter"),JF,1,o,"y2",l-a,1,a,g)),i.rowtitle&&(p=je(n.titleAnchor,Wo),m=je(s,"rowTitle"),m=p===Zt?d+m:c-m,g=je(n.titleBand,Wo,.5),t3(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=je(n.titleAnchor,qo),m=je(s,"columnTitle"),m=p===Zt?h+m:f-m,g=je(n.titleBand,qo,.5),t3(e,i.coltitle,m,1,y,g))}function IW(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function zW(e,t){return e.bounds[t]}function mp(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,w,_,E,$,S;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=s(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=o,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(_=t[b],w=_.mark.bounds,v=y;v>=0&&(E=n[v])==null;v-=d);a?($=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),S=g):($=g,S=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),w.union(_.bounds.translate($-(_.x||0),S-(_.y||0))),_.x=$,_.y=S,e.dirty(_),m=s(m,w[l])}return m}function t3(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function BW(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function UW(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function jW(e,t,n,i,r,o,s){const a=BW(n,t),u=UW(e,a("offset",0)),l=a("anchor",sv),c=l===Zt?1:l===av?.5:0,f={align:dv,bounds:a("bounds",hv),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case mi:f.anchor={x:Math.floor(i.x1)-u,column:Zt,y:c*(s||i.height()+2*i.y1),row:l};break;case yi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case $u:f.anchor={y:Math.floor(r.y1)-u,row:Zt,x:c*(o||r.width()+2*r.x1),column:l};break;case jo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case mW:f.anchor={x:u,y:u};break;case yW:f.anchor={x:o-u,y:u,column:Zt};break;case bW:f.anchor={x:u,y:s-u,row:Zt};break;case vW:f.anchor={x:o-u,y:s-u,column:Zt,row:Zt};break}return f}function qW(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),HW(e,n,n.items[0].items[0]),o=WW(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===SW&&GW(n.items[0].items[0].items[0].items),r!==fv&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Lr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function WW(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function HW(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&Ic(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case mi:r+=Math.ceil(s.bounds.width())+u;break;case yi:case jo:break;default:o+=s.bounds.height()+u}switch((r||o)&&Ic(e,n,r,o),s.orient){case mi:c+=Au(t,n,s,a,1,1);break;case yi:l+=Au(t,n,s,Zt,0,0)+u,c+=Au(t,n,s,a,1,1);break;case jo:l+=Au(t,n,s,a,0,0),c+=Au(t,n,s,Zt,-1,0,1)+u;break;default:l+=Au(t,n,s,a,0,0)}(l||c)&&Ic(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(Ic(e,n,-l,0),Ic(e,s,-l,0))}}function Au(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:Bb(n);return Math.round(i===sv?f:i===Zt?d-h:.5*(c-h))}function Ic(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function GW(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function VW(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===mi||a===yi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(s!==dp?a===mi?(p=r.y2,h=r.y1):a===yi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===mi&&(p=i,h=0),v=u===sv?p:u===Zt?h:(p+h)/2,d&&d.text){switch(a){case $u:case jo:b=f.bounds.height()+c;break;case mi:y=f.bounds.width()+c;break;case yi:y=-f.bounds.width()-c;break}qt.clear().union(d.bounds),qt.translate(y-(d.x||0),b-(d.y||0)),Su(d,"x",y)|Su(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(qt),d.mark.bounds.clear().union(qt),e.dirty(d)),qt.clear().union(d.bounds)}else qt.clear();switch(qt.union(f.bounds),a){case $u:g=v,m=r.y1-qt.height()-l;break;case mi:g=r.x1-qt.width()-l,m=v;break;case yi:g=r.x2+qt.width()+l,m=v;break;case jo:g=v,m=r.y2+l;break;default:g=o.x,m=o.y}return Su(o,"x",g)|Su(o,"y",m)&&(qt.translate(g,m),e.dirty(o),o.bounds.clear().union(qt),t.bounds.clear().union(qt),e.dirty(o)),o.bounds}function n3(e){O.call(this,null,e)}G(n3,O,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&LW(n,i,e.layout),XW(n,i,e)}),YW(e.mark.group)?t.reflow():t}});function YW(e){return e&&e.mark.role!=="legend-entry"}function XW(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new nt().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case uv:h=TW(f)?a:u,h.union(DW(e,f,r,o));break;case lv:c=f;break;case cv:l.push(qW(e,f));break;case EW:case _W:case OF:case DF:case NF:case RF:case PF:case LF:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||yi,d!==fv&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];e3(e,b,jW(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===IF||n.autosize.type===zF||n.autosize.type===BF))switch(y.orient){case mi:case yi:s.add(b.x1,0).add(b.x2,0);break;case $u:case jo:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(VW(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),KW(e,t,s,n)}function KW(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=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-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===$W){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===fv?(l=0,f=0,u=s,c=a):o===IF?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===zF?(u=Math.max(0,s-l-d),a=c+f+h):o===BF?(s=u+l+d,c=Math.max(0,a-f-h)):o===AW&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const ZW=Object.freeze(Object.defineProperty({__proto__:null,bound:UF,identifier:pv,mark:qF,overlap:WF,render:KF,viewlayout:n3},Symbol.toStringTag,{value:"Module"}));function i3(e){O.call(this,null,e)}G(i3,O,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=db(o,s,e.minstep),u=e.format||XC(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?YC(o,e.values,a):hb(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function r3(e){O.call(this,null,e)}function JW(){return Ce({})}function QW(e){const t=Ga().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(r3,O,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||JW,o=e.key||ie,s=this.value;return L(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&R("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=QW(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function o3(e){O.call(this,null,e)}G(o3,O,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(L(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||go,u=r.enter||go,l=r.exit||go,c=(o&&!s?r[o]:a)||go;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==go&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==go&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==go){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function s3(e){O.call(this,[],e)}G(s3,O,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||Oh,s=e.scale,a=+e.limit,u=db(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===Oh,c=e.format||QC(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||JC(s,u),d,h,p,g,m;return r&&(i.rem=r),o===Oh?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ce(p=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Lt(g=p||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):o===AU?(d=s.domain(),h=WC(s,d[0],ve(d)),f.length<3&&!e.values&&d[0]!==ve(d)&&(f=[d[0],ve(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=LU(s),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const eH=e=>e.source.x,tH=e=>e.source.y,nH=e=>e.target.x,iH=e=>e.target.y;function gv(e){O.call(this,{},e)}gv.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"}]},G(gv,O,{transform(e,t){var n=e.sourceX||eH,i=e.sourceY||tH,r=e.targetX||nH,o=e.targetY||iH,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=c3.get(u+"-"+a)||c3.get(u);return l||R("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const a3=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,rH=(e,t,n,i)=>a3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),u3=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},oH=(e,t,n,i)=>u3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),l3=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},c3=Ga({line:a3,"line-radial":rH,arc:u3,"arc-radial":oH,curve:l3,"curve-radial":(e,t,n,i)=>l3(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a}});function mv(e){O.call(this,null,e)}mv.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"]}]},G(mv,O,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||qa,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/I$(l),h=Mn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const sH=5;function aH(e){const t=e.type;return!e.bins&&(t===pu||t===mc||t===yc)}function f3(e){return ub(e)&&e!==Ki}const uH=li(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function d3(e){O.call(this,null,e),this.modified(!0)}G(d3,O,{transform(e,t){var n=t.dataflow,i=this.value,r=lH(e);(!i||r!==i.type)&&(this.value=i=Se(r)());for(r in e)if(!uH[r]){if(r==="padding"&&f3(i.type))continue;ce(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return gH(i,e,pH(i,e,fH(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function lH(e){var t=e.type,n="",i;return t===Ki?Ki+"-"+pu:(cH(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Ki+"-":i===3?gu+"-":""),(n+t||pu).toLowerCase())}function cH(e){const t=e.type;return ub(t)&&t!==Ls&&t!==Is&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function fH(e,t,n){const i=dH(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&aH(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return f3(o)&&t.padding&&r[0]!==ve(r)&&(r=hH(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(h3(o,r,n)),o===ib&&e.unknown(t.domainImplicit?My:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&db(e,t.nice)||null),r.length}function dH(e,t,n){return t?(e.domain(h3(e.type,t,n)),t.length):-1}function hH(e,t,n,i,r,o){var s=Math.abs(ve(n)-n[0]),a=s/(s-2*i),u=e===Rr?R0(t,null,a):e===yc?_d(t,null,a,.5):e===mc?_d(t,null,a,r||1):e===kh?P0(t,null,a,o||1):N0(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function h3(e,t,n){if(zC(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function pH(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),o=r[0],s=ve(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||R("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Mn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===ob&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function gH(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=mH(i,t,n);else if(t.scheme&&(o=yH(i,t,n),ce(o))){if(e.interpolator)return e.interpolator(o);R(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&BC(i))return e.interpolator(Th(yv(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(cb(t.interpolate,t.interpolateGamma)):ce(e.round)?e.round(r):ce(e.rangeRound)&&e.interpolate(r?pc:To),o&&e.range(yv(o,t.reverse))}function mH(e,t,n){e!==DC&&e!==rb&&R("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===rb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*nb(n,r,i)]}function yH(e,t,n){var i=t.schemeExtent,r,o;return L(t.scheme)?o=Th(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=fb(r),o||R(`Unrecognized scheme name: ${t.scheme}`)),n=e===Mh?n+1:e===ob?n-1:e===mu||e===Ch?+t.schemeCount||sH:n,BC(e)?p3(o,i,t.reverse):ce(o)?qC(p3(o,i),n):e===ib?o:o.slice(0,n)}function p3(e,t,n){return ce(e)&&(t||n)?jC(e,yv(t||[0,1],n)):e}function yv(e,t){return t?e.slice().reverse():e}function g3(e){O.call(this,null,e)}G(g3,O,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ks(e.sort)),this.modified(n),t}});const m3="zero",y3="center",b3="normalize",v3=["y0","y1"];function bv(e){O.call(this,null,e)}bv.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:m3,values:[m3,y3,b3]},{name:"as",type:"string",array:!0,length:2,default:v3}]},G(bv,O,{transform(e,t){var n=e.as||v3,i=n[0],r=n[1],o=ks(e.sort),s=e.field||qa,a=e.offset===y3?bH:e.offset===b3?vH:xH,u,l,c,f;for(u=wH(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function bH(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function vH(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function xH(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function wH(e,t,n,i){var r=[],o=g=>g(c),s,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const EH=Object.freeze(Object.defineProperty({__proto__:null,axisticks:i3,datajoin:r3,encode:o3,legendentries:s3,linkpath:gv,pie:mv,scale:d3,sortitems:g3,stack:bv},Symbol.toStringTag,{value:"Module"}));var se=1e-6,yp=1e-12,ge=Math.PI,Xe=ge/2,bp=ge/4,Jt=ge*2,Je=180/ge,pe=ge/180,xe=Math.abs,ku=Math.atan,Zn=Math.atan2,ae=Math.cos,vp=Math.ceil,x3=Math.exp,vv=Math.hypot,xp=Math.log,xv=Math.pow,re=Math.sin,Jn=Math.sign||function(e){return e>0?1:e<0?-1:0},Qt=Math.sqrt,wv=Math.tan;function w3(e){return e>1?0:e<-1?ge:Math.acos(e)}function bn(e){return e>1?Xe:e<-1?-Xe:Math.asin(e)}function $t(){}function wp(e,t){e&&_3.hasOwnProperty(e.type)&&_3[e.type](e,t)}var E3={Feature:function(e,t){wp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)wp(n[i].geometry,t)}},_3={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ev(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Ev(n[i],t,0)},Polygon:function(e,t){$3(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)$3(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)wp(n[i],t)}};function Ev(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function $3(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Ev(e[n],t,1);t.polygonEnd()}function zr(e,t){e&&E3.hasOwnProperty(e.type)?E3[e.type](e,t):wp(e,t)}var Ep=new Xt,_p=new Xt,S3,A3,_v,$v,Sv,er={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){Ep=new Xt,er.lineStart=_H,er.lineEnd=$H},polygonEnd:function(){var e=+Ep;_p.add(e<0?Jt+e:e),this.lineStart=this.lineEnd=this.point=$t},sphere:function(){_p.add(Jt)}};function _H(){er.point=SH}function $H(){k3(S3,A3)}function SH(e,t){er.point=k3,S3=e,A3=t,e*=pe,t*=pe,_v=e,$v=ae(t=t/2+bp),Sv=re(t)}function k3(e,t){e*=pe,t*=pe,t=t/2+bp;var n=e-_v,i=n>=0?1:-1,r=i*n,o=ae(t),s=re(t),a=Sv*s,u=$v*o+a*ae(r),l=a*i*re(r);Ep.add(Zn(l,u)),_v=e,$v=o,Sv=s}function AH(e){return _p=new Xt,zr(e,er),_p*2}function $p(e){return[Zn(e[1],e[0]),bn(e[2])]}function Gs(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*re(t),re(n)]}function Sp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cu(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 Av(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ap(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function kp(e){var t=Qt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,vn,Ke,Nn,Vs,C3,M3,Mu,zc,Ho,Br,Ur={point:kv,lineStart:T3,lineEnd:O3,polygonStart:function(){Ur.point=D3,Ur.lineStart=kH,Ur.lineEnd=CH,zc=new Xt,er.polygonStart()},polygonEnd:function(){er.polygonEnd(),Ur.point=kv,Ur.lineStart=T3,Ur.lineEnd=O3,Ep<0?(He=-(Ke=180),vn=-(Nn=90)):zc>se?Nn=90:zc<-se&&(vn=-90),Br[0]=He,Br[1]=Ke},sphere:function(){He=-(Ke=180),vn=-(Nn=90)}};function kv(e,t){Ho.push(Br=[He=e,Ke=e]),t<vn&&(vn=t),t>Nn&&(Nn=t)}function F3(e,t){var n=Gs([e*pe,t*pe]);if(Mu){var i=Cu(Mu,n),r=[i[1],-i[0],0],o=Cu(r,i);kp(o),o=$p(o);var s=e-Vs,a=s>0?1:-1,u=o[0]*Je*a,l,c=xe(s)>180;c^(a*Vs<u&&u<a*e)?(l=o[1]*Je,l>Nn&&(Nn=l)):(u=(u+360)%360-180,c^(a*Vs<u&&u<a*e)?(l=-o[1]*Je,l<vn&&(vn=l)):(t<vn&&(vn=t),t>Nn&&(Nn=t))),c?e<Vs?Rn(He,e)>Rn(He,Ke)&&(Ke=e):Rn(e,Ke)>Rn(He,Ke)&&(He=e):Ke>=He?(e<He&&(He=e),e>Ke&&(Ke=e)):e>Vs?Rn(He,e)>Rn(He,Ke)&&(Ke=e):Rn(e,Ke)>Rn(He,Ke)&&(He=e)}else Ho.push(Br=[He=e,Ke=e]);t<vn&&(vn=t),t>Nn&&(Nn=t),Mu=n,Vs=e}function T3(){Ur.point=F3}function O3(){Br[0]=He,Br[1]=Ke,Ur.point=kv,Mu=null}function D3(e,t){if(Mu){var n=e-Vs;zc.add(xe(n)>180?n+(n>0?360:-360):n)}else C3=e,M3=t;er.point(e,t),F3(e,t)}function kH(){er.lineStart()}function CH(){D3(C3,M3),er.lineEnd(),xe(zc)>se&&(He=-(Ke=180)),Br[0]=He,Br[1]=Ke,Mu=null}function Rn(e,t){return(t-=e)<0?t+360:t}function MH(e,t){return e[0]-t[0]}function N3(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function FH(e){var t,n,i,r,o,s,a;if(Nn=Ke=-(He=vn=1/0),Ho=[],zr(e,Ur),n=Ho.length){for(Ho.sort(MH),t=1,i=Ho[0],o=[i];t<n;++t)r=Ho[t],N3(i,r[0])||N3(i,r[1])?(Rn(i[0],r[1])>Rn(i[0],i[1])&&(i[1]=r[1]),Rn(r[0],i[1])>Rn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Rn(i[1],r[0]))>s&&(s=a,He=r[0],Ke=i[1])}return Ho=Br=null,He===1/0||vn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,vn],[Ke,Nn]]}var Bc,Cp,Mp,Fp,Tp,Op,Dp,Np,Cv,Mv,Fv,R3,P3,en,tn,nn,bi={sphere:$t,point:Tv,lineStart:L3,lineEnd:I3,polygonStart:function(){bi.lineStart=DH,bi.lineEnd=NH},polygonEnd:function(){bi.lineStart=L3,bi.lineEnd=I3}};function Tv(e,t){e*=pe,t*=pe;var n=ae(t);Uc(n*ae(e),n*re(e),re(t))}function Uc(e,t,n){++Bc,Mp+=(e-Mp)/Bc,Fp+=(t-Fp)/Bc,Tp+=(n-Tp)/Bc}function L3(){bi.point=TH}function TH(e,t){e*=pe,t*=pe;var n=ae(t);en=n*ae(e),tn=n*re(e),nn=re(t),bi.point=OH,Uc(en,tn,nn)}function OH(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*re(e),o=re(t),s=Zn(Qt((s=tn*o-nn*r)*s+(s=nn*i-en*o)*s+(s=en*r-tn*i)*s),en*i+tn*r+nn*o);Cp+=s,Op+=s*(en+(en=i)),Dp+=s*(tn+(tn=r)),Np+=s*(nn+(nn=o)),Uc(en,tn,nn)}function I3(){bi.point=Tv}function DH(){bi.point=RH}function NH(){z3(R3,P3),bi.point=Tv}function RH(e,t){R3=e,P3=t,e*=pe,t*=pe,bi.point=z3;var n=ae(t);en=n*ae(e),tn=n*re(e),nn=re(t),Uc(en,tn,nn)}function z3(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*re(e),o=re(t),s=tn*o-nn*r,a=nn*i-en*o,u=en*r-tn*i,l=vv(s,a,u),c=bn(l),f=l&&-c/l;Cv.add(f*s),Mv.add(f*a),Fv.add(f*u),Cp+=c,Op+=c*(en+(en=i)),Dp+=c*(tn+(tn=r)),Np+=c*(nn+(nn=o)),Uc(en,tn,nn)}function PH(e){Bc=Cp=Mp=Fp=Tp=Op=Dp=Np=0,Cv=new Xt,Mv=new Xt,Fv=new Xt,zr(e,bi);var t=+Cv,n=+Mv,i=+Fv,r=vv(t,n,i);return r<yp&&(t=Op,n=Dp,i=Np,Cp<se&&(t=Mp,n=Fp,i=Tp),r=vv(t,n,i),r<yp)?[NaN,NaN]:[Zn(n,t)*Je,bn(i/r)*Je]}function Ov(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function Dv(e,t){return xe(e)>ge&&(e-=Math.round(e/Jt)*Jt),[e,t]}Dv.invert=Dv;function B3(e,t,n){return(e%=Jt)?t||n?Ov(j3(e),q3(t,n)):j3(e):t||n?q3(t,n):Dv}function U3(e){return function(t,n){return t+=e,xe(t)>ge&&(t-=Math.round(t/Jt)*Jt),[t,n]}}function j3(e){var t=U3(e);return t.invert=U3(-e),t}function q3(e,t){var n=ae(e),i=re(e),r=ae(t),o=re(t);function s(a,u){var l=ae(u),c=ae(a)*l,f=re(a)*l,d=re(u),h=d*n+c*i;return[Zn(f*r-h*o,c*n-d*i),bn(h*r+f*o)]}return s.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=re(a)*l,d=re(u),h=d*r-f*o;return[Zn(f*r+d*o,c*n+h*i),bn(h*n-c*i)]},s}function LH(e){e=B3(e[0]*pe,e[1]*pe,e.length>2?e[2]*pe:0);function t(n){return n=e(n[0]*pe,n[1]*pe),n[0]*=Je,n[1]*=Je,n}return t.invert=function(n){return n=e.invert(n[0]*pe,n[1]*pe),n[0]*=Je,n[1]*=Je,n},t}function IH(e,t,n,i,r,o){if(n){var s=ae(t),a=re(t),u=i*n;r==null?(r=t+i*Jt,o=t-u/2):(r=W3(s,r),o=W3(s,o),(i>0?r<o:r>o)&&(r+=i*Jt));for(var l,c=r;i>0?c>o:c<o;c-=u)l=$p([s,-a*ae(c),-a*re(c)]),e.point(l[0],l[1])}}function W3(e,t){t=Gs(t),t[0]-=e,kp(t);var n=w3(-t[1]);return((-t[2]<0?-n:n)+Jt-se)%Jt}function H3(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:$t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Rp(e,t){return xe(e[0]-t[0])<se&&xe(e[1]-t[1])<se}function Pp(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function G3(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Rp(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*se}o.push(b=new Pp(m,p,null,!0)),s.push(b.o=new Pp(m,null,b,!1)),o.push(b=new Pp(y,p,null,!1)),s.push(b.o=new Pp(y,null,b,!0))}}),!!o.length){for(s.sort(t),V3(o),V3(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function V3(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Nv(e){return xe(e[0])<=ge?e[0]:Jn(e[0])*((xe(e[0])+ge)%Jt-ge)}function zH(e,t){var n=Nv(t),i=t[1],r=re(i),o=[re(n),-ae(n),0],s=0,a=0,u=new Xt;r===1?i=Xe+se:r===-1&&(i=-Xe-se);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Nv(h),g=h[1]/2+bp,m=re(g),y=ae(g),b=0;b<d;++b,p=x,m=_,y=E,h=v){var v=f[b],x=Nv(v),w=v[1]/2+bp,_=re(w),E=ae(w),$=x-p,S=$>=0?1:-1,M=S*$,k=M>ge,D=m*_;if(u.add(Zn(D*S*re(M),y*E+D*ae(M))),s+=k?$+S*Jt:$,k^p>=n^x>=n){var A=Cu(Gs(h),Gs(v));kp(A);var F=Cu(o,A);kp(F);var C=(k^$>=0?-1:1)*bn(F[2]);(i>C||i===C&&(A[0]||A[1]))&&(a+=k^$>=0?1:-1)}}return(s<-se||s<se&&u<-yp)^a&1}function Y3(e,t,n,i){return function(r){var o=t(r),s=H3(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=L$(c);var x=zH(l,i);c.length?(u||(r.polygonStart(),u=!0),G3(c,UH,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,w){e(x,w)&&r.point(x,w)}function p(x,w){o.point(x,w)}function g(){d.point=p,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(x,w){f.push([x,w]),a.point(x,w)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),w=s.result(),_,E=w.length,$,S,M;if(f.pop(),l.push(f),f=null,!!E){if(x&1){if(S=w[0],($=S.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),_=0;_<$;++_)r.point((M=S[_])[0],M[1]);r.lineEnd()}return}E>1&&x&2&&w.push(w.pop().concat(w.shift())),c.push(w.filter(BH))}}return d}}function BH(e){return e.length>1}function UH(e,t){return((e=e.x)[0]<0?e[1]-Xe-se:Xe-e[1])-((t=t.x)[0]<0?t[1]-Xe-se:Xe-t[1])}const X3=Y3(function(){return!0},jH,WH,[-ge,-Xe]);function jH(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?ge:-ge,u=xe(o-t);xe(u-ge)<se?(e.point(t,n=(n+s)/2>0?Xe:-Xe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=ge&&(xe(t-i)<se&&(t-=i*se),xe(o-a)<se&&(o-=a*se),n=qH(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function qH(e,t,n,i){var r,o,s=re(e-n);return xe(s)>se?ku((re(t)*(o=ae(i))*re(n)-re(i)*(r=ae(t))*re(e))/(r*o*s)):(t+i)/2}function WH(e,t,n,i){var r;if(e==null)r=n*Xe,i.point(-ge,r),i.point(0,r),i.point(ge,r),i.point(ge,0),i.point(ge,-r),i.point(0,-r),i.point(-ge,-r),i.point(-ge,0),i.point(-ge,r);else if(xe(e[0]-t[0])>se){var o=e[0]<t[0]?ge:-ge;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function HH(e){var t=ae(e),n=2*pe,i=t>0,r=xe(t)>se;function o(c,f,d,h){IH(h,e,n,d,c,f)}function s(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=s(m,y),w=i?x?0:l(m,y):x?l(m+(m<0?ge:-ge),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||Rp(f,v)||Rp(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var _;!(w&d)&&(_=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(_[0][0],_[0][1]),c.point(_[1][0],_[1][1]),c.lineEnd()):(c.point(_[1][0],_[1][1]),c.lineEnd(),c.lineStart(),c.point(_[0][0],_[0][1],3)))}x&&(!f||!Rp(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=w},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Gs(c),p=Gs(f),g=[1,0,0],m=Cu(h,p),y=Sp(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,w=-t*b/v,_=Cu(g,m),E=Ap(g,x),$=Ap(m,w);Av(E,$);var S=_,M=Sp(E,S),k=Sp(S,S),D=M*M-k*(Sp(E,E)-1);if(!(D<0)){var A=Qt(D),F=Ap(S,(-M-A)/k);if(Av(F,E),F=$p(F),!d)return F;var C=c[0],T=f[0],P=c[1],I=f[1],z;T<C&&(z=C,C=T,T=z);var te=T-C,ne=xe(te-ge)<se,de=ne||te<se;if(!ne&&I<P&&(z=P,P=I,I=z),de?ne?P+I>0^F[1]<(xe(F[0]-C)<se?P:I):P<=F[1]&&F[1]<=I:te>ge^(C<=F[0]&&F[0]<=T)){var ke=Ap(S,(-M+A)/k);return Av(ke,E),[F,$p(ke)]}}}function l(c,f){var d=i?e:ge-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return Y3(s,a,o,i?[0,-e]:[-ge,e-ge])}function GH(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var jc=1e9,Lp=-jc;function K3(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,p=0;if(l==null||(h=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function s(l,c){return xe(l[0]-e)<se?c>0?0:3:xe(l[0]-n)<se?c>0?2:1:xe(l[1]-t)<se?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=H3(),d,h,p,g,m,y,b,v,x,w,_,E={point:$,lineStart:D,lineEnd:A,polygonStart:M,polygonEnd:k};function $(C,T){r(C,T)&&c.point(C,T)}function S(){for(var C=0,T=0,P=h.length;T<P;++T)for(var I=h[T],z=1,te=I.length,ne=I[0],de,ke,Ee=ne[0],Ie=ne[1];z<te;++z)de=Ee,ke=Ie,ne=I[z],Ee=ne[0],Ie=ne[1],ke<=i?Ie>i&&(Ee-de)*(i-ke)>(Ie-ke)*(e-de)&&++C:Ie<=i&&(Ee-de)*(i-ke)<(Ie-ke)*(e-de)&&--C;return C}function M(){c=f,d=[],h=[],_=!0}function k(){var C=S(),T=_&&C,P=(d=L$(d)).length;(T||P)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&G3(d,a,C,o,l),l.polygonEnd()),c=l,d=h=p=null}function D(){E.point=F,h&&h.push(p=[]),w=!0,x=!1,b=v=NaN}function A(){d&&(F(g,m),y&&x&&f.rejoin(),d.push(f.result())),E.point=$,x&&c.lineEnd()}function F(C,T){var P=r(C,T);if(h&&p.push([C,T]),w)g=C,m=T,y=P,w=!1,P&&(c.lineStart(),c.point(C,T));else if(P&&x)c.point(C,T);else{var I=[b=Math.max(Lp,Math.min(jc,b)),v=Math.max(Lp,Math.min(jc,v))],z=[C=Math.max(Lp,Math.min(jc,C)),T=Math.max(Lp,Math.min(jc,T))];GH(I,z,e,t,n,i)?(x||(c.lineStart(),c.point(I[0],I[1])),c.point(z[0],z[1]),P||c.lineEnd(),_=!1):P&&(c.lineStart(),c.point(C,T),_=!1)}b=C,v=T,x=P}return E}}function Z3(e,t,n){var i=Mn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function J3(e,t,n){var i=Mn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function VH(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Mn(vp(i/c)*c,n,c).map(p).concat(Mn(vp(a/f)*f,s,f).map(g)).concat(Mn(vp(t/u)*u,e,u).filter(function(v){return xe(v%c)>se}).map(d)).concat(Mn(vp(o/l)*l,r,l).filter(function(v){return xe(v%f)>se}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],s=+v[1][1],i>n&&(v=i,i=n,n=v),a>s&&(v=a,a=s,s=v),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),o>r&&(v=o,o=r,r=v),y.precision(m)):[[t,o],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=Z3(o,r,90),h=J3(t,e,m),p=Z3(a,s,90),g=J3(i,n,m),y):m},y.extentMajor([[-180,-90+se],[180,90-se]]).extentMinor([[-180,-80-se],[180,80+se]])}const qc=e=>e;var Rv=new Xt,Pv=new Xt,Q3,eT,Lv,Iv,jr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){jr.lineStart=YH,jr.lineEnd=KH},polygonEnd:function(){jr.lineStart=jr.lineEnd=jr.point=$t,Rv.add(xe(Pv)),Pv=new Xt},result:function(){var e=Rv/2;return Rv=new Xt,e}};function YH(){jr.point=XH}function XH(e,t){jr.point=tT,Q3=Lv=e,eT=Iv=t}function tT(e,t){Pv.add(Iv*e-Lv*t),Lv=e,Iv=t}function KH(){tT(Q3,eT)}var Fu=1/0,Ip=Fu,Wc=-Fu,zp=Wc,Bp={point:ZH,lineStart:$t,lineEnd:$t,polygonStart:$t,polygonEnd:$t,result:function(){var e=[[Fu,Ip],[Wc,zp]];return Wc=zp=-(Ip=Fu=1/0),e}};function ZH(e,t){e<Fu&&(Fu=e),e>Wc&&(Wc=e),t<Ip&&(Ip=t),t>zp&&(zp=t)}var zv=0,Bv=0,Hc=0,Up=0,jp=0,Tu=0,Uv=0,jv=0,Gc=0,nT,iT,tr,nr,Qn={point:Ys,lineStart:rT,lineEnd:oT,polygonStart:function(){Qn.lineStart=eG,Qn.lineEnd=tG},polygonEnd:function(){Qn.point=Ys,Qn.lineStart=rT,Qn.lineEnd=oT},result:function(){var e=Gc?[Uv/Gc,jv/Gc]:Tu?[Up/Tu,jp/Tu]:Hc?[zv/Hc,Bv/Hc]:[NaN,NaN];return zv=Bv=Hc=Up=jp=Tu=Uv=jv=Gc=0,e}};function Ys(e,t){zv+=e,Bv+=t,++Hc}function rT(){Qn.point=JH}function JH(e,t){Qn.point=QH,Ys(tr=e,nr=t)}function QH(e,t){var n=e-tr,i=t-nr,r=Qt(n*n+i*i);Up+=r*(tr+e)/2,jp+=r*(nr+t)/2,Tu+=r,Ys(tr=e,nr=t)}function oT(){Qn.point=Ys}function eG(){Qn.point=nG}function tG(){sT(nT,iT)}function nG(e,t){Qn.point=sT,Ys(nT=tr=e,iT=nr=t)}function sT(e,t){var n=e-tr,i=t-nr,r=Qt(n*n+i*i);Up+=r*(tr+e)/2,jp+=r*(nr+t)/2,Tu+=r,r=nr*e-tr*t,Uv+=r*(tr+e),jv+=r*(nr+t),Gc+=r*3,Ys(tr=e,nr=t)}function aT(e){this._context=e}aT.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(){this._line===0&&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,Jt);break}}},result:$t};var qv=new Xt,Wv,uT,lT,Vc,Yc,Xc={point:$t,lineStart:function(){Xc.point=iG},lineEnd:function(){Wv&&cT(uT,lT),Xc.point=$t},polygonStart:function(){Wv=!0},polygonEnd:function(){Wv=null},result:function(){var e=+qv;return qv=new Xt,e}};function iG(e,t){Xc.point=cT,uT=Vc=e,lT=Yc=t}function cT(e,t){Vc-=e,Yc-=t,qv.add(Qt(Vc*Vc+Yc*Yc)),Vc=e,Yc=t}let fT,qp,dT,hT;class pT{constructor(t){this._append=t==null?gT:rG(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==dT||this._append!==qp){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,dT=i,qp=this._append,hT=this._,this._=r}this._+=hT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function gT(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function rG(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return gT;if(t!==fT){const n=10**t;fT=t,qp=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return qp}function mT(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),zr(a,r(o))),o.result()}return s.area=function(a){return zr(a,r(jr)),jr.result()},s.measure=function(a){return zr(a,r(Xc)),Xc.result()},s.bounds=function(a){return zr(a,r(Bp)),Bp.result()},s.centroid=function(a){return zr(a,r(Qn)),Qn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,qc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new pT(n)):new aT(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new pT(n)),s},s.projection(e).digits(n).context(t)}function Wp(e){return function(t){var n=new Hv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Hv(){}Hv.prototype={constructor:Hv,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()}};function Gv(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),zr(n,e.stream(Bp)),t(Bp.result()),i!=null&&e.clipExtent(i),e}function Hp(e,t,n){return Gv(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function Vv(e,t,n){return Hp(e,[[0,0],t],n)}function Yv(e,t,n){return Gv(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function Xv(e,t,n){return Gv(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var yT=16,oG=ae(30*pe);function bT(e,t){return+t?aG(e,t):sG(e)}function sG(e){return Wp({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function aG(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=s+d,w=a+h,_=u+p,E=Qt(x*x+w*w+_*_),$=bn(_/=E),S=xe(xe(_)-1)<se||xe(o-f)<se?(o+f)/2:Zn(w,x),M=e(S,$),k=M[0],D=M[1],A=k-i,F=D-r,C=b*A-y*F;(C*C/v>t||xe((y*A+b*F)/v-.5)>.3||s*d+a*h+u*p<oG)&&(n(i,r,o,s,a,u,k,D,S,x/=E,w/=E,_,g,m),m.point(k,D),n(k,D,S,x,w,_,l,c,f,d,h,p,g,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=w},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y($,S){$=e($,S),i.point($[0],$[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v($,S){var M=Gs([$,S]),k=e($,S);n(f,d,c,h,p,g,f=k[0],d=k[1],c=$,h=M[0],p=M[1],g=M[2],yT,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function w(){b(),m.point=_,m.lineEnd=E}function _($,S){v(r=$,S),o=f,s=d,a=h,u=p,l=g,m.point=v}function E(){n(f,d,c,h,p,g,o,s,r,a,u,l,yT,i),m.lineEnd=x,x()}return m}}var uG=Wp({point:function(e,t){this.stream.point(e*pe,t*pe)}});function lG(e){return Wp({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function cG(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function vT(e,t,n,i,r,o){if(!o)return cG(e,t,n,i,r);var s=ae(o),a=re(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function ir(e){return xT(function(){return e})()}function xT(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=X3,m=null,y,b,v,x=qc,w=.5,_,E,$,S,M;function k(C){return $(C[0]*pe,C[1]*pe)}function D(C){return C=$.invert(C[0],C[1]),C&&[C[0]*Je,C[1]*Je]}k.stream=function(C){return S&&M===C?S:S=uG(lG(c)(g(_(x(M=C)))))},k.preclip=function(C){return arguments.length?(g=C,p=void 0,F()):g},k.postclip=function(C){return arguments.length?(x=C,m=y=b=v=null,F()):x},k.clipAngle=function(C){return arguments.length?(g=+C?HH(p=C*pe):(p=null,X3),F()):p*Je},k.clipExtent=function(C){return arguments.length?(x=C==null?(m=y=b=v=null,qc):K3(m=+C[0][0],y=+C[0][1],b=+C[1][0],v=+C[1][1]),F()):m==null?null:[[m,y],[b,v]]},k.scale=function(C){return arguments.length?(n=+C,A()):n},k.translate=function(C){return arguments.length?(i=+C[0],r=+C[1],A()):[i,r]},k.center=function(C){return arguments.length?(o=C[0]%360*pe,s=C[1]%360*pe,A()):[o*Je,s*Je]},k.rotate=function(C){return arguments.length?(a=C[0]%360*pe,u=C[1]%360*pe,l=C.length>2?C[2]%360*pe:0,A()):[a*Je,u*Je,l*Je]},k.angle=function(C){return arguments.length?(f=C%360*pe,A()):f*Je},k.reflectX=function(C){return arguments.length?(d=C?-1:1,A()):d<0},k.reflectY=function(C){return arguments.length?(h=C?-1:1,A()):h<0},k.precision=function(C){return arguments.length?(_=bT(E,w=C*C),F()):Qt(w)},k.fitExtent=function(C,T){return Hp(k,C,T)},k.fitSize=function(C,T){return Vv(k,C,T)},k.fitWidth=function(C,T){return Yv(k,C,T)},k.fitHeight=function(C,T){return Xv(k,C,T)};function A(){var C=vT(n,0,0,d,h,f).apply(null,t(o,s)),T=vT(n,i-C[0],r-C[1],d,h,f);return c=B3(a,u,l),E=Ov(t,T),$=Ov(c,E),_=bT(E,w),F()}function F(){return S=M=null,k}return function(){return t=e.apply(this,arguments),k.invert=t.invert&&D,A()}}function Kv(e){var t=0,n=ge/3,i=xT(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*pe,n=o[1]*pe):[t*Je,n*Je]},r}function fG(e){var t=ae(e);function n(i,r){return[i*t,re(r)/t]}return n.invert=function(i,r){return[i/t,bn(r*t)]},n}function dG(e,t){var n=re(e),i=(n+re(t))/2;if(xe(i)<se)return fG(e);var r=1+n*(2*i-n),o=Qt(r)/i;function s(a,u){var l=Qt(r-2*i*re(u))/i;return[l*re(a*=i),o-l*ae(a)]}return s.invert=function(a,u){var l=o-u,c=Zn(a,xe(l))*Jn(l);return l*i<0&&(c-=ge*Jn(a)*Jn(l)),[c/i,bn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Gp(){return Kv(dG).scale(155.424).center([0,33.6442])}function wT(){return Gp().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function hG(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function pG(){var e,t,n=wT(),i,r=Gp().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Gp().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(o.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=hG([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),o=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+se,g+.12*h+se],[p-.214*h-se,g+.234*h-se]]).stream(l),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+se,g+.166*h+se],[p-.115*h-se,g+.234*h-se]]).stream(l),f()},c.fitExtent=function(d,h){return Hp(c,d,h)},c.fitSize=function(d,h){return Vv(c,d,h)},c.fitWidth=function(d,h){return Yv(c,d,h)},c.fitHeight=function(d,h){return Xv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function ET(e){return function(t,n){var i=ae(t),r=ae(n),o=e(i*r);return o===1/0?[2,0]:[o*r*re(t),o*re(n)]}}function Kc(e){return function(t,n){var i=Qt(t*t+n*n),r=e(i),o=re(r),s=ae(r);return[Zn(t*o,i*s),bn(i&&n*o/i)]}}var _T=ET(function(e){return Qt(2/(1+e))});_T.invert=Kc(function(e){return 2*bn(e/2)});function gG(){return ir(_T).scale(124.75).clipAngle(180-.001)}var $T=ET(function(e){return(e=w3(e))&&e/re(e)});$T.invert=Kc(function(e){return e});function mG(){return ir($T).scale(79.4188).clipAngle(180-.001)}function Vp(e,t){return[e,xp(wv((Xe+t)/2))]}Vp.invert=function(e,t){return[e,2*ku(x3(t))-Xe]};function yG(){return ST(Vp).scale(961/Jt)}function ST(e){var t=ir(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=ge*i(),d=t(LH(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Vp?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function Yp(e){return wv((Xe+e)/2)}function bG(e,t){var n=ae(e),i=e===t?re(e):xp(n/ae(t))/xp(Yp(t)/Yp(e)),r=n*xv(Yp(e),i)/i;if(!i)return Vp;function o(s,a){r>0?a<-Xe+se&&(a=-Xe+se):a>Xe-se&&(a=Xe-se);var u=r/xv(Yp(a),i);return[u*re(i*s),r-u*ae(i*s)]}return o.invert=function(s,a){var u=r-a,l=Jn(i)*Qt(s*s+u*u),c=Zn(s,xe(u))*Jn(u);return u*i<0&&(c-=ge*Jn(s)*Jn(u)),[c/i,2*ku(xv(r/l,1/i))-Xe]},o}function vG(){return Kv(bG).scale(109.5).parallels([30,30])}function Xp(e,t){return[e,t]}Xp.invert=Xp;function xG(){return ir(Xp).scale(152.63)}function wG(e,t){var n=ae(e),i=e===t?re(e):(n-ae(t))/(t-e),r=n/i+e;if(xe(i)<se)return Xp;function o(s,a){var u=r-a,l=i*s;return[u*re(l),r-u*ae(l)]}return o.invert=function(s,a){var u=r-a,l=Zn(s,xe(u))*Jn(u);return u*i<0&&(l-=ge*Jn(s)*Jn(u)),[l/i,r-Jn(i)*Qt(s*s+u*u)]},o}function EG(){return Kv(wG).scale(131.154).center([0,13.9389])}var Zc=1.340264,Jc=-.081106,Qc=893e-6,ef=.003796,Kp=Qt(3)/2,_G=12;function AT(e,t){var n=bn(Kp*re(t)),i=n*n,r=i*i*i;return[e*ae(n)/(Kp*(Zc+3*Jc*i+r*(7*Qc+9*ef*i))),n*(Zc+Jc*i+r*(Qc+ef*i))]}AT.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<_G&&(a=n*(Zc+Jc*i+r*(Qc+ef*i))-t,u=Zc+3*Jc*i+r*(7*Qc+9*ef*i),n-=s=a/u,i=n*n,r=i*i*i,!(xe(s)<yp));++o);return[Kp*e*(Zc+3*Jc*i+r*(7*Qc+9*ef*i))/ae(n),bn(re(n)/Kp)]};function $G(){return ir(AT).scale(177.158)}function kT(e,t){var n=ae(t),i=ae(e)*n;return[n*re(e)/i,re(t)/i]}kT.invert=Kc(ku);function SG(){return ir(kT).scale(144.049).clipAngle(60)}function AG(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,p=Wp({point:function(x,w){var _=v([x,w]);this.stream.point(_[0],_[1])}}),g=qc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var w=x[0]*d,_=x[1]*h;if(o){var E=_*s-w*a;w=w*s+_*a,_=E}return[w+t,_+n]}return v.invert=function(x){var w=x[0]-t,_=x[1]-n;if(o){var E=_*s+w*a;w=w*s-_*a,_=E}return[w/d,_/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,qc):K3(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*pe,a=re(o),s=ae(o),b()):o*Je},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,w){return Hp(v,x,w)},v.fitSize=function(x,w){return Vv(v,x,w)},v.fitWidth=function(x,w){return Yv(v,x,w)},v.fitHeight=function(x,w){return Xv(v,x,w)},v}function CT(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}CT.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(xe(r)>se&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function kG(){return ir(CT).scale(175.295)}function MT(e,t){return[ae(t)*re(e),re(t)]}MT.invert=Kc(bn);function CG(){return ir(MT).scale(249.5).clipAngle(90+se)}function FT(e,t){var n=ae(t),i=1+ae(e)*n;return[n*re(e)/i,re(t)/i]}FT.invert=Kc(function(e){return 2*ku(e)});function MG(){return ir(FT).scale(250).clipAngle(142)}function TT(e,t){return[xp(wv((Xe+t)/2)),-e]}TT.invert=function(e,t){return[-t,2*ku(x3(e))-Xe]};function FG(){var e=ST(TT),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var TG=Math.abs,Zv=Math.cos,Zp=Math.sin,OG=1e-6,OT=Math.PI,Jv=OT/2,DT=DG(2);function NT(e){return e>1?Jv:e<-1?-Jv:Math.asin(e)}function DG(e){return e>0?Math.sqrt(e):0}function NG(e,t){var n=e*Zp(t),i=30,r;do t-=r=(t+Zp(t)-n)/(1+Zv(t));while(TG(r)>OG&&--i>0);return t/2}function RG(e,t,n){function i(r,o){return[e*r*Zv(o=NG(n,o)),t*Zp(o)]}return i.invert=function(r,o){return o=NT(o/t),[r/(e*Zv(o)),NT((2*o+Zp(2*o))/n)]},i}var PG=RG(DT/Jv,DT,OT);function LG(){return ir(PG).scale(169.529)}const IG=mT(),Qv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function zG(e,t){return function n(){const i=t();return i.type=e,i.path=mT().projection(i),i.copy=i.copy||function(){const r=n();return Qv.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},LC(i)}}function ex(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Jp[e]=zG(e,t),this):Jp[e]||null}function RT(e){return e&&e.path||IG}const Jp={albers:wT,albersusa:pG,azimuthalequalarea:gG,azimuthalequidistant:mG,conicconformal:vG,conicequalarea:Gp,conicequidistant:EG,equalEarth:$G,equirectangular:xG,gnomonic:SG,identity:AG,mercator:yG,mollweide:LG,naturalEarth1:kG,orthographic:CG,stereographic:MG,transversemercator:FG};for(const e in Jp)ex(e,Jp[e]);function BG(){}const qr=[[],[[[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 PT(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),UG(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(jG((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,qr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,qr[g|m<<1].forEach(v);for(qr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,qr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,qr[g|m<<1|y<<2|b<<3].forEach(v);qr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,qr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,qr[y<<2|b<<3].forEach(v);qr[y<<3].forEach(v);function v(x){var w=[x[0][0]+h,x[0][1]+p],_=[x[1][0]+h,x[1][1]+p],E=s(w),$=s(_),S,M;(S=d[E])?(M=f[$])?(delete d[S.end],delete f[M.start],S===M?(S.ring.push(_),c(S.ring)):f[S.start]=d[M.end]={start:S.start,end:M.end,ring:S.ring.concat(M.ring)}):(delete d[S.end],S.ring.push(_),d[S.end=$]=S):(S=f[$])?(M=d[E])?(delete f[S.start],delete d[M.end],S===M?(S.ring.push(_),c(S.ring)):f[M.start]=d[S.end]={start:M.start,end:S.end,ring:M.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(w),f[S.start=E]=S):f[E]=d[$]={start:E,end:$,ring:[w,_]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||R("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:BG,i):n===a},i}function UG(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function jG(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=qG(e,t[n]))return r;return 0}function qG(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(WG(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function WG(e,t,n){var i;return HG(e,t,n)&&GG(e[i=+(e[0]===t[0])],n[i],t[i])}function HG(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function GG(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function LT(e,t,n){return function(i){var r=Bi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?xo(o,s,e):a/(e+1);return Mn(o+u,s,u)}}function tx(e){O.call(this,null,e)}tx.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"}]},G(tx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Rt,o=PT().smooth(e.smooth!==!1),s=e.thresholds||VG(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,L(s)?s:s(c.values));YG(f,c,l,e),f.forEach(d=>{u.push(Hd(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function VG(e,t,n){const i=LT(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Es(t(r).values)))}function YG(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ce(r)&&(r=r(n,i)),ce(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(_e(r)?r:r[0])||1,a=(_e(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(IT(t,s,a,u,l))}function IT(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function zT(e,t,n){const i=e>=0?e:F1(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function nx(e){return ce(e)?e:Lt(+e)}function BT(){var e=u=>u[0],t=u=>u[1],n=qa,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=zT(i[0],u,e)>>s,f=zT(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>s),g=2*h+(o>>s),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const w=d+(+e(x)>>s),_=h+(+t(x)>>s);w>=0&&w<p&&_>=0&&_<g&&(m[w+_*p]+=+n(x))}),c>0&&f>0?(Ou(p,g,m,y,c),Du(p,g,y,m,f),Ou(p,g,m,y,c),Du(p,g,y,m,f),Ou(p,g,m,y,c),Du(p,g,y,m,f)):c>0?(Ou(p,g,m,y,c),Ou(p,g,y,m,c),Ou(p,g,m,y,c),b=y):f>0&&(Du(p,g,m,y,f),Du(p,g,y,m,f),Du(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*s):1/I$(b);for(let x=0,w=p*g;x<w;++x)b[x]*=v;return{values:b,scale:1<<s,width:p,height:g,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=nx(u),a):e},a.y=function(u){return arguments.length?(t=nx(u),a):t},a.weight=function(u){return arguments.length?(n=nx(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||R("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||R("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&R("invalid bandwidth"),i=u,a):i},a}function Ou(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function Du(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function ix(e){O.call(this,null,e)}ix.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 XG=["x","y","weight","size","cellSize","bandwidth"];function UT(e,t){return XG.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(ix,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=KG(i,e.groupby),o=(e.groupby||[]).map(Ye),s=UT(BT(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function KG(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function rx(e){O.call(this,null,e)}rx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},G(rx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=PT().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||LT(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=UT(BT(),e)(r,!0),u=IT(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=L(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const ox="Feature",sx="FeatureCollection",ZG="MultiPoint";function ax(e){O.call(this,null,e)}ax.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},G(ax,O,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&Rt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Nt(a))||o&&t.modified(Nt(o))||s&&t.modified(Nt(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:ox,geometry:{type:ZG,coordinates:i}})),this.value={type:sx,features:n}}});function ux(e){O.call(this,null,e)}ux.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"}]},G(ux,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Rt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=RT(e.projection),n.materialize().reflow()):s=r===Rt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=JG(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function JG(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function lx(e){O.call(this,null,e)}lx.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"]}]},G(lx,O,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function cx(e){O.call(this,null,e)}cx.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"}]},G(cx,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=QG(RT(e.projection),e.field||qn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function QG(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function fx(e){O.call(this,[],e),this.generator=VH()}fx.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}]},G(fx,O,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ce(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(eA(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function dx(e){O.call(this,null,e)}dx.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"}]},G(dx,O,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Rt,o=tV(e.opacity,e),s=eV(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Es(n.map(l=>Es(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=fe({},l,u);i||(f.$max=Es(c.values||[])),l[a]=nV(c,f,s.dep?s:Lt(s(f)),o.dep?o:Lt(o(f)))}),t.reflow(!0).modifies(a)}});function eV(e,t){let n;return ce(e)?(n=i=>Fo(e(i,t)),n.dep=jT(e)):n=Lt(Fo(e||"#888")),n}function tV(e,t){let n;return ce(e)?(n=i=>e(i,t),n.dep=jT(e)):e?n=Lt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function jT(e){if(!ce(e))return!1;const t=li(Nt(e));return t.$x||t.$y||t.$value||t.$max}function nV(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:po,d=ko(u-s,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-s,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,v=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function qT(e){O.call(this,null,e),this.modified(!0)}G(qT,O,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=rV(e.type),Qv.forEach(i=>{e[i]!=null&&WT(n,i,e[i])})):Qv.forEach(i=>{e.modified(i)&&WT(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&iV(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function iV(e,t){const n=oV(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function rV(e){const t=ex((e||"mercator").toLowerCase());return t||R("Unrecognized projection type: "+e),t()}function WT(e,t,n){ce(e[t])&&e[t](n)}function oV(e){return e=X(e),e.length===1?e[0]:{type:sx,features:e.reduce((t,n)=>t.concat(sV(n)),[])}}function sV(e){return e.type===sx?e.features:X(e).filter(t=>t!=null).map(t=>t.type===ox?t:{type:ox,geometry:t})}const aV=Object.freeze(Object.defineProperty({__proto__:null,contour:rx,geojson:ax,geopath:ux,geopoint:lx,geoshape:cx,graticule:fx,heatmap:dx,isocontour:tx,kde2d:ix,projection:qT},Symbol.toStringTag,{value:"Module"}));function uV(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function lV(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return HT(this.cover(t,n),t,n,e)}function HT(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|g]))return r[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function cV(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)HT(this,s[n],a[n],e[n]);return this}function fV(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function dV(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function hV(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function rn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function pV(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new rn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(s=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new rn(h[3],m,y,u,l),new rn(h[2],s,y,m,l),new rn(h[1],m,a,u,y),new rn(h[0],s,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var w=Math.sqrt(n=x);r=e-w,o=t-w,c=e+w,f=t+w,i=h.data}}return i}function gV(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(s+u)/2))?s=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function mV(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function yV(){return this._root}function bV(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function vV(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new rn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new rn(r,l,c,a,u)),(r=i[2])&&t.push(new rn(r,o,c,l,u)),(r=i[1])&&t.push(new rn(r,l,s,a,c)),(r=i[0])&&t.push(new rn(r,o,s,l,c))}return this}function xV(e){var t=[],n=[],i;for(this._root&&t.push(new rn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new rn(o,s,a,c,f)),(o=r[1])&&t.push(new rn(o,c,a,u,f)),(o=r[2])&&t.push(new rn(o,s,f,c,l)),(o=r[3])&&t.push(new rn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function wV(e){return e[0]}function EV(e){return arguments.length?(this._x=e,this):this._x}function _V(e){return e[1]}function $V(e){return arguments.length?(this._y=e,this):this._y}function hx(e,t,n){var i=new px(t??wV,n??_V,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function px(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function GT(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var on=hx.prototype=px.prototype;on.copy=function(){var e=new px(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=GT(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=GT(i));return e},on.add=lV,on.addAll=cV,on.cover=fV,on.data=dV,on.extent=hV,on.find=pV,on.remove=gV,on.removeAll=mV,on.root=yV,on.size=bV,on.visit=vV,on.visitAfter=xV,on.x=EV,on.y=$V;function sn(e){return function(){return e}}function Go(e){return(e()-.5)*1e-6}function SV(e){return e.x+e.vx}function AV(e){return e.y+e.vy}function kV(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=sn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<o;++y)for(f=hx(t,SV,AV).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,w,_,E){var $=v.data,S=v.r,M=g+S;if($){if($.index>d.index){var k=h-$.x-$.vx,D=p-$.y-$.vy,A=k*k+D*D;A<M*M&&(k===0&&(k=Go(i),A+=k*k),D===0&&(D=Go(i),A+=D*D),A=(M-(A=Math.sqrt(A)))/A*r,d.vx+=(k*=A)*(M=(S*=S)/(m+S)),d.vy+=(D*=A)*M,$.vx-=k*(M=1-M),$.vy-=D*M)}return}return x>h+M||_<h-M||w>p+M||E<p-M}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:sn(+l),u(),s):e},s}function CV(e){return e.index}function VT(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function MV(e){var t=CV,n=f,i,r=sn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,w,_,E,$,S,M;v<b;++v)x=e[v],w=x.source,_=x.target,E=_.x+_.vx-w.x-w.vx||Go(l),$=_.y+_.vy-w.y-w.vy||Go(l),S=Math.sqrt(E*E+$*$),S=(S-o[v])/S*m*i[v],E*=S,$*=S,_.vx-=E*(M=u[v]),_.vy-=$*M,w.vx+=E*(M=1-M),w.vy+=$*M}function h(){if(s){var m,y=s.length,b=e.length,v=new Map(s.map((w,_)=>[t(w,_,s),w])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=VT(v,x.source)),typeof x.target!="object"&&(x.target=VT(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),o=new Array(b),g()}}function p(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:sn(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:sn(+m),g(),d):r},d}var FV={value:()=>{}};function YT(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Qp(n)}function Qp(e){this._=e}function TV(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Qp.prototype=YT.prototype={constructor:Qp,on:function(e,t){var n=this._,i=TV(e+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((r=(e=i[o]).type)&&(r=OV(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(r=(e=i[o]).type)n[r]=XT(n[r],e.name,t);else if(t==null)for(r in n)n[r]=XT(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Qp(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};function OV(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function XT(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=FV,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Nu=0,tf=0,nf=0,KT=1e3,eg,rf,tg=0,Xs=0,ng=0,of=typeof performance=="object"&&performance.now?performance:Date,ZT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function gx(){return Xs||(ZT(DV),Xs=of.now()+ng)}function DV(){Xs=0}function ig(){this._call=this._time=this._next=null}ig.prototype=JT.prototype={constructor:ig,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?gx():+n)+(t==null?0:+t),!this._next&&rf!==this&&(rf?rf._next=this:eg=this,rf=this),this._call=e,this._time=n,mx()},stop:function(){this._call&&(this._call=null,this._time=1/0,mx())}};function JT(e,t,n){var i=new ig;return i.restart(e,t,n),i}function NV(){gx(),++Nu;for(var e=eg,t;e;)(t=Xs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nu}function QT(){Xs=(tg=of.now())+ng,Nu=tf=0;try{NV()}finally{Nu=0,PV(),Xs=0}}function RV(){var e=of.now(),t=e-tg;t>KT&&(ng-=t,tg=e)}function PV(){for(var e,t=eg,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:eg=n);rf=e,mx(i)}function mx(e){if(!Nu){tf&&(tf=clearTimeout(tf));var t=e-Xs;t>24?(e<1/0&&(tf=setTimeout(QT,e-of.now()-ng)),nf&&(nf=clearInterval(nf))):(nf||(tg=of.now(),nf=setInterval(RV,KT)),Nu=1,ZT(QT))}}function LV(e,t,n){var i=new ig,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?gx():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const IV=1664525,zV=1013904223,eO=4294967296;function BV(){let e=1;return()=>(e=(IV*e+zV)%eO)/eO}function UV(e){return e.x}function jV(e){return e.y}var qV=10,WV=Math.PI*(3-Math.sqrt(5));function HV(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=JT(f),l=YT("tick","end"),c=BV();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(o-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=qV*Math.sqrt(.5+g),v=g*WV;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(o=+g,t):o},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,w,_,E,$;for(y==null?y=1/0:y*=y,b=0;b<v;++b)E=e[b],x=g-E.x,w=m-E.y,_=x*x+w*w,_<y&&($=E,y=_);return $},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function GV(){var e,t,n,i,r=sn(-30),o,s=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=hx(e,UV,jV).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(o=new Array(p),h=0;h<p;++h)g=e[h],o[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=o[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=Go(n),x+=y*y),b===0&&(b=Go(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=Go(n),x+=y*y),b===0&&(b=Go(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)));do h.data!==t&&(v=o[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:sn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function VV(e){var t=sn(.1),n,i,r;typeof e!="function"&&(e=sn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:sn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:sn(+a),s(),o):e},o}function YV(e){var t=sn(.1),n,i,r;typeof e!="function"&&(e=sn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:sn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:sn(+a),s(),o):e},o}const tO={center:uV,collide:kV,nbody:GV,link:MV,x:VV,y:YV},sf="forces",yx=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],XV=["static","iterations"],nO=["x","y","vx","vy"];function bx(e){O.call(this,null,e)}bx.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:nO}]},G(bx,O,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(yx),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&iO(n,e,0,t)):(this.value=n=ZV(t.source,e),n.on("tick",KV(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(XV)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==sf||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(nO)}});function KV(e,t){return()=>e.touch(t).run()}function ZV(e,t){const n=HV(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),iO(n,t,!0).on("end",()=>o=!0)}function iO(e,t,n,i){var r=X(t.forces),o,s,a,u;for(o=0,s=yx.length;o<s;++o)a=yx[o],a!==sf&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=sf+o,a=n||t.modified(sf,o)?QV(r[o]):i&&JV(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(sf+o,null);return e.numForces=r.length,e}function JV(e,t){var n,i;for(n in e)if(ce(i=e[n])&&t.modified(Nt(i)))return 1;return 0}function QV(e){var t,n;Z(tO,e.force)||R("Unrecognized force: "+e.force),t=tO[e.force]();for(n in e)ce(t[n])&&eY(t[n],e[n],e);return t}function eY(e,t,n){e(ce(t)?i=>t(i,n):t)}const tY=Object.freeze(Object.defineProperty({__proto__:null,force:bx},Symbol.toStringTag,{value:"Module"}));function nY(e,t){return e.parent===t.parent?1:2}function iY(e){return e.reduce(rY,0)/e.length}function rY(e,t){return e+t.x}function oY(e){return 1+e.reduce(sY,0)}function sY(e,t){return Math.max(e,t.y)}function aY(e){for(var t;t=e.children;)e=t[0];return e}function uY(e){for(var t;t=e.children;)e=t[t.length-1];return e}function lY(){var e=nY,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=iY(h),d.y=oY(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=aY(o),l=uY(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function cY(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function fY(){return this.eachAfter(cY)}function dY(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function hY(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function pY(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function gY(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function mY(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function yY(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bY(e){for(var t=this,n=vY(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function vY(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function xY(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function wY(){return Array.from(this)}function EY(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function _Y(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*$Y(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function vx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=kY)):t===void 0&&(t=AY);for(var n=new Ru(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new Ru(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(rO)}function SY(){return vx(this).eachBefore(CY)}function AY(e){return e.children}function kY(e){return Array.isArray(e)?e[1]:null}function CY(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function rO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ru(e){this.data=e,this.depth=this.height=0,this.parent=null}Ru.prototype=vx.prototype={constructor:Ru,count:fY,each:dY,eachAfter:pY,eachBefore:hY,find:gY,sum:mY,sort:yY,path:bY,ancestors:xY,descendants:wY,leaves:EY,links:_Y,copy:SY,[Symbol.iterator]:$Y};function rg(e){return e==null?null:oO(e)}function oO(e){if(typeof e!="function")throw new Error;return e}function Ks(){return 0}function Pu(e){return function(){return e}}const MY=1664525,FY=1013904223,sO=4294967296;function TY(){let e=1;return()=>(e=(MY*e+FY)%sO)/sO}function OY(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DY(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function NY(e,t){for(var n=0,i=(e=DY(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&aO(s,o)?++n:(s=PY(r=RY(r,o)),n=0);return s}function RY(e,t){var n,i;if(xx(t,e))return[t];for(n=0;n<e.length;++n)if(og(t,e[n])&&xx(af(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(og(af(e[n],e[i]),t)&&og(af(e[n],t),e[i])&&og(af(e[i],t),e[n])&&xx(uO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function og(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function aO(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function xx(e,t){for(var n=0;n<t.length;++n)if(!aO(e,t[n]))return!1;return!0}function PY(e){switch(e.length){case 1:return LY(e[0]);case 2:return af(e[0],e[1]);case 3:return uO(e[0],e[1],e[2])}}function LY(e){return{x:e.x,y:e.y,r:e.r}}function af(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function uO(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,p=r-a,g=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,v=b-s*s-a*a+u*u,x=b-l*l-c*c+f*f,w=h*p-d*g,_=(p*x-g*v)/(w*2)-i,E=(g*m-p*y)/w,$=(h*v-d*x)/(w*2)-r,S=(d*y-h*m)/w,M=E*E+S*S-1,k=2*(o+_*E+$*S),D=_*_+$*$-o*o,A=-(Math.abs(M)>1e-6?(k+Math.sqrt(k*k-4*M*D))/(2*M):D/k);return{x:i+_+E*A,y:r+$+S*A,r:A}}function lO(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function cO(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function fO(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function sg(e){this._=e,this.next=null,this.previous=null}function IY(e,t){if(!(o=(e=OY(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;lO(i,n,r=e[2]),n=new sg(n),i=new sg(i),r=new sg(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){lO(n._,i._,r=e[u]),r=new sg(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(cO(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(cO(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=fO(n);(r=r.next)!==i;)(a=fO(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=NY(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function zY(e){return Math.sqrt(e.value)}function BY(){var e=null,t=1,n=1,i=Ks;function r(o){const s=TY();return o.x=t/2,o.y=n/2,e?o.eachBefore(dO(e)).eachAfter(wx(i,.5,s)).eachBefore(hO(1)):o.eachBefore(dO(zY)).eachAfter(wx(Ks,1,s)).eachAfter(wx(i,o.r/Math.min(t,n),s)).eachBefore(hO(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=rg(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:Pu(+o),r):i},r}function dO(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function wx(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=IY(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function hO(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function pO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function uf(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function UY(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(pO),s}function o(s,a){return function(u){u.children&&uf(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var jY={depth:-1},gO={},Ex={};function qY(e){return e.id}function WY(e){return e.parentId}function mO(){var e=qY,t=WY,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=o.map((x,w)=>HY(n(x,w,r))),b=y.map(yO),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(yO(x)),o.push(Ex));s=(x,w)=>y[w],a=(x,w)=>b[w]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new Ru(l),(p=s(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?gO:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=o[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===gO)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Ex&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Ex);--y)h.data=null}if(f.parent=jY,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(rO),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=rg(r),i):e},i.parentId=function(r){return arguments.length?(t=rg(r),i):t},i.path=function(r){return arguments.length?(n=rg(r),i):n},i}function HY(e){e=`${e}`;let t=e.length;return _x(e,t-1)&&!_x(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function yO(e){let t=e.length;if(t<2)return"";for(;--t>1&&!_x(e,t););return e.slice(0,t)}function _x(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function GY(e,t){return e.parent===t.parent?1:2}function $x(e){var t=e.children;return t?t[0]:e.t}function Sx(e){var t=e.children;return t?t[t.length-1]:e.t}function VY(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function YY(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function XY(e,t,n){return e.a.parent===t.parent?e.a:n}function ag(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}ag.prototype=Object.create(Ru.prototype);function KY(e){for(var t=new ag(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new ag(o[s],s)),r.parent=n;return(t.parent=new ag(null,0)).children=[t],t}function ZY(){var e=GY,t=1,n=1,i=null;function r(l){var c=KY(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){YY(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=Sx(p),d=$x(d),p&&d;)g=$x(g),h=Sx(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(VY(XY(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!Sx(h)&&(h.t=p,h.m+=b-y),d&&!$x(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function ug(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var bO=(1+Math.sqrt(5))/2;function vO(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,v,x,w,_;c<d;){h=r-n,p=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,w=Math.max(p/h,h/p)/(g*e),_=m*m*w,x=Math.max(b/_,_/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),_=m*m*w,v=Math.max(b/_,_/y),v>x){m-=l;break}x=v}s.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?uf(u,n,i,r,g?i+=p*m/g:o):ug(u,n,i,g?n+=h*m/g:r,o),g-=m,c=f}return s}const xO=function e(t){function n(i,r,o,s,a){vO(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bO);function JY(){var e=xO,t=!1,n=1,i=1,r=[0],o=Ks,s=Ks,a=Ks,u=Ks,l=Ks;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(pO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,p+=l(d)-h,g+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=oO(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Pu(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Pu(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Pu(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Pu(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Pu(+d),c):l},c}function QY(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=o[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,w=f+1,_=d-1;w<_;){var E=w+_>>>1;l[E]<x?w=E+1:_=E}x-l[w-1]<l[w]-x&&f+1<w&&--w;var $=l[w]-v,S=h-$;if(m-p>y-g){var M=h?(p*S+m*$)/h:m;c(f,w,$,p,g,M,y),c(w,d,S,M,g,m,y)}else{var k=h?(g*S+y*$)/h:y;c(f,w,$,p,g,m,k),c(w,d,S,p,k,m,y)}}}function eX(e,t,n,i,r){(e.depth&1?ug:uf)(e,t,n,i,r)}const tX=function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?uf(l,r,o,s,g?o+=(a-o)*l.value/g:a):ug(l,r,o,g?r+=(s-r)*l.value/g:s,a),g-=l.value}else i._squarify=u=vO(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bO);function Ax(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function kx(e){O.call(this,null,e)}kx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const nX=e=>e.values;G(kx,O,{transform(e,t){t.source||R("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&Wd(s.data)&&r.rem.push(s.data)}),this.value=o=vx({values:X(e.keys).reduce((s,a)=>(s.key(a),s),iX()).entries(r.source)},nX),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),Ax(o,ie,ie)),r.source.root=o,r}});function iX(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function Wr(e){O.call(this,null,e)}const rX=(e,t)=>e.parent===t.parent?1:2;G(Wr,O,{transform(e,t){(!t.source||!t.source.root)&&R(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ks(e.sort,s=>s.data)),oX(n,this.params,e),n.separation&&n.separation(e.separation!==!1?rX:qa);try{this.value=n(r)}catch(s){R(s)}return r.each(s=>sX(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function oX(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function sX(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const Cx=["x","y","r","depth","children"];function Mx(e){Wr.call(this,e)}Mx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Cx.length,default:Cx}]},G(Mx,Wr,{layout:BY,params:["radius","size","padding"],fields:Cx});const Fx=["x0","y0","x1","y1","depth","children"];function Tx(e){Wr.call(this,e)}Tx.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:Fx.length,default:Fx}]},G(Tx,Wr,{layout:UY,params:["size","round","padding"],fields:Fx});function Ox(e){O.call(this,null,e)}Ox.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},G(Ox,O,{transform(e,t){t.source||R("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?Ax(mO().id(e.key).parentId(e.parentKey)(r.source),e.key,Wn):Ax(mO()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const wO={tidy:ZY,cluster:lY},Dx=["x","y","depth","children"];function Nx(e){Wr.call(this,e)}Nx.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:Dx.length,default:Dx}]},G(Nx,Wr,{layout(e){const t=e||"tidy";if(Z(wO,t))return wO[t]();R("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Dx});function Rx(e){O.call(this,[],e)}Rx.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},G(Rx,O,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||R("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ie(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ie(a)]&&o[ie(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ie(s)]=1),n.forEach(s=>{(o[ie(s.source)]||o[ie(s.target)])&&r.mod.push(s)})),r}});const EO={binary:QY,dice:uf,slice:ug,slicedice:eX,squarify:xO,resquarify:tX},Px=["x0","y0","x1","y1","depth","children"];function Lx(e){Wr.call(this,e)}Lx.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:Px.length,default:Px}]},G(Lx,Wr,{layout(){const e=JY();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Z(EO,t)?e.tile(EO[t]):R("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Px});const aX=Object.freeze(Object.defineProperty({__proto__:null,nest:kx,pack:Mx,partition:Tx,stratify:Ox,tree:Nx,treelinks:Rx,treemap:Lx},Symbol.toStringTag,{value:"Module"})),Ix=4278190080;function uX(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function lX(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=ko(o,s).getContext("2d"),l=ko(o,s).getContext("2d"),c=a&&ko(o,s).getContext("2d");n.forEach($=>lg(u,$,!1)),lg(l,t,!1),a&&lg(c,t,!0);const f=zx(u,o,s),d=zx(l,o,s),h=a&&zx(c,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,w,_,E;for(y=0;y<s;++y)for(m=0;m<o;++m)x=y*o+m,w=f[x]&Ix,E=d[x]&Ix,_=a&&h[x]&Ix,(w||_||E)&&(b=e(m),v=e(y),!r&&(w||E)&&p.set(b,v),a&&(w||_)&&g.set(b,v));return[p,g]}function zx(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function lg(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>lg(e,o.items,n))}):Dn[i].draw(e,{items:n?t.map(cX):t})}function cX(e){const t=Hd(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Hr=5,an=31,lf=32,Vo=new Uint32Array(lf+1),vi=new Uint32Array(lf+1);vi[0]=0,Vo[0]=~vi[0];for(let e=1;e<=lf;++e)vi[e]=vi[e-1]<<1|1,Vo[e]=~vi[e];function fX(e,t){const n=new Uint32Array(~~((e*t+lf)/lf));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Hr]&1<<(a&an)},set:(o,s)=>{const a=s*e+o;i(a>>>Hr,1<<(a&an))},clear:(o,s)=>{const a=s*e+o;r(a>>>Hr,~(1<<(a&an)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>Hr,h=f>>>Hr,d===h){if(n[d]&Vo[c&an]&vi[(f&an)+1])return!0}else{if(n[d]&Vo[c&an]||n[h]&vi[(f&an)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>Hr,d=c>>>Hr,f===d)i(f,Vo[l&an]&vi[(c&an)+1]);else for(i(f,Vo[l&an]),i(d,vi[(c&an)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>Hr,d=c>>>Hr,f===d)r(f,vi[l&an]|Vo[(c&an)+1]);else for(r(f,vi[l&an]),r(d,Vo[(c&an)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function dX(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>fX(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function hX(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=On.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",p<0&&g<=o?s.baseline="top":0<=p&&o<g&&(s.baseline="bottom"),!0}}function cg(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function Yo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function pX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=o,b;if(!cg(p,g,d,h,r,o)&&!Yo(e,p,g,h,d,m,s,a)&&!Yo(e,p,g,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,Yo(e,p,g,h,d,b,s,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=On.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,w,_,E,$,S,M,k,D,A,F,C,T,P,I;for(let z=0;z<f;++z){for(b=c[z].x,x=c[z].y,v=c[z].x2===void 0?b:c[z].x2,w=c[z].y2===void 0?x:c[z].y2,b>v&&(I=b,b=v,v=I),x>w&&(I=x,x=w,w=I),M=e(b),D=e(v),k=~~((M+D)/2),A=e(x),C=e(w),F=~~((A+C)/2),$=k;$>=M;--$)for(S=F;S>=A;--S)P=u($,S,p,h,d),P&&([l.x,l.y,p,g]=P);for($=k;$<=D;++$)for(S=F;S<=C;++S)P=u($,S,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(T=Math.abs(v-b+w-x),_=(b+v)/2,E=(x+w)/2,T>=y&&!cg(_,E,h,d,r,o)&&!Yo(e,_,E,d,h,d,s,null)&&(y=T,l.x=_,l.y=E,m=!0))}return g||m?(_=h/2,E=d/2,s.setRange(e(l.x-_),e(l.y-E),e(l.x+_),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const gX=[-1,-1,1,1],mX=[-1,1,-1,1];function yX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=On.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,w,_,E,$,S,M,k,D,A,F;for(let C=0;C<f;++C){for(v=c[C].x,w=c[C].y,x=c[C].x2===void 0?v:c[C].x2,_=c[C].y2===void 0?w:c[C].y2,p.push([e((v+x)/2),e((w+_)/2)]);p.length;)if([S,M]=p.pop(),!(s.get(S,M)||a.get(S,M)||u.get(S,M))){u.set(S,M);for(let T=0;T<4;++T)E=S+gX[T],$=M+mX[T],u.outOfBounds(E,$,E,$)||p.push([E,$]);if(E=e.invert(S),$=e.invert(M),k=g,D=o,!cg(E,$,h,d,r,o)&&!Yo(e,E,$,d,h,k,s,a)&&!Yo(e,E,$,d,h,d,s,null)){for(;D-k>=1;)A=(k+D)/2,Yo(e,E,$,d,h,A,s,a)?D=A:k=A;k>g&&(l.x=E,l.y=$,g=k,m=!0)}}!m&&!n&&(F=Math.abs(x-v+_-w),E=(v+x)/2,$=(w+_)/2,F>=b&&!cg(E,$,h,d,r,o)&&!Yo(e,E,$,d,h,d,s,null)&&(b=F,l.x=E,l.y=$,y=!0))}return m||y?(E=h/2,$=d/2,s.setRange(e(l.x-E),e(l.y-$),e(l.x+E),e(l.y+$)),l.align="center",l.baseline="middle",!0):!1}}const bX=["right","center","left"],vX=["bottom","middle","top"];function xX(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,w,_,E,$,S,M,k;for(let D=0;D<u;++D){if(h=(n[D]&3)-1,p=(n[D]>>>2&3)-1,g=h===0&&p===0||i[D]<0,m=h&&p?Math.SQRT1_2:1,y=i[D]<0?-1:1,b=c[1+h]+i[D]*h*m,E=c[4+p]+y*f*p/2+i[D]*p*m,x=E-f/2,w=E+f/2,$=e(b),M=e(x),k=e(w),!d)if(_O($,$,M,k,s,a,b,b,x,w,c,g))d=On.width(l.datum,l.datum.text);else continue;if(_=b+y*d*h/2,b=_-d/2,v=_+d/2,$=e(b),S=e(v),_O($,S,M,k,s,a,b,v,x,w,c,g))return l.x=h?h*y<0?v:b:_,l.y=p?p*y<0?w:x:E,l.align=bX[h*y+1],l.baseline=vX[p*y+1],s.setRange($,M,S,k),!0}return!1}}function _O(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Bx=0,Ux=4,jx=8,qx=0,Wx=1,Hx=2,wX={"top-left":Bx+qx,top:Bx+Wx,"top-right":Bx+Hx,left:Ux+qx,middle:Ux+Wx,right:Ux+Hx,"bottom-left":jx+qx,bottom:jx+Wx,"bottom-right":jx+Hx},EX={naive:hX,"reduced-search":pX,floodfill:yX};function _X(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=$X(i,f),h=SX(r,f),p=AX(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=kX(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,w=-1;const _=e.map(M=>{const k=b?On.width(M,M.text):void 0;return x=Math.max(x,k),w=Math.max(w,M.fontSize),{datum:M,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(M),textWidth:k}});l=l===null||l===1/0?Math.max(x,w)+Math.max(...i):l;const E=dX(t[0],t[1],l);let $;if(!v){n&&_.sort((D,A)=>n(D.datum,A.datum));let M=!1;for(let D=0;D<h.length&&!M;++D)M=h[D]===5||d[D]<0;const k=(p&&s||m)&&e.map(D=>D.datum);$=o.length||k?lX(E,k||[],o,M,m):uX(E,s&&_)}const S=m?EX[c](E,$,s,u):xX(E,$,h,d);return _.forEach(M=>M.opacity=+S(M)),_}function $X(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function SX(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=wX[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function AX(e){return e&&e.mark&&e.mark.marktype}function kX(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const Gx=["x","y","opacity","align","baseline"],$O=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Vx(e){O.call(this,null,e)}Vx.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:$O},{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:Gx.length,default:Gx}]},G(Vx,O,{transform(e,t){function n(o){const s=e[o];return ce(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&R("Size parameter should be specified as a [width, height] array.");const r=e.as||Gx;return _X(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||$O),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const CX=Object.freeze(Object.defineProperty({__proto__:null,label:Vx},Symbol.toStringTag,{value:"Module"}));function SO(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Yx(e){O.call(this,null,e)}Yx.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},G(Yx,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=SO(i,e.groupby),o=(e.groupby||[]).map(Ye),s=o.length,a=e.as||[Ye(e.x),Ye(e.y)],u=[];r.forEach(l=>{AA(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const Xx={constant:j1,linear:q1,log:xA,exp:wA,pow:EA,quad:W1,poly:_A},MX=(e,t)=>e==="poly"?t:e==="quad"?2:1;function Kx(e){O.call(this,null,e)}Kx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(Xx)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},G(Kx,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=SO(i,e.groupby),o=(e.groupby||[]).map(Ye),s=e.method||"linear",a=e.order==null?3:e.order,u=MX(s,a),l=e.as||[Ye(e.x),Ye(e.y)],c=Xx[s],f=[];let d=e.extent;Z(Xx,s)||R("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Bi(h,e.x),y=b=>{const v={};for(let x=0;x<o.length;++x)v[o[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};s==="linear"||s==="constant"?m.forEach(b=>y([b,g.predict(b)])):th(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const FX=Object.freeze(Object.defineProperty({__proto__:null,loess:Yx,regression:Kx},Symbol.toStringTag,{value:"Module"})),Gr=11102230246251565e-32,Wt=134217729,TX=(3+8*Gr)*Gr;function Zx(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function OX(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function cf(e){return new Float64Array(e)}const DX=(3+16*Gr)*Gr,NX=(2+12*Gr)*Gr,RX=(9+64*Gr)*Gr*Gr,Lu=cf(4),AO=cf(8),kO=cf(12),CO=cf(16),un=cf(4);function PX(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,w,_,E,$;const S=e-r,M=n-r,k=t-o,D=i-o;x=S*D,d=Wt*S,h=d-(d-S),p=S-h,d=Wt*D,g=d-(d-D),m=D-g,w=p*m-(x-h*g-p*g-h*m),_=k*M,d=Wt*k,h=d-(d-k),p=k-h,d=Wt*M,g=d-(d-M),m=M-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,Lu[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Lu[1]=v-(y+f)+(f-_),$=b+y,f=$-b,Lu[2]=b-($-f)+(y-f),Lu[3]=$;let A=OX(4,Lu),F=NX*s;if(A>=F||-A>=F||(f=e-S,a=e-(S+f)+(f-r),f=n-M,l=n-(M+f)+(f-r),f=t-k,u=t-(k+f)+(f-o),f=i-D,c=i-(D+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=RX*s+TX*Math.abs(A),A+=S*c+D*a-(k*l+M*u),A>=F||-A>=F))return A;x=a*D,d=Wt*a,h=d-(d-a),p=a-h,d=Wt*D,g=d-(d-D),m=D-g,w=p*m-(x-h*g-p*g-h*m),_=u*M,d=Wt*u,h=d-(d-u),p=u-h,d=Wt*M,g=d-(d-M),m=M-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const C=Zx(4,Lu,4,un,AO);x=S*c,d=Wt*S,h=d-(d-S),p=S-h,d=Wt*c,g=d-(d-c),m=c-g,w=p*m-(x-h*g-p*g-h*m),_=k*l,d=Wt*k,h=d-(d-k),p=k-h,d=Wt*l,g=d-(d-l),m=l-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const T=Zx(C,AO,4,un,kO);x=a*c,d=Wt*a,h=d-(d-a),p=a-h,d=Wt*c,g=d-(d-c),m=c-g,w=p*m-(x-h*g-p*g-h*m),_=u*l,d=Wt*u,h=d-(d-u),p=u-h,d=Wt*l,g=d-(d-l),m=l-g,E=p*m-(_-h*g-p*g-h*m),y=w-E,f=w-y,un[0]=w-(y+f)+(f-E),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,un[1]=v-(y+f)+(f-_),$=b+y,f=$-b,un[2]=b-($-f)+(y-f),un[3]=$;const P=Zx(T,kO,4,un,CO);return CO[P-1]}function fg(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=DX*l?u:-PX(e,t,n,i,r,o,l)}const MO=Math.pow(2,-52),dg=new Uint32Array(512);class hg{static from(t,n=UX,i=jX){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new hg(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let S=0;S<s;S++){const M=t[2*S],k=t[2*S+1];M<a&&(a=M),k<u&&(u=k),M>l&&(l=M),k>c&&(c=k),this._ids[S]=S}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let S=0,M=1/0;S<s;S++){const k=Jx(f,d,t[2*S],t[2*S+1]);k<M&&(h=S,M=k)}const m=t[2*h],y=t[2*h+1];for(let S=0,M=1/0;S<s;S++){if(S===h)continue;const k=Jx(m,y,t[2*S],t[2*S+1]);k<M&&k>0&&(p=S,M=k)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let S=0;S<s;S++){if(S===h||S===p)continue;const M=zX(m,y,b,v,t[2*S],t[2*S+1]);M<x&&(g=S,x=M)}let w=t[2*g],_=t[2*g+1];if(x===1/0){for(let k=0;k<s;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];Iu(this._ids,this._dists,0,s-1);const S=new Uint32Array(s);let M=0;for(let k=0,D=-1/0;k<s;k++){const A=this._ids[k],F=this._dists[A];F>D&&(S[M++]=A,D=F)}this.hull=S.subarray(0,M),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fg(m,y,b,v,w,_)<0){const S=p,M=b,k=v;p=g,b=w,v=_,g=S,w=M,_=k}const E=BX(m,y,b,v,w,_);this._cx=E.x,this._cy=E.y;for(let S=0;S<s;S++)this._dists[S]=Jx(t[2*S],t[2*S+1],E.x,E.y);Iu(this._ids,this._dists,0,s-1),this._hullStart=h;let $=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,v)]=p,o[this._hashKey(w,_)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let S=0,M,k;S<this._ids.length;S++){const D=this._ids[S],A=t[2*D],F=t[2*D+1];if(S>0&&Math.abs(A-M)<=MO&&Math.abs(F-k)<=MO||(M=A,k=F,D===h||D===p||D===g))continue;let C=0;for(let te=0,ne=this._hashKey(A,F);te<this._hashSize&&(C=o[(ne+te)%this._hashSize],!(C!==-1&&C!==i[C]));te++);C=n[C];let T=C,P;for(;P=i[T],fg(A,F,t[2*T],t[2*T+1],t[2*P],t[2*P+1])>=0;)if(T=P,T===C){T=-1;break}if(T===-1)continue;let I=this._addTriangle(T,D,i[T],-1,-1,r[T]);r[D]=this._legalize(I+2),r[T]=I,$++;let z=i[T];for(;P=i[z],fg(A,F,t[2*z],t[2*z+1],t[2*P],t[2*P+1])<0;)I=this._addTriangle(z,D,P,r[D],-1,r[z]),r[D]=this._legalize(I+2),i[z]=z,$--,z=P;if(T===C)for(;P=n[T],fg(A,F,t[2*P],t[2*P+1],t[2*T],t[2*T+1])<0;)I=this._addTriangle(P,D,T,-1,r[T],r[P]),this._legalize(I+2),r[P]=I,i[T]=T,$--,T=P;this._hullStart=n[D]=T,i[T]=n[z]=D,i[D]=z,o[this._hashKey(A,F)]=D,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array($);for(let S=0,M=this._hullStart;S<$;S++)this.hull[S]=M,M=i[M];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(LX(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=dg[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],p=n[c],g=n[f];if(IX(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<dg.length&&(dg[o++]=b)}else{if(o===0)break;t=dg[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function LX(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Jx(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function IX(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function zX(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,p=(s*f-u*c)*d;return h*h+p*p}function BX(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,p=t+(s*f-u*c)*d;return{x:h,y:p}}function Iu(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;ff(e,r,o),t[e[n]]>t[e[i]]&&ff(e,n,i),t[e[o]]>t[e[i]]&&ff(e,o,i),t[e[n]]>t[e[o]]&&ff(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;ff(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(Iu(e,t,o,i),Iu(e,t,n,s-1)):(Iu(e,t,n,s-1),Iu(e,t,o,i))}}function ff(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function UX(e){return e[0]}function jX(e){return e[1]}const FO=1e-6;class Zs{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>FO||Math.abs(this._y1-o)>FO)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Qx{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let qX=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,w=i[g+1]*2,_=i[g+2]*2,E=t[x],$=t[x+1],S=t[w],M=t[w+1],k=t[_],D=t[_+1],A=S-E,F=M-$,C=k-E,T=D-$,P=(A*T-F*C)*2;if(Math.abs(P)<1e-9){if(o===void 0){o=s=0;for(const z of n)o+=t[z*2],s+=t[z*2+1];o/=n.length,s/=n.length}const I=1e9*Math.sign((o-E)*T-(s-$)*C);b=(E+k)/2-I*T,v=($+D)/2+I*C}else{const I=1/P,z=A*A+F*F,te=C*C+T*T;b=E+(T*z-F*te)*I,v=$+(A*te-C*z)*I}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Zs:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=s[h],m=s[h+1],y=s[p],b=s[p+1];this._renderSegment(g,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Zs:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Zs:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new Qx;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(o,s,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const WX=2*Math.PI,zu=Math.pow;function HX(e){return e[0]}function GX(e){return e[1]}function VX(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function YX(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class e2{static from(t,n=HX,i=GX,r){return new e2("length"in t?XX(t,n,i,r):Float64Array.from(KX(t,n,i,r)))}constructor(t){this._delaunator=new hg(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&VX(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=YX(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new hg(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new qX(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=zu(n-l[t*2],2)+zu(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=zu(n-l[p*2],2)+zu(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&zu(n-l[h*2],2)+zu(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Zs:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Zs:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,WX)}return i&&i.value()}renderHull(t){const n=t==null?t=new Zs:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Qx;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Zs:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Qx;return this.renderTriangle(t,n),n.value()}}function XX(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*KX(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function t2(e){O.call(this,null,e)}t2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const ZX=[-1e5,-1e5,1e5,1e5];G(t2,O,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:ZX;const o=this.value=e2.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!QX(u)?JX(u):null}return t.reflow(e.modified()).modifies(n)}});function JX(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function QX(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const eK=Object.freeze(Object.defineProperty({__proto__:null,voronoi:t2},Symbol.toStringTag,{value:"Module"}));var n2=Math.PI/180,df=64,pg=2048;function tK(){var e=[256,256],t,n,i,r,o,s,a,u=TO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(ko()),g=aK((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(_=>({text:t(_),font:n(_),style:r(_),weight:o(_),rotate:s(_),size:~~(i(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,E)=>E.size-_.size);++b<y;){var w=x[b];w.x=e[0]*(c()+.5)>>1,w.y=e[1]*(c()+.5)>>1,nK(p,w,x,b),w.hasText&&h(g,w,m)&&(v.push(w),m?rK(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(df<<5)/g,p.height=pg/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),w=c()<.5?1:-1,_=-w,E,$,S;(E=x(_+=w))&&($=~~E[0],S=~~E[1],!(Math.min(Math.abs($),Math.abs(S))>=v));)if(g.x=y+$,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!iK(g,p,e[0]))&&(!m||oK(g,m))){for(var M=g.sprite,k=g.width>>5,D=e[0]>>5,A=g.x-(k<<4),F=A&127,C=32-F,T=g.y1-g.y0,P=(g.y+g.y0)*D+(A>>5),I,z=0;z<T;z++){I=0;for(var te=0;te<=k;te++)p[P+te]|=I<<C|(te<k?(I=M[z*k+te])>>>F:0);P+=D}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Js(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Js(p),f):r},f.fontWeight=function(p){return arguments.length?(o=Js(p),f):o},f.rotate=function(p){return arguments.length?(s=Js(p),f):s},f.text=function(p){return arguments.length?(t=Js(p),f):t},f.spiral=function(p){return arguments.length?(u=uK[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=Js(p),f):i},f.padding=function(p){return arguments.length?(a=Js(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function nK(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(df<<5)/o,pg/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*n2),m=Math.cos(t.rotate*n2),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=df<<5&&(s=0,a+=u,u=0),a+d>=pg)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*n2),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var w=r.getImageData(0,0,(df<<5)/o,pg/o).data,_=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)_[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var E=0,$=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var S=f*p+(h>>5),M=w[(a+p)*(df<<5)+(s+h)<<2]?1<<31-h%32:0;_[S]|=M,E|=M}E?$=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+$,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function iK(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function rK(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function oK(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function TO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function sK(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function aK(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Js(e){return typeof e=="function"?e:function(){return e}}var uK={archimedean:TO,rectangular:sK};const OO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],lK=["text","font","rotate","fontSize","fontStyle","fontWeight"];function i2(e){O.call(this,tK(),e)}i2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:OO}]},G(i2,O,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&R("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return ce(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||lK.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||OO;let a=e.fontSize||14,u;if(ce(a)?u=e.fontSizeRange:a=Lt(a),u){const p=a,g=Se("sqrt")().domain(Bi(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const l=o.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(a).random(Vn).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[s[0]]=g.x+f,m[s[1]]=g.y+d,m[s[2]]=g.font,m[s[3]]=g.size,m[s[4]]=g.style,m[s[5]]=g.weight,m[s[6]]=g.rotate;return t.reflow(i).modifies(s)}});const cK=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:i2},Symbol.toStringTag,{value:"Module"})),fK=e=>new Uint8Array(e),dK=e=>new Uint16Array(e),hf=e=>new Uint32Array(e);function hK(){let e=8,t=[],n=hf(0),i=gg(0,e),r=gg(0,e);return{data:()=>t,seen:()=>n=pK(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=gg(o,e,i),r=gg(o,e))}}}function pK(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function gg(e,t,n){const i=(t<257?fK:t<65537?dK:hf)(e);return n&&i.set(n),i}function DO(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function NO(){let e=hf(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=hf(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=gK(h,d),c)p=t,g=e,t=Array(c+f),e=hf(c+f),mK(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[kI(u,a[0],0,l),vo(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function gK(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),FI(e,t)}function mK(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function r2(e){O.call(this,hK(),e),this._indices=null,this._dims=null}r2.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}}]},G(r2,O,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=NO()),o.push(DO(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,w,_,E;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,w=0,_=b.length;w<_;++w)x[b[w]._index]=1;for(w=0;w<h;++w)E=i[w],(!s[w]||e.modified("fields",w)||t.modified(E.fields))&&(y=E.fname,(g=p[y])||(o[y]=m=NO(),p[y]=g=m.insert(E,t.source,0)),s[w]=DO(m,w,r[w]).onAdd(g,u));for(w=0,_=a.data().length;w<_;++w)v[w]||(l[w]!==u[w]?f.push(w):x[w]&&u[w]!==c&&d.push(w));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=s[p].insert(a[h],i,d)),o[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=p=o[h],o[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=s[p],o[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=s[p],o[m]^=h,i.push(m);e.range=t.slice()}});function o2(e){O.call(this,null,e)}o2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},G(o2,O,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const yK=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:r2,resolvefilter:o2},Symbol.toStringTag,{value:"Module"})),bK="RawCode",Qs="Literal",vK="Property",xK="Identifier",wK="ArrayExpression",EK="BinaryExpression",RO="CallExpression",_K="ConditionalExpression",$K="LogicalExpression",SK="MemberExpression",AK="ObjectExpression",kK="UnaryExpression";function xi(e){this.type=e}xi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=CK(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function CK(e){switch(e.type){case wK:return e.elements;case EK:case $K:return[e.left,e.right];case RO:return[e.callee].concat(e.arguments);case _K:return[e.test,e.consequent,e.alternate];case SK:return[e.object,e.property];case AK:return e.properties;case vK:return[e.key,e.value];case kK:return[e.argument];case xK:case Qs:case bK:default:return[]}}var rr,Q,N,Ht,Fe,mg=1,pf=2,ea=3,Xo=4,yg=5,ta=6,xn=7,gf=8,MK=9;rr={},rr[mg]="Boolean",rr[pf]="<end>",rr[ea]="Identifier",rr[Xo]="Keyword",rr[yg]="Null",rr[ta]="Numeric",rr[xn]="Punctuator",rr[gf]="String",rr[MK]="RegularExpression";var FK="ArrayExpression",TK="BinaryExpression",OK="CallExpression",DK="ConditionalExpression",PO="Identifier",NK="Literal",RK="LogicalExpression",PK="MemberExpression",LK="ObjectExpression",IK="Property",zK="UnaryExpression",pt="Unexpected token %0",BK="Unexpected number",UK="Unexpected string",jK="Unexpected identifier",qK="Unexpected reserved word",WK="Unexpected end of input",s2="Invalid regular expression",a2="Invalid regular expression: missing /",LO="Octal literals are not allowed in strict mode.",HK="Duplicate data property in object literal not allowed in strict mode",St="ILLEGAL",mf="Disabled.",GK=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]"),VK=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 bg(e,t){if(!e)throw new Error("ASSERT: "+t)}function Vr(e){return e>=48&&e<=57}function u2(e){return"0123456789abcdefABCDEF".includes(e)}function yf(e){return"01234567".includes(e)}function YK(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function bf(e){return e===10||e===13||e===8232||e===8233}function vf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&GK.test(String.fromCharCode(e))}function vg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&VK.test(String.fromCharCode(e))}const XK={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 IO(){for(;N<Ht;){const e=Q.charCodeAt(N);if(YK(e)||bf(e))++N;else break}}function l2(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)N<Ht&&u2(Q[N])?(i=Q[N++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):Ae({},pt,St);return String.fromCharCode(r)}function KK(){var e,t,n,i;for(e=Q[N],t=0,e==="}"&&Ae({},pt,St);N<Ht&&(e=Q[N++],!!u2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ae({},pt,St),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function zO(){var e,t;for(e=Q.charCodeAt(N++),t=String.fromCharCode(e),e===92&&(Q.charCodeAt(N)!==117&&Ae({},pt,St),++N,e=l2("u"),(!e||e==="\\"||!vf(e.charCodeAt(0)))&&Ae({},pt,St),t=e);N<Ht&&(e=Q.charCodeAt(N),!!vg(e));)++N,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Q.charCodeAt(N)!==117&&Ae({},pt,St),++N,e=l2("u"),(!e||e==="\\"||!vg(e.charCodeAt(0)))&&Ae({},pt,St),t+=e);return t}function ZK(){var e,t;for(e=N++;N<Ht;){if(t=Q.charCodeAt(N),t===92)return N=e,zO();if(vg(t))++N;else break}return Q.slice(e,N)}function JK(){var e,t,n;return e=N,t=Q.charCodeAt(N)===92?zO():ZK(),t.length===1?n=ea:XK.hasOwnProperty(t)?n=Xo:t==="null"?n=yg:t==="true"||t==="false"?n=mg:n=ea,{type:n,value:t,start:e,end:N}}function c2(){var e=N,t=Q.charCodeAt(N),n,i=Q[N],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++N,{type:xn,value:String.fromCharCode(t),start:e,end:N};default:if(n=Q.charCodeAt(N+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return N+=2,{type:xn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:N};case 33:case 61:return N+=2,Q.charCodeAt(N)===61&&++N,{type:xn,value:Q.slice(e,N),start:e,end:N}}}if(s=Q.substr(N,4),s===">>>=")return N+=4,{type:xn,value:s,start:e,end:N};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return N+=3,{type:xn,value:o,start:e,end:N};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return N+=2,{type:xn,value:r,start:e,end:N};if(r==="//"&&Ae({},pt,St),"<>=!+-*%&|^/".includes(i))return++N,{type:xn,value:i,start:e,end:N};Ae({},pt,St)}function QK(e){let t="";for(;N<Ht&&u2(Q[N]);)t+=Q[N++];return t.length===0&&Ae({},pt,St),vf(Q.charCodeAt(N))&&Ae({},pt,St),{type:ta,value:parseInt("0x"+t,16),start:e,end:N}}function eZ(e){let t="0"+Q[N++];for(;N<Ht&&yf(Q[N]);)t+=Q[N++];return(vf(Q.charCodeAt(N))||Vr(Q.charCodeAt(N)))&&Ae({},pt,St),{type:ta,value:parseInt(t,8),octal:!0,start:e,end:N}}function BO(){var e,t,n;if(n=Q[N],bg(Vr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=N,e="",n!=="."){if(e=Q[N++],n=Q[N],e==="0"){if(n==="x"||n==="X")return++N,QK(t);if(yf(n))return eZ(t);n&&Vr(n.charCodeAt(0))&&Ae({},pt,St)}for(;Vr(Q.charCodeAt(N));)e+=Q[N++];n=Q[N]}if(n==="."){for(e+=Q[N++];Vr(Q.charCodeAt(N));)e+=Q[N++];n=Q[N]}if(n==="e"||n==="E")if(e+=Q[N++],n=Q[N],(n==="+"||n==="-")&&(e+=Q[N++]),Vr(Q.charCodeAt(N)))for(;Vr(Q.charCodeAt(N));)e+=Q[N++];else Ae({},pt,St);return vf(Q.charCodeAt(N))&&Ae({},pt,St),{type:ta,value:parseFloat(e),start:t,end:N}}function tZ(){var e="",t,n,i,r,o=!1;for(t=Q[N],bg(t==="'"||t==='"',"String literal must starts with a quote"),n=N,++N;N<Ht;)if(i=Q[N++],i===t){t="";break}else if(i==="\\")if(i=Q[N++],!i||!bf(i.charCodeAt(0)))switch(i){case"u":case"x":Q[N]==="{"?(++N,e+=KK()):e+=l2(i);break;case"n":e+=`
49
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:yf(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),N<Ht&&yf(Q[N])&&(o=!0,r=r*8+"01234567".indexOf(Q[N++]),"0123".includes(i)&&N<Ht&&yf(Q[N])&&(r=r*8+"01234567".indexOf(Q[N++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Q[N]===`
50
+ `&&++N;else{if(bf(i.charCodeAt(0)))break;e+=i}return t!==""&&Ae({},pt,St),{type:gf,value:e,octal:o,start:n,end:N}}function nZ(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Ae({},s2)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ae({},s2)}try{return new RegExp(e,t)}catch{return null}}function iZ(){var e,t,n,i,r;for(e=Q[N],bg(e==="/","Regular expression literal must start with a slash"),t=Q[N++],n=!1,i=!1;N<Ht;)if(e=Q[N++],t+=e,e==="\\")e=Q[N++],bf(e.charCodeAt(0))&&Ae({},a2),t+=e;else if(bf(e.charCodeAt(0)))Ae({},a2);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||Ae({},a2),r=t.substr(1,t.length-2),{value:r,literal:t}}function rZ(){var e,t,n;for(t="",n="";N<Ht&&(e=Q[N],!!vg(e.charCodeAt(0)));)++N,e==="\\"&&N<Ht?Ae({},pt,St):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ae({},s2,n),{value:n,literal:t}}function oZ(){var e,t,n,i;return Fe=null,IO(),e=N,t=iZ(),n=rZ(),i=nZ(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:N}}function sZ(e){return e.type===ea||e.type===Xo||e.type===mg||e.type===yg}function UO(){if(IO(),N>=Ht)return{type:pf,start:N,end:N};const e=Q.charCodeAt(N);return vf(e)?JK():e===40||e===41||e===59?c2():e===39||e===34?tZ():e===46?Vr(Q.charCodeAt(N+1))?BO():c2():Vr(e)?BO():c2()}function wn(){const e=Fe;return N=e.end,Fe=UO(),N=e.end,e}function jO(){const e=N;Fe=UO(),N=e}function aZ(e){const t=new xi(FK);return t.elements=e,t}function qO(e,t,n){const i=new xi(e==="||"||e==="&&"?RK:TK);return i.operator=e,i.left=t,i.right=n,i}function uZ(e,t){const n=new xi(OK);return n.callee=e,n.arguments=t,n}function lZ(e,t,n){const i=new xi(DK);return i.test=e,i.consequent=t,i.alternate=n,i}function f2(e){const t=new xi(PO);return t.name=e,t}function xf(e){const t=new xi(NK);return t.value=e.value,t.raw=Q.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function WO(e,t,n){const i=new xi(PK);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function cZ(e){const t=new xi(LK);return t.properties=e,t}function HO(e,t,n){const i=new xi(IK);return i.key=t,i.value=n,i.kind=e,i}function fZ(e,t){const n=new xi(zK);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ae(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(bg(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=N,n.description=r,n}function xg(e){e.type===pf&&Ae(e,WK),e.type===ta&&Ae(e,BK),e.type===gf&&Ae(e,UK),e.type===ea&&Ae(e,jK),e.type===Xo&&Ae(e,qK),Ae(e,pt,e.value)}function Gt(e){const t=wn();(t.type!==xn||t.value!==e)&&xg(t)}function Be(e){return Fe.type===xn&&Fe.value===e}function d2(e){return Fe.type===Xo&&Fe.value===e}function dZ(){const e=[];for(N=Fe.start,Gt("[");!Be("]");)Be(",")?(wn(),e.push(null)):(e.push(na()),Be("]")||Gt(","));return wn(),aZ(e)}function GO(){N=Fe.start;const e=wn();return e.type===gf||e.type===ta?(e.octal&&Ae(e,LO),xf(e)):f2(e.value)}function hZ(){var e,t,n,i;if(N=Fe.start,e=Fe,e.type===ea)return n=GO(),Gt(":"),i=na(),HO("init",n,i);if(e.type===pf||e.type===xn)xg(e);else return t=GO(),Gt(":"),i=na(),HO("init",t,i)}function pZ(){var e=[],t,n,i,r={},o=String;for(N=Fe.start,Gt("{");!Be("}");)t=hZ(),t.key.type===PO?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?Ae({},HK):r[i]=!0,e.push(t),Be("}")||Gt(",");return Gt("}"),cZ(e)}function gZ(){Gt("(");const e=h2();return Gt(")"),e}const mZ={if:1};function yZ(){var e,t,n;if(Be("("))return gZ();if(Be("["))return dZ();if(Be("{"))return pZ();if(e=Fe.type,N=Fe.start,e===ea||mZ[Fe.value])n=f2(wn().value);else if(e===gf||e===ta)Fe.octal&&Ae(Fe,LO),n=xf(wn());else{if(e===Xo)throw new Error(mf);e===mg?(t=wn(),t.value=t.value==="true",n=xf(t)):e===yg?(t=wn(),t.value=null,n=xf(t)):Be("/")||Be("/=")?(n=xf(oZ()),jO()):xg(wn())}return n}function bZ(){const e=[];if(Gt("("),!Be(")"))for(;N<Ht&&(e.push(na()),!Be(")"));)Gt(",");return Gt(")"),e}function vZ(){N=Fe.start;const e=wn();return sZ(e)||xg(e),f2(e.value)}function xZ(){return Gt("."),vZ()}function wZ(){Gt("[");const e=h2();return Gt("]"),e}function EZ(){var e,t,n;for(e=yZ();;)if(Be("."))n=xZ(),e=WO(".",e,n);else if(Be("("))t=bZ(),e=uZ(e,t);else if(Be("["))n=wZ(),e=WO("[",e,n);else break;return e}function VO(){const e=EZ();if(Fe.type===xn&&(Be("++")||Be("--")))throw new Error(mf);return e}function wg(){var e,t;if(Fe.type!==xn&&Fe.type!==Xo)t=VO();else{if(Be("++")||Be("--"))throw new Error(mf);if(Be("+")||Be("-")||Be("~")||Be("!"))e=wn(),t=wg(),t=fZ(e.value,t);else{if(d2("delete")||d2("void")||d2("typeof"))throw new Error(mf);t=VO()}}return t}function YO(e){let t=0;if(e.type!==xn&&e.type!==Xo)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":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;break}return t}function _Z(){var e,t,n,i,r,o,s,a,u,l;if(e=Fe,u=wg(),i=Fe,r=YO(i),r===0)return u;for(i.prec=r,wn(),t=[e,Fe],s=wg(),o=[u,i,s];(r=YO(Fe))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=qO(a,u,s),o.push(n);i=wn(),i.prec=r,o.push(i),t.push(Fe),n=wg(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=qO(o[l-1].value,o[l-2],n),l-=2;return n}function na(){var e,t,n;return e=_Z(),Be("?")&&(wn(),t=na(),Gt(":"),n=na(),e=lZ(e,t,n)),e}function h2(){const e=na();if(Be(","))throw new Error(mf);return e}function p2(e){Q=e,N=0,Ht=Q.length,Fe=null,jO();const t=h2();if(Fe.type!==pf)throw new Error("Unexpect token after expression.");return t}var XO={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 KO(e){function t(s,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,u){return l=>t(s,l,a,u)}const i="new Date",r="String",o="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(s){s.length<3&&R("Missing arguments to clamp function."),s.length>3&&R("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&R("Missing arguments to if function."),s.length>3&&R("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function $Z(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function ZO(e){e=e||{};const t=e.allowed?li(e.allowed):{},n=e.forbidden?li(e.forbidden):{},i=e.constants||XO,r=(e.functions||KO)(f),o=e.globalvar,s=e.fieldvar,a=ce(o)?o:p=>`${o}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&R("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:Z(n,g)?R("Illegal identifier: "+g):Z(i,g)?i[g]:Z(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===s&&(l[$Z(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&R("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=Z(r,g)&&r[g];return y||R("Unrecognized function: "+g),ce(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const JO=Symbol("vega_selection_getter");function QO(e){return(!e.getter||!e.getter[JO])&&(e.getter=qn(e.field),e.getter[JO]=!0),e.getter}const g2="intersect",eD="union",SZ="vlMulti",AZ="vlPoint",tD="or",kZ="and",or="_vgsid_",wf=qn(or),CZ="E",MZ="R",FZ="R-E",TZ="R-LE",OZ="R-RE",Eg="index:unit";function nD(e,t){for(var n=t.fields,i=t.values,r=n.length,o=0,s,a;o<r;++o)if(a=n[o],s=QO(a)(e),yo(s)&&(s=Pt(s)),yo(i[o])&&(i[o]=Pt(i[o])),L(i[o])&&yo(i[o][0])&&(i[o]=i[o].map(Pt)),a.type===CZ){if(L(i[o])?i[o].indexOf(s)<0:s!==i[o])return!1}else if(a.type===MZ){if(!Va(s,i[o]))return!1}else if(a.type===OZ){if(!Va(s,i[o],!0,!1))return!1}else if(a.type===FZ){if(!Va(s,i[o],!1,!1))return!1}else if(a.type===TZ&&!Va(s,i[o],!1,!0))return!1;return!0}function DZ(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[Eg]&&i[Eg].value:void 0,s=n===g2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],o&&s){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=nD(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=nD(t,l),s^h)return h;return a&&s}const iD=Ya(wf),NZ=iD.left,RZ=iD.right;function PZ(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[Eg]&&i[Eg].value:void 0,s=n===g2,a=wf(t),u=NZ(r,a);if(u===r.length||wf(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(RZ(r,a)-u<o.size)return!1}return!0}function LZ(e,t){return e.map(n=>fe(t.fields?{values:t.fields.map(i=>QO(i)(n.datum))}:{[or]:wf(n.datum)},t))}function IZ(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=o.length,x=0,w,_;x<v;++x)if(l=o[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(w=0,_=c.length;w<_;++w)h=c[w],g=s[h.field]||(s[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=m2[`${y}_union`],g[d]=b(m,X(f[w]));n&&(m=a[d]||(a[d]=[]),m.push(X(f).reduce((E,$,S)=>(E[c[S].field]=$,E),{})))}else h=or,p=wf(l),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[or]:p}));if(t=t||eD,s[or]?s[or]=m2[`${or}_${t}`](...Object.values(s[or])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map($=>s[E][$]).reduce(($,S)=>$===void 0?S:m2[`${u[E]}_${t}`]($,S))}),o=Object.keys(a),n&&o.length){const E=i?AZ:SZ;s[E]=t===eD?{[tD]:o.reduce(($,S)=>($.push(...a[S]),$),[])}:{[kZ]:o.map($=>({[tD]:a[$]}))}}return s}var m2={[`${or}_union`]:zI,[`${or}_intersect`]:LI,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=Pt(t[0]),i=Pt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=Pt(t[0]),i=Pt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const zZ=":",BZ="@";function y2(e,t,n,i){t[0].type!==Qs&&R("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&ve(t).value,s="unit",a=BZ+s,u=zZ+r;o===g2&&!Z(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),Z(i,u)||(i[u]=n.getData(r).tuplesRef())}function rD(e){const t=this.context.data[e];return t?t.values.value:[]}function UZ(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function jZ(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Wn).insert(t)),1}function qZ(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Ef=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},WZ=Ef("format"),oD=Ef("timeFormat"),HZ=Ef("utcFormat"),GZ=Ef("timeParse"),VZ=Ef("utcParse"),_g=new Date(2e3,0,1);function $g(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(_g.setYear(2e3),_g.setMonth(e),_g.setDate(t),oD.call(this,_g,n))}function YZ(e){return $g.call(this,e,1,"%B")}function XZ(e){return $g.call(this,e,1,"%b")}function KZ(e){return $g.call(this,0,2+e,"%A")}function ZZ(e){return $g.call(this,0,2+e,"%a")}const JZ=":",QZ="@",b2="%",sD="$";function v2(e,t,n,i){t[0].type!==Qs&&R("First argument to data functions must be a string literal.");const r=t[0].value,o=JZ+r;if(!Z(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function eJ(e,t,n,i){t[0].type!==Qs&&R("First argument to indata must be a string literal."),t[1].type!==Qs&&R("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=QZ+o;Z(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function ln(e,t,n,i){if(t[0].type===Qs)aD(n,i,t[0].value);else for(e in n.scales)aD(n,i,e)}function aD(e,t,n){const i=b2+n;if(!Z(t,i))try{t[i]=e.scaleRef(n)}catch{}}function sr(e,t){if(ce(e))return e;if(K(e)){const n=t.scales[e];return n&&bU(n.value)?n.value:void 0}}function tJ(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=ln,n._range=ln,n._scale=ln;const i=r=>"_["+(r.type===Qs?H(b2+r.value):H(b2)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function x2(e,t){return function(n,i,r){if(n){const o=sr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const nJ=x2("area",AH),iJ=x2("bounds",FH),rJ=x2("centroid",PH);function oJ(e,t){const n=sr(e,(t||this).context);return n&&n.scale()}function sJ(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}function w2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function aJ(){return w2(this.context.dataflow,"warn",arguments)}function uJ(){return w2(this.context.dataflow,"info",arguments)}function lJ(){return w2(this.context.dataflow,"debug",arguments)}function E2(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _2(e){const t=Fo(e),n=E2(t.r),i=E2(t.g),r=E2(t.b);return .2126*n+.7152*i+.0722*r}function cJ(e,t){const n=_2(e),i=_2(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function fJ(){const e=[].slice.call(arguments);return e.unshift({}),fe(...e)}function uD(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?dJ(e,t):!1:Y(e)&&Y(t)?lD(e,t):!1}function dJ(e,t){for(let n=0,i=e.length;n<i;++n)if(!uD(e[n],t[n]))return!1;return!0}function lD(e,t){for(const n in e)if(!uD(e[n],t[n]))return!1;return!0}function cD(e){return t=>lD(e,t)}function hJ(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,l=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=s.changeset(),c.stamp=l,s.runAfter(()=>{a.modified=!0,s.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Wn:L(n)||Wd(n)?n:cD(n),c.remove(f)),t&&c.insert(t),i&&(f=cD(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function pJ(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function gJ(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const fD={};function mJ(e,t){const n=fD[t]||(fD[t]=qn(t));return L(e)?e.map(n):n(e)}function $2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function S2(e){return $2(e)||(K(e)?e:null)}function yJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return $2(e).join(...n)}function bJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).indexOf(...n)}function vJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).lastIndexOf(...n)}function xJ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return S2(e).slice(...n)}function wJ(e,t,n){return ce(n)&&R("Function argument passed to replace."),String(e).replace(t,n)}function EJ(e){return $2(e).slice().reverse()}function _J(e,t,n){return nb(e||0,t||0,n||0)}function $J(e,t){const n=sr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function SJ(e,t){const n=sr(e,(t||this).context);return n?n.copy():void 0}function AJ(e,t){const n=sr(e,(t||this).context);return n?n.domain():[]}function kJ(e,t,n){const i=sr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function CJ(e,t){const n=sr(e,(t||this).context);return n&&n.range?n.range():[]}function MJ(e,t,n){const i=sr(e,(n||this).context);return i?i(t):void 0}function FJ(e,t,n,i,r){e=sr(e,(r||this).context);const o=oM(t,n);let s=e.domain(),a=s[0],u=ve(s),l=Rt;return u-a?l=WC(e,a,u):e=(e.interpolator?Se("sequential")().interpolator(e.interpolator()):Se("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(s=e.ticks(+i||15),a!==s[0]&&s.unshift(a),u!==ve(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function TJ(e,t,n){const i=sr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function OJ(e){let t=null;return function(n){return n?xc(n,t=t||bu(e)):e}}const dD=e=>e.data;function hD(e,t){const n=rD.call(t,e);return n.root&&n.root.lookup||{}}function DJ(e,t,n){const i=hD(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(dD):void 0}function NJ(e,t){const n=hD(e,this)[t];return n?n.ancestors().map(dD):void 0}const pD=()=>typeof window<"u"&&window||null;function RJ(){const e=pD();return e?e.screen:{}}function PJ(){const e=pD();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function LJ(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function gD(e,t,n){if(!e)return[];const[i,r]=e,o=new nt().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return AF(s,o,IJ(t))}function IJ(e){let t=null;if(e){const n=X(e.marktype),i=X(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function zJ(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=X(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function BJ(e){return X(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function UJ(e,t,n){const{x:i,y:r,mark:o}=n,s=new nt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<s.x1&&(s.x1=u),u>s.x2&&(s.x2=u),l<s.y1&&(s.y1=l),l>s.y2&&(s.y2=l);return s.translate(i,r),gD([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>jJ(u.x,u.y,t))}function jJ(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[s,a]=n[o],[u,l]=n[r];l>t!=a>t&&e<(s-u)*(t-l)/(a-l)+u&&i++}return i&1}const _f={random(){return Vn()},cumulativeNormal:Jd,cumulativeLogNormal:P1,cumulativeUniform:B1,densityNormal:T1,densityLogNormal:R1,densityUniform:z1,quantileNormal:Qd,quantileLogNormal:L1,quantileUniform:U1,sampleNormal:Zd,sampleLogNormal:N1,sampleUniform:I1,isArray:L,isBoolean:mo,isDate:yo,isDefined(e){return e!==void 0},isNumber:_e,isObject:Y,isRegExp:m$,isString:K,isTuple:Wd,isValid(e){return e!=null&&e===e},toBoolean:B0,toDate(e){return U0(e)},toNumber:Pt,toString:j0,indexof:bJ,join:yJ,lastindexof:vJ,replace:wJ,reverse:EJ,slice:xJ,flush:p$,lerp:y$,merge:fJ,pad:x$,peek:ve,pluck:mJ,span:zl,inrange:Va,truncate:w$,rgb:Fo,lab:bh,hcl:vh,hsl:gh,luminance:_2,contrast:cJ,sequence:Mn,format:WZ,utcFormat:HZ,utcParse:VZ,utcOffset:cS,utcSequence:hS,timeFormat:oD,timeParse:GZ,timeOffset:lS,timeSequence:dS,timeUnitSpecifier:J$,monthFormat:YZ,monthAbbrevFormat:XZ,dayFormat:KZ,dayAbbrevFormat:ZZ,quarter:c$,utcquarter:f$,week:eS,utcweek:iS,dayofyear:Q$,utcdayofyear:nS,warn:aJ,info:uJ,debug:lJ,extent(e){return Bi(e)},inScope:sJ,intersect:gD,clampRange:d$,pinchDistance:pJ,pinchAngle:gJ,screen:RJ,containerSize:LJ,windowSize:PJ,bandspace:_J,setdata:jZ,pathShape:OJ,panLinear:s$,panLog:a$,panPow:u$,panSymlog:l$,zoomLinear:N0,zoomLog:R0,zoomPow:_d,zoomSymlog:P0,encode:qZ,modify:hJ,lassoAppend:zJ,lassoPath:BJ,intersectLasso:UJ},qJ=["view","item","group","xy","x","y"],WJ="event.vega.",mD="this.",A2={},yD={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(sD+e)}]`,functions:HJ,constants:XO,visitors:A2},k2=ZO(yD);function HJ(e){const t=KO(e);qJ.forEach(n=>t[n]=WJ+n);for(const n in _f)t[n]=mD+n;return fe(t,tJ(e,_f,A2)),t}function Qe(e,t,n){return arguments.length===1?_f[e]:(_f[e]=t,n&&(A2[e]=n),k2&&(k2.functions[e]=mD+e),this)}Qe("bandwidth",$J,ln),Qe("copy",SJ,ln),Qe("domain",AJ,ln),Qe("range",CJ,ln),Qe("invert",kJ,ln),Qe("scale",MJ,ln),Qe("gradient",FJ,ln),Qe("geoArea",nJ,ln),Qe("geoBounds",iJ,ln),Qe("geoCentroid",rJ,ln),Qe("geoShape",TJ,ln),Qe("geoScale",oJ,ln),Qe("indata",UZ,eJ),Qe("data",rD,v2),Qe("treePath",DJ,v2),Qe("treeAncestors",NJ,v2),Qe("vlSelectionTest",DZ,y2),Qe("vlSelectionIdTest",PZ,y2),Qe("vlSelectionResolve",IZ,y2),Qe("vlSelectionTuples",LZ);function ar(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=p2(e)}catch{R("Expression parse error: "+e)}i.visit(o=>{if(o.type!==RO)return;const s=o.callee.name,a=yD.visitors[s];a&&a(s,o.arguments,t,n)});const r=k2(i);return r.globals.forEach(o=>{const s=sD+o;!Z(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:fe({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function GJ(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(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const VJ=li(["rule"]),bD=li(["group","image","rect"]);function YJ(e,t){let n="";return VJ[t]||(e.x2&&(e.x?(bD[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?(bD[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}function C2(e){return(e+"").toLowerCase()}function XJ(e){return C2(e)==="operator"}function KJ(e){return C2(e)==="collect"}function $f(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function ZJ(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
51
51
  : (u > v || v == null) && u != null ? ${i}
52
52
  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
53
- : v !== v && u === u ? ${i} : `}var QJ={operator:(e,t)=>_f(e,["_"],t.code),parameter:(e,t)=>_f(e,["datum","_"],t.code),event:(e,t)=>_f(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return _f(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const s="o["+H(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=XJ(i,n),r+="return m;",_f(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(o,s)=>{const a=t[s];let u,l;return o.path?(u=`a${o.path}`,l=`b${o.path}`):((n=n||{})["f"+s]=o,u=`this.f${s}(a)`,l=`this.f${s}(b)`),JJ(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function eQ(e){const t=this;KJ(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function tQ(e){const t=this;if(e.params){const n=t.get(e.id);n||R("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function nQ(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=L(r)?r.map(o=>vN(o,n,t)):vN(r,n,t)}return t}function vN(e,t,n){if(!e||!Y(e))return e;for(let i=0,r=xN.length,o;i<r;++i)if(o=xN[i],Z(e,o.key))return o.parse(e,t,n);return e}var xN=[{key:"$ref",parse:iQ},{key:"$key",parse:oQ},{key:"$expr",parse:rQ},{key:"$field",parse:sQ},{key:"$encode",parse:uQ},{key:"$compare",parse:aQ},{key:"$context",parse:lQ},{key:"$subflow",parse:cQ},{key:"$tupleid",parse:fQ}];function iQ(e,t){return t.get(e.$ref)||R("Operator not defined: "+e.$ref)}function rQ(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=hn(t.parameterExpression(e.$expr),e.$fields))}function oQ(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=z0(e.$key,e.$flat,t.expr.codegen))}function sQ(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=qn(e.$field,e.$name,t.expr.codegen))}function aQ(e,t){const n="c:"+e.$compare+"_"+e.$order,i=X(e.$compare).map(r=>r&&r.$tupleid?ie:r);return t.fn[n]||(t.fn[n]=L0(i,e.$order,t.expr.codegen))}function uQ(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=hn(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function lQ(e,t){return t}function cQ(e,t){const n=e.$subflow;return function(i,r,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),u=s.signals.parent;return u&&u.set(o),a.detachSubflow=()=>t.detach(s),a}}function fQ(){return ie}function dQ(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(o=>t.get(o)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(o=>t.get(o)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&R("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function hQ(e){var t=this,n=Y(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||R("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,i,r,o,s)}const pQ={skip:!0};function gQ(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(i[o]=s.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(r[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function mQ(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(o=>{n.update(t.signals[o],r[o],pQ)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Wn).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function wN(e,t,n,i){return new EN(e,t,n,i)}function EN(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||QJ,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function _N(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)}EN.prototype=_N.prototype={fork(){const e=new _N(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==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,i=n.dataflow,r=e.value;if(n.set(e.id,t),ZJ(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(i.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),i.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=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[C2(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,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:VJ,parseOperator:eQ,parseOperatorParameters:tQ,parseParameters:nQ,parseStream:dQ,parseUpdate:hQ,getState:gQ,setState:mQ};function yQ(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),$N(t,e.description()))}function $N(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function bQ(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const M2="default";function vQ(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:M2,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?K(r)?r:r.user:M2,s=i.item&&i.item.cursor||null;return r&&o===r.user&&s==r.item?r:{user:o,item:s}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),F2(e,i&&i!==M2?i:r||i),r},{cursor:t})}function F2(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function $g(e,t){var n=e._runtime.data;return Z(n,t)||R("Unrecognized data set: "+t),n[t]}function xQ(e,t){return arguments.length<2?$g(this,e).values.value:Sg.call(this,e,Cs().remove(Wn).insert(t))}function Sg(e,t){tA(t)||R("Second argument to changes must be a changeset.");const n=$g(this,e);return n.modified=!0,this.pulse(n.input,t)}function wQ(e,t){return Sg.call(this,e,Cs().insert(t))}function EQ(e,t){return Sg.call(this,e,Cs().remove(t))}function SN(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function AN(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Ag(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function _Q(e){var t=Ag(e),n=SN(e),i=AN(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(o){e.error(o)}})}function $Q(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=Ag(e),s=t.changedTouches?t.changedTouches[0]:t,o=Zh(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=SQ(e,n,o),t}function SQ(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(s){var a=i,u;if(s){for(u=t;u;u=u.mark.group)if(u.mark.name===s){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;K(s)&&(s=r(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:Lt(e),item:Lt(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const kN="view",AQ="timer",kQ="window",CQ={trap:!1};function MQ(e){const t=fe({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{L(i[o])&&(i[o]=li(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function CN(e,t,n,i){e._eventListeners.push({type:n,sources:X(t),handler:i})}function FQ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function kg(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||Y(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function TQ(e,t,n){var i=this,r=new Vd(n),o=function(l,c){i.runAsync(null,()=>{e===kN&&FQ(i,t)&&l.preventDefault(),r.receive($Q(i,l,c))})},s;if(e===AQ)kg(i,"timer",t)&&i.timer(o,t);else if(e===kN)kg(i,"view",t)&&i.addEventListener(t,o,CQ);else if(e===kQ?kg(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&kg(i,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=s.length;a<u;++a)s[a].addEventListener(t,o);CN(i,s,t,o)}return r}function MN(e){return e.item}function FN(e){return e.item.mark.source}function TN(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function OQ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",MN),FN,TN(e)),this.on(this.events("view","pointerout",MN),FN,TN(t)),this}function NQ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,o,s,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(s=i[r],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Pn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const DQ="vega-bind",RQ="vega-bind-name",PQ="vega-bind-radio";function LQ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,s)})}},i.debounce&&(r.update=I0(i.debounce,r.update))),(i.input==null&&i.element?IQ:BQ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function IQ(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),CN(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(zQ(r))}}function zQ(e){return typeof Event<"u"?new Event(e):{type:e}}function BQ(e,t,n,i){const r=i.signal(n.signal),o=Pn("div",{class:DQ}),s=n.input==="radio"?o:o.appendChild(Pn("label"));s.appendChild(Pn("span",{class:RQ},n.name||n.signal)),t.appendChild(o);let a=UQ;switch(n.input){case"checkbox":a=jQ;break;case"select":a=qQ;break;case"radio":a=WQ;break;case"range":a=HQ;break}a(e,s,n,r)}function UQ(e,t,n,i){const r=Pn("input");for(const o in n)o!=="signal"&&o!=="element"&&r.setAttribute(o==="input"?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=o=>r.value=o}function jQ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Pn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function qQ(e,t,n,i){const r=Pn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};Cg(s,i)&&(u.selected=!0),r.appendChild(Pn("option",u,(o[a]||s)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=s=>{for(let a=0,u=n.options.length;a<u;++a)if(Cg(n.options[a],s)){r.selectedIndex=a;return}}}function WQ(e,t,n,i){const r=Pn("span",{class:PQ}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};Cg(s,i)&&(u.checked=!0);const l=Pn("input",u);l.addEventListener("change",()=>e.update(s));const c=Pn("label",{},(o[a]||s)+"");return c.prepend(l),r.appendChild(c),l}),e.set=s=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)Cg(a[l].value,s)&&(a[l].checked=!0)}}function HQ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,s=n.step||xo(o,r,100),a=Pn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Pn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function Cg(e,t){return e===t||e+""==t+""}function ON(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,SN(e),AN(e),Ag(e),r,o).background(e.background())}function T2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function GQ(e,t,n,i){const r=new i(e.loader(),T2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Ag(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function VQ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=cp(i);e=n._el=e?O2(n,e,!0):null,yQ(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Nc,a=e?o.renderer:o.headless;return n._renderer=a?ON(n,n._renderer,e,a):null,n._handler=GQ(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=O2(n,t,!0):e.appendChild(Pn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=O2(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{LQ(n,u.element||t,u)})),n}function O2(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const $f=e=>+e||0,YQ=e=>({top:e,bottom:e,left:e,right:e});function NN(e){return Y(e)?{top:$f(e.top),bottom:$f(e.bottom),left:$f(e.left),right:$f(e.right)}:YQ($f(e))}async function N2(e,t,n,i){const r=cp(t),o=r&&r.headless;return o||R("Unrecognized renderer type: "+t),await e.runAsync(),ON(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function XQ(e,t){e!==Uo.Canvas&&e!==Uo.SVG&&e!==Uo.PNG&&R("Unrecognized image type: "+e);const n=await N2(this,e,t);return e===Uo.SVG?KQ(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function KQ(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function ZQ(e,t){return(await N2(this,Uo.Canvas,e,t)).canvas()}async function JQ(e){return(await N2(this,Uo.SVG,e)).svg()}function QQ(e,t,n){return wN(e,au,Ef,n).parse(t)}function eee(e){var t=this._runtime.scales;return Z(t,e)||R("Unrecognized scale or projection: "+e),t[e].value}var DN="width",RN="height",D2="padding",PN={skip:!0};function LN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===D2?i.left+i.right:0)}function IN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===D2?i.top+i.bottom:0)}function tee(e){var t=e._signals,n=t[DN],i=t[RN],r=t[D2];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=LN(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=IN(e,a.size),o()},{size:i});const s=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,s.rank=r.rank+1}function nee(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(DN,n,PN),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(RN,i,PN),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==r[0]||s._origin[1]!==r[1])&&(s._resize=1,s._origin=r),a&&s.run("enter"),o&&s.runAfter(u=>u.resize())},!1,1)}function iee(e){return this._runtime.getState(e||{data:ree,signals:oee,recurse:!0})}function ree(e,t){return t.modified&&L(t.input.value)&&!e.startsWith("_:vega:_")}function oee(e,t){return!(e==="parent"||t instanceof au.proxy)}function see(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function aee(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(IV(n,t))}function uee(e,t,n,i){const r=e.element();r&&r.setAttribute("title",lee(i))}function lee(e){return e==null?"":L(e)?zN(e):Y(e)&&!yo(e)?cee(e):e+""}function cee(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(L(n)?zN(n):BN(n))}).join(`
54
- `)}function zN(e){return"["+e.map(BN).join(", ")+"]"}function BN(e){return L(e)?"[…]":Y(e)&&!yo(e)?"{…}":e}function fee(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function UN(e,t){const n=this;if(t=t||{},su.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=fe({},e.locale,t.locale);n.locale(qS(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Uo.Canvas,n._scenegraph=new qM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||uee,n._redraw=!0,n._handler=new Nc().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=MQ(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=QQ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:fe({},o)})),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=LN(n,n._width),n._viewHeight=IN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,tee(n),bQ(n),vQ(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Mg(e,t){return Z(e._signals,t)?e._signals[t]:R("Unrecognized signal name: "+H(t))}function jN(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function qN(e,t,n,i){let r=jN(n,i);return r||(r=T2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function WN(e,t,n){const i=jN(t,n);return i&&t._targets.remove(i),e}G(UN,su,{async evaluate(e,t,n){if(await su.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,_Q(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&jd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&$N(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 i=Mg(this,e);return arguments.length===1?i.value:this.update(i,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",NN(e)):NN(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?(cp(e)||R("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&&(su.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Mg(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:nee,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=T2(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,o;--i>=0;)if(o=n[i].type,r=n[i].handler,e===o&&(t===r||t===r.raw)){this._handler.off(o,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||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 qN(this,e,Mg(this,e),t)},removeSignalListener(e,t){return WN(this,Mg(this,e),t)},addDataListener(e,t){return qN(this,e,$g(this,e).values,t)},removeDataListener(e,t){return WN(this,$g(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=F2(this,null);this._globalCursor=!!e,t&&F2(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:aee,events:TQ,finalize:NQ,hover:OQ,data:xQ,change:Sg,insert:wQ,remove:EQ,scale:eee,initialize:VQ,toImageURL:XQ,toCanvas:ZQ,toSVG:JQ,getState:iee,setState:see,_watchPixelRatio:fee});const dee="view",Fg="[",Tg="]",HN="{",GN="}",hee=":",VN=",",pee="@",gee=">",mee=/[[\]{}]/,yee={"*":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 YN,XN;function Ko(e,t,n){return YN=t||dee,XN=n||yee,KN(e.trim()).map(R2)}function bee(e){return XN[e]}function Sf(e,t,n,i,r){const o=e.length;let s=0,a;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function KN(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Sf(e,r,VN,Fg+HN,Tg+GN),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function R2(e){return e[0]==="["?vee(e):xee(e)}function vee(e){const t=e.length;let n=1,i;if(n=Sf(e,n,Tg,Fg,Tg),n===t)throw"Empty between selector: "+e;if(i=KN(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==gee)throw"Expected '>' after between selector: "+e;i=i.map(R2);const r=R2(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function xee(e){const t={source:YN},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===GN){if(a=e.lastIndexOf(HN),a>=0){try{i=wee(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===pee&&(r=++a),u=Sf(e,a,hee),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=Sf(e,a,Fg),a===s)n.push(e.substring(o,s).trim());else if(n.push(e.substring(o,a).trim()),l=[],o=++a,o===s)throw"Unmatched left bracket: "+e;for(;a<s;){if(a=Sf(e,a,Tg),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==Fg)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||mee.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):bee(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function wee(e){const t=e.split(VN);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function Eee(e){return Y(e)?e:{type:e||"pad"}}const Af=e=>+e||0,_ee=e=>({top:e,bottom:e,left:e,right:e});function $ee(e){return Y(e)?e.signal?e:{top:Af(e.top),bottom:Af(e.bottom),left:Af(e.left),right:Af(e.right)}:_ee(Af(e))}const gt=e=>Y(e)&&!L(e)?fe({},e):{value:e};function ZN(e,t,n,i){return n!=null?(Y(n)&&!L(n)||L(n)&&n.length&&Y(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function At(e,t,n){for(const i in t)ZN(e,i,t[i]);for(const i in n)ZN(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&Z(n,i)||(e[i]=fe(e[i]||{},t[i]));return e}function Uu(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const P2="mark",L2="frame",I2="scope",See="axis",Aee="axis-domain",kee="axis-grid",Cee="axis-label",Mee="axis-tick",Fee="axis-title",Tee="legend",Oee="legend-band",Nee="legend-entry",Dee="legend-gradient",JN="legend-label",Ree="legend-symbol",Pee="legend-title",Lee="title",Iee="title-text",zee="title-subtitle";function Bee(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Uu(u,e)&&z2(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===L2?r.group:n===P2?fe({},r.mark,r[t]):null;for(u in c)l=Uu(u,e)||(u==="fill"||u==="stroke")&&(Uu("fill",e)||Uu("stroke",e)),l||z2(o,u,c[u]);X(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Uu(h,e)||z2(o,h,d[h])}),e=fe({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=fe(s,e.enter),a&&(e.update=fe(a,e.update)),e}function z2(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const QN=e=>K(e)?H(e):e.signal?`(${e.signal})`:eD(e);function Og(e){if(e.gradient!=null)return jee(e);let t=e.signal?`(${e.signal})`:e.color?Uee(e.color):e.field!=null?eD(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=qee(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${Dg(e.exponent)})`),e.mult!=null&&(t+=`*${Dg(e.mult)}`),e.offset!=null&&(t+=`+${Dg(e.offset)}`),e.round&&(t=`round(${t})`),t}const Ng=(e,t,n,i)=>`(${e}(${[t,n,i].map(Og).join(",")})+'')`;function Uee(e){return e.c?Ng("hcl",e.h,e.c,e.l):e.h||e.s?Ng("hsl",e.h,e.s,e.l):e.l||e.a?Ng("lab",e.l,e.a,e.b):e.r||e.g||e.b?Ng("rgb",e.r,e.g,e.b):null}function jee(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&ve(t)==null;)t.pop();return t.unshift(QN(e.gradient)),`gradient(${t.join(",")})`}function Dg(e){return Y(e)?"("+Og(e)+")":e}function eD(e){return tD(Y(e)?e:{datum:e})}function tD(e){let t,n,i;if(e.signal)t="datum",i=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?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):R("Invalid field reference: "+H(e));return e.signal||(i=K(i)?zi(i).map(H).join("]["):tD(i)),t+"["+i+"]"}function qee(e,t){const n=QN(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+Dg(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Wee(e){let t="";return e.forEach(n=>{const i=Og(n);t+=n.test?`(${n.test})?${i}:`:i}),ve(t)===":"&&(t+="null"),t}function nD(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=Bee(e,t,n,i,r.config);for(const a in e)s[a]=Hee(e[a],t,o,r);return o}function Hee(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=Vee(Gee(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function Gee(e){return L(e)?Wee(e):Og(e)}function Vee(e,t,n,i){const r=ar(e,t);return r.$fields.forEach(o=>i[o]=1),fe(n,r.$params),r.$expr}const Yee="outer",Xee=["value","update","init","react","bind"];function iD(e,t){R(e+' for "outer" push: '+H(t))}function rD(e,t){const n=e.name;if(e.push===Yee)t.signals[n]||iD("No prior signal definition",n),Xee.forEach(i=>{e[i]!==void 0&&iD("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function B2(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Rg(e,t,n,i){return new B2(e,t,n,i)}function Pg(e,t){return Rg("operator",e,t)}function oe(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function kf(e,t){return t?{$field:e,$name:t}:{$field:e}}const U2=kf("key");function oD(e,t){return{$compare:e,$order:t}}function Kee(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Zee="ascending",Jee="descending";function Qee(e){return Y(e)?(e.order===Jee?"-":"+")+Lg(e.op,e.field):""}function Lg(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const j2="scope",q2="view";function ut(e){return e&&e.signal}function ete(e){return e&&e.expr}function Ig(e){if(ut(e))return!0;if(Y(e)){for(const t in e)if(Ig(e[t]))return!0}return!1}function wi(e,t){return e??t}function ia(e){return e&&e.signal||e}const sD="timer";function Cf(e,t){return(e.merge?nte:e.stream?ite:e.type?rte:R("Invalid stream specification: "+H(e)))(e,t)}function tte(e){return e===j2?q2:e||q2}function nte(e,t){const n=e.merge.map(r=>Cf(r,t)),i=W2({merge:n},e,t);return t.addStream(i).id}function ite(e,t){const n=Cf(e.stream,t),i=W2({stream:n},e,t);return t.addStream(i).id}function rte(e,t){let n;e.type===sD?(n=t.event(sD,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(tte(e.source),e.type);const i=W2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function W2(e,t,n){let i=t.between;return i&&(i.length!==2&&R('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[Cf(i[0],n),Cf(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(ote(t.marktype,t.markname,t.markrole)),t.source===j2&&i.push("inScope(event.item)"),i.length&&(e.filter=ar("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function ote(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const ste={code:"_.$value",ast:{type:"Identifier",value:"value"}};function ate(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||R("Signal update missing events specification."),K(o)&&(o=Ko(o,t.isSubscope()?j2:q2)),o=X(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[lte(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&R("Signal encode and update are mutually exclusive."),s="encode(item(),"+H(i)+")"),r.update=K(s)?ar(s,t):s.expr!=null?ar(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:ste,$params:{$value:t.signalRef(s.signal)}}:R("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(fe(ute(u,t),r)))}function ute(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Cf(e,t)}}function lte(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function cte(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?R("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=ar(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>ate(r,t,n.id))}const Ne=e=>(t,n,i)=>Rg(e,n,t||void 0,i),aD=Ne("aggregate"),fte=Ne("axisticks"),uD=Ne("bound"),Ei=Ne("collect"),lD=Ne("compare"),dte=Ne("datajoin"),cD=Ne("encode"),hte=Ne("expression"),pte=Ne("facet"),gte=Ne("field"),mte=Ne("key"),yte=Ne("legendentries"),bte=Ne("load"),vte=Ne("mark"),xte=Ne("multiextent"),wte=Ne("multivalues"),Ete=Ne("overlap"),_te=Ne("params"),fD=Ne("prefacet"),$te=Ne("projection"),Ste=Ne("proxy"),Ate=Ne("relay"),dD=Ne("render"),kte=Ne("scale"),ra=Ne("sieve"),Cte=Ne("sortitems"),hD=Ne("viewlayout"),Mte=Ne("values");let Fte=0;const pD={min:"min",max:"max",count:"sum"};function Tte(e,t){const n=e.type||"linear";IC(n)||R("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function Ote(e,t){const n=t.getScale(e.name).params;let i;n.domain=gD(e.domain,e,t),e.range!=null&&(n.range=yD(e,t,n)),e.interpolate!=null&&jte(e.interpolate,n),e.nice!=null&&(n.nice=Ute(e.nice,t)),e.bins!=null&&(n.bins=Bte(e.bins,t));for(i in e)Z(n,i)||i==="name"||(n[i]=ei(e[i],t))}function ei(e,t){return Y(e)?e.signal?t.signalRef(e.signal):R("Unsupported object: "+H(e)):e}function zg(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>ei(n,t))}function Bg(e){R("Can not find data set: "+H(e))}function gD(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&R("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(L(e)?Nte:e.fields?Rte:Dte)(e,t,n)}function Nte(e,t,n){return e.map(i=>ei(i,n))}function Dte(e,t,n){const i=n.getData(e.data);return i||Bg(e.data),yu(t.type)?i.valuesRef(n,e.field,mD(e.sort,!1)):UC(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Rte(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=K(s)?{data:i,field:s}:L(s)||s.signal?Pte(s,n):s,o.push(s),o),[]);return(yu(t.type)?Lte:UC(t.type)?Ite:zte)(e,n,r)}function Pte(e,t){const n="_:vega:_"+Fte++,i=Ei({});if(L(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+H(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,ra({})]),{data:n,field:"data"}}function Lte(e,t,n){const i=mD(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||Bg(l.data),c.countsRef(t,l.field,i)}),a={groupby:U2,pulse:s};i&&(r=i.op||"count",o=i.field?Lg(r,i.field):"count",a.ops=[pD[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(aD(a));const u=t.add(Ei({pulse:oe(r)}));return o=t.add(Mte({field:U2,sort:t.sortRef(i),pulse:oe(u)})),oe(o)}function mD(e,t){return e&&(!e.field&&!e.op?Y(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?R("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!pD[e.op]&&R("Multiple domain scales can not be sorted using "+e.op)),e}function Ite(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Bg(r.data),o.domainRef(t,r.field)});return oe(t.add(wte({values:i})))}function zte(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Bg(r.data),o.extentRef(t,r.field)});return oe(t.add(xte({extents:i})))}function Bte(e,t){return e.signal||L(e)?zg(e,t):t.objectProperty(e)}function Ute(e,t){return e.signal?t.signalRef(e.signal):Y(e)?{interval:ei(e.interval),step:ei(e.step)}:ei(e)}function jte(e,t){t.interpolate=ei(e.type||e),e.gamma!=null&&(t.interpolateGamma=ei(e.gamma))}function yD(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(K(r)){if(i&&Z(i,r))return e=fe({},e,{range:i[r]}),yD(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=yu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:R("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=L(r.scheme)?zg(r.scheme,t):ei(r.scheme,t),r.extent&&(n.schemeExtent=zg(r.extent,t)),r.count&&(n.schemeCount=ei(r.count,t));return}else if(r.step){n.rangeStep=ei(r.step,t);return}else{if(yu(e.type)&&!L(r))return gD(r,e,t);L(r)||R("Unsupported range type: "+H(r))}return r.map(o=>(L(o)?zg:ei)(o,t))}function qte(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=H2(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=H2(n[r],r,t));t.addProjection(e.name,i)}function H2(e,t,n){return L(e)?e.map(i=>H2(i,t,n)):Y(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:R("Unsupported parameter object: "+H(e)):e}const _i="top",ju="left",qu="right",Zo="bottom",bD="center",Wte="vertical",Hte="start",Gte="middle",Vte="end",G2="index",V2="label",Yte="offset",Wu="perc",Xte="perc2",ti="value",Mf="guide-label",Y2="guide-title",Kte="group-title",Zte="group-subtitle",vD="symbol",Ug="gradient",X2="discrete",K2="size",Z2=[K2,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ff={name:1,style:1,interactive:1},we={value:0},ni={value:1},jg="group",xD="rect",J2="rule",Jte="symbol",oa="text";function Tf(e){return e.type=jg,e.interactive=e.interactive||!1,e}function En(e,t){const n=(i,r)=>wi(e[i],wi(t[i],r));return n.isVertical=i=>Wte===wi(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>wi(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>wi(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>wi(e.columns,wi(t.columns,+n.isVertical(!0))),n}function wD(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 Qte(e,t,n){const i=t.config.style[n];return i&&i[e]}function qg(e,t,n){return`item.anchor === '${Hte}' ? ${e} : item.anchor === '${Vte}' ? ${t} : ${n}`}const Q2=qg(H(ju),H(qu),H(bD));function ene(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},Y(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function ED(e,t){return t?e?Y(e)?Object.assign({},e,{offset:ED(e.offset,t)}):{value:e,offset:t}:t:e}function Ln(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,Ff)):e.interactive=!1,e}function tne(e,t,n,i){const r=En(e,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=s,d=a):(l=[0,0],c=[1,0],f=a,d=s);const h={enter:u={opacity:we,x:we,y:we,width:gt(f),height:gt(d)},update:fe({},u,{opacity:ni,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:we}};return At(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Ln({type:xD,role:Dee,encode:h},i)}function nne(e,t,n,i,r){const o=En(e,n),s=o.isVertical(),a=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";s?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:we,fill:{scale:t,field:ti}};p[l]={signal:h+"datum."+Wu,mult:u},p[c]=we,p[f]={signal:h+"datum."+Xte,mult:u},p[d]=gt(a);const g={enter:p,update:fe({},p,{opacity:ni}),exit:{opacity:we}};return At(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Ln({type:xD,role:Oee,key:ti,from:r,encode:g},i)}const ine=`datum.${Wu}<=0?"${ju}":datum.${Wu}>=1?"${qu}":"${bD}"`,rne=`datum.${Wu}<=0?"${Zo}":datum.${Wu}>=1?"${_i}":"${Gte}"`;function _D(e,t,n,i){const r=En(e,t),o=r.isVertical(),s=gt(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:we},update:c={opacity:ni,text:{field:V2}},exit:{opacity:we}};return At(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:wi(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:rne},f="y",d="x",h="1-"):(l.align=c.align={signal:ine},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Wu,mult:a},l[d]=c[d]=s,s.offset=wi(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+G2}:void 0,Ln({type:oa,role:JN,style:Mf,key:ti,from:i,encode:p,overlap:u},n)}function one(e,t,n,i,r){const o=En(e,t),s=n.entries,a=!!(s&&s.interactive),u=s?s.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Yte} : datum.${K2}`,h=l?gt(l):{field:K2},p=`datum.${G2}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:we,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:ni,x:y.x,y:y.y},exit:{opacity:we}};let w=null,_=null;e.fill||(w=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),At(m,{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")}),Z2.forEach(M=>{e[M]&&(b[M]=y[M]={scale:e[M],field:ti})});const E=Ln({type:Jte,role:Ree,key:ti,from:f,clip:l?!0:void 0,encode:m},n.symbols),$=gt(c);$.offset=o("labelOffset"),m={enter:y={opacity:we,x:{signal:d,offset:$},y:h},update:b={opacity:ni,text:{field:V2},x:y.x,y:y.y},exit:{opacity:we}},At(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 S=Ln({type:oa,role:JN,style:Mf,key:ti,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:we,height:l?gt(l):we,opacity:we},exit:{opacity:we},update:b={opacity:ni,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:G2}},Tf({role:I2,from:i,encode:Bu(m,s,Ff),marks:[E,S],name:u,interactive:a,sort:x})}function sne(e,t){const n=En(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ew='item.orient === "left"',tw='item.orient === "right"',Wg=`(${ew} || ${tw})`,ane=`datum.vgrad && ${Wg}`,une=qg('"top"','"bottom"','"middle"'),lne=qg('"right"','"left"','"center"'),cne=`datum.vgrad && ${tw} ? (${lne}) : (${Wg} && !(datum.vgrad && ${ew})) ? "left" : ${Q2}`,fne=`item._anchor || (${Wg} ? "middle" : "start")`,dne=`${ane} ? (${ew} ? -90 : 90) : 0`,hne=`${Wg} ? (datum.vgrad ? (${tw} ? "bottom" : "top") : ${une}) : "top"`;function pne(e,t,n,i){const r=En(e,t),o={enter:{opacity:we},update:{opacity:ni,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:we}};return At(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:fne},angle:{signal:dne},align:{signal:cne},baseline:{signal:hne},text:e.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")}),Ln({type:oa,role:Pee,style:Y2,from:i,encode:o},n)}function gne(e,t){let n;return Y(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+$D(e.path)+")":e.sphere&&(n="geoShape("+$D(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function $D(e){return Y(e)&&e.signal?e.signal:H(e)}function SD(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===jg?I2:t||P2}function mne(e){return{marktype:e.type,name:e.name||void 0,role:e.role||SD(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function yne(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function nw(e,t){const n=cA(e.type);n||R("Unrecognized transform type: "+H(e.type));const i=Rg(n.type.toLowerCase(),null,AD(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function AD(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=bne(s,t,n)}return i}function bne(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return vne(e,t,n);if(r===void 0){e.required&&R("Missing required "+H(t.type)+" parameter: "+H(e.name));return}else{if(i==="param")return xne(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!ut(r)?r.map(o=>kD(e,o,n)):kD(e,r,n)}function kD(e,t,n){const i=e.type;if(ut(t))return MD(i)?R("Expression references can not be signals."):iw(i)?n.fieldRef(t):FD(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||iw(i);return r&&wne(t)?n.exprRef(t.expr,t.as):r&&Ene(t)?kf(t.field,t.as):MD(i)?ar(t,n):_ne(i)?oe(n.getData(t).values):iw(i)?kf(t):FD(i)?n.compareRef(t):t}}function vne(e,t,n){return K(t.from)||R('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function xne(e,t,n){const i=t[e.name];return e.array?(L(i)||R("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>CD(e,r,n))):CD(e,i,n)}function CD(e,t,n){const i=e.params.length;let r;for(let s=0;s<i;++s){r=e.params[s];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||R("Unsupported parameter: "+H(t));const o=fe(AD(r,t,n),r.key);return oe(n.add(_te(o)))}const wne=e=>e&&e.expr,Ene=e=>e&&e.field,_ne=e=>e==="data",MD=e=>e==="expr",iw=e=>e==="field",FD=e=>e==="compare";function $ne(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||R("Only group marks can be faceted."),i.field!=null?s=a=Hg(i,n):(e.data?a=oe(n.getData(e.data).aggregate):(o=nw(fe({type:"aggregate",groupby:X(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Hg(i,n),s=a=oe(n.add(o))),r=n.keyRef(i.groupby,!0))):s=oe(n.add(Ei(null,[{}]))),s||(s=Hg(e,n)),{key:r,pulse:s,parent:a}}function Hg(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:oe(t.getData(e.data).output)}function sa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}sa.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=oe(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new sa(e,o,r,i,s)};function TD(e){return K(e)?e:null}function OD(e,t,n){const i=Lg(n.op,n.field);let r;if(t.ops){for(let o=0,s=t.as.length;o<s;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function Of(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=Qee(o);let l=TD(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:U2,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:oe(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(Rg(i,void 0,d)),s&&(t.index[r]=f),c=oe(f),l!=null&&(a[l]=c)}return c}sa.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=TD(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&OD(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:oe(i.output)},n&&n.field&&OD(e,u,n),a=e.add(aD(u)),s=e.add(Ei({pulse:oe(a)})),s={agg:a,ref:oe(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return oe(this.values)},extentRef(e,t){return Of(e,this,"extent","extent",t,!1)},domainRef(e,t){return Of(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Of(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Of(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Of(e,this,"indata","tupleindex",t,!0,!0)}};function Sne(e,t,n){const i=e.from.facet,r=i.name,o=Hg(i,t);let s;i.name||R("Facet must have a name: "+H(i)),i.data||R("Facet must reference a data set: "+H(i)),i.field?s=t.add(fD({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(pte({key:t.keyRef(i.groupby),group:oe(t.proxy(n.parent)),pulse:o})):R("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add(Ei()),l=a.add(ra({pulse:oe(u)}));a.addData(r,new sa(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function Ane(e,t,n){const i=t.add(fD({pulse:n.pulse})),r=t.fork();r.add(ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function ND(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(Pg()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=ar(l,t);u.update=c.$expr,u.params=c.$params}function Gg(e,t){const n=SD(e),i=e.type===jg,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===I2||n===L2,a,u,l,c,f,d,h;const p=n===P2||s||r,g=$ne(e.from,i,t);u=t.add(dte({key:g.key||(e.key?kf(e.key):void 0),pulse:g.pulse,clean:!i}));const m=oe(u);u=l=t.add(Ei({pulse:m})),u=t.add(vte({markdef:mne(e),interactive:yne(e.interactive,t),clip:gne(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:oe(u)}));const y=oe(u);u=c=t.add(cD(nD(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{const E=nw(_,t),$=E.metadata;($.generates||$.changes)&&R("Mark transforms should not generate new data."),$.nomod||(c.params.mod=!0),E.params.pulse=oe(u),t.add(u=E)}),e.sort&&(u=t.add(Cte({sort:t.compareRef(e.sort),pulse:oe(u)})));const b=oe(u);(r||s)&&(s=t.add(hD({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=oe(s));const v=t.add(uD({mark:y,pulse:d||b}));h=oe(v),i&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?Sne(e,t,g):p?Ane(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(v))),o&&(h=kne(o,h,t));const x=t.add(dD({pulse:h})),w=t.add(ra({pulse:oe(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new sa(t,l,x,w)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&R("Marks only support modify triggers."),ND(_,t,f)}))}function kne(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:ut(o)?n.signalRef(o.signal):o,method:ut(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;s.boundTolerance=ut(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return oe(n.add(Ete(s)))}function Cne(e,t){const n=t.config.legend,i=e.encode||{},r=En(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;Z2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||R("Missing valid scale for legend.");const p=Mne(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=oe(t.add(Ei(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=oe(t.add(yte(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===Ug?(h=[tne(e,c,n,i.gradient),_D(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ia(r.gradientLength())})/100))`)):p===X2?h=[nne(e,c,n,i.gradient,b),_D(e,n,i.labels,b)]:(f=sne(e,n),h=[one(e,n,i,b,ia(f.columns))],d.size=One(e,t,h[0].marks)),h=[Tf({role:Nee,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(pne(e,n,i.title,m)),Gg(Tf({role:Tee,from:m,encode:Bu(Tne(r,e,n),o,Ff),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function Mne(e,t){let n=e.type||vD;return!e.type&&Fne(e)===1&&(e.fill||e.stroke)&&(n=ub(t)?Ug:lb(t)?X2:vD),n!==Ug?n:lb(t)?X2:Ug}function Fne(e){return Z2.reduce((t,n)=>t+(e[n]?1:0),0)}function Tne(e,t,n){const i={enter:{},update:{}};return At(i,{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}),i}function One(e,t,n){const i=ia(DD("size",e,n)),r=ia(DD("strokeWidth",e,n)),o=ia(Nne(n[1].encode,t,Mf));return ar(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function DD(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wD(e,n[0].encode)}function Nne(e,t,n){return wD("fontSize",e)||Qte("fontSize",t,n)}const Dne=`item.orient==="${ju}"?-90:item.orient==="${qu}"?90:0`;function Rne(e,t){e=K(e)?{text:e}:e;const n=En(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=oe(t.add(Ei(null,[l])));return u.push(Ine(e,n,Pne(e),c)),e.subtitle&&u.push(zne(e,n,i.subtitle,c)),Gg(Tf({role:Lee,from:c,encode:Lne(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Pne(e){const t=e.encode;return t&&t.title||fe({name:e.name,interactive:e.interactive,style:e.style},t)}function Lne(e,t){const n={enter:{},update:{}};return At(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:Q2},angle:{signal:Dne},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,Ff)}function Ine(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return At(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ln({type:oa,role:Iee,style:Kte,from:i,encode:s},n)}function zne(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return At(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ln({type:oa,role:zee,style:Zte,from:i,encode:s},n)}function Bne(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(nw(i,t))}),e.on&&e.on.forEach(i=>{ND(i,t,e.name)}),t.addDataPipeline(e.name,Une(e,t,n))}function Une(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?ut(e.values)||Ig(e.format)?(i.push(RD(t,e)),i.push(r=aa())):i.push(r=aa({$ingest:e.values,$format:e.format})):e.url?Ig(e.url)||Ig(e.format)?(i.push(RD(t,e)),i.push(r=aa())):i.push(r=aa({$request:e.url,$format:e.format})):e.source&&(r=a=X(e.source).map(d=>oe(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=aa()),i.push(c),f.generates&&(s=!0),f.modifies&&!s&&(o=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=Ate({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,aa())),r||i.push(aa()),i.push(ra({})),i}function aa(e){const t=Ei({},e);return t.metadata={source:!0},t}function RD(e,t){return bte({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const PD=e=>e===Zo||e===_i,Vg=(e,t,n)=>ut(e)?Hne(e.signal,t,n):e===ju||e===_i?t:n,mt=(e,t,n)=>ut(e)?qne(e.signal,t,n):PD(e)?t:n,$i=(e,t,n)=>ut(e)?Wne(e.signal,t,n):PD(e)?n:t,LD=(e,t,n)=>ut(e)?Gne(e.signal,t,n):e===_i?{value:t}:{value:n},jne=(e,t,n)=>ut(e)?Vne(e.signal,t,n):e===qu?{value:t}:{value:n},qne=(e,t,n)=>ID(`${e} === '${_i}' || ${e} === '${Zo}'`,t,n),Wne=(e,t,n)=>ID(`${e} !== '${_i}' && ${e} !== '${Zo}'`,t,n),Hne=(e,t,n)=>rw(`${e} === '${ju}' || ${e} === '${_i}'`,t,n),Gne=(e,t,n)=>rw(`${e} === '${_i}'`,t,n),Vne=(e,t,n)=>rw(`${e} === '${qu}'`,t,n),ID=(e,t,n)=>(t=t!=null?gt(t):t,n=n!=null?gt(n):n,zD(t)&&zD(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[fe({test:e},t)].concat(n||[])),zD=e=>e==null||Object.keys(e).length===1,rw=(e,t,n)=>({signal:`${e} ? (${Hu(t)}) : (${Hu(n)})`}),Yne=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${ju}' ? (${Hu(i)}) : `:"")+(n!=null?`${e} === '${Zo}' ? (${Hu(n)}) : `:"")+(r!=null?`${e} === '${qu}' ? (${Hu(r)}) : `:"")+(t!=null?`${e} === '${_i}' ? (${Hu(t)}) : `:"")+"(null)"}),Hu=e=>ut(e)?e.signal:e==null?null:H(e),Xne=(e,t)=>t===0?0:ut(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Gu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Vu(e,t,n,i){let r;if(t&&Z(t,e))return t[e];if(Z(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[Y2][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Mf][r]}return null}function BD(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Kne(e,t){var n=t.config,i=n.style,r=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,u,l;if(ut(s)){const f=BD([n.axisX,n.axisY]),d=BD([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=mt(s,Vu(l,n.axisX,r,i),Vu(l,n.axisY,r,i));u={};for(l of d)u[l]=Yne(s.signal,Vu(l,n.axisTop,r,i),Vu(l,n.axisBottom,r,i),Vu(l,n.axisLeft,r,i),Vu(l,n.axisRight,r,i))}else a=s===_i||s===Zo?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?fe({},r,a,u,o):r}function Zne(e,t,n,i){const r=En(e,t),o=e.orient;let s,a;const u={enter:s={opacity:we},update:a={opacity:ni},exit:{opacity:we}};At(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=UD(e,0),c=UD(e,1);return s.x=a.x=mt(o,l,we),s.x2=a.x2=mt(o,c),s.y=a.y=$i(o,l,we),s.y2=a.y2=$i(o,c),Ln({type:J2,role:Aee,from:i,encode:u},n)}function UD(e,t){return{scale:e.scale,range:t}}function Jne(e,t,n,i,r){const o=En(e,t),s=e.orient,a=e.gridScale,u=Vg(s,1,-1),l=Qne(e.offset,u);let c,f,d;const h={enter:c={opacity:we},update:d={opacity:ni},exit:f={opacity:we}};At(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:ti,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=mt(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:fe(g,{mult:u,offset:l});return c.x=d.x=mt(s,p,m),c.y=d.y=$i(s,p,m),c.x2=d.x2=$i(s,y),c.y2=d.y2=mt(s,y),f.x=mt(s,p),f.y=$i(s,p),Ln({type:J2,role:kee,key:ti,from:i,encode:h},n)}function Qne(e,t){if(t!==1)if(!Y(e))e=ut(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=fe({},e);for(;n.mult!=null;)if(Y(n.mult))n=n.mult=fe({},n.mult);else return n.mult=ut(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function eie(e,t,n,i,r,o){const s=En(e,t),a=e.orient,u=Vg(a,-1,1);let l,c,f;const d={enter:l={opacity:we},update:f={opacity:ni},exit:c={opacity:we}};At(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=gt(r);h.mult=u;const p={scale:e.scale,field:ti,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=mt(a,we,p),f.y2=l.y2=mt(a,h),c.x=mt(a,p),f.x=l.x=$i(a,we,p),f.x2=l.x2=$i(a,h),c.y=$i(a,p),Ln({type:J2,role:Mee,key:ti,from:i,encode:d},n)}function ow(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function tie(e,t,n,i,r,o){const s=En(e,t),a=e.orient,u=e.scale,l=Vg(a,-1,1),c=ia(s("labelFlush")),f=ia(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=c===0||!!c,g;const m=gt(r);m.mult=l,m.offset=gt(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:ti,band:.5,offset:ED(o.offset,s("labelOffset"))},b=mt(a,p?ow(u,c,'"left"','"right"','"center"'):{value:"center"},jne(a,"left","right")),v=mt(a,LD(a,"bottom","top"),p?ow(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=ow(u,c,`-(${f})`,f,0);p=p&&f;const w={opacity:we,x:mt(a,y,m),y:$i(a,y,m)},_={enter:w,update:g={opacity:ni,text:{field:V2},x:w.x,y:w.y,align:b,baseline:v},exit:{opacity:we,x:w.x,y:w.y}};At(_,{dx:!d&&p?mt(a,x):null,dy:!h&&p?$i(a,x):null}),At(_,{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:d,baseline:h});const E=s("labelBound");let $=s("labelOverlap");return $=$||E?{separation:s("labelSeparation"),method:$,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,g.align!==b&&(g.align=Gu(g.align,b)),g.baseline!==v&&(g.baseline=Gu(g.baseline,v)),Ln({type:oa,role:Cee,style:Mf,key:ti,from:i,encode:_,overlap:$},n)}function nie(e,t,n,i){const r=En(e,t),o=e.orient,s=Vg(o,-1,1);let a,u;const l={enter:a={opacity:we,anchor:gt(r("titleAnchor",null)),align:{signal:Q2}},update:u=fe({},a,{opacity:ni,text:gt(e.title)}),exit:{opacity:we}},c={signal:`lerp(range("${e.scale}"), ${qg(0,1,.5)})`};return u.x=mt(o,c),u.y=$i(o,c),a.angle=mt(o,we,Xne(s,90)),a.baseline=mt(o,LD(o,Zo,_i),{value:Zo}),u.angle=a.angle,u.baseline=a.baseline,At(l,{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")}),iie(r,o,l,n),l.update.align=Gu(l.update.align,a.align),l.update.angle=Gu(l.update.angle,a.angle),l.update.baseline=Gu(l.update.baseline,a.baseline),Ln({type:oa,role:Fee,style:Y2,from:i,encode:l},n)}function iie(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Gu(gt(a),n.update[u]),!1):!Uu(u,i),o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?gt(s):mt(t,gt(s),gt(o))}function rie(e,t){const n=Kne(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=En(e,n),l=ene(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=oe(t.add(Ei({},[c]))),d=oe(t.add(fte({scale:t.scaleRef(e.scale),extra:t.property(l.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(Jne(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(eie(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(tie(e,n,i.labels,d,p,l))),c.domain&&h.push(Zne(e,n,i.domain,f)),c.title&&h.push(nie(e,n,i.title,f)),Gg(Tf({role:See,from:f,encode:Bu(oie(u,e),r,Ff),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function oie(e,t){const n={enter:{},update:{}};return At(n,{orient:e("orient"),offset:e("offset")||0,position:wi(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 jD(e,t,n){const i=X(e.signals),r=X(e.scales);return n||i.forEach(o=>rD(o,t)),X(e.projections).forEach(o=>qte(o,t)),r.forEach(o=>Tte(o,t)),X(e.data).forEach(o=>Bne(o,t)),r.forEach(o=>Ote(o,t)),(n||i).forEach(o=>cte(o,t)),X(e.axes).forEach(o=>rie(o,t)),X(e.marks).forEach(o=>Gg(o,t)),X(e.legends).forEach(o=>Cne(o,t)),e.title&&Rne(e.title,t),t.parseLambdas(),t}const sie=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function aie(e,t){const n=t.config,i=oe(t.root=t.add(Pg())),r=uie(e,n);r.forEach(l=>rD(l,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(Ei()),s=t.add(cD(nD(sie(e.encode),jg,L2,e.style,t,{pulse:oe(o)}))),a=t.add(hD({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:oe(s)}));t.operators.pop(),t.pushState(oe(s),oe(a),null),jD(e,t,r),t.operators.push(a);let u=t.add(uD({mark:i,pulse:oe(a)}));return u=t.add(dD({pulse:oe(u)})),u=t.add(ra({pulse:oe(u)})),t.addData("root",new sa(t,o,o,u)),t}function Nf(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function uie(e,t){const n=s=>wi(e[s],t[s]),i=[Nf("background",n("background")),Nf("autosize",Eee(n("autosize"))),Nf("padding",$ee(n("padding"))),Nf("width",n("width")||0),Nf("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return X(e.signals).forEach(s=>{Z(r,s.name)?s=fe(r[s.name],s):i.push(s),o[s.name]=s}),X(t.signals).forEach(s=>{!Z(o,s.name)&&!Z(r,s.name)&&i.push(s)}),i}function qD(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 WD(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}qD.prototype=WD.prototype={parse(e){return jD(e,this)},fork(){return new WD(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 B2?oe(e):e;return this.add(Ste({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;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,o){let s,a;i&&(s=i.data||(i.data={}),a=s[r]||(s[r]=[]),a.push(o))}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 i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(oe(this.add(ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?oe(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ve(this._parent)},encode(){return ve(this._encode)},lookup(){return ve(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return kf(e,t);e.signal||R("Unsupported field reference: "+H(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=oe(this.add(gte(r)))}return i},compareRef(e){let t=!1;const n=o=>ut(o)?(t=!0,this.signalRef(o.signal)):ete(o)?(t=!0,this.exprRef(o.expr)):o,i=X(e.field).map(n),r=X(e.order).map(n);return t?oe(this.add(lD({fields:i,orders:r}))):oD(i,r)},keyRef(e,t){let n=!1;const i=o=>ut(o)?(n=!0,oe(r[o.signal])):o,r=this.signals;return e=X(e).map(i),n?oe(this.add(mte({fields:e,flat:t}))):Kee(e,t)},sortRef(e){if(!e)return e;const t=Lg(e.op,e.field),n=e.order||Zee;return n.signal?oe(this.add(lD({fields:t,orders:this.signalRef(n.signal)}))):oD(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return Z(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&R("Duplicate signal name: "+H(e));const n=t instanceof B2?t:this.add(Pg(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||R("Unrecognized signal name: "+H(e)),this.signals[e]},signalRef(e){return this.signals[e]?oe(this.signals[e]):(Z(this.lambdas,e)||(this.lambdas[e]=this.add(Pg(null))),oe(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=ar(i,this),o=this.lambdas[i];o.params=r.$params,o.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!Y(e)?e:this.signalRef(e.signal||sw(e))},exprRef(e,t){const n={expr:ar(e,this)};return t&&(n.expr.$name=t),oe(this.add(hte(n)))},addBinding(e,t){this.bindings||R("Nested signals do not support binding: "+H(e)),this.bindings.push(fe({signal:e},t))},addScaleProj(e,t){Z(this.scales,e)&&R("Duplicate scale or projection name: "+H(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,kte(t))},addProjection(e,t){this.addScaleProj(e,$te(t))},getScale(e){return this.scales[e]||R("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return oe(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return Z(this.data,e)&&R("Duplicate data set name: "+H(e)),this.data[e]=t},getData(e){return this.data[e]||R("Undefined data set name: "+H(e)),this.data[e]},addDataPipeline(e,t){return Z(this.data,e)&&R("Duplicate data set name: "+H(e)),this.addData(e,sa.fromEntries(this,t))}};function sw(e){return(L(e)?lie:cie)(e)}function lie(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(Y(r)?r.signal||sw(r):H(r))}return n+"]"}function cie(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(Y(r)?r.signal||sw(r):H(r));return t+"}"}function fie(){const e="sans-serif",i="#4c78a8",r="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function die(e,t,n){return Y(e)||R("Input Vega specification must be an object."),t=Wa(fie(),t,e.config),aie(e,new qD(t,n)).toRuntime()}var hie="5.30.0";fe(au,w7,JW,_H,uV,nY,MX,uX,TX,tK,fK,bK);const pie=Object.freeze(Object.defineProperty({__proto__:null,Bounds:nt,CanvasHandler:Nc,CanvasRenderer:sp,DATE:mn,DAY:zt,DAYOFYEAR:qi,Dataflow:su,Debug:e$,Error:T0,EventStream:Vd,Gradient:oM,GroupItem:Ph,HOURS:Fn,Handler:Hb,HybridHandler:xF,HybridRenderer:iv,Info:Q_,Item:Rh,MILLISECONDS:ci,MINUTES:Tn,MONTH:It,Marks:Nn,MultiPulse:A1,None:J_,Operator:Le,Parameters:Gd,Pulse:$o,QUARTER:gn,RenderType:Uo,Renderer:Tc,ResourceLoader:mM,SECONDS:Gn,SVGHandler:tF,SVGRenderer:nv,SVGStringRenderer:vF,Scenegraph:qM,TIME_UNITS:i1,Transform:O,View:UN,WEEK:rt,Warn:O0,YEAR:Et,accessor:hn,accessorFields:Dt,accessorName:Ye,array:X,ascending:_d,bandwidthNRD:F1,bin:hA,bootstrapCI:pA,boundClip:FF,boundContext:$c,boundItem:qb,boundMark:zM,boundStroke:Lr,changeset:Cs,clampRange:d$,codegenExpression:ZO,compare:L0,constant:Lt,cumulativeLogNormal:P1,cumulativeNormal:Zd,cumulativeUniform:B1,dayofyear:Q$,debounce:I0,defaultLocale:v1,definition:cA,densityLogNormal:R1,densityNormal:T1,densityUniform:z1,domChild:st,domClear:Kn,domCreate:zo,domFind:Wb,dotbin:gA,error:R,expressionFunction:Qe,extend:fe,extent:Bi,extentIndex:h$,falsy:go,fastmap:Ga,field:qn,flush:p$,font:Xh,fontFamily:Mc,fontSize:Qi,format:zd,formatLocale:Ld,formats:_1,hasOwnProperty:Z,id:Pl,identity:Rt,inferType:GS,inferTypes:VS,ingest:Ce,inherits:G,inrange:Va,interpolate:cb,interpolateColors:Fh,interpolateRange:jC,intersect:AF,intersectBoxLine:wu,intersectPath:Cb,intersectPoint:Mb,intersectRule:$M,isArray:L,isBoolean:mo,isDate:yo,isFunction:ce,isIterable:g$,isNumber:_e,isObject:Y,isRegExp:m$,isString:K,isTuple:qd,key:z0,lerp:y$,lineHeight:Lo,loader:Bd,locale:qS,logger:N0,lruCache:b$,markup:tv,merge:v$,mergeConfig:Wa,multiLineOffset:Bb,one:qa,pad:x$,panLinear:s$,panLog:a$,panPow:u$,panSymlog:l$,parse:die,parseExpression:p2,parseSelector:Ko,path:rh,pathCurves:mb,pathEqual:TF,pathParse:bu,pathRectangle:dM,pathRender:vc,pathSymbols:fM,pathTrail:hM,peek:ve,point:Zh,projection:ex,quantileLogNormal:L1,quantileNormal:Jd,quantileUniform:U1,quantiles:C1,quantizeInterpolator:qC,quarter:c$,quartiles:M1,get random(){return Vn},randomInteger:S9,randomKDE:N1,randomLCG:$9,randomLogNormal:yA,randomMixture:bA,randomNormal:O1,randomUniform:vA,read:ZS,regressionConstant:j1,regressionExp:wA,regressionLinear:q1,regressionLoess:AA,regressionLog:xA,regressionPoly:_A,regressionPow:EA,regressionQuad:W1,renderModule:cp,repeat:Ll,resetDefaultLocale:w8,resetSVGClipId:gM,resetSVGDefIds:mW,responseType:KS,runtimeContext:wN,sampleCurve:eh,sampleLogNormal:D1,sampleNormal:Kd,sampleUniform:I1,scale:Se,sceneEqual:ov,sceneFromJSON:UM,scenePickVisit:qh,sceneToJSON:BM,sceneVisit:pi,sceneZOrder:Fb,scheme:fb,serializeXML:dF,setHybridRendererOptions:dW,setRandom:E9,span:Il,splitAccessPath:zi,stringValue:H,textMetrics:On,timeBin:bS,timeFloor:sS,timeFormatLocale:ec,timeInterval:nu,timeOffset:lS,timeSequence:dS,timeUnitSpecifier:J$,timeUnits:o1,toBoolean:B0,toDate:U0,toNumber:Pt,toSet:li,toString:j0,transform:fA,transforms:au,truncate:w$,truthy:Wn,tupleid:ie,typeParsers:x1,utcFloor:aS,utcInterval:iu,utcOffset:cS,utcSequence:hS,utcdayofyear:nS,utcquarter:f$,utcweek:iS,version:hie,visitArray:bo,week:eS,writeConfig:Ha,zero:po,zoomLinear:D0,zoomLog:R0,zoomPow:Ed,zoomSymlog:P0},Symbol.toStringTag,{value:"Module"}));function gie(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),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&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var mie={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},yie={"*":(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,"==":(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,">>>":(e,t)=>e>>>t},bie={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const vie=Array.prototype.slice,ua=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,vie.call(t,1))},xie=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var wie={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:xie,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 ua("join",arguments)},indexof:function(){return ua("indexOf",arguments)},lastindexof:function(){return ua("lastIndexOf",arguments)},slice:function(){return ua("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ua("substring",arguments,String)},split:function(){return ua("split",arguments,String)},replace:function(){return ua("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Eie=["view","item","group","xy","x","y"],aw=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&aw.add(setImmediate);const _ie={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:mie[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),aw.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||wie[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>yie[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>bie[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((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,aw.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Df(e,t,n,i,r,o){const s=a=>_ie[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=i,s.event=r,s.item=o,Eie.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var $ie={operator(e,t){const n=t.ast,i=e.functions;return r=>Df(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Df(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Df(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,o)=>{const s=o.item&&o.item.datum;return Df(n,i,r,s,o)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const u=s.datum;let l=0,c;for(const f in i)c=Df(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&gie(s,i,o),l}}};const Sie={name:"vega-lite",author:'Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',version:"5.21.0",collaborators:["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],homepage:"https://vega.github.io/vega-lite/",description:"Vega-Lite is a concise high-level language for interactive visualization.",keywords:["vega","chart","visualization"],main:"build/vega-lite.js",unpkg:"build/vega-lite.min.js",jsdelivr:"build/vega-lite.min.js",module:"build/src/index",types:"build/src/index.d.ts",bin:{vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},files:["bin","build","src","vega-lite*","tsconfig.json"],scripts:{changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},repository:{type:"git",url:"https://github.com/vega/vega-lite.git"},license:"BSD-3-Clause",bugs:{url:"https://github.com/vega/vega-lite/issues"},devDependencies:{"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},dependencies:{"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},peerDependencies:{vega:"^5.24.0"},engines:{node:">=18"},packageManager:"yarn@1.22.19"};function uw(e){return U(e,"or")}function lw(e){return U(e,"and")}function cw(e){return U(e,"not")}function Yg(e,t){if(cw(e))Yg(e.not,t);else if(lw(e))for(const n of e.and)Yg(n,t);else if(uw(e))for(const n of e.or)Yg(n,t);else t(e)}function Yu(e,t){return cw(e)?{not:Yu(e.not,t)}:lw(e)?{and:e.and.map(n=>Yu(n,t))}:uw(e)?{or:e.or.map(n=>Yu(n,t))}:t(e)}const ue=structuredClone;function HD(e){throw new Error(e)}function Xu(e,t){const n={};for(const i of t)Z(e,i)&&(n[i]=e[i]);return n}function _n(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Re(e)).join(",")})`};function be(e){if(_e(e))return e;const t=K(e)?e:Re(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function fw(e){return e===!1||e===null}function ye(e,t){return e.includes(t)}function Ku(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function dw(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function GD(e,...t){for(const n of t)Aie(e,n??{});return e}function Aie(e,t){for(const n of B(t))Ha(e,n,t[n],!0)}function ur(e,t){const n=[],i={};let r;for(const o of e)r=t(o),!(r in i)&&(i[r]=1,n.push(o));return n}function kie(e,t){const n=B(e),i=B(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function VD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hw(e,t){for(const n of e)if(t.has(n))return!0;return!1}function pw(e){const t=new Set;for(const n of e){const r=zi(n).map((s,a)=>a===0?s:`[${s}]`),o=r.map((s,a)=>r.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function gw(e,t){return e===void 0||t===void 0?!0:hw(pw(e),pw(t))}function De(e){return B(e).length===0}const B=Object.keys,kt=Object.values,Jo=Object.entries;function Rf(e){return e===!0||e===!1}function qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Pf(e,t){return cw(e)?`!(${Pf(e.not,t)})`:lw(e)?`(${e.and.map(n=>Pf(n,t)).join(") && (")})`:uw(e)?`(${e.or.map(n=>Pf(n,t)).join(") || (")})`:t(e)}function Xg(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Xg(e[n],t)&&delete e[n],De(e)}function Lf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function mw(e,t="datum"){const n=zi(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(H).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function YD(e,t="datum"){return`${t}[${H(zi(e).join("."))}]`}function Cie(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ii(e){return`${zi(e).map(Cie).join("\\.")}`}function la(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Zu(e){return`${zi(e).join(".")}`}function Ju(e){return e?zi(e).length:0}function et(...e){return e.find(t=>t!==void 0)}let XD=42;function KD(e){const t=++XD;return e?String(e)+t:t}function Mie(){XD=42}function ZD(e){return JD(e)?e:`__${e}`}function JD(e){return e.startsWith("__")}function If(e){if(e!==void 0)return(e%360+360)%360}function Kg(e){return _e(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const QD=Object.getPrototypeOf(structuredClone({}));function In(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!In(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!In(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])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!==QD.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==QD.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!In(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Re(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,o;if(Array.isArray(i)){for(o="[",r=0;r<i.length;r++)r&&(o+=","),o+=n(i[r])||"null";return o+"]"}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const s=t.push(i)-1,a=Object.keys(i).sort();for(o="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(o&&(o+=","),o+=JSON.stringify(u)+":"+l)}return t.splice(s,1),`{${o}}`}(e)}function U(e,t){return Y(e)&&Z(e,t)&&e[t]!==void 0}const Yr="row",Xr="column",Zg="facet",We="x",yt="y",Si="x2",lr="y2",Qo="xOffset",Qu="yOffset",Ai="radius",Kr="radius2",ri="theta",Zr="theta2",ki="latitude",Ci="longitude",Mi="latitude2",oi="longitude2",$n="color",cr="fill",fr="stroke",Sn="shape",Jr="size",ca="angle",Qr="opacity",es="fillOpacity",ts="strokeOpacity",ns="strokeWidth",is="strokeDash",zf="text",el="order",Bf="detail",Jg="key",fa="tooltip",Qg="href",em="url",tm="description",Fie={x:1,y:1,x2:1,y2:1},eR={theta:1,theta2:1,radius:1,radius2:1};function tR(e){return Z(eR,e)}const yw={longitude:1,longitude2:1,latitude:1,latitude2:1};function nR(e){switch(e){case ki:return"y";case Mi:return"y2";case Ci:return"x";case oi:return"x2"}}function iR(e){return Z(yw,e)}const Tie=B(yw),bw={...Fie,...eR,...yw,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function tl(e){return e===$n||e===cr||e===fr}const rR={row:1,column:1,facet:1},si=B(rR),vw={...bw,...rR},Oie=B(vw),{order:Xpe,detail:Kpe,tooltip:Zpe,...Nie}=vw,{row:Jpe,column:Qpe,facet:ege,...Die}=Nie;function Rie(e){return Z(Die,e)}function oR(e){return Z(vw,e)}const Pie=[Si,lr,Mi,oi,Zr,Kr];function sR(e){return da(e)!==e}function da(e){switch(e){case Si:return We;case lr:return yt;case Mi:return ki;case oi:return Ci;case Zr:return ri;case Kr:return Ai}return e}function rs(e){if(tR(e))switch(e){case ri:return"startAngle";case Zr:return"endAngle";case Ai:return"outerRadius";case Kr:return"innerRadius"}return e}function dr(e){switch(e){case We:return Si;case yt:return lr;case ki:return Mi;case Ci:return oi;case ri:return Zr;case Ai:return Kr}}function An(e){switch(e){case We:case Si:return"width";case yt:case lr:return"height"}}function aR(e){switch(e){case We:return"xOffset";case yt:return"yOffset";case Si:return"x2Offset";case lr:return"y2Offset";case ri:return"thetaOffset";case Ai:return"radiusOffset";case Zr:return"theta2Offset";case Kr:return"radius2Offset"}}function xw(e){switch(e){case We:return"xOffset";case yt:return"yOffset"}}function Lie(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Iie=B(bw),{x:tge,y:nge,x2:ige,y2:rge,xOffset:oge,yOffset:sge,latitude:age,longitude:uge,latitude2:lge,longitude2:cge,theta:fge,theta2:dge,radius:hge,radius2:pge,...ww}=bw,zie=B(ww),Ew={x:1,y:1},eo=B(Ew);function tt(e){return Z(Ew,e)}const _w={theta:1,radius:1},Bie=B(_w);function nm(e){return e==="width"?We:yt}const uR={xOffset:1,yOffset:1};function Uf(e){return Z(uR,e)}const{text:gge,tooltip:mge,href:yge,url:bge,description:vge,detail:xge,key:wge,order:Ege,...lR}=ww,Uie=B(lR);function jie(e){return Z(ww,e)}function qie(e){switch(e){case $n:case cr:case fr:case Jr:case Sn:case Qr:case ns:case is:return!0;case es:case ts:case ca:return!1}}const cR={...Ew,..._w,...uR,...lR},$w=B(cR);function hr(e){return Z(cR,e)}function Wie(e,t){return Gie(e)[t]}const fR={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:_ge,...Hie}=fR;function Gie(e){switch(e){case $n:case cr:case fr:case tm:case Bf:case Jg:case fa:case Qg:case el:case Qr:case es:case ts:case ns:case Zg:case Yr:case Xr:return fR;case We:case yt:case Qo:case Qu:case ki:case Ci:return Hie;case Si:case lr:case Mi:case oi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Jr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case is:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Sn:return{point:"always",geoshape:"always"};case zf:return{text:"always"};case ca:return{point:"always",square:"always",text:"always"};case em:return{image:"always"};case ri:return{text:"always",arc:"always"};case Ai:return{text:"always",arc:"always"};case Zr:case Kr:return{arc:"always"}}}function Sw(e){switch(e){case We:case yt:case ri:case Ai:case Qo:case Qu:case Jr:case ca:case ns:case Qr:case es:case ts:case Si:case lr:case Zr:case Kr:return;case Zg:case Yr:case Xr:case Sn:case is:case zf:case fa:case Qg:case em:case tm:return"discrete";case $n:case cr:case fr:return"flexible";case ki:case Ci:case Mi:case oi:case Bf:case Jg:case el:return}}const Vie={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Yie={count:1,min:1,max:1};function to(e){return U(e,"argmin")}function os(e){return U(e,"argmax")}function Aw(e){return K(e)&&Z(Vie,e)}const Xie=new Set(["count","valid","missing","distinct"]);function im(e){return K(e)&&Xie.has(e)}function Kie(e){return K(e)&&ye(["min","max"],e)}const Zie=new Set(["count","sum","distinct","valid","missing"]),Jie=new Set(["mean","average","median","q1","q3","min","max"]);function dR(e){return mo(e)&&(e=Em(e,void 0)),"bin"+B(e).map(t=>rm(e[t])?qe(`_${t}_${Jo(e[t])}`):qe(`_${t}_${e[t]}`)).join("")}function ze(e){return e===!0||ha(e)&&!e.binned}function Ct(e){return e==="binned"||ha(e)&&e.binned===!0}function ha(e){return Y(e)}function rm(e){return U(e,"param")}function hR(e){switch(e){case Yr:case Xr:case Jr:case $n:case cr:case fr:case ns:case Qr:case es:case ts:case Sn:return 6;case is:return 4;default:return 10}}function jf(e){return U(e,"expr")}function Mt(e,{level:t}={level:0}){const n=B(e||{}),i={};for(const r of n)i[r]=t===0?zn(e[r]):Mt(e[r],{level:t-1});return i}function pR(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:s,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Xu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function ss(e){return K(e)||L(e)&&K(e[0])}function ee(e){return U(e,"signal")}function pa(e){return U(e,"step")}function Qie(e){return L(e)?!1:U(e,"fields")&&!U(e,"data")}function ere(e){return L(e)?!1:U(e,"fields")&&U(e,"data")}function no(e){return L(e)?!1:U(e,"field")&&U(e,"data")}const tre=B({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}),nre={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},kw=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function gR(e){const t=L(e.condition)?e.condition.map(mR):mR(e.condition);return{...zn(e),condition:t}}function zn(e){if(jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function mR(e){if(jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ue(e){if(jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ee(e)?e:e!==void 0?{value:e}:void 0}function ire(e){return ee(e)?e.signal:H(e)}function yR(e){return ee(e)?e.signal:H(e.value)}function Fi(e){return ee(e)?e.signal:e==null?null:H(e)}function rre(e,t,n){for(const i of n){const r=pr(i,t.markDef,t.config);r!==void 0&&(e[i]=Ue(r))}return e}function bR(e){return[].concat(e.type,e.style??[])}function Pe(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&U(t,r)?t[r]:t[e]!==void 0?t[e]:o&&(!r||r===e)?void 0:pr(e,t,n,i)}function pr(e,t,n,{vgChannel:i}={}){const r=Cw(e,t,n.style);return et(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Cw(e,t,n){return vR(e,bR(t),n)}function vR(e,t,n){t=X(t);let i;for(const r of t){const o=n[r];U(o,e)&&(i=o[e])}return i}function xR(e,t){return X(e).reduce((n,i)=>(n.field.push(V(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function wR(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(In(r,i))return;n.push(i)}),n}function ER(e,t){return In(e,t)||!t?e:e?[...X(e),...X(t)].join(", "):t}function _R(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((ss(n)||ee(n))&&(ss(i)||ee(i)))return{explicit:e.explicit,value:ER(n,i)};if(ss(n)||ee(n))return{explicit:e.explicit,value:n};if(ss(i)||ee(i))return{explicit:e.explicit,value:i};if(!ss(n)&&!ee(n)&&!ss(i)&&!ee(i))return{explicit:e.explicit,value:wR(n,i)};throw new Error("It should never reach here")}function Mw(e){return`Invalid specification ${Re(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const ore='Autosize "fit" only works for single views and layered views.';function $R(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function SR(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function AR(e){return e?`Dropping "fit-${e}" because spec has discrete ${An(e)}.`:'Dropping "fit" because spec has discrete size.'}function Fw(e){return`Unknown field for ${e}. Cannot calculate view size.`}function kR(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function sre(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function are(e){return`The "nearest" transform is not supported for ${e} marks.`}function CR(e){return`Selection not supported for ${e} yet.`}function ure(e){return`Cannot find a selection named "${e}".`}const lre="Scale bindings are currently only supported for scales with unbinned, continuous domains.",cre="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",fre="Legend bindings are only supported for selections over an individual field or encoding channel.";function dre(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function hre(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const pre="The same selection must be used to override scale domains in a layered view.",gre='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function mre(e){return`Unknown repeated value "${e}".`}function MR(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const yre="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function bre(e){return`Unrecognized parse "${e}".`}function FR(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const vre="Attempt to add the same child twice.";function xre(e){return`Ignoring an invalid transform: ${Re(e)}.`}const wre='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.';function TR(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ere(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Re(t)} is overridden by a child projection ${Re(n)}.`}const _re="Arc marks uses theta channel rather than angle, replacing angle with theta.";function $re(e){return`${e}Offset dropped because ${e} is continuous`}function Sre(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Re(n)}}.`}function OR(e){return`Invalid field type "${e}".`}function Are(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function kre(e){return`Invalid aggregation operator "${e}".`}function NR(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Cre(e){return`Position range does not support relative band size for ${e}.`}function Tw(e,t){return`Dropping ${Re(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Mre="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function om(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Fre(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Tre(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Ore(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Nre(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Ow(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Dre(e){return`The ${e} for range marks cannot be an expression`}function Rre(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Pre(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Lre(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Ire(e){return`Cannot use the relative band size with ${e} scale.`}function zre(e){return`Using unaggregated domain with raw field has no effect (${Re(e)}).`}function Bre(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Ure(e){return`Unaggregated domain is currently unsupported for log scale (${Re(e)}).`}function jre(e){return`Cannot apply size to non-oriented mark "${e}".`}function qre(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Wre(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function DR(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function RR(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Hre(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using ${Re(n)}.`}function Gre(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using the union of the two domains.`}function Vre(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Yre(e){return`Dropping sort property ${Re(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const PR="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Xre="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.",Kre="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.",Zre="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.";function Jre(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Qre(e){return`Stack is applied to a non-linear scale (${e}).`}function eoe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function sm(e,t){return`Invalid ${e}: ${Re(t)}.`}function toe(e){return`Dropping day from datetime ${Re(e)} as day cannot be combined with other units.`}function noe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function ioe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function roe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function LR(e){return`1D error band does not support ${e}.`}function IR(e){return`Channel ${e} is required for "binned" bin.`}function ooe(e){return`Channel ${e} should not be used with "binned" bin.`}function soe(e){return`Domain for ${e} is required for threshold scale.`}const zR=N0(O0);let nl=zR;function aoe(e){return nl=e,nl}function uoe(){return nl=zR,nl}function j(...e){nl.warn(...e)}function loe(...e){nl.debug(...e)}function ga(e){if(e&&Y(e)){for(const t of Dw)if(U(e,t))return!0}return!1}const BR=["january","february","march","april","may","june","july","august","september","october","november","december"],coe=BR.map(e=>e.substr(0,3)),UR=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],foe=UR.map(e=>e.substr(0,3));function doe(e){if(Kg(e)&&(e=+e),_e(e))return e>4&&j(sm("quarter",e)),e-1;throw new Error(sm("quarter",e))}function hoe(e){if(Kg(e)&&(e=+e),_e(e))return e-1;{const t=e.toLowerCase(),n=BR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=coe.indexOf(i);if(r!==-1)return r;throw new Error(sm("month",e))}}function poe(e){if(Kg(e)&&(e=+e),_e(e))return e%7;{const t=e.toLowerCase(),n=UR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=foe.indexOf(i);if(r!==-1)return r;throw new Error(sm("day",e))}}function Nw(e,t){const n=[];if(t&&e.day!==void 0&&B(e).length>1&&(j(toe(e)),e=ue(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?hoe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?doe(e.quarter):e.quarter;n.push(_e(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?poe(e.day):e.day;n.push(_e(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ma(e){const n=Nw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function goe(e){const n=Nw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function moe(e){const t=Nw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const jR={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Dw=B(jR);function yoe(e){return Z(jR,e)}function ya(e){return Y(e)?e.binned:qR(e)}function qR(e){return e&&e.startsWith("binned")}function Rw(e){return e.startsWith("utc")}function boe(e){return e.substring(3)}const voe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function am(e){return Dw.filter(t=>HR(e,t))}function WR(e){const t=am(e);return t[t.length-1]}function HR(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function xoe(e,t,{end:n}={end:!1}){const i=mw(t),r=Rw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of Dw)HR(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),goe(a)}function GR(e){if(!e)return;const t=am(e);return`timeUnitSpecifier(${Re(t)}, ${Re(voe)})`}function woe(e,t,n){if(!e)return;const i=GR(e);return`${n||Rw(e)?"utc":"time"}Format(${t}, ${i})`}function bt(e){if(!e)return;let t;return K(e)?qR(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Y(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Rw(t.unit)&&(t.utc=!0,t.unit=boe(t.unit)),t}function Eoe(e){const{utc:t,...n}=bt(e);return n.unit?(t?"utc":"")+B(n).map(i=>qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+B(n).map(i=>qe(`_${i}_${n[i]}`)).join("")}function VR(e,t=n=>n){const n=bt(e),i=WR(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=YR(i,n.step),a={...r,[s]:+r[s]+o};return`${t(ma(a))} - ${t(ma(r))}`}}const _oe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function $oe(e){return Z(_oe,e)}function YR(e,t=1){if($oe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Soe(e){return U(e,"param")}function Pw(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Lw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Iw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function zw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Bw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Uw(e){if(e!=null&&e.field){if(L(e.range)&&e.range.length===2)return!0;if(ee(e.range))return!0}return!1}function jw(e){return!!(e!=null&&e.field)&&(L(e.oneOf)||L(e.in))}function Aoe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function XR(e){return jw(e)||Pw(e)||Uw(e)||Lw(e)||zw(e)||Iw(e)||Bw(e)}function gr(e,t){return _m(e,{timeUnit:t,wrapTime:!0})}function koe(e,t){return e.map(n=>gr(n,t))}function KR(e,t=!0){const{field:n}=e,i=bt(e.timeUnit),{unit:r,binned:o}=i||{},s=V(e,{expr:"datum"}),a=r?`time(${o?s:xoe(r,n)})`:s;if(Pw(e))return`${a}===${gr(e.equal,r)}`;if(Lw(e)){const u=e.lt;return`${a}<${gr(u,r)}`}else if(zw(e)){const u=e.gt;return`${a}>${gr(u,r)}`}else if(Iw(e)){const u=e.lte;return`${a}<=${gr(u,r)}`}else if(Bw(e)){const u=e.gte;return`${a}>=${gr(u,r)}`}else{if(jw(e))return`indexof([${koe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Aoe(e))return um(a,e.valid);if(Uw(e)){const{range:u}=Mt(e),l=ee(u)?{signal:`${u.signal}[0]`}:u[0],c=ee(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+gr(l,r)+", "+gr(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${gr(l,r)}`),c!==null&&f.push(`${a} <= ${gr(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Re(e)}`)}function um(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Coe(e){return XR(e)&&e.timeUnit?{...e,timeUnit:bt(e.timeUnit)}:e}const qf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Moe(e){return e==="quantitative"||e==="temporal"}function ZR(e){return e==="ordinal"||e==="nominal"}const ba=qf.quantitative,qw=qf.ordinal,il=qf.temporal,Ww=qf.nominal,rl=qf.geojson;function Foe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case ba:return"quantitative";case"t":case il:return"temporal";case"o":case qw:return"ordinal";case"n":case Ww:return"nominal";case rl:return"geojson"}}const Ft={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"},Hw={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 Toe(e,t){const n=Hw[e],i=Hw[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Ooe={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 JR(e){return Ooe[e]}const QR=new Set(["linear","log","pow","sqrt","symlog"]),e5=new Set([...QR,"time","utc"]);function t5(e){return QR.has(e)}const n5=new Set(["quantile","quantize","threshold"]),Noe=new Set([...e5,...n5,"sequential","identity"]),Doe=new Set(["ordinal","bin-ordinal","point","band"]);function vt(e){return Doe.has(e)}function Ti(e){return Noe.has(e)}function mr(e){return e5.has(e)}function ol(e){return n5.has(e)}const Roe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Poe(e){return!K(e)&&U(e,"name")}function i5(e){return U(e,"param")}function Loe(e){return U(e,"unionWith")}function Ioe(e){return Y(e)&&"field"in e}const zoe={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},{type:Sge,domain:Age,range:kge,rangeMax:Cge,rangeMin:Mge,scheme:Fge,...Boe}=zoe,Uoe=B(Boe);function Gw(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 mr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return mr(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return mr(e);case"nice":return mr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ti(e)&&!ye(["log","time","utc","threshold","quantile"],e)}}function r5(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return tl(e)?void 0:Lre(t);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}}function joe(e,t){return ye([qw,Ww],t)?e===void 0||vt(e):t===il?ye([Ft.TIME,Ft.UTC,void 0],e):t===ba?t5(e)||ol(e)||e===void 0:!0}function qoe(e,t,n=!1){if(!hr(e))return!1;switch(e){case We:case yt:case Qo:case Qu:case ri:case Ai:return mr(t)||t==="band"?!0:t==="point"?!n:!1;case Jr:case ns:case Qr:case es:case ts:case ca:return mr(t)||ol(t)||ye(["band","point","ordinal"],t);case $n:case cr:case fr:return t!=="band";case is:case Sn:return t==="ordinal"||ol(t)}}function Woe(e){return Y(e)&&"value"in e}const cn={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"},o5=cn.arc,lm=cn.area,cm=cn.bar,Hoe=cn.image,fm=cn.line,dm=cn.point,Goe=cn.rect,hm=cn.rule,s5=cn.text,Vw=cn.tick,Voe=cn.trail,Yw=cn.circle,Xw=cn.square,a5=cn.geoshape;function as(e){return["line","area","trail"].includes(e)}function Wf(e){return["rect","bar","image","arc","tick"].includes(e)}const Yoe=new Set(B(cn));function yr(e){return U(e,"type")}const Xoe=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Koe=["fill","fillOpacity"],Zoe=[...Xoe,...Koe],u5=B({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Kw=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Joe={area:["line","point"],bar:Kw,rect:Kw,line:["point"],tick:["bandSize","thickness",...Kw]},Qoe={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},l5=B({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 va(e){return U(e,"band")}const ese={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Zw={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},tse={...Zw,binSpacing:1},nse={...Zw,thickness:1};function ise(e){return yr(e)?e.type:e}function c5(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Jw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Ti(i)||r)return"always-valid";const o=c5(Pe("invalid",e,t),{isPath:as(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function rse(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function f5({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,o=`peek(${i})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:o})`}}function d5({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=Di(t),u=im(a==null?void 0:a.aggregate),l=Jw({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const f=((c=o.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:um(V(a,{expr:"datum"}),!1),...ose(f,n,i)}}}function ose(e,t,n){if(Woe(e)){const{value:i}=e;return ee(i)?{signal:i.signal}:{value:i}}return f5({scale:t,scaleName:n,mode:"zeroOrMin"})}function Qw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=da(t),u=eE(e),l=d5({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function sse(e){const{datum:t}=e;return ga(t)?ma(t):`${Re(t)}`}function xa(e,t,n,i){const r={};if(t&&(r.scale=t),br(e)){const{datum:o}=e;ga(o)?r.signal=ma(o):ee(o)?r.signal=o.signal:jf(o)?r.signal=o.expr:r.value=o}else r.field=V(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function pm({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!ee(s)&&0<s&&s<1?"datum":void 0,u=V(t,{expr:a,suffix:r}),l=n!==void 0?V(n,{expr:a}):V(t,{suffix:o,expr:a}),c={};if(s===0||s===1){c.scale=e;const f=s===0?u:l;c.field=f}else{const f=ee(s)?`(1-${s.signal}) * ${u} + ${s.signal} * ${l}`:`${1-s} * ${u} + ${s} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function ase({scaleName:e,fieldDef:t}){const n=V(t,{expr:"datum"}),i=V(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function eE({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(le(t)){const f=s==null?void 0:s.get("type");if(fn(t)){c??(c=us({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:p}=t;if(ze(d)||c&&h&&p===il)return a!=null&&a.impute?xa(t,o,{binSuffix:"mid"},{offset:u}):c&&!vt(f)?pm({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):xa(t,o,Kf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Ct(d)){if(q(n))return pm({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(IR(e===We?Si:lr))}}return xa(t,o,vt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Ni(t)){const f=t.value,d=u?{offset:u}:{};return{...Hf(e,f),...d}}}return ce(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Hf(e,t){return ye(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ye(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ue(t)}function wa(e){return e&&e!=="number"&&e!=="time"}function h5(e,t,n){return`${e}(${t}${n?`, ${Re(n)}`:""})`}const use=" – ";function tE({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(wa(n))return Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=p5(e,i,r),a=sl(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return Oi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Oi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return Oi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(cl(e)){const c=cse({field:s,timeUnit:q(e)?(u=bt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:Ea(e)&&((l=e.scale)==null?void 0:l.type)===Ft.UTC});return c?{signal:c}:void 0}if(t=nE({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&ze(e.bin)){const c=V(e,{expr:i,binSuffix:"end"});return{signal:Gf(s,c,t,n,o)}}else return t||sl(e)==="quantitative"?{signal:`${y5(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function p5(e,t,n){return q(e)?n?`${V(e,{expr:t,suffix:"end"})}-${V(e,{expr:t,suffix:"start"})}`:V(e,{expr:t}):sse(e)}function Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=p5(e,i,r)),s!=="datum.value"&&q(e)&&ze(e.bin)){const a=V(e,{expr:i,binSuffix:"end"});return{signal:Gf(s,a,t,n,o)}}return{signal:h5(n,s,t)}}function g5(e,t,n,i,r,o){var s;if(!(K(i)&&wa(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&sl(e)==="quantitative"&&(r.normalizedNumberFormatType&&al(e)&&e.stack==="normalize"||r.numberFormatType))){if(al(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return nE({type:"quantitative",config:r,normalizeStack:!0});if(cl(e)){const a=q(e)?(s=bt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:lse({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return nE({type:t,specifiedFormat:n,config:r})}}function m5(e,t,n){var i;if(e&&(ee(e)||e==="number"||e==="time"))return e;if(cl(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=bt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function nE({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===ba)return i?n.normalizedNumberFormat:n.numberFormat}function lse({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:GR(t)}:i?void 0:n.timeFormat)}function y5(e,t){return`format(${e}, "${t||""}")`}function b5(e,t,n,i){return wa(n)?h5(n,e,t):y5(e,(K(t)?t:void 0)??i.numberFormat)}function Gf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Gf(e,t,r.numberFormat,r.numberFormatType,r);const o=b5(e,n,i,r),s=b5(t,n,i,r);return`${um(e,!1)} ? "null" : ${o} + "${use}" + ${s}`}function cse({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=K(n)?n:r,`${o?"utc":"time"}Format(${e}, '${n}')`):woe(t,e,o)}const gm="min",fse={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function v5(e){return Z(fse,e)}function dse(e){return U(e,"encoding")}function io(e){return e&&(e.op==="count"||U(e,"field"))}function x5(e){return e&&L(e)}function Vf(e){return U(e,"row")||U(e,"column")}function iE(e){return U(e,"header")}function mm(e){return U(e,"facet")}function hse(e){return U(e,"param")}function pse(e){return!K(e)&&U(e,"repeat")}function w5(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function rE(e){return U(e,"sort")}function us({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(le(e)&&e.bandPosition!==void 0)return e.bandPosition;if(q(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return pr("timeUnitBandPosition",n,i);if(ze(o))return .5}}function E5({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=An(e),u=Pe(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:pr("timeUnitBandSize",i,r)};if(ze(h)&&!vt(o))return{band:1}}if(Wf(i.type))return o?vt(o)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function _5(e,t,n,i){return ze(e.bin)||e.timeUnit&&fn(e)&&e.type==="temporal"?us({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function $5(e){return U(e,"sort")&&!U(e,"field")}function Yf(e){return U(e,"condition")}function ym(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&q(t)}function Xf(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&le(t)}function gse(e){const t=e==null?void 0:e.condition;return!!t&&(L(t)||Ni(t))}function q(e){return U(e,"field")||(e==null?void 0:e.aggregate)==="count"}function sl(e){return e==null?void 0:e.type}function br(e){return U(e,"datum")}function ls(e){return fn(e)&&!vm(e)||bm(e)}function S5(e){return fn(e)&&e.type==="quantitative"&&!e.bin||bm(e)}function bm(e){return br(e)&&_e(e.datum)}function le(e){return q(e)||br(e)}function fn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function Ni(e){return U(e,"value")}function Ea(e){return U(e,"scale")||U(e,"sort")}function al(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function A5(e){return U(e,"legend")}function k5(e){return U(e,"format")||U(e,"formatType")}function mse(e){return _n(e,["legend","axis","header","scale"])}function yse(e){return U(e,"op")}function V(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(vse(e))n=ZD("count");else{let s;if(!t.nofn)if(yse(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;ze(a)?(s=dR(a),r=(t.binSuffix??"")+(t.suffix??"")):u?os(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):to(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!ya(l)&&(s=Eoe(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}s&&(n=n?`${s}_${n}`:s)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?Zu(n):t.expr?YD(n,t.expr)+o:ii(n)+o}function vm(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return q(e)&&!!e.bin;case"temporal":return!1}throw new Error(OR(e.type))}function bse(e){var t;return Ea(e)&&ol((t=e.scale)==null?void 0:t.type)}function vse(e){return e.aggregate==="count"}function xse(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(ze(i))return`${n} (binned)`;if(r&&!ya(r)){const a=(s=bt(r))==null?void 0:s.unit;if(a)return`${n} (${am(a).join("-")})`}else if(o)return os(o)?`${n} for max ${o.argmax}`:to(o)?`${n} for min ${o.argmin}`:`${Lf(o)} of ${n}`;return n}function wse(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(os(t))return`${r} for argmax(${t.argmax})`;if(to(t))return`${r} for argmin(${t.argmin})`;const o=i&&!ya(i)?bt(i):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||ze(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const C5=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return wse(e);default:return xse(e,t)}};let M5=C5;function F5(e){M5=e}function Ese(){F5(C5)}function ul(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=oE(e))==null?void 0:a.title;if(!q(e))return r??e.title;const o=e,s=i?sE(o,t):void 0;return n?et(r,o.title,s):r??o.title??s}function oE(e){if(al(e)&&e.axis)return e.axis;if(A5(e)&&e.legend)return e.legend;if(iE(e)&&e.header)return e.header}function sE(e,t){return M5(e,t)}function xm(e){if(k5(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=oE(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function _se(e,t){var o;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(rE(e)&&L(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!os(n)&&!to(n))return"quantitative";if(Ea(e)&&((o=e.scale)!=null&&o.type))switch(Hw[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Di(e){if(q(e))return e;if(ym(e))return e.condition}function lt(e){if(le(e))return e;if(Xf(e))return e.condition}function T5(e,t,n,i={}){if(K(e)||_e(e)||mo(e)){const r=K(e)?"string":_e(e)?"number":"boolean";return j(Sre(t,r,e)),{value:e}}return le(e)?wm(e,t,n,i):Xf(e)?{...e,condition:wm(e.condition,t,n,i)}:e}function wm(e,t,n,i){if(k5(e)){const{format:r,formatType:o,...s}=e;if(wa(o)&&!n.customFormatTypes)return j(TR(t)),wm(s,t,n,i)}else{const r=al(e)?"axis":A5(e)?"legend":iE(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(wa(s)&&!n.customFormatTypes)return j(TR(t)),wm({...e,[r]:a},t,n,i)}}return q(e)?aE(e,t,i):$se(e)}function $se(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=_e(n)?"quantitative":K(n)?"nominal":ga(n)?"temporal":void 0,{...e,type:t}}function aE(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!Aw(i)&&!os(i)&&!to(i)&&(j(kre(i)),delete a.aggregate),r&&(a.timeUnit=bt(r)),s&&(a.field=`${s}`),ze(o)&&(a.bin=Em(o,t)),Ct(o)&&!tt(t)&&j(ooe(t)),fn(a)){const{type:u}=a,l=Foe(u);u!==l&&(a.type=l),u!=="quantitative"&&im(i)&&(j(Are(u,i)),a.type="quantitative")}else if(!sR(t)){const u=_se(a,t);a.type=u}if(fn(a)){const{compatible:u,warning:l}=Sse(a,t)||{};u===!1&&j(l)}if(rE(a)&&K(a.sort)){const{sort:u}=a;if(v5(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&v5(l))return{...a,sort:{encoding:l,order:"descending"}}}if(iE(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function Em(e,t){return mo(e)?{maxbins:hR(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:hR(t)}:e}const ll={compatible:!0};function Sse(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Yr:case Xr:case Zg:return vm(e)?ll:{compatible:!1,warning:Tre(t)};case We:case yt:case Qo:case Qu:case $n:case cr:case fr:case zf:case Bf:case Jg:case fa:case Qg:case em:case ca:case ri:case Ai:case tm:return ll;case Ci:case oi:case ki:case Mi:return n!==ba?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ll;case Qr:case es:case ts:case ns:case Jr:case Zr:case Kr:case Si:case lr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:ll;case Sn:case is:return!vm(e)&&!bse(e)?{compatible:!1,warning:Ore(t)}:ll;case el:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:ll}}function cl(e){const{formatType:t}=xm(e);return t==="time"||!t&&Ase(e)}function Ase(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function _m(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const o=t&&((u=bt(t))==null?void 0:u.unit);let s=o||n==="temporal",a;return jf(e)?a=e.expr:ee(e)?a=e.signal:ga(e)?(s=!0,a=ma(e)):(K(e)||_e(e))&&s&&(a=`datetime(${Re(e)})`,yoe(o)&&(_e(e)&&e<1e4||K(e)&&isNaN(Date.parse(e)))&&(a=ma({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:Re(e)}function O5(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!ya(e.timeUnit)?e.timeUnit:void 0,o=_m(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function Kf(e,t){return ze(e.bin)?hr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const N5={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 Zf(e){return e==null?void 0:e.condition}const D5=["domain","grid","labels","ticks","title"],kse={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"},R5={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},Cse={...R5,style:1,labelExpr:1,encoding:1};function P5(e){return Z(Cse,e)}const L5=B({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 ro(e){return U(e,"mark")}class $m{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ro(t)?ise(t.mark)===this.name:!1}}function _a(e,t){const n=e&&e[t];return n?L(n)?Ku(n,i=>!!i.field):q(n)||ym(n):!1}function I5(e,t){const n=e&&e[t];return n?L(n)?Ku(n,i=>!!i.field):q(n)||br(n)||Xf(n):!1}function z5(e,t){if(tt(t)){const n=e[t];if((q(n)||br(n))&&(ZR(n.type)||q(n)&&n.timeUnit)){const i=xw(t);return I5(e,i)}}return!1}function B5(e){return Ku(Oie,t=>{if(_a(e,t)){const n=e[t];if(L(n))return Ku(n,i=>!!i.aggregate);{const i=Di(n);return i&&!!i.aggregate}}return!1})}function U5(e,t){const n=[],i=[],r=[],o=[],s={};return uE(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=oE(a),g=p==null?void 0:p.title;let m=V(a,{forAs:!0});const y={...g?[]:{title:ul(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(os(c)?(b="argmax",m=V({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):to(c)?(b="argmin",m=V({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),o.push(v)}}else if(n.push(m),fn(a)&&ze(f)){if(i.push({bin:f,field:l,as:m}),n.push(V(a,{binSuffix:"end"})),Kf(a,u)&&n.push(V(a,{binSuffix:"range"})),tt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",sR(u)||(y.type=ba)}else if(d&&!ya(d)){r.push({timeUnit:d,field:l,as:m});const b=fn(a)&&a.type!==il&&"time";b&&(u===zf||u===fa?y.formatType=b:jie(u)?y.legend={formatType:b,...y.legend}:tt(u)&&(y.axis={formatType:b,...y.axis}))}s[u]=y}else n.push(l),s[u]=e[u]}else s[u]=e[u]}),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function Mse(e,t,n){const i=Wie(t,n);if(i){if(i==="binned"){const r=e[t===Si?We:yt];return!!(q(r)&&q(e[t])&&Ct(r.bin))}}else return!1;return!0}function Fse(e,t,n,i){const r={};for(const o of B(e))oR(o)||j(Fre(o));for(let o of Iie){if(!e[o])continue;const s=e[o];if(Uf(o)){const a=Lie(o),u=r[a];if(q(u)&&Moe(u.type)&&q(s)&&!u.timeUnit){j($re(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(_re),o=ri),!Mse(e,o,t)){j(om(o,t));continue}if(o===Jr&&t==="line"){const a=Di(e[o]);if(a!=null&&a.aggregate){j(Mre);continue}}if(o===$n&&(n?"fill"in e:"stroke"in e)){j(NR("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Bf||o===el&&!L(s)&&!Ni(s)||o===fa&&L(s)){if(s){if(o===el){const a=e[o];if($5(a)){r[o]=a;continue}}r[o]=X(s).reduce((a,u)=>(q(u)?a.push(aE(u,o)):j(Tw(u,o)),a),[])}}else{if(o===fa&&s===null)r[o]=null;else if(!q(s)&&!br(s)&&!Ni(s)&&!Yf(s)&&!ee(s)){j(Tw(s,o));continue}r[o]=T5(s,o,i)}}return r}function Sm(e,t){const n={};for(const i of B(e)){const r=T5(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Tse(e){const t=[];for(const n of B(e))if(_a(e,n)){const i=e[n],r=X(i);for(const o of r)q(o)?t.push(o):ym(o)&&t.push(o.condition)}return t}function uE(e,t,n){if(e)for(const i of B(e)){const r=e[i];if(L(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function Ose(e,t,n,i){return e?B(e).reduce((r,o)=>{const s=e[o];return L(s)?s.reduce((a,u)=>t.call(i,a,u,o),r):t.call(i,r,s,o)},n):n}function j5(e,t){return B(t).reduce((n,i)=>{switch(i){case We:case yt:case Qg:case tm:case em:case Si:case lr:case Qo:case Qu:case ri:case Zr:case Ai:case Kr:case ki:case Ci:case Mi:case oi:case zf:case Sn:case ca:case fa:return n;case el:if(e==="line"||e==="trail")return n;case Bf:case Jg:{const r=t[i];if(L(r)||q(r))for(const o of X(r))o.aggregate||n.push(V(o,{}));return n}case Jr:if(e==="trail")return n;case $n:case cr:case fr:case Qr:case es:case ts:case is:case ns:{const r=Di(t[i]);return r&&!r.aggregate&&n.push(V(r,{})),n}}},[])}function Nse(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(L(t)){for(const o of t)o.aggregate?(i||(i=[]),i.push(o)):(r||(r=[]),r.push(o));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return L(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function lE(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:s,titlePrefix:a})=>{const u=i?` of ${cE(t)}`:"";return{field:s+t.field,type:t.type,title:ee(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=Tse(n).map(mse);return{tooltip:[...r,...ur(o,be)]}}function cE(e){const{title:t,field:n}=e;return et(t,n)}function fE(e,t,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=cE(n);return q5(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...K(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function q5(e,t,n,i){const{clip:r,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...s?{opacity:s}:{},...yr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...mo(e[t])?{}:e[t]}}]:[]}function W5(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",o=i[r],s=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Am(o,n),continuousAxisChannelDef2:Am(s,n),continuousAxisChannelDefError:Am(a,n),continuousAxisChannelDefError2:Am(u,n),continuousAxis:r}}function Am(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(roe(n,t)),i}else return e}function H5(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(yr(n)&&n.orient)return n.orient;if(ls(r)){if(ls(o)){const s=q(r)&&r.aggregate,a=q(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return cl(o)&&!cl(r)?"horizontal":"vertical"}return"horizontal"}else{if(ls(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const km="boxplot",Dse=["box","median","outliers","rule","ticks"],Rse=new $m(km,V5);function G5(e){return _e(e)?"tukey":e}function V5(e,{config:t}){e={...e,encoding:Sm(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=yr(n)?n:{type:n};r&&j(CR("boxplot"));const u=a.extent??t.boxplot.extent,l=Pe("size",a,t),c=a.invalid,f=G5(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:_}=Pse(e,u,t),E=Zu(g.field),{color:$,size:S,...M}=v,k=g0=>fE(a,m,g,g0,t.boxplot),N=k(M),A=k(v),F=(Y(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",C=k({...M,...S?{size:S}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...$||{value:F}}}}),T=lE([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),P={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},I=f==="min-max"?T:lE([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),z=[...N({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:I}),...N({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:I}),...N({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:I}),...N({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:I})],te=[...f!=="tukey"?z:[],...A({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:w,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...C({partName:"median",mark:{type:"tick",invalid:c,...Y(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:te};const ne=`datum["lower_box_${g.field}"]`,de=`datum["upper_box_${g.field}"]`,ke=`(${de} - ${ne})`,Ee=`${ne} - ${u} * ${ke}`,Ie=`${de} + ${u} * ${ke}`,$r=`datum["${g.field}"]`,Ia={joinaggregate:Y5(g.field),groupby:y},ms={transform:[{filter:`(${Ee} <= ${$r}) && (${$r} <= ${Ie})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${E}`},{op:"max",field:g.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${E}`},...b],groupby:y}],layer:z},{tooltip:J,...he}=M,{scale:me,axis:W}=g,Ot=cE(g),Oe=_n(W,["title"]),Yt=q5(a,"outliers",t.boxplot,{transform:[{filter:`(${$r} < ${Ee}) || (${$r} > ${Ie})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Ot!==void 0?{title:Ot}:{},...me!==void 0?{scale:me}:{},...De(Oe)?{}:{axis:Oe}},...he,...$?{color:$}:{},..._?{tooltip:_}:{}}})[0];let wt;const Sr=[...d,...h,Ia];return Yt?wt={transform:Sr,layer:[Yt,ms]}:(wt=ms,wt.transform.unshift(...Sr)),{...s,layer:[wt,{transform:p,layer:te}]}}function Y5(e){const t=Zu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Pse(e,t,n){const i=H5(e,km),{continuousAxisChannelDef:r,continuousAxis:o}=W5(e,i,km),s=r.field,a=Zu(s),u=G5(t),l=[...Y5(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{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]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Nse(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=U5(p,n),x=i==="vertical"?"horizontal":"vertical",w=i,_=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:_,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:h}}const dE="errorbar",Lse=["ticks","rule"],Ise=new $m(dE,X5);function X5(e,{config:t}){e={...e,encoding:Sm(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=K5(e,dE,t);delete o.size;const c=fE(a,r,i,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function zse(e,t){const{encoding:n}=e;if(Bse(n))return{orient:H5(e,t),inputType:"raw"};const i=Use(n),r=jse(n),o=n.x,s=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(le(a)&&le(u))throw new Error(`${t} cannot have both x2 and y2`);if(le(a)){if(ls(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(le(u)){if(ls(s))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")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(le(u)&&!le(a))throw new Error(`${t} cannot have xError2 without xError`);if(le(c)&&!le(l))throw new Error(`${t} cannot have yError2 without yError`);if(le(a)&&le(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(le(a)){if(ls(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(le(l)){if(ls(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 Bse(e){return(le(e.x)||le(e.y))&&!le(e.x2)&&!le(e.y2)&&!le(e.xError)&&!le(e.xError2)&&!le(e.yError)&&!le(e.yError2)}function Use(e){return le(e.x2)||le(e.y2)}function jse(e){return le(e.xError)||le(e.xError2)||le(e.yError)||le(e.yError2)}function K5(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=yr(i)?i:{type:i};o&&j(CR(t));const{orient:l,inputType:c}=zse(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=W5(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=qse(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:E,...$}=r,{bins:S,timeUnits:M,aggregate:k,groupby:N,encoding:A}=U5($,n),F=[...k,...m],C=c!=="raw"?[]:N,T=lE(b,f,A,v);return{transform:[...a.transform??[],...S,...M,...F.length===0?[]:[{aggregate:F,groupby:C}],...y],groupby:C,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:A,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:T}}function qse(e,t,n,i,r,o,s,a){let u=[],l=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&j(ioe(h,p,s)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Lf(h)},{fieldPrefix:"upper_",titlePrefix:Z5(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:Z5(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:ul({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ul({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ul({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(noe(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:la(la(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function Z5(e,t,n){return`${Lf(e)} ${n} ${t}`}const hE="errorband",Wse=["band","borders"],Hse=new $m(hE,J5);function J5(e,{config:t}){e={...e,encoding:Sm(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=K5(e,hE,t),l=s,c=fE(l,r,i,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?j(LR("interpolate")):l.tension&&j(LR("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const Q5={};function pE(e,t,n){const i=new $m(e,t);Q5[e]={normalizer:i,parts:n}}function Gse(){return B(Q5)}pE(km,V5,Dse),pE(dE,X5,Lse),pE(hE,J5,Wse);const Vse=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],e6={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"},t6={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"},Yse=B(e6),Xse=B(t6),n6=B({header:1,headerRow:1,headerColumn:1,headerFacet:1}),i6=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Kse={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Zse={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},Ri="_vgsid_",Jse={point:{on:"click",fields:[Ri],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 gE(e){return e==="legend"||!!(e!=null&&e.legend)}function mE(e){return gE(e)&&Y(e)}function yE(e){return!!(e!=null&&e.select)}function r6(e){const t=[];for(const n of e||[]){if(yE(n))continue;const{expr:i,bind:r,...o}=n;if(r&&i){const s={...o,bind:r,init:i};t.push(s)}else{const s={...o,...i?{update:i}:{},...r?{bind:r}:{}};t.push(s)}}return t}function Qse(e){return Cm(e)||vE(e)||bE(e)}function bE(e){return U(e,"concat")}function Cm(e){return U(e,"vconcat")}function vE(e){return U(e,"hconcat")}function o6({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function vr(e){return U(e,"step")}function s6(e){return U(e,"view")||U(e,"width")||U(e,"height")}const a6=20,eae=B({align:1,bounds:1,center:1,columns:1,spacing:1});function tae(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(mm(e)&&!Vf(e.facet)||bE(e))&&(r.columns=s),Cm(e)&&(r.columns=1);for(const a of eae)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=_e(u)?u:{row:u.row??o,column:u.column??o}}else r[a]=e[a];return r}function xE(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function wE(e,t){const n=Mm(e,t);return vr(n)?n.step:u6}function Mm(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return et(n,{step:e.step})}const u6=20,nae={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:u6},mark:Qoe,arc:{},area:{},bar:tse,circle:{},geoshape:{},image:{},line:{},point:{},rect:Zw,rule:{color:"black"},square:{},text:{color:"black"},tick:nse,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:Roe,projection:{},legend:Kse,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Jse,style:{},title:{},facet:{spacing:a6},concat:{spacing:a6},normalizedNumberFormat:".0%"},oo=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],l6={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},c6={blue:oo[0],orange:oo[1],red:oo[2],teal:oo[3],green:oo[4],yellow:oo[5],purple:oo[6],pink:oo[7],brown:oo[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 iae(e={}){return{signals:[{name:"color",value:Y(e)?{...c6,...e}:c6}],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"}]}}}function rae(e){return{signals:[{name:"fontSize",value:Y(e)?{...l6,...e}:l6}],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"}}}}}function oae(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function f6(e){const t=B(e||{}),n={};for(const i of t){const r=e[i];n[i]=Zf(r)?gR(r):zn(r)}return n}function sae(e){const t=B(e),n={};for(const i of t)n[i]=f6(e[i]);return n}const aae=[...l5,...L5,...n6,"background","padding","legend","lineBreak","scale","style","title","view"];function d6(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=Wa({},ue(nae),n?oae(n):{},t?iae(t):{},i?rae(i):{},o||{});r&&Ha(s,"selection",r,!0);const a=_n(s,aae);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=zn(s[u]));for(const u of l5)s[u]&&(a[u]=Mt(s[u]));for(const u of L5)s[u]&&(a[u]=f6(s[u]));for(const u of n6)s[u]&&(a[u]=Mt(s[u]));if(s.legend&&(a.legend=Mt(s.legend)),s.scale){const{invalid:u,...l}=s.scale,c=Mt(u,{level:1});a.scale={...Mt(l),...B(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=sae(s.style)),s.title&&(a.title=Mt(s.title)),s.view&&(a.view=Mt(s.view)),a}const uae=new Set(["view",...Yoe]),lae=["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"],cae={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Joe};function fae(e){e=ue(e);for(const t of lae)delete e[t];if(e.axis)for(const t in e.axis)Zf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Vse)delete e.legend[t];if(e.mark){for(const t of u5)delete e.mark[t];e.mark.tooltip&&Y(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(r6(e.params)),delete e.params);for(const t of uae){for(const i of u5)delete e[t][i];const n=cae[t];if(n)for(const i of n)delete e[t][i];hae(e,t)}for(const t of Gse())delete e[t];dae(e);for(const t in e)Y(e[t])&&De(e[t])&&delete e[t];return De(e)?void 0:e}function dae(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=pR(e.title);De(t)||(e.style["group-title"]={...e.style["group-title"],...t}),De(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),De(i)?delete e.title:e.title=i}function hae(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};De(o)||(e.style[n??t]=o),delete e[t]}function Fm(e){return U(e,"layer")}function pae(e){return U(e,"repeat")}function gae(e){return!L(e.repeat)&&U(e.repeat,"layer")}class EE{map(t,n){return mm(t)?this.mapFacet(t,n):pae(t)?this.mapRepeat(t,n):vE(t)?this.mapHConcat(t,n):Cm(t)?this.mapVConcat(t,n):bE(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Fm(t))return this.mapLayer(t,n);if(ro(t))return this.mapUnit(t,n);throw new Error(Mw(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const mae={zero:1,center:1,normalize:1};function yae(e){return Z(mae,e)}const bae=new Set([o5,cm,lm,hm,dm,Yw,Xw,fm,s5,Vw]),vae=new Set([cm,lm,o5]);function fl(e){return q(e)&&sl(e)==="quantitative"&&!e.bin}function h6(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(i),s=e[t],a=e[r];if(q(s)&&q(a))if(fl(s)&&fl(a)){if(s.stack)return t;if(a.stack)return r;const u=q(s)&&!!s.aggregate,l=q(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(o){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(fl(s))return t;if(fl(a))return r}else{if(fl(s))return o&&n==="vertical"?void 0:t;if(fl(a))return o&&n==="horizontal"?void 0:r}}function xae(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function p6(e,t){var g,m;const n=yr(e)?e:{type:e},i=n.type;if(!bae.has(i))return null;const r=h6(t,"x",n)||h6(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?V(o,{}):void 0,a=xae(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?V(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?V(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=zie.reduce((y,b)=>{if(b!=="tooltip"&&_a(t,b)){const v=t[b];for(const x of X(v)){const w=Di(x);if(w.aggregate)continue;const _=V(w,{});(!_||!l.has(_))&&y.push({channel:b,fieldDef:w})}}return y},[]);let p;return o.stack!==void 0?mo(o.stack)?p=o.stack?"zero":null:p=o.stack:vae.has(i)&&(p="zero"),!p||!yae(p)||B5(t)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Ft.LINEAR&&o!=null&&o.stack&&j(Qre(o.scale.type)),le(t[dr(r)])?(o.stack!==void 0&&j(Jre(r)),null):(q(o)&&o.aggregate&&!Zie.has(o.aggregate)&&j(eoe(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:as(i),stackBy:h,offset:p}))}function g6(e,t,n){const i=Mt(e),r=Pe("orient",i,n);if(i.orient=$ae(i.type,t,r),r!==void 0&&r!==i.orient&&j(Pre(i.orient,r)),i.type==="bar"&&i.orient){const u=Pe("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:ese[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Pe("opacity",i,n),s=Pe("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=Eae(i.type,t)),Pe("cursor",i,n)===void 0&&(i.cursor=wae(i,t,n)),i}function wae(e,t,n){return t.href||e.href||Pe("href",e,n)?"pointer":e.cursor}function Eae(e,t){if(ye([dm,Vw,Yw,Xw],e)&&!B5(t))return .7}function _ae(e,t,{graticule:n}){if(n)return!1;const i=pr("filled",e,t),r=e.type;return et(i,r!==dm&&r!==fm&&r!==hm)}function $ae(e,t,n){switch(e){case dm:case Yw:case Xw:case s5:case Goe:case Hoe:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case cm:if(q(i)&&(Ct(i.bin)||q(r)&&r.aggregate&&!i.aggregate))return"vertical";if(q(r)&&(Ct(r.bin)||q(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(q(i)&&i.type===ba&&!ze(i.bin)||bm(i))&&q(r)&&Ct(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===ba&&!ze(r.bin)||bm(r))&&q(i)&&Ct(i.bin)?"vertical":"horizontal"}case hm:if(o&&!(q(i)&&Ct(i.bin))&&s&&!(q(r)&&Ct(r.bin)))return;case lm:if(s)return q(r)&&Ct(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Ct(i.bin)?"vertical":"horizontal";if(e===hm){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case fm:case Vw:{const a=S5(i),u=S5(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=fn(i)&&i.type===il,c=fn(r)&&r.type===il;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function Sae(e){const{point:t,line:n,...i}=e;return B(i).length>1?i:i.type}function Aae(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:_n(e[t],["point","line"])});return e}function _E(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Y(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Y(t.point)?t.point:{}:void 0}function m6(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class kae{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ro(t)){const{mark:i,encoding:r}=t,o=yr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!_E(o,n[o.type],r);case"area":return!!_E(o,n[o.type],r)||!!m6(o,n[o.type])}}return!1}run(t,n,i){const{config:r}=n,{params:o,projection:s,mark:a,name:u,encoding:l,...c}=t,f=Sm(l,r),d=yr(a)?a:{type:a},h=_E(d,r[d.type],f),p=d.type==="area"&&m6(d,r[d.type]),g=[{name:u,...o?{params:o}:{},mark:Sae({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:_n(f,["shape"])}],m=p6(g6(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=_n(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...Xu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...Xu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Aae(r)})}}function Cae(e,t){return t?Vf(e)?x6(e,t):y6(e,t):e}function $E(e,t){return t?x6(e,t):e}function SE(e,t,n){const i=t[e];if(pse(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(mre(i.repeat));return}return t}function y6(e,t){if(e=SE("field",e,t),e!==void 0){if(e===null)return null;if(rE(e)&&io(e.sort)){const n=SE("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function b6(e,t){if(q(e))return y6(e,t);{const n=SE("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function v6(e,t){if(le(e)){const n=b6(e,t);if(n)return n;if(Yf(e))return{condition:e.condition}}else{if(Xf(e)){const n=b6(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function x6(e,t){const n={};for(const i in e)if(U(e,i)){const r=e[i];if(L(r))n[i]=r.map(o=>v6(o,t)).filter(o=>o);else{const o=v6(r,t);o!==void 0&&(n[i]=o)}}return n}class Mae{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ro(t)){const{encoding:n,mark:i}=t;if(i==="line"||yr(i)&&i.type==="line")for(const r of Pie){const o=da(r),s=n[o];if(n[r]&&(q(s)&&!Ct(s.bin)||br(s)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:o}=t;return j(Rre(!!r.x2,!!r.y2)),i({...t,mark:Y(o)?{...o,type:"rule"}:"rule"},n)}}class Fae extends EE{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Rse,Ise,Hse,new kae,new Mae]}map(t,n){if(ro(t)){const i=_a(t.encoding,Yr),r=_a(t.encoding,Xr),o=_a(t.encoding,Zg);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=$E(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(s,n.config))return u.run(s,n,a);return s}mapRepeat(t,n){return gae(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...o}=t,{row:s,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...o,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${qe(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!L(i)&&t.columns&&(t=_n(t,["columns"]),j(MR("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!L(i)&&i.row||[u?u.row:null],f=!L(i)&&i.column||[u?u.column:null],d=L(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(L(i)?`${qe(p)}`:(i.row?`row_${qe(g)}`:"")+(i.column?`column_${qe(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(_n(v,["data"]))}const h=L(i)?t.columns:i.column?i.column.length:1;return{data:r.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Vf(i)&&t.columns&&(t=_n(t,["columns"]),j(MR("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=E6({parentProjection:s,projection:r}),l=w6({parentEncoding:o,encoding:$E(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:o,...s}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=$E(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:o}=t;if(i||r){o&&j(Nre([...i?[Yr]:[],...r?[Xr]:[]]));const s={},a={};for(const u of[Yr,Xr]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;s[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:Cae(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:o,projection:s,...a}=t,u={...r,parentEncoding:w6({parentEncoding:n,encoding:o,layer:!0}),parentProjection:E6({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function w6({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...B(e),...B(t)]);for(const o of r){const s=t[o],a=e[o];if(le(s)){const u={...a,...s};i[o]=u}else Xf(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Ni(a)||ee(a)||le(a)||L(a))&&(i[o]=a)}}else i=t;return!i||De(i)?void 0:i}function E6(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Ere({parentProjection:t,projection:n})),n??t}function AE(e){return U(e,"filter")}function Tae(e){return U(e,"stop")}function _6(e){return U(e,"lookup")}function Oae(e){return U(e,"data")}function Nae(e){return U(e,"param")}function Dae(e){return U(e,"pivot")}function Rae(e){return U(e,"density")}function Pae(e){return U(e,"quantile")}function Lae(e){return U(e,"regression")}function Iae(e){return U(e,"loess")}function zae(e){return U(e,"sample")}function Bae(e){return U(e,"window")}function Uae(e){return U(e,"joinaggregate")}function jae(e){return U(e,"flatten")}function qae(e){return U(e,"calculate")}function $6(e){return U(e,"bin")}function Wae(e){return U(e,"impute")}function Hae(e){return U(e,"timeUnit")}function Gae(e){return U(e,"aggregate")}function Vae(e){return U(e,"stack")}function Yae(e){return U(e,"fold")}function Xae(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function Kae(e){return e.map(t=>AE(t)?{filter:Yu(t.filter,Coe)}:t)}class Zae extends EE{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=S6(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=S6(t,n),t.encoding){const i={};for(const[r,o]of Jo(t.encoding))i[r]=A6(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Jo(i).map(([o,s])=>{const{init:a,bind:u,empty:l,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=l!=="none";for(const f of kt(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function S6(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(AE(o))return{filter:kE(o,t)};if($6(o)&&ha(o.bin))return{...o,bin:k6(o.bin)};if(_6(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function A6(e,t){var i,r;const n=ue(e);if(q(n)&&ha(n.bin)&&(n.bin=k6(n.bin)),Ea(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(Yf(n))if(L(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:kE(o,t)}});else{const{selection:o,param:s,test:a,...u}=A6(n.condition,t);n.condition=s?n.condition:{...u,test:kE(n.condition,t)}}return n}function k6(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function kE(e,t){const n=i=>Yu(i,r=>{var o;const s=t.emptySelections[r]??!0,a={param:r,empty:s};return(o=t.selectionPredicates)[r]??(o[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):Yu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class CE extends EE{map(t,n){const i=n.selections??[];if(t.params&&!ro(t)){const r=[];for(const o of t.params)yE(o)?i.push(o):r.push(o);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),o=[];for(const s of i)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(K(a)&&(a===t.name||r.includes(a))||L(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=CE.prototype[e];CE.prototype[e]=function(n,i){return t.call(this,n,Jae(n,i))}}function Jae(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function C6(e,t){t===void 0&&(t=d6(e.config));const n=nue(e,t),{width:i,height:r}=e,o=iue(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Qae=new Fae,eue=new Zae,tue=new CE;function nue(e,t={}){const n={config:t};return tue.map(Qae.map(eue.map(e,n),n),n)}function M6(e){return K(e)?{type:e}:e??{}}function iue(e,t,n){let{width:i,height:r}=t;const o=ro(e)||Fm(e),s={};o?i=="container"&&r=="container"?(s.type="fit",s.contains="padding"):i=="container"?(s.type="fit-x",s.contains="padding"):r=="container"&&(s.type="fit-y",s.contains="padding"):(i=="container"&&(j($R("width")),i=void 0),r=="container"&&(j($R("height")),r=void 0));const a={type:"pad",...s,...n?M6(n.autosize):{},...M6(e.autosize)};if(a.type==="fit"&&!o&&(j(ore),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(SR("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(SR("height")),!In(a,{type:"pad"}))return a}function rue(e){return["fit","fit-x","fit-y"].includes(e)}function oue(e){return e?`fit-${nm(e)}`:"fit"}const sue=["background","padding"];function F6(e,t){const n={};for(const i of sue)e&&e[i]!==void 0&&(n[i]=zn(e[i]));return t&&(n.params=e.params),n}class so{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new so(ue(this.explicit),ue(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return et(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of B(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function xr(e){return{explicit:!0,value:e}}function Bn(e){return{explicit:!1,value:e}}function T6(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Tm(t,n,i,r)}}function Tm(e,t,n,i){return e.explicit&&t.explicit&&j(Hre(n,i,e.value,t.value)),e}function cs(e,t,n,i,r=Tm){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:In(e.value,t.value)?e:r(e,t,n,i)}class aue extends so{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function dl(e){return U(e,"url")}function Jf(e){return U(e,"values")}function O6(e){return U(e,"name")&&!dl(e)&&!Jf(e)&&!fs(e)}function fs(e){return e&&(N6(e)||D6(e)||ME(e))}function N6(e){return U(e,"sequence")}function D6(e){return U(e,"sphere")}function ME(e){return U(e,"graticule")}var Ze;(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",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ze||(Ze={}));function R6({invalid:e,isPath:t}){switch(c5(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function uue(e){const{marks:t,scales:n}=R6(e);return t===n?Ze.Main:n==="include-invalid-values"?Ze.PreFilterInvalid:Ze.PostFilterInvalid}function P6(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ii(r.field),r}function $a(e,t=!0,n=Rt){if(L(e)){const i=e.map(r=>$a(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ga(e))return n(t?ma(e):moe(e));return t?n(Re(e)):e}function lue(e,t){for(const n of kt(e.component.selection??{})){const i=n.name;let r=`${i}${ds}, ${n.resolve==="global"?"true":`{unit: ${Aa(e)}}`}`;for(const o of Im)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+zue,on:[{events:{signal:n.name+ds},update:`modify(${H(n.name+Sa)}, ${r})`}]})}return FE(t)}function cue(e,t){if(e.component.selection&&B(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Ko("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return FE(t)}function fue(e,t){let n=!1;for(const i of kt(e.component.selection??{})){const r=i.name,o=H(r+Sa);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${d4}(${o}, ${H(a)}${u}`})}n=!0;for(const a of Im)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),FE(t)}function due(e,t){const n=[...t],i=Aa(e,{escape:!1});for(const r of kt(e.component.selection??{})){const o={name:r.name+Sa};if(r.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Ri}}]),r.init){const a=r.project.items.map(P6);o.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[Ri]:$a(u,!1)[0]})):r.init.map(u=>({unit:i,fields:a,values:$a(u,!1)}))}n.filter(a=>a.name===r.name+Sa).length||n.push(o)}return n}function L6(e,t){for(const n of kt(e.component.selection??{}))for(const i of Im)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function hue(e,t){for(const n of e.children)Ge(n)&&(t=L6(n,t));return t}function pue(e,t,n,i){const r=y4(e,t.param,t);return{signal:Ti(n.get("type"))&&L(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function FE(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class Te{constructor(t,n){this.debugName=n,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,n){if(this._children.includes(t)){j(vre);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class kn extends Te{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,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${KD()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function TE(e){return e.as!==void 0}function I6(e){return`${e}_end`}class wr extends Te{clone(){return new wr(null,ue(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{const{field:a,timeUnit:u}=o;if(u){let l;if(ya(u)){if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=us({fieldDef:o,markDef:f,config:d});(Wf(c)||h)&&(l={timeUnit:bt(u),field:a})}}else l={as:V(o,{forAs:!0}),field:a,timeUnit:u};if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=us({fieldDef:o,markDef:f,config:d});Wf(c)&&tt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[be(l)]=l)}return r},{});return De(i)?null:new wr(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=bt(i),s={...r,timeUnit:o};return new wr(t,{[be(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of Jo(this.timeUnits)){const o=TE(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(kt(this.timeUnits).map(t=>TE(t)?t.as:I6(t.field)))}dependentFields(){return new Set(kt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${be(this.timeUnits)}`}assemble(){const t=[];for(const n of kt(this.timeUnits)){const{rectBandPosition:i}=n,r=bt(n.timeUnit);if(TE(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:ii(o),type:"timeunit",...a?{units:am(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...B6(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=z6({timeUnit:r,field:s}),u=I6(s);t.push({type:"formula",expr:a,as:u}),t.push(...B6([s,u],i,r))}}return t}}const Om="offsetted_rect_start",Nm="offsetted_rect_end";function z6({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=WR(i),{part:s,step:a}=YR(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function B6([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:U6([z6({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Om}`},{type:"formula",expr:U6([r,o],n+.5),as:`${e}_${Nm}`}]}return[]}function U6([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Qf="_tuple_fields";class gue{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const mue={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new gue),o={},s={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=qe(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?X(n.value):null;let{fields:d,encodings:h}=Y(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(Y(p))for(const g of B(p))Rie(g)?(h||(h=[])).push(g):l==="interval"?(j(gre),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){j(sre(p,g.aggregate));continue}else if(!m){j(kR(p));continue}if(g.timeUnit&&!ya(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};s[be(y)]=y}if(!o[m]){const y=l==="interval"&&hr(p)&&Ti(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(o[m]=b),r.hasField[m]=o[m],r.hasSelectionId=r.hasSelectionId||m===Ri,iR(p)?(b.geoChannel=p,b.channel=nR(p),r.hasChannel[b.channel]=o[m]):r.hasChannel[p]=o[m]}}else j(kR(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Ri}f&&(t.init=f.map(p=>r.items.map(g=>Y(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),De(s)||(r.timeUnit=new wr(null,s))},signals:(e,t,n)=>{const i=t.name+Qf;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(P6)})}},ao={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!hr(r))continue;const o=e.getScaleComponent(r),s=o?o.get("type"):void 0;if(s=="sequential"&&j(cre),!o||!Ti(s)){j(lre);continue}o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||j6(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(d4))r.update=`{${i.map(s=>`${H(ii(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${H(ii(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}r.update=o}return n.concat(i.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!j6(e))for(const i of t.scales){const r=n.find(o=>o.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function OE(e,t){return`domain(${H(e.scaleName(t))})`}function j6(e){return e.parent&&_l(e.parent)&&!e.parent.parent}const hl="_brush",q6="_scale_trigger",ed="geo_interval_init_tick",W6="_init",yue="_center",bue={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Y(n.select)?n.select:{}};r.fields=[Ri],r.encodings||(r.encodings=n.value?B(n.value):[Ci,ki]),n.select={type:"interval",...r}}if(t.translate&&!ao.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+hl)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=X((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+ds,o=kt(t.project.hasChannel).filter(a=>a.channel===We||a.channel===yt),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(vue(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+yue,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?s&&s[l.index]:`${u}[0]`,p=c?s&&s[c.index]:`${u}[1]`,g=w=>e.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:i+W6,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(_=>_.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${H(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Aa(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=o.map(w=>w.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...s?[{signal:ed}]:[]],update:v}]})}else{if(!ao.defined(t)){const l=i+q6,c=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=H(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Ti(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=o.map(l=>l.signals.data),u=`unit: ${Aa(e)}, fields: ${i+Qf}, values`;return n.concat({name:r,...s?{init:`{${u}: ${$a(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ge(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===ed).length||n.unshift({name:ed,value:null,on:[{events:"timer{1}",update:`${ed} === null ? {} : ${ed}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r==null?void 0:r.signals.visual,a=o==null?void 0:o.signals.visual,u=`data(${H(t.name+Sa)})`;if(ao.defined(t)||!r&&!o)return n;const l={x:r!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of B(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Aa(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=B(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+hl}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+hl,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function vue(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=H(r?e.scaleName(o):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(o===We?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=ao.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=i?{init:$a(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+q6},update:Ti(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:$a(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===We?0:1,h=t.name+W6,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const xue={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+Qf,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=kt(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+hl):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Aa(e)}, `;if(t.project.hasSelectionId)l+=`${Ri}: ${s}[${H(Ri)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${H(e.vgField(d.channel,{}))}], ${s}[${H(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${H(d.field)}]`}).join(", ");l+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+ds,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function pl({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=Yf(t)&&t.condition;let s=[];o&&(s=X(o).map(l=>{const c=r(l);if(hse(l)){const{param:f,empty:d}=l;return{test:m4(e,{param:f,empty:d}),...c}}else return{test:zm(e,l.test),...c}})),i!==void 0&&s.push(i);const a=r(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function NE(e,t="text"){const n=e.encoding[t];return pl({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>Dm(i,e.config),invalidValueRef:void 0})}function Dm(e,t,n="datum"){if(e){if(Ni(e))return Ue(e.value);if(le(e)){const{format:i,formatType:r}=xm(e);return tE({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function H6(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(L(s))return{tooltip:V6({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return pl({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=Dm(l,r,a);if(c)return c;if(l===null)return;let f=Pe("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(Y(f))return ee(f)?f:f.content==="encoding"?V6(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function G6(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o=new Set,s=i?"datum.datum":"datum",a=[];function u(c,f){const d=da(f),h=fn(c)?c:{...c,type:e[d].type},p=h.title||sE(h,r),g=X(p).join(", ").replaceAll(/"/g,'\\"');let m;if(tt(f)){const y=f==="x"?"x2":"y2",b=Di(e[y]);if(Ct(h.bin)&&b){const v=V(h,{expr:s}),x=V(b,{expr:s}),{format:w,formatType:_}=xm(h);m=Gf(v,x,w,_,r),o.add(y)}}if((tt(f)||f===ri||f===Ai)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=xm(h);m=tE({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??(m=Dm(h,r,s).signal),a.push({channel:f,key:g,value:m})}uE(e,(c,f)=>{q(c)?u(c,f):ym(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!o.has(c)&&!l[f]&&(l[f]=d);return l}function V6(e,t,n,{reactiveGeom:i}={}){const r=G6(e,t,n,{reactiveGeom:i}),o=Jo(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function wue(e){const{markDef:t,config:n}=e,i=Pe("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Eue(e),..._ue(e)}}function Eue(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Pe("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:Z(nre,t)?{}:{ariaRoleDescription:{value:t}}}function _ue(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return pl({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>Dm(u,e.config),invalidValueRef:void 0});const s=Pe("description",n,i);if(s!=null)return{description:Ue(s)};if(i.aria===!1)return{};const a=G6(t,r,i);if(!De(a))return{description:{signal:Jo(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function Tt(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=Pe(e,i,o,{vgChannel:s,ignoreVgConfig:!Yf(l)})),u!==void 0&&(a=Ue(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=d5({...c,scaleChannel:e,channelDef:l});return pl({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>eE({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function Y6(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Pe("filled",n,r),a=ye(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Pe(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Pe(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ue(u)}:{},...l?{stroke:Ue(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(NR("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Tt("color",e,{vgChannel:c,defaultValue:s?u:l}),...Tt("fill",e,{defaultValue:i.fill?u:void 0}),...Tt("stroke",e,{defaultValue:i.stroke?l:void 0})}}function $ue(e){const{encoding:t,mark:n}=e,i=t.order;return!as(n)&&Ni(i)?pl({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ue(r.value),invalidValueRef:void 0}):{}}function gl({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:eE({channel:o,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ue(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function dn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=t,u=r[e],l=r[dr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=gl({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),p=DE({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&tt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Sue({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function Sue(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(le(n)&&r&&t===r.fieldChannel){if(q(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return pm({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return xa(n,i,{suffix:"end"},{offset:o})}return Qw(e)}function DE({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=da(n),u=rs(n),l=Pe(n,o,s,{vgChannel:u});if(l!==void 0)return Hf(n,l);switch(t){case"zeroOrMin":return X6({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return X6({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[An(n)],mult:.5}}}}function X6({mainChannel:e,config:t,...n}){const i=f5(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=r.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Aue={left:"x",center:"xc",right:"x2"},kue={top:"y",middle:"yc",bottom:"y2"};function K6(e,t,n,i="middle"){if(e==="radius"||e==="theta")return rs(e);const r=e==="x"?"align":"baseline",o=Pe(r,t,n);let s;return ee(o)?(j(Dre(r)),s=void 0):s=o,e==="x"?Aue[s||(i==="top"?"left":"center")]:kue[s||i]}function Rm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Z6(e,t,{defaultPos:n,defaultPos2:i}):dn(e,t,{defaultPos:n})}function Z6(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=dr(e),a=An(e),u=Cue(t,i,s),l=u[a]?K6(e,r,o):rs(e);return{...dn(e,t,{defaultPos:n,vgChannel:l}),...u}}function Cue(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=da(n),l=An(n),c=rs(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in o?gl({channel:n,markDef:o,encoding:i,model:e}):gl({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=An(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Mue({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:Pm(n,o)||Pm(n,{[n]:Cw(n,o,a.style),[l]:Cw(l,o,a.style)})||Pm(n,a[r])||Pm(n,a.mark)||{[c]:DE({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Mue({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?xa(t,o,{suffix:"start"},{offset:u}):Qw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Pm(e,t){const n=An(e),i=rs(e);if(t[i]!==void 0)return{[i]:Hf(e,t[i])};if(t[e]!==void 0)return{[i]:Hf(e,t[e])};if(t[n]){const r=t[n];if(va(r))j(Cre(n));else return{[n]:Hf(e,r)}}}function uo(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=dr(t),a=An(t),u=i[t],l=i[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??Pe("size",r,n,{vgChannel:a}),p=aR(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(ze(u.bin)||Ct(u.bin)||u.timeUnit&&!l)&&!(h&&!va(h))&&!i[p]&&!vt(f)?Oue({fieldDef:u,fieldDef2:l,channel:t,model:e}):(le(u)&&vt(f)||g)&&!l?Tue(u,t,e):Z6(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Fue(e,t,n,i,r,o,s){if(va(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=pr("minBandSize",{type:s},i);return{signal:c?`max(${Fi(c)}, ${l})`:l}}else r.band!==1&&(j(Ire(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(ee(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(pa(u)&&_e(u.step))return{value:u.step-2}}if(!o){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=et(u,s==="tick"?f:s==="bar"?l:c);if(ee(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(_e(d))return{signal:`${1-d} * ${e}`}}return{value:wE(i.view,e)-2}}function Tue(e,t,n){var S,M;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=An(t),f=dr(t),d=aR(t),h=n.scaleName(d),p=n.getScaleComponent(xw(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=Tt("size",n,{vgChannel:c,defaultRef:Ue(i.size)}):j(jre(i.type)));const y=!!m,b=E5({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(S=l||p)==null?void 0:S.get("type"),useVlSizeChannel:g});m=m||{[c]:Fue(c,h||u,p||l,o,b,!!e,i.type)};const v=((M=l||p)==null?void 0:M.get("type"))==="band"&&va(b)&&!y?"top":"middle",x=K6(t,i,o,v),w=x==="xc"||x==="yc",{offset:_,offsetType:E}=gl({channel:t,markDef:i,encoding:r,model:n,bandPosition:w?.5:0}),$=Qw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:_,defaultRef:DE({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:w?E==="encoding"?0:.5:ee(b)?{signal:`(1-${b})/2`}:va(b)?(1-b.band)/2:0});if(c)return{[x]:$,...m};{const k=rs(f),N=m[c],A=_?{...N,offset:_}:N;return{[x]:$,[k]:L($)?[$[0],{...$[1],offset:A}]:{...$,offset:A}}}}function J6(e,t,n,i,r,o,s){if(tR(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(ee(n)||ee(r)||ee(i)||o){const l=Fi(n),c=Fi(r),f=Fi(i),d=Fi(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function Oue({fieldDef:e,fieldDef2:t,channel:n,model:i}){var M;const{config:r,markDef:o,encoding:s}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=E5({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(M=i.component.axes[n])==null?void 0:M[0],h=(d==null?void 0:d.get("translate"))??.5,p=tt(n)?Pe("binSpacing",o,r)??0:0,g=dr(n),m=rs(n),y=rs(g),b=pr("minBandSize",o,r),{offset:v}=gl({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:x}=gl({channel:g,markDef:o,encoding:s,model:i,bandPosition:0}),w=ase({fieldDef:e,scaleName:u}),_=J6(n,p,c,h,v,b,w),E=J6(g,p,c,h,x??v,b,w),$=ee(f)?{signal:`(1-${f.signal})/2`}:va(f)?(1-f.band)/2:.5,S=us({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(ze(e.bin)||e.timeUnit){const k=e.timeUnit&&S!==.5;return{[y]:Q6({fieldDef:e,scaleName:u,bandPosition:$,offset:E,useRectOffsetField:k}),[m]:Q6({fieldDef:e,scaleName:u,bandPosition:ee($)?{signal:`1-${$.signal}`}:1-$,offset:_,useRectOffsetField:k})}}else if(Ct(e.bin)){const k=xa(e,u,{},{offset:E});if(q(t))return{[y]:k,[m]:xa(t,u,{},{offset:_})};if(ha(e.bin)&&e.bin.step)return{[y]:k,[m]:{signal:`scale("${u}", ${V(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}j(IR(g))}function Q6({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return pm({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Om,endSuffix:Nm}:{}})}const Nue=new Set(["aria","width","height"]);function ai(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?Y6(e):{};return{...Due(e.markDef,t),...e4("fill",n),...e4("stroke",i),...Tt("opacity",e),...Tt("fillOpacity",e),...Tt("strokeOpacity",e),...Tt("strokeWidth",e),...Tt("strokeDash",e),...$ue(e),...H6(e),...NE(e,"href"),...wue(e)}}function e4(e,t){return t?{[e]:t}:{}}function Due(e,t){return tre.reduce((n,i)=>(!Nue.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ue(e[i])),n),{})}function RE(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!hr(o)||!(s=e.getScaleType(o)))return;const a=im(r.aggregate),u=Jw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(rse(u)){const c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(o=>um(o,!0)).join(" && ")}}}function t4(e,t){if(t!==void 0)return{[e]:Ue(t)}}const PE="voronoi",n4={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(PE)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(as(o))return j(are(o)),n;const s={name:e.getName(PE),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...H6(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(PE)&&(u=!0)}),u||n.splice(a+1,0,s),n}},i4={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!gE(e.bind),parse:(e,t,n)=>h4(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=n4.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=qe(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:$a(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${H(u.field)}] : null`}]:[],bind:o[u.field]??o[u.channel]??o})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(l=>l.name===i+ds),s=i+Qf,a=r.items.map(l=>qe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(o.update=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},Lm="_toggle",r4={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Lm,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+ds,i=t.name+Lm;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Aa(e)}}, `)+`${i} ? ${n} : null`}},Rue={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Ko(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(i4.defined(t))for(const i of t.project.items){const r=n.findIndex(o=>o.name===qe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,o){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const r of t.project.items){const o=n.findIndex(s=>s.name===r.signals.visual);if(i(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===r.signals.data);i(s,"null")}}else{let r=n.findIndex(o=>o.name===t.name+ds);i(r,"null"),r4.defined(t)&&(r=n.findIndex(o=>o.name===t.name+Lm),i(r,"false"))}return n}},o4={defined:e=>{const t=e.resolve==="global"&&e.bind&&gE(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Ri;return t&&!n&&j(fre),t&&n},parse:(e,t,n)=>{const i=ue(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},h4(t,i),Y(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=X(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const r=mE(t.bind)?t.bind.legend:"click",o=K(r)?Ko(r,"view"):X(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=mE(t.bind)&&t.bind.legend,o=s=>a=>{const u=ue(a);return u.markname=s,u};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${qe(s.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(o(`${a}_symbols`)).concat(r.merge.map(o(`${a}_labels`))).concat(r.merge.map(o(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(d=>d.name===i+ds),s=i+Qf,a=r.items.filter(d=>d.hasLegend).map(d=>qe(`${i}_${qe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(o.update=l,delete o.value,delete o.on);const c=n.find(d=>d.name===i+Lm),f=mE(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Pue(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const o of kt(e.component.selection??{})){const s=o.project.hasField[i]??o.project.hasChannel[t];if(s&&o4.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const s4="_translate_anchor",a4="_translate_delta",Lue={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+s4,{x:s,y:a}=t.project.hasChannel;let u=Ko(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+hl,l))),n.push({name:o,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${r?OE(e,We):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?OE(e,yt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+a4,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&u4(e,t,s,"width",n),a!==void 0&&u4(e,t,a,"height",n),n}};function u4(e,t,n,i,r){const o=t.name,s=o+s4,a=o+a4,u=n.channel,l=ao.defined(t),c=r.find(w=>w.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===We?p?"":"-":p?"-":"":"",m=`${s}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const l4="_zoom_anchor",c4="_zoom_delta",Iue={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+c4,{x:s,y:a}=t.project.hasChannel,u=H(e.scaleName(We)),l=H(e.scaleName(yt));let c=Ko(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+hl,f))),n.push({name:i+l4,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&f4(e,t,s,"width",n),a!==void 0&&f4(e,t,a,"height",n),n}};function f4(e,t,n,i,r){const o=t.name,s=n.channel,a=ao.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?OE(e,s):u.name,h=o+c4,p=`${o}${l4}.${s}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Sa="_store",ds="_tuple",zue="_modify",d4="vlSelectionResolve",Im=[xue,bue,mue,r4,i4,ao,o4,Rue,Lue,Iue,n4];function Bue(e){let t=e.parent;for(;t&&!Un(t);)t=t.parent;return t}function Aa(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=Bue(e);if(i){const{facet:r}=i;for(const o of si)r[o]&&(n+=` + '__facet_${o}_' + (facet[${H(i.vgField(o))}])`)}return n}function LE(e){return kt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function h4(e,t){(K(t.select)||!t.select.on)&&delete e.events,(K(t.select)||!t.select.clear)&&delete e.clear,(K(t.select)||!t.select.toggle)&&delete e.toggle}function IE(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...IE(e.object)),t.push(...IE(e.property))),t)}function p4(e){return e.object.type==="MemberExpression"?p4(e.object):e.object.name==="datum"}function g4(e){const t=p2(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&p4(i)&&n.add(IE(i).slice(1).join("."))}),n}class ml extends Te{clone(){return new ml(null,this.model,ue(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=zm(this.model,this.filter,this),this._dependentFields=g4(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Uue(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const o=qe(r.name),s=r.select,a=K(s)?s:s.type,u=Y(s)?ue(s):{type:a},l=i[a];for(const d in l)d==="fields"||d==="encodings"||(d==="mark"&&(u.mark={...l.mark,...u.mark}),(u[d]===void 0||u[d]===!0)&&(u[d]=ue(l[d]??u[d])));const c=n[o]={...u,name:o,type:a,init:r.value,bind:r.bind,events:K(u.on)?Ko(u.on,"scope"):X(ue(u.on))},f=ue(r);for(const d of Im)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function m4(e,t,n,i="datum"){const r=K(t)?t:t.param,o=qe(r),s=H(o+Sa);let a;try{a=e.getSelectionComponent(o,r)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${H(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function y4(e,t,n){const i=qe(t),r=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!o)o=s.project.items[0].field,s.project.items.length>1&&j(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${H(o)}.`);else if(r&&!o){const a=s.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(o=s.project.items[0].field,j((a.length?"Multiple ":"No ")+`matching ${H(r)} encoding found for selection ${H(n.param)}. Using "field": ${H(o)}.`)):o=a[0].field}return`${s.name}[${H(ii(o))}]`}function jue(e,t){for(const[n,i]of Jo(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new kn(new ml(t,e,{param:n}),r,Ze.Lookup,e.component.data.outputNodeRefCounts)}}function zm(e,t,n){return Pf(t,i=>K(i)?i:Soe(i)?m4(e,i,n):KR(i))}function que(e,t){if(e)return L(e)&&!ss(e)?e.map(n=>sE(n,t)).join(", "):e}function zE(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function td(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=kse[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(Zf(m)){const{condition:y,...b}=m,v=X(y),x=N5[p];if(x){const{vgProp:w,part:_}=x,E=[...v.map($=>{const{test:S,...M}=$;return{test:zm(null,S),...M}}),b];zE(c,_,w,E),delete c[p]}else if(x===null){const w={signal:v.map(_=>{const{test:E,...$}=_;return`${zm(null,E)} ? ${yR($)} : `}).join("")+yR(b)};c[p]=w}}else if(ee(m)){const y=N5[p];if(y){const{vgProp:b,part:v}=y;zE(c,v,b,m),delete c[p]}}ye(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},De(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:et(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&ee(c.encode.labels.update.text)&&(p=la(a,"datum.label",c.encode.labels.update.text.signal)),zE(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of D5)e.hasAxisPart(p)||delete c.encode[p];De(c.encode)&&delete c.encode}const h=que(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:et(l,0)}}}}function b4(e){const{axes:t}=e.component,n=[];for(const i of eo)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const o=i==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function Wue(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>td(r,"grid",t)),...i.map(r=>td(r,"grid",t)),...n.map(r=>td(r,"main",t)),...i.map(r=>td(r,"main",t))].filter(r=>r)}function v4(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...B(s),...B(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${Fi(s[c])} : ${Fi(a[c])}`};return l}return t[r]})])}function Hue(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:t5(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=ee(n)?"axisOrient":`axis${Lf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:v4(a,i,e,n),vgAxisConfig:v4(u,i,e,n),axisConfigStyle:Gue([...u,...a],i)}}function Gue(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=X(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function BE(e,t,n,i={}){var o;const r=vR(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=i[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const x4={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??Vue(n,e),gridScale:({model:e,channel:t})=>Yue(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||E4(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||w4(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Kue(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Zue(t.type,n,q(t)&&!!t.timeUnit,q(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??Que({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:ele,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=_4(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return wR(r?[w5(r)]:[],q(s)?[w5(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>tle(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??nle(n,t)};function Vue(e,t){return!vt(e)&&q(t)&&!ze(t==null?void 0:t.bin)&&!Ct(t==null?void 0:t.bin)}function Yue(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Xue(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return ee(o)?o:If(o);{const{configValue:s}=BE("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?If(s):n===We&&ye([Ww,qw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function UE(e){return`(((${e.signal} % 360) + 360) % 360)`}function w4(e,t,n,i){if(e!==void 0)if(n==="x"){if(ee(e)){const r=UE(e),o=ee(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ee(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(ee(e)){const r=UE(e),o=ee(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ee(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function E4(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,o=i?"bottom":"left";if(ee(e)){const s=UE(e),a=ee(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${r?`(${s} + 90)`:s} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${s} && ${s} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ee(t)){const s=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${s} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===o)?"left":"right"}function Kue(e,t){if(t==="x"&&ye(["quantitative","temporal"],e))return!0}function Zue(e,t,n,i){if(n&&!Y(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Jue(e){return e==="x"?"bottom":"left"}function Que({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!vt(t)&&t!=="log"){if(q(e)){if(ze(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ye(["month","hours","day","quarter"],(r=bt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function ele({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=VR(n);if(i)return{signal:i}}}}function _4(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,s=r?r.title:void 0;if(o&&s)return ER(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function tle(e,t){const n=e.values;if(L(n))return O5(t,n);if(ee(n))return n}function nle(e,t){return e==="rect"&&vm(t)?1:0}class yl extends Te{clone(){return new yl(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=g4(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Ea(i)&&x5(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${KR({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new yl(t,{calculate:u,as:bl(i,r,{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 ${be(this.transform)}`}}function bl(e,t,n){return V(e,{prefix:t,suffix:"sort_index",...n})}function Bm(e,t){return ye(["top","bottom"],t)?"column":ye(["left","right"],t)||e==="row"?"row":"column"}function vl(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return et((t||{})[e],r[e],n.header[e])}function Um(e,t,n,i){const r={};for(const o of e){const s=vl(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const jE=["row","column"],qE=["header","footer"];function ile(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=Um(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Bm(t,a),l=If(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...S4(l,u),...$4(u,l,o),...A4(i,r,t,Yse,e6)}}}function $4(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=E4(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function S4(e,t){const n=w4(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function rle(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of qE)if(n[r])for(const o of n[r]){const s=sle(e,t,r,n,o);s!=null&&i.push(s)}return i}function ole(e,t){const{sort:n}=e;return io(n)?{field:V(n,{expr:"datum"}),order:n.order??"ascending"}:L(n)?{field:bl(e,t,{expr:"datum"}),order:"ascending"}:{field:V(e,{expr:"datum"}),order:n??"ascending"}}function WE(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=Um(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=tE({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Bm(t,a);return{text:{signal:u?la(la(u,"datum.label",l),"datum.value",V(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...S4(o,c),...$4(c,o,s),...A4(n,e,t,Xse,t6)}}function sle(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i,a=e.config?e.config:void 0;if(s&&r.labels){const{labelOrient:f}=Um(["labelOrient"],s.header,a,t);(t==="row"&&!ye(["top","bottom"],f)||t==="column"&&!ye(["left","right"],f))&&(o=WE(s,t,a))}const u=Un(e)&&!Vf(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:ole(s,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const ale={column:{start:0,end:1},row:{start:1,end:0}};function ule(e,t){return ale[t][e]}function lle(e,t){const n={};for(const i of si){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=Um(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=Bm(i,s),u=ule(o,a);u!==void 0&&(n[a]=u)}}return De(n)?void 0:n}function A4(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=vl(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function HE(e){return[...jm(e,"width"),...jm(e,"height"),...jm(e,"childWidth"),...jm(e,"childHeight")]}function jm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(vt(s)&&pa(a)){const u=e.scaleName(n);return Un(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[k4(u,a)]:[k4(u,a),{name:r,update:C4(u,o,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const o=r.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=xE(e.config.view,o?"width":"height"),u=`isFinite(${s}) ? ${s} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function k4(e,t){const n=`${e}_step`;return ee(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function C4(e,t,n){const i=t.get("type"),r=t.get("padding"),o=et(t.get("paddingOuter"),r);let s=t.get("paddingInner");return s=i==="band"?s!==void 0?s:r:1,`bandspace(${n}, ${Fi(s)}, ${Fi(o)}) * ${e}_step`}function M4(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function F4(e,t){return B(e).reduce((n,i)=>({...n,...pl({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ue(r.value),invalidValueRef:void 0})}),{})}function T4(e,t){if(Un(t))return e==="theta"?"independent":"shared";if(_l(t))return"shared";if(a_(t))return tt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function GE(e,t){const n=e.scale[t],i=tt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(Vre(t)),"independent"):e[i][t]||"shared"}const cle={...Zse,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},O4=B(cle);class fle extends so{}const N4={symbols:dle,gradient:hle,labels:ple,entries:gle};function dle(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:u,mark:l}=n,c=s.filled&&l!=="trail";let f={...rre({},n,Zoe),...Y6(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?D4(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===$n)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ue(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ue(g??1));else if(L(f.fill)){const m=VE(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ue(m))}}if(f.stroke){if(i==="stroke"||!c&&i===$n)delete f.stroke;else if(U(f.stroke,"field")||p)delete f.stroke;else if(L(f.stroke)){const m=et(VE(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Qr){const m=q(t)&&P4(n,r,t);m?f.opacity=[{test:m,...Ue(g??1)},Ue(u.legend.unselectedOpacity)]:g&&(f.opacity=Ue(g))}return f={...f,...e},De(f)?void 0:f}function hle(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:o,encoding:s}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?D4(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ue(l)),a={...a,...e},De(a)?void 0:a}function ple(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?P4(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;wa(c)?f=Oi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:s}):l===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&q(t)&&t.timeUnit===void 0&&(f=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return De(d)?void 0:d}function gle(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function D4(e){return R4(e,(t,n)=>Math.max(t,n.value))}function VE(e){return R4(e,(t,n)=>et(t,n.value))}function R4(e,t){if(gse(e))return X(e.condition).reduce(t,e.value);if(Ni(e))return e.value}function P4(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=H(n.field);return i.map(o=>`(!length(data(${H(qe(o)+Sa)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const L4={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return g5(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return m5(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Ele(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??_le(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??yle(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>ul(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(tl(n)&&mr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>mle(t,e)};function mle(e,t){const n=e.values;if(L(n))return O5(t,n);if(ee(n))return n}function yle(e,t,n,i){if(t!=="shape"){const r=VE(n)??i;if(r)return r}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"}}function ble(e){const{legend:t}=e;return et(t.type,vle(e))}function vle({channel:e,timeUnit:t,scaleType:n}){if(tl(e)){if(ye(["quarter","month","day"],t))return"symbol";if(mr(n))return"gradient"}return"symbol"}function xle({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??wle(n,t)}function wle(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Ele({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(mr(r))return n==="horizontal"?i==="top"||i==="bottom"?I4(t,"width",s,o):s:I4(t,"height",u,a)}function I4(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function _le(e){if(ye(["quantile","threshold","log","symlog"],e))return"greedy"}function z4(e){const t=Ge(e)?$le(e):Cle(e);return e.component.legends=t,t}function $le(e){const{encoding:t}=e,n={};for(const i of[$n,...i6]){const r=lt(t[i]);!r||!e.getScaleComponent(i)||i===Sn&&q(r)&&r.type===rl||(n[i]=kle(e,i))}return n}function Sle(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Ale(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function kle(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new fle({},Sle(e,t));Pue(e,t,a);const u=n!==void 0?!n:s.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=lt(r[t]),f=q(c)?(x=bt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||o.legend.orient||"right",h=ble({legend:n,channel:t,timeUnit:f,scaleType:l}),p=xle({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:p};for(const w of O4){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in L4?L4[w](g):n[w];if(_!==void 0){const E=Ale(_,w,n,e.fieldDef(t));(E||o.legend[w]===void 0)&&a.set(w,_,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=F4(m[w]??{},e),E=w in N4?N4[w](_,v):_;E!==void 0&&!De(E)&&(b[w]={...y!=null&&y.length&&q(c)?{name:`${qe(c.field)}_legend_${w}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return De(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function Cle(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){z4(i);for(const r of B(i.component.legends))n.legend[r]=GE(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=B4(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of B(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function B4(e,t){var o,s,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of O4){const c=cs(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return Mle(f,d);case"title":return _R(f,d);case"type":return r=!0,Bn("symbol")}return Tm(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&Xg(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Xg(e.explicit,["encode","gradient"])),e}function Mle(e,t){return t.value==="circle"?t:e}function Fle(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function U4(e){const t=e.component.legends,n={};for(const r of B(t)){const o=e.getScaleComponent(r),s=Re(o.get("domains"));if(n[s])for(const a of n[s])B4(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return kt(n).flat().map(r=>Tle(r,e.config)).filter(r=>r!==void 0)}function Tle(e,t){var s,a,u;const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const l=o.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!o.stroke&&(l.stroke={value:"transparent"});for(const c of i6)o[c]&&delete l[c]}if(o.title||delete o.title,i!==void 0){let l=i;(u=(a=o.encode)==null?void 0:a.labels)!=null&&u.update&&ee(o.encode.labels.update.text)&&(l=la(i,"datum.label",o.encode.labels.update.text.signal)),Fle(o,"labels","text",{signal:l})}return o}}function Ole(e){return _l(e)||a_(e)?Nle(e):j4(e)}function Nle(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),j4(e))}function j4(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const u=ee(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ye(s,u)||s.push(u),s},[]);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}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Dle=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class q4 extends so{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function W4(e){e.component.projection=Ge(e)?Rle(e):Ile(e)}function Rle(e){if(e.hasProjection){const t=Mt(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Ple(e):void 0,o=new q4(e.projectionName(!0),{...Mt(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function Ple(e){const t=[],{encoding:n}=e;for(const i of[[Ci,ki],[oi,Mi]])(lt(n[i[0]])||lt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Sn)&&e.typedFieldDef(Sn).type===rl&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ze.Main)),t}function Lle(e,t){const n=dw(Dle,r=>!!(!Z(e.explicit,r)&&!Z(t.explicit,r)||Z(e.explicit,r)&&Z(t.explicit,r)&&In(e.get(r),t.get(r))));if(In(e.size,t.size)){if(n)return e;if(In(e.explicit,{}))return t;if(In(t.explicit,{}))return e}return null}function Ile(e){if(e.children.length===0)return;let t;for(const i of e.children)W4(i);const n=dw(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=Lle(t,r);return o&&(t=o),!!o}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new q4(i,t.specifiedProjection,t.size,ue(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&r.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),i),s.merged=!0)}return r}}function zle(e,t,n,i){if(Kf(t,n)){const r=Ge(e)?e.axis(n)??e.legend(n)??{}:{},o=V(t,{expr:"datum"}),s=V(t,{expr:"datum",binSuffix:"end"});return{formulaAs:V(t,{binSuffix:"range",forAs:!0}),formula:Gf(o,s,r.format,r.formatType,i)}}return{}}function H4(e,t){return`${dR(e)}_${t}`}function Ble(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function YE(e,t,n){const i=Em(n,void 0)??{},r=H4(i,t);return e.getName(`${r}_bins`)}function Ule(e){return"as"in e}function G4(e,t,n){let i,r;Ule(e)?i=K(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[V(e,{forAs:!0}),V(e,{binSuffix:"end",forAs:!0})];const o={...Em(t,void 0)},s=H4(o,e.field),{signal:a,extentSignal:u}=Ble(n,s);if(rm(o.extent)){const c=o.extent;r=y4(n,c.param,c),delete o.extent}const l={bin:o,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:s,binComponent:l}}class Er extends Te{clone(){return new Er(null,ue(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(fn(o)&&ze(o.bin)){const{key:a,binComponent:u}=G4(o,o.bin,n);r[a]={...u,...r[a],...zle(n,o,s,n.config)}}return r},{});return De(i)?null:new Er(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=G4(n,n.bin,i);return new Er(t,{[r]:o})}merge(t,n){for(const i of B(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ur([...this.bins[i].as,...t.bins[i].as],be)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(kt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(kt(this.bins).map(t=>t.field))}hash(){return`Bin ${be(this.bins)}`}assemble(){return kt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:ii(t.field),as:i,signal:t.signal,...rm(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:ii(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:V({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function jle(e,t,n,i){var o;const r=Ge(i)?i.encoding[dr(t)]:void 0;if(fn(n)&&Ge(i)&&_5(n,r,i.markDef,i.config)){e.add(V(n,{})),e.add(V(n,{suffix:"end"}));const{mark:s,markDef:a,config:u}=i,l=us({fieldDef:n,markDef:a,config:u});Wf(s)&&l!==.5&&tt(t)&&(e.add(V(n,{suffix:Om})),e.add(V(n,{suffix:Nm}))),n.bin&&Kf(n,t)&&e.add(V(n,{binSuffix:"range"}))}else if(iR(t)){const s=nR(t);e.add(i.getName(s))}else e.add(V(n));return Ea(n)&&Ioe((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function qle(e,t){for(const n of B(t)){const i=t[n];for(const r of B(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Pi extends Te{clone(){return new Pi(null,new Set(this.dimensions),ue(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(s=>{s.aggregate&&(i=!0)});const r={},o=new Set;return!i||(n.forEachFieldDef((s,a)=>{const{aggregate:u,field:l}=s;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([V(s,{forAs:!0})]);else{if(to(u)||os(u)){const c=to(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([V({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([V(s,{forAs:!0})]);hr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([V({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([V({field:l,aggregate:"max"},{forAs:!0})]))}else jle(o,a,s,n)}),o.size+B(r).length===0)?null:new Pi(t,o,r)}static makeFromTransform(t,n){var i;const r=new Set,o={};for(const s of n.aggregate){const{op:a,field:u,as:l}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([l||V(s,{forAs:!0})])):(o[u]??(o[u]={}),(i=o[u])[a]??(i[a]=new Set),o[u][a].add(l||V(s,{forAs:!0}))))}for(const s of n.groupby??[])r.add(s);return r.size+B(o).length===0?null:new Pi(t,r,o)}merge(t){return VD(this.dimensions,t.dimensions)?(qle(this.measures,t.measures),!0):(loe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...B(this.measures)])}producedFields(){const t=new Set;for(const n of B(this.measures))for(const i of B(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${be({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of B(this.measures))for(const s of B(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:ii(o));return{type:"aggregate",groupby:[...this.dimensions].map(ii),ops:t,fields:n,as:i}}}class xl extends Te{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of si){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[V(s),...ze(a)?[V(s,{binSuffix:"end"})]:[]],...io(u)?{sortField:u}:L(u)?{sortIndexField:bl(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of si)this[n]&&(t+=` ${n.charAt(0)}:${be(this[n])}`);return t}get fields(){var n;const t=[];for(const i of si)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of si)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of eo){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(vt(r)&&pa(o)){const s=Wm(this.childModel,n),a=o_(s);a?t[n]=a:j(Fw(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];r&&i&&i[r]&&(n?(o.push(`distinct_${i[r]}`),s.push("max")):(o.push(i[r]),s.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=gm,field:f}=u;o.push(f),s.push(c),a.push(V(u,{forAs:!0}))}else l&&(o.push(l),s.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const l of jE){for(const c of qE){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:o,facet:s}=this;if(r&&o&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Xr,Yr])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function V4(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Wle(e,t){const n=mw(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=V4(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=V4(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(bre(t)),null}function Hle(e){const t={};return Yg(e.filter,n=>{if(XR(n)){let i=null;Pw(n)?i=zn(n.equal):Iw(n)?i=zn(n.lte):Lw(n)?i=zn(n.lt):zw(n)?i=zn(n.gt):Bw(n)?i=zn(n.gte):Uw(n)?i=n.range[0]:jw(n)&&(i=(n.oneOf??n.in)[0]),i&&(ga(i)?t[n.field]="date":_e(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Gle(e){const t={};function n(i){cl(i)?t[i.field]="date":i.type==="quantitative"&&Kie(i.aggregate)?t[i.field]="number":Ju(i.field)>1?i.field in t||(t[i.field]="flatten"):Ea(i)&&io(i.sort)&&Ju(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ge(e)||Un(e))&&e.forEachFieldDef((i,r)=>{if(fn(i))n(i);else{const o=da(r),s=e.fieldDef(o);n({...i,type:s.type})}}),Ge(e)){const{mark:i,markDef:r,encoding:o}=e;if(as(i)&&!e.encoding.order){const s=r.orient==="horizontal"?"y":"x",a=o[s];q(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Vle(e){const t={};if(Ge(e)&&e.component.selection)for(const n of B(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Ju(r.field)>1&&(t[r.field]="flatten")}return t}class Vt extends Te{clone(){return new Vt(null,ue(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${be(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!fs(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of B(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(FR(a,i[a],u.value)))}for(const a of B(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(FR(a,n[a],u)))}const o=new so(n,i);r.copyAll(o);const s={};for(const a of B(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return B(s).length===0||r.parseNothing?null:new Vt(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of B(this._parse)){const i=this._parse[n];Ju(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(B(this._parse))}dependentFields(){return new Set(B(this._parse))}assembleTransforms(t=!1){return B(this._parse).filter(n=>t?Ju(n)>1:!0).map(n=>{const i=Wle(n,this._parse[n]);return i?{type:"formula",expr:i,as:Zu(n)}:null}).filter(n=>n!==null)}}class hs extends Te{clone(){return new hs(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Ri])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ri}}}class nd extends Te{clone(){return new nd(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${be(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class id extends Te{clone(){return new id(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${be(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class ka extends Te{constructor(t){super(null),t??(t={name:"source"});let n;if(fs(t)||(n=t.format?{..._n(t.format,["parse"])}:{}),Jf(t))this._data={values:t.values};else if(dl(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ye(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else D6(t)?this._data={values:[{type:"Sphere"}]}:(O6(t)||fs(t))&&(this._data={});this._generator=fs(t),t.name&&(this._name=t.name),n&&!De(n)&&(this._data.format=n)}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 Y4=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Yle=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},rd;function XE(e){return e instanceof ka||e instanceof nd||e instanceof id}class KE{constructor(){rd.set(this,void 0),Y4(this,rd,!1,"f")}setModified(){Y4(this,rd,!0,"f")}get modifiedFlag(){return Yle(this,rd,"f")}}rd=new WeakMap;class Ca extends KE{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,o)=>o[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class ZE extends KE{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Xle extends ZE{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of B(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Kle extends ZE{constructor(t){super(),this.requiresSelectionId=t&&LE(t)}run(t){t instanceof hs&&(this.requiresSelectionId&&(XE(t.parent)||t.parent instanceof Pi||t.parent instanceof Vt)||(this.setModified(),t.remove()))}}class Zle extends KE{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof wr&&(i=t.producedFields(),hw(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class Jle extends ZE{constructor(){super()}run(t){t instanceof kn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Qle extends Ca{run(t){if(!XE(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Vt)if(t instanceof Vt)this.setModified(),t.merge(n);else{if(gw(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class ece extends Ca{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Vt);if(t.numChildren()>1&&i.length>=1){const r={},o=new Set;for(const s of i){const a=s.parse;for(const u of B(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!De(r)){this.setModified();const s=new Vt(t,r);for(const a of n){if(a instanceof Vt)for(const u of B(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof Vt&&B(a.parse).length===0&&a.remove()}}}}}class tce extends Ca{run(t){t instanceof kn||t.numChildren()>0||t instanceof xl||t instanceof ka||(this.setModified(),t.remove())}}class nce extends Ca{run(t){const n=t.children.filter(r=>r instanceof wr),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class ice extends Ca{run(t){const n=t.children.filter(r=>r instanceof Pi),i={};for(const r of n){const o=be(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of B(i)){const o=i[r];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class rce extends Ca{constructor(t){super(),this.model=t}run(t){const n=!(XE(t)||t instanceof ml||t instanceof Vt||t instanceof hs),i=[],r=[];for(const o of t.children)o instanceof Er&&(n&&!gw(t.producedFields(),o.dependentFields())?i.push(o):r.push(o));if(i.length>0){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Er?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(r.length>1){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class oce extends Ca{run(t){const n=[...t.children];if(!Ku(n,s=>s instanceof kn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof kn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof kn)a=u;else break}r.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else r.push(s);if(r.length){this.setModified();for(const s of r)s.parent.removeChild(s),s.parent=o}}}class Ma extends Te{clone(){return new Ma(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`JoinAggregateTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const o of this.transform.joinaggregate)n.push(o.op),i.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class wl extends Te{clone(){return new wl(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:o}=n,{marks:s,scales:a}=i;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=hr(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=Jw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:im(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return B(u).length?new wl(t,u):null}dependentFields(){return new Set(B(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${be(this.filter)}`}assemble(){const t=B(this.filter).reduce((n,i)=>{const r=this.filter[i],o=V(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${JE(o)}))`):r.type==="quantitative"&&n.push(JE(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function JE(e){return`isValid(${e}) && isFinite(+${e})`}function sce(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=V(i);return r&&t.push(r),t},[])}function ace(e){return L(e)&&e.every(t=>K(t))&&e.length>1}class lo extends Te{clone(){return new lo(null,ue(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:o,offset:s="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(et(f.order,"ascending"));const l={field:a,order:u};let c;return ace(o)?c=o:K(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new lo(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:s,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:u}=i,l=o.map(h=>{const p=r[h];return Di(p)}).filter(h=>!!h),c=sce(n),f=n.encoding.order;let d;if(L(f)||q(f))d=xR(f);else{const h=$5(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new lo(t,{dimensionFieldDefs:l,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{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 ${be(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[V(r,{binSuffix:"mid"})]:[V(r,{}),V(r,{binSuffix:"end"})]:[V(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:o,sort:s,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=V(c,{expr:"datum"}),p=V(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${JE(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:V(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:V(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:s,as:l,offset:a}),t}}class El extends Te{clone(){return new El(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`WindowTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>Aw(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function uce(e){function t(n){if(!(n instanceof xl)){const i=n.clone();if(i instanceof kn){const r=e_+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Pi||i instanceof lo||i instanceof El||i instanceof Ma)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function QE(e){if(e instanceof xl)if(e.numChildren()===1&&!(e.children[0]instanceof kn)){const t=e.children[0];(t instanceof Pi||t instanceof lo||t instanceof El||t instanceof Ma)&&t.addDimensions(e.fields),t.swapWithParent(),QE(e)}else{const t=e.model.component.data.main;X4(t);const n=uce(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(QE)}function X4(e){if(e instanceof kn&&e.type===Ze.Main&&e.numChildren()===1){const t=e.children[0];t instanceof xl||(t.swapWithParent(),X4(e))}}const e_="scale_",qm=5;function t_(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!t_(t.children))return!1}return!0}function Li(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function K4(e,t,n){let i=e.sources,r=!1;return r=Li(new Jle,i)||r,r=Li(new Kle(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=Li(new tce,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=Li(new Qle,i)||r,r=Li(new rce(t),i)||r,r=Li(new Zle,i)||r,r=Li(new ece,i)||r,r=Li(new ice,i)||r,r=Li(new nce,i)||r,r=Li(new Xle,i)||r,r=Li(new oce,i)||r),e.sources=i,r}function lce(e,t){t_(e.sources);let n=0,i=0;for(let r=0;r<qm&&K4(e,t,!0);r++)n++;e.sources.map(QE);for(let r=0;r<qm&&K4(e,t,!1);r++)i++;t_(e.sources),Math.max(n,i)===qm&&j(`Maximum optimization runs(${qm}) reached.`)}class xt{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new xt(()=>t(n))}}function Z4(e){Ge(e)?cce(e):fce(e)}function cce(e){const t=e.component.scales;for(const n of B(t)){const i=hce(e,n);if(t[n].setWithExplicit("domains",i),gce(e,n),e.component.data.isFaceted){let o=e;for(;!Un(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of i.value)no(a)&&(a.data=e_+a.data.replace(e_,""))}}}function fce(e){for(const n of e.children)Z4(n);const t=e.component.scales;for(const n of B(t)){let i,r=null;for(const o of e.children){const s=o.component.scales[n];if(s){i===void 0?i=s.getWithExplicit("domains"):i=cs(i,s.getWithExplicit("domains"),"domains","scale",r_);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(pre),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function dce(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=J4(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=J4(t,n);if(r)return"unaggregated"}return e}function hce(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=dce(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&lt(i.x2)?lt(i.x)?cs(ps(n,r,e,"x"),ps(n,r,e,"x2"),"domain","scale",r_):ps(n,r,e,"x2"):t==="y"&&lt(i.y2)?lt(i.y)?cs(ps(n,r,e,"y"),ps(n,r,e,"y2"),"domain","scale",r_):ps(n,r,e,"y2"):ps(n,r,e,t)}function pce(e,t,n){return e.map(i=>({signal:`{data: ${_m(i,{timeUnit:n,type:t})}}`}))}function n_(e,t,n){var r;const i=(r=bt(n))==null?void 0:r.unit;return t==="temporal"||i?pce(e,t,i):[e]}function ps(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=lt(r[i]),{type:c}=l,f=l.timeUnit,d=uue({invalid:pr("invalid",o,a),isPath:as(s)});if(Loe(t)){const g=ps(e,void 0,n,i),m=n_(t.unionWith,c,f);return xr([...m,...g.value])}else{if(ee(t))return xr([t]);if(t&&t!=="unaggregated"&&!i5(t))return xr(n_(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Bn([[0,1]]);const g=n.requestDataName(d);return Bn([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=hr(i)&&q(l)?mce(n,i,e):void 0;if(br(l)){const g=n_([l.datum],c,f);return Bn(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Bn([{data:n.requestDataName(d),field:V({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:V({field:g,aggregate:"max"})}])}else if(ze(p.bin)){if(vt(e))return Bn(e==="bin-ordinal"?[]:[{data:Rf(h)?n.requestDataName(d):n.requestDataName(Ze.Raw),field:n.vgField(i,Kf(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!Y(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(ze(g)){const m=YE(n,p.field,g);return Bn([new xt(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Bn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&ye(["time","utc"],e)){const g=r[dr(i)];if(_5(p,g,o,a)){const m=n.requestDataName(d),y=us({fieldDef:p,fieldDef2:g,markDef:o,config:a}),b=Wf(s)&&y!==.5&&tt(i);return Bn([{data:m,field:n.vgField(i,b?{suffix:Om}:{})},{data:m,field:n.vgField(i,{suffix:b?Nm:"end"})}])}}return Bn(h?[{data:Rf(h)?n.requestDataName(d):n.requestDataName(Ze.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function i_(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":gm),...i?{field:ii(i)}:{},...r?{order:r}:{}}}function gce(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,o=i5(i)?i:void 0,s=ha(r)&&rm(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function mce(e,t,n){if(!vt(n))return;const i=e.fieldDef(t),r=i.sort;if(x5(r))return{op:"min",field:bl(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(io(r)){const a=o&&!s.has(r.field);return i_(r,a)}else if(dse(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(to(c)||os(c))return i_({field:V(l),order:u},d);if(Aw(c)||!c)return i_({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ye(["ascending",void 0],r))return!0}}function J4(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!Jie.has(n)?{valid:!1,reason:Bre(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Ure(e)}:{valid:!0}:{valid:!1,reason:zre(e)}}function r_(e,t,n,i){return e.explicit&&t.explicit&&j(Gre(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function yce(e){const t=ur(e.map(s=>{if(no(s)){const{sort:a,...u}=s;return u}return s}),be),n=ur(e.map(s=>{if(no(s)){const a=s.sort;return a!==void 0&&!Rf(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),be);if(t.length===0)return;if(t.length===1){const s=e[0];if(no(s)&&n.length>0){let a=n[0];if(n.length>1){j(PR);const u=n.filter(l=>Y(l)&&"op"in l&&l.op!=="min");n.every(l=>Y(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Y(a)&&"field"in a){const u=a.field;s.field===u&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const i=ur(n.map(s=>Rf(s)||!("op"in s)||K(s.op)&&Z(Yie,s.op)?s:(j(Yre(s)),!0)),be);let r;i.length===1?r=i[0]:i.length>1&&(j(PR),r=!0);const o=ur(e.map(s=>no(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function o_(e){if(no(e)&&K(e.field))return e.field;if(Qie(e)){let t;for(const n of e.fields)if(no(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(Xre),t}return j(Kre),t}else if(ere(e)){j(Zre);const t=e.fields[0];return K(t)?t:void 0}}function Wm(e,t){const i=e.component.scales[t].get("domains").map(r=>(no(r)&&(r.data=e.lookupDataSource(r.data)),r));return yce(i)}function Q4(e){return _l(e)||a_(e)?e.children.reduce((t,n)=>t.concat(Q4(n)),eP(e)):eP(e)}function eP(e){return B(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:s,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=bce(r.range,o,n,e),h=Wm(e,n),p=a?pue(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function bce(e,t,n,i){if(tt(n)){if(pa(e))return{step:{signal:`${t}_step`}}}else if(Y(e)&&no(e))return{...e,data:i.lookupDataSource(e.data)};return e}class tP extends so{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ye([Ft.LOG,Ft.TIME,Ft.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ye([Ft.LINEAR,Ft.SQRT,Ft.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,o=!1,s=!1;for(const a of i){if(L(a)){const u=a[0],l=a[a.length-1];if(_e(u)&&_e(l))if(u<=0&&l>=0){r=!0;continue}else{o=!0;continue}}s=!0}if(r)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const vce=["range","scheme"];function xce(e){const t=e.component.scales;for(const n of $w){const i=t[n];if(!i)continue;const r=wce(n,e);i.setWithExplicit("range",r)}}function nP(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=An(t),s=e.getName(o);if(Y(i)&&i.binned&&i.step!==void 0)return new xt(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(s)} / (${u})`});if(ze(i)){const a=YE(e,r,i);return new xt(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function wce(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of vce)if(n[f]!==void 0){const d=Gw(o,f),h=r5(e,f);if(!d)j(DR(o,f,e));else if(h)j(h);else switch(f){case"range":{const p=n.range;if(L(p)){if(tt(e))return xr(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return xt.fromName(y,m)}return g}))}else if(Y(p))return xr({data:t.requestDataName(Ze.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return xr(p)}case"scheme":return xr(Ece(n[f]))}}const s=e===We||e==="xOffset"?"width":"height",a=i[s];if(vr(a)){if(tt(e))if(vt(o)){const f=rP(a,t,e);if(f)return xr({step:f})}else j(RR(s));else if(Uf(e)){const f=e===Qo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=oP(a,o);if(p)return xr(p)}}}const{rangeMin:u,rangeMax:l}=n,c=_ce(e,t);return(u!==void 0||l!==void 0)&&Gw(o,"rangeMin")&&L(c)&&c.length===2?xr([u??c[0],l??c[1]]):Bn(c)}function Ece(e){return Poe(e)?{scheme:e.name,..._n(e,["name"])}:{scheme:e}}function iP(e,t,n,{center:i}={}){const r=An(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===yt&&Ti(n)?i?[xt.fromName(a=>`${s(a)}/2`,o),xt.fromName(a=>`-${s(a)}/2`,o)]:[xt.fromName(s,o),0]:i?[xt.fromName(a=>`-${s(a)}/2`,o),xt.fromName(a=>`${s(a)}/2`,o)]:[0,xt.fromName(s,o)]}function _ce(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=lt(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case We:case yt:{if(ye(["point","band"],u)){const f=sP(e,n,i.view);if(vr(f))return{step:rP(f,t,e)}}return iP(e,t,u)}case Qo:case Qu:return $ce(e,t,u);case Jr:{const f=kce(r,i),d=Cce(r,n,t,i);return ol(u)?Ace(f,d,Sce(u,i,l,e)):[f,d]}case ri:return[0,Math.PI*2];case ca:return[0,360];case Ai:return[0,new xt(()=>{const f=t.getSignalName(Un(t.parent)?"child_width":"width"),d=t.getSignalName(Un(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case ns:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case is:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Sn:return"symbol";case $n:case cr:case fr:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Qr:case es:case ts:return[i.scale.minOpacity,i.scale.maxOpacity]}}function rP(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=xw(n),s=i[o];if(o6({step:e,offsetIsDiscrete:le(s)&&ZR(s.type)})==="offset"&&I5(i,o)){const u=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${ire(f)})`}}else return e.step}function oP(e,t){if(o6({step:e,offsetIsDiscrete:vt(t)})==="offset")return{step:e.step}}function $ce(e,t,n){const i=e===Qo?"x":"y",r=t.getScaleComponent(i);if(!r)return iP(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=sP(i,t.size,t.config.view);if(vr(l)){const c=oP(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=VR(l.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=us({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=ee(f)?`${f.signal}/2`+h:`${f/2+d}`,g=ee(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return HD(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function sP(e,t,n){const i=e===We?"width":"height",r=t[i];return r||Mm(n,i)}function Sce(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&L(n)?n.length+1:(j(soe(i)),3)}}function Ace(e,t,n){const i=()=>{const r=Fi(t),o=Fi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return ee(t)?new xt(i):{signal:i()}}function kce(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(om("size",e))}const aP=.95;function Cce(e,t,n,i){const r={x:nP(n,"x"),y:nP(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=uP(t,r,i.view);return _e(o)?o-1:new xt(()=>`${o.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 o=uP(t,r,i.view);return _e(o)?Math.pow(aP*o,2):new xt(()=>`pow(${aP} * ${o.signal}, 2)`)}}throw new Error(om("size",e))}function uP(e,t,n){const i=vr(e.width)?e.width.step:wE(n,"width"),r=vr(e.height)?e.height.step:wE(n,"height");return t.x||t.y?new xt(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function lP(e,t){Ge(e)?Mce(e,t):dP(e,t)}function Mce(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of B(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=lt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Gw(h,t),y=r5(a,t);if(d!==void 0&&(m?y&&j(y):j(DR(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ga(u[t])||v==="temporal"||b?l.set(t,{signal:_m(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(cP,t)?cP[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:z5(r,a),hasSecondaryRangeChannel:!!r[dr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const cP={bins:({model:e,fieldOrDatumDef:t})=>q(t)?Fce(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Tce(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>Oce(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Nce(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>Dce(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>Rce(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=q(e)?e.sort:void 0;return Pce(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>Lce(e,t,n,i,r,o.scale,s)};function fP(e){Ge(e)?xce(e):dP(e,"range")}function dP(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?fP(i):lP(i,t);for(const i of B(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=cs(r,a,t,"scale",T6((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Fce(e,t){const n=t.bin;if(ze(n)){const i=YE(e,t.field,n);return new xt(()=>e.getSignalName(i))}else if(Ct(n)&&ha(n)&&n.step!==void 0)return{step:n.step}}function Tce(e,t){if(ye([$n,cr,fr],e)&&t!=="nominal")return"hcl"}function Oce(e,t,n,i,r,o){var s;if(!((s=Di(o))!=null&&s.bin||L(n)||r!=null||i!=null||ye([Ft.TIME,Ft.UTC],e)))return tt(t)?!0:void 0}function Nce(e,t,n,i,r,o){if(tt(e)){if(mr(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=r;if(s==="bar"&&!(q(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Ft.POINT)return n.pointPadding}}function Dce(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return o?c:et(s,n==="bar"?a:n==="tick"?l:u)}else if(Uf(t)&&i===Ft.BAND)return r.offsetBandPaddingInner}}function Rce(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=r;if(o)return a;if(n===Ft.BAND)return et(s,ee(i)?{signal:`${i.signal}/2`}:i/2)}else if(Uf(t)){if(n===Ft.POINT)return .5;if(n===Ft.BAND)return r.offsetBandPaddingOuter}}}function Pce(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ti(e)&&t==="descending"?ee(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ti(e)&&t==="descending")return!0}function Lce(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Ti(r)){if(L(n)){const u=n[0],l=n[n.length-1];if(_e(u)&&u<=0&&_e(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ol(r))return!0;if(!(q(t)&&t.bin)&&ye([...eo,...Bie],e)){const{orient:u,type:l}=i;return ye(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ye(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function Ice(e,t,n,i,r=!1){const o=zce(t,n,i,r),{type:s}=e;return hr(t)?s!==void 0?qoe(t,s)?q(n)&&!joe(s,n.type)?(j(Wre(s,o)),o):s:(j(qre(t,s,o)),o):o:null}function zce(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(tl(e)||Sw(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(Ow(e,"ordinal")),"ordinal";if(tt(e)||Uf(e)){if(ye(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in _w)return"band";const o=n[An(e)];return va(o)||al(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return tl(e)?"time":Sw(e)==="discrete"?(j(Ow(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&bt(t.timeUnit).utc?"utc":"time";case"quantitative":return tl(e)?q(t)&&ze(t.bin)?"bin-ordinal":"linear":Sw(e)==="discrete"?(j(Ow(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(OR(t.type))}function Bce(e,{ignoreRange:t}={}){hP(e),Z4(e);for(const n of Uoe)lP(e,n);t||fP(e)}function hP(e){Ge(e)?e.component.scales=Uce(e):e.component.scales=qce(e)}function Uce(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of $w){const s=lt(t[o]);if(s&&n===a5&&o===Sn&&s.type===rl)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=z5(t,o),l=Ice(a,o,s,i,u);r[o]=new tP(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const jce=T6((e,t)=>JR(e)-JR(t));function qce(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){hP(o);for(const s of B(o.component.scales))if((t=r.scale)[s]??(t[s]=T4(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?Toe(a.value,u.value)?i[s]=cs(a,u,"type","scale",jce):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of B(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new tP(s,a);for(const u of e.children){const l=u.component.scales[o];l&&(u.renameScale(l.get("name"),s),l.merged=!0)}}return n}class s_{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ge(e){return(e==null?void 0:e.type)==="unit"}function Un(e){return(e==null?void 0:e.type)==="facet"}function a_(e){return(e==null?void 0:e.type)==="concat"}function _l(e){return(e==null?void 0:e.type)==="layer"}class u_{constructor(t,n,i,r,o,s,a){this.type=n,this.parent=i,this.config=o,this.correctDataNames=u=>{var l,c,f;return(l=u.from)!=null&&l.data&&(u.from.data=this.lookupDataSource(u.from.data)),(f=(c=u.from)==null?void 0:c.facet)!=null&&f.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u},this.parent=i,this.config=o,this.view=Mt(a),this.name=t.name??r,this.title=ss(t.title)?{text:t.title}:t.title?Mt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new s_,this.projectionNameMap=i?i.projectionNameMap:new s_,this.signalNameMap=i?i.signalNameMap:new s_,this.data=t.data,this.description=t.description,this.transforms=Kae(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:tae(t,n,o),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:mm(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new so,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?ue(s):{}},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(){Bce(this)}parseProjection(){W4(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){z4(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of B(i)){const s=i[o];s!==void 0&&(r[o]=Ue(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ue(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:De(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=lle(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of si)t[i].title&&n.push(ile(this,i));for(const i of jE)n=n.concat(rle(this,i));return n}assembleAxes(){return Wue(this.component.axes,this.config)}assembleLegends(){return U4(this)}assembleProjections(){return Ole(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...pR(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ye(["unit","layer"],this.type)?ye(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),De(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Un(this.parent)?Q4(this):[];r.length>0&&(n.scales=r);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return qe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ze[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Un(this.parent)){const n=M4(t),i=nm(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(vt(o)&&pa(s)){const a=r.get("name"),u=Wm(this,i),l=o_(u);if(l){const c=V({aggregate:"distinct",field:l},{expr:"datum"});return{signal:C4(a,r,c)}}else return j(Fw(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(oR(t)&&hr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}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 n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(ure(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class pP extends u_{vgField(t,n={}){const i=this.fieldDef(t);if(i)return V(i,n)}reduceFieldDef(t,n){return Ose(this.getMapping(),(i,r,o)=>{const s=Di(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){uE(this.getMapping(),(i,r)=>{const o=Di(i);o&&t(o,r)},n)}}class Hm extends Te{clone(){return new Hm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${be(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class Gm extends Te{clone(){return new Gm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${be(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class Vm extends Te{clone(){return new Vm(this.parent,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((o,s)=>r[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${be(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Ym extends Te{clone(){return new Ym(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${be(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class $l extends Te{clone(){return new $l(null,ue(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Ci,ki],[oi,Mi]]){const o=r.map(s=>{const a=lt(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:Ni(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new $l(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Sn)){const r=n.typedFieldDef(Sn);r.type===rl&&(t=new $l(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(K);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${be(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 od extends Te{clone(){return new od(null,this.projection,ue(this.fields),ue(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Ci,ki],[oi,Mi]]){const r=i.map(s=>{const a=lt(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:Ni(a)?{expr:`${a.value}`}:void 0}),o=i[0]===oi?"2":"";(r[0]||r[1])&&(t=new od(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(K))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${be(this.fields)} ${be(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Fa extends Te{clone(){return new Fa(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Fa(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,o=i.y;if(q(r)&&q(o)){const s=r.impute?r:o.impute?o:void 0;if(s===void 0)return;const a=r.impute?o:o.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=s.impute,d=j5(n.mark,i);return new Fa(t,{impute:s.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${be(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:o,value:s,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Tae(i)?this.processSequence(i):i}:{},method:"value",...o?{groupby:o}:{},value:!r||r==="value"?s:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Xm extends Te{clone(){return new Xm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${be(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class sd extends Te{clone(){return new sd(null,ue(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const o=n.component.data.sources,{from:s}=i;let a=null;if(Oae(s)){let u=bP(s.data,o);u||(u=new ka(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new kn(u,l,Ze.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Nae(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(qe(u),u)}catch{throw new Error(dre(u))}if(a=l.materialized,!a)throw new Error(hre(u))}return new sd(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?X(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${be({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:X(this.transform.as)}:{}};else{let n=this.transform.as;K(n)||(j(wre),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Km extends Te{clone(){return new Km(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${be(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Zm extends Te{clone(){return new Zm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${be(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Jm extends Te{clone(){return new Jm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${be(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:o}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...o!==void 0?{op:o}:{},...i!==void 0?{groupby:i}:{}}}}class Qm extends Te{clone(){return new Qm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${be(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function gP(e){let t=0;function n(i,r){if(i instanceof ka&&!i.isGenerator&&!dl(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Vt&&(i.parent instanceof ka&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof xl){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof nd||i instanceof id||i instanceof wl||i instanceof ml||i instanceof yl||i instanceof od||i instanceof Pi||i instanceof sd||i instanceof El||i instanceof Ma||i instanceof Ym||i instanceof Vm||i instanceof Hm||i instanceof Xm||i instanceof Km||i instanceof Zm||i instanceof hs||i instanceof Qm||i instanceof Jm||i instanceof Gm)&&r.transform.push(i.assemble()),(i instanceof Er||i instanceof wr||i instanceof Fa||i instanceof lo||i instanceof $l)&&r.transform.push(...i.assemble()),i instanceof kn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof kn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof kn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const s of i.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function Wce(e){const t=[],n=gP(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Hce(e,t){const n=[],i=gP(n);let r=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${r++}`);const a=s.assemble();i(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function Gce(e){return e==="top"||e==="left"||ee(e)?"header":"footer"}function Vce(e){for(const t of si)Yce(e,t);yP(e,"x"),yP(e,"y")}function Yce(e,t){var s;const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],u=vl("title",null,i,t);let l=ul(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=L(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=vl("labelOrient",a.header,i,t),f=a.header!==null?et((s=a.header)==null?void 0:s.labels,i.header.labels,!0):!1,d=ye(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[mP(e,t,f)]}}}function mP(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function yP(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=GE(r,t),r.axis[t]==="shared"){const o=t==="x"?"column":"row",s=i[o];for(const a of n.component.axes[t]){const u=Gce(a.get("orient"));s[u]??(s[u]=[mP(e,o,!1)]);const l=td(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function Xce(e){l_(e),e0(e,"width"),e0(e,"height")}function Kce(e){l_(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";e0(e,t),e0(e,n)}function l_(e){for(const t of e.children)t.parseLayoutSize()}function e0(e,t){const n=M4(t),i=nm(n),r=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??T4(i,e);if(l==="independent"&&u.value==="step"){s=void 0;break}if(s){if(l==="independent"&&s.value!==u.value){s=void 0;break}s=cs(s,u,n,"")}else s=u}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Zce(e){const{size:t,component:n}=e;for(const i of eo){const r=An(i);if(t[r]){const o=t[r];n.layoutSize.set(r,vr(o)?"step":o,!0)}else{const o=Jce(e,r);n.layoutSize.set(r,o,!1)}}}function Jce(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const o=r.get("type"),s=r.get("range");if(vt(o)){const a=Mm(i.view,t);return pa(s)||vr(a)?"step":a}else return xE(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return xE(i.view,t);{const o=Mm(i.view,t);return vr(o)?o.step:o}}}function c_(e,t,n){return V(t,{suffix:`by_${V(e)}`,...n})}class ad extends pP{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=g_(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Vf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=B(t),i={};for(const r of n){if(![Yr,Xr].includes(r)){j(om(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Tw(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=aE(t,n);return i.header?i.header=Mt(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return U(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=t0(this),this.child.parseData()}parseLayoutSize(){l_(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Vce(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 n of si)for(const i of qE){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=vl("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=Bm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof ad))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof ad?{...this.channelHasField("column")?{encode:{update:{columns:{field:V(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof ad){if(this.child.channelHasField("column")){const r=V(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of eo){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(vt(s)&&pa(a)){const u=Wm(this.child,r),l=o_(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(Fw(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of si){const f=this.facet[c];if(f){u.push(V(f));const{bin:d,sort:h}=f;if(ze(d)&&u.push(V(f,{binSuffix:"end"})),io(h)){const{field:p,op:g=gm}=h,m=c_(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(L(h)){const p=bl(f,c);o.push(p),s.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?io(i.sort)?[c_(i,i.sort,{expr:"datum"})]:L(i.sort)?[bl(i,t,{expr:"datum"})]:[V(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(io(r)?r.order:!L(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return WE(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of jE)if(t[o]){const s=vl("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return WE(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Wce(n),r=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:si.map(u=>this.facetSortFields(u)).flat(),order:si.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(cue(this,[]))}]}getMapping(){return this.facet}}function Qce(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(io(o.sort)){const{field:s,op:a=gm}=o.sort;e=r=new Ma(e,{joinaggregate:[{op:a,field:s,as:c_(o,o.sort,{forAs:!0})}],groupby:[V(o)]})}return r}return null}function bP(e,t){var n,i,r,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((u||f)&&u!==f)){if(Jf(e)&&Jf(a)){if(In(e.values,a.values))return s}else if(dl(e)&&dl(a)){if(e.url===a.url)return s}else if(O6(e)&&e.name===s.dataName)return s}}return null}function efe(e,t){if(e.data||!e.parent){if(e.data===null){const i=new ka({values:[]});return t.push(i),i}const n=bP(e.data,t);if(n)return fs(e.data)||(n.data.format=GD({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new ka(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function tfe(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(qae(r))s=e=new yl(e,r),o="derived";else if(AE(r)){const a=Hle(r);s=e=Vt.makeWithAncestors(e,{},a,n)??e,e=new ml(e,t,r.filter)}else if($6(r))s=e=Er.makeFromTransform(e,r,t),o="number";else if(Hae(r))o="date",n.getWithExplicit(r.field).value===void 0&&(e=new Vt(e,{[r.field]:o}),n.set(r.field,o,!1)),s=e=wr.makeFromTransform(e,r);else if(Gae(r))s=e=Pi.makeFromTransform(e,r),o="number",LE(t)&&(e=new hs(e));else if(_6(r))s=e=sd.make(e,t,r,i++),o="derived";else if(Bae(r))s=e=new El(e,r),o="number";else if(Uae(r))s=e=new Ma(e,r),o="number";else if(Vae(r))s=e=lo.makeFromTransform(e,r),o="derived";else if(Yae(r))s=e=new Ym(e,r),o="derived";else if(Xae(r))s=e=new Gm(e,r),o="derived";else if(jae(r))s=e=new Vm(e,r),o="derived";else if(Dae(r))s=e=new Jm(e,r),o="derived";else if(zae(r))e=new Qm(e,r);else if(Wae(r))s=e=Fa.makeFromTransform(e,r),o="derived";else if(Rae(r))s=e=new Hm(e,r),o="derived";else if(Pae(r))s=e=new Km(e,r),o="derived";else if(Lae(r))s=e=new Zm(e,r),o="derived";else if(Iae(r))s=e=new Xm(e,r),o="derived";else{j(xre(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function t0(e){var m;let t=efe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(fs(r)||dl(r)||Jf(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new aue;fs(r)?(N6(r)?t=new id(t,r.sequence):ME(r)&&(t=new nd(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=Vt.makeExplicit(t,e,s)??t,t=new hs(t);const a=e.parent&&_l(e.parent);(Ge(e)||Un(e))&&a&&(t=Er.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=tfe(t,e,s));const u=Vle(e),l=Gle(e);t=Vt.makeWithAncestors(t,{},{...u,...l},s)??t,Ge(e)&&(t=$l.parseAll(t,e),t=od.parseAll(t,e)),(Ge(e)||Un(e))&&(a||(t=Er.makeFromEncoding(t,e)??t),t=wr.makeFromEncoding(t,e)??t,t=yl.parseAllForSortIndex(t,e));const c=t=n0(Ze.Raw,e,t);if(Ge(e)){const y=Pi.makeFromEncoding(t,e);y&&(t=y,LE(e)&&(t=new hs(t))),t=Fa.makeFromEncoding(t,e)??t,t=lo.makeFromEncoding(t,e)??t}let f,d;if(Ge(e)){const{markDef:y,mark:b,config:v}=e,x=Pe("invalid",y,v),{marks:w,scales:_}=d=R6({invalid:x,isPath:as(b)});w!==_&&_==="include-invalid-values"&&(f=t=n0(Ze.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=wl.make(t,e,d)??t)}const h=t=n0(Ze.Main,e,t);let p;if(Ge(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=wl.make(t,e,d)??t,p=t=n0(Ze.PostFilterInvalid,e,t))}Ge(e)&&jue(e,h);let g=null;if(Un(e)){const y=e.getName("facet");t=Qce(t,e.facet)??t,g=new xl(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function n0(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new kn(n,o,e,r);return i[o]=s,s}class nfe extends u_{constructor(t,n,i,r){var o,s,a,u;super(t,"concat",n,i,r,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(yre),this.children=this.getChildren(t).map((l,c)=>g_(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=t0(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Cm(t)?t.vconcat:vE(t)?t.hconcat:t.concat}parseLayoutSize(){Kce(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=HE(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function ife(e){return e===!1||e===null}const rfe={disable:1,gridScale:1,scale:1,...R5,labelExpr:1,encode:1},vP=B(rfe);class f_ extends so{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new f_(ue(this.explicit),ue(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!ife(this.get(t))}hasOrientSignalRef(){return ee(this.explicit.orient)}}function ofe(e,t,n){const{encoding:i,config:r}=e,o=lt(i[t])??lt(i[dr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(wa(u))return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(sl(o)==="quantitative"){if(al(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(sl(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function sfe(e){return eo.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[hfe(n,e)]),t),{})}const afe={bottom:"top",top:"bottom",left:"right",right:"left"};function ufe(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const o of B(r.component.axes))n.axis[o]=GE(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=lfe(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of eo){for(const o of e.children)if(o.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const s of o.component.axes[r]){const{value:a,explicit:u}=s.getWithExplicit("orient");if(!ee(a)){if(i[a]>0&&!u){const l=afe[a];i[a]>i[l]&&s.set("orient",l,!1)}i[a]++}}}delete o.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[o,s]of(t[r]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function lfe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],o=t[i];if(!!r!=!!o)return;if(r&&o){const s=r.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value)return;e[i]=cfe(r,o)}}}else return t.map(n=>n.clone());return e}function cfe(e,t){for(const n of vP){const i=cs(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return _R(r,o);case"gridScale":return{explicit:r.explicit,value:et(r.value,o.value)}}return Tm(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function ffe(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ee(n.labelAngle)?n.labelAngle:If(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===_4(i,r))return!0}return e===n[t]}const dfe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function hfe(e,t){var y,b;let n=t.axis(e);const i=new f_,r=lt(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=s.axis)==null?void 0:b.orient)||Jue(e),u=t.getScaleComponent(e).get("type"),l=Hue(e,u,a,t.config),c=n!==void 0?!n:BE("disable",s.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Xue(r,n,e,s.style,l),d=m5(n.formatType,r,u),h=g5(r,r.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const v of vP){const x=v in x4?x4[v](p):P5(v)?n[v]:void 0,w=x!==void 0,_=ffe(x,v,n,t,e);if(w&&_)i.set(v,x,_);else{const{configValue:E=void 0,configFrom:$=void 0}=P5(v)&&v!=="values"?BE(v,s.style,n.style,l):{},S=E!==void 0;w&&!S?i.set(v,x,_):($!=="vgAxisConfig"||dfe.has(v)&&S||Zf(E)||ee(E))&&i.set(v,E,!1)}}const g=n.encoding??{},m=D5.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const w=F4(g[x]??{},t),_=x==="labels"?ofe(t,e,w):w;return _!==void 0&&!De(_)&&(v[x]={update:_}),v},{});return De(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function pfe({encoding:e,size:t}){for(const n of eo){const i=An(n);vr(t[i])&&ls(e[n])&&(delete t[i],j(RR(i)))}return t}const gfe={vgMark:"arc",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...uo(e,"radius"),...uo(e,"theta")})},mfe={vgMark:"area",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Rm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Rm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...RE(e)})},yfe={vgMark:"rect",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y")})},bfe={vgMark:"shape",encodeEntry:e=>({...ai(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&&q(n)&&n.type===rl?{field:V(n,{expr:"datum"})}:{}}]}},vfe={vgMark:"image",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y"),...NE(e,"url")})},xfe={vgMark:"line",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e,{vgChannel:"strokeWidth"}),...RE(e)})},wfe={vgMark:"trail",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e),...RE(e)})};function d_(e,t){const{config:n}=e;return{...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e),...Tt("angle",e),...Efe(e,n,t)}}function Efe(e,t,n){return n?{shape:{value:n}}:Tt("shape",e)}const _fe={vgMark:"symbol",encodeEntry:e=>d_(e)},$fe={vgMark:"symbol",encodeEntry:e=>d_(e,"circle")},Sfe={vgMark:"symbol",encodeEntry:e=>d_(e,"square")},Afe={vgMark:"rect",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y")})},kfe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Rm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Rm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Tt("size",e,{vgChannel:"strokeWidth"})}}},Cfe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...ai(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...NE(e),...Tt("size",e,{vgChannel:"fontSize"}),...Tt("angle",e),...t4("align",Mfe(e.markDef,n,t)),...t4("baseline",Ffe(e.markDef,n,t)),...dn("radius",e,{defaultPos:null}),...dn("theta",e,{defaultPos:null})}}};function Mfe(e,t,n){if(Pe("align",e,n)===void 0)return"center"}function Ffe(e,t,n){if(Pe("baseline",e,n)===void 0)return"middle"}const i0={arc:gfe,area:mfe,bar:yfe,circle:$fe,geoshape:bfe,image:vfe,line:xfe,point:_fe,rect:Afe,rule:kfe,square:Sfe,text:Cfe,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",o=i==="horizontal"?"y":"x",s=i==="horizontal"?"height":"width";return{...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,r),...dn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ue(Pe("thickness",n,t))}}},trail:wfe};function Tfe(e){if(ye([fm,lm,Voe],e.mark)){const t=j5(e.mark,e.encoding);if(t.length>0)return Ofe(e,t)}else if(e.mark===cm){const t=kw.some(n=>Pe(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Nfe(e)}return h_(e)}const xP="faceted_path_";function Ofe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:xP+e.requestDataName(Ze.Main),data:e.requestDataName(Ze.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:h_(e,{fromPrefix:xP})}]}const wP="stack_group_";function Nfe(e){var l;const[t]=h_(e,{fromPrefix:wP}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...Xu(t.encode.update,["y","yc","y2","height",...kw]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={..._n(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...Xu(t.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"}}},t.encode.update={..._n(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of kw){const f=pr(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Ue(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=V(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(V(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=pr(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ue(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ze.Main),name:wP+e.requestDataName(Ze.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:[t]}]}]}function Dfe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!L(s)&&Ni(s)&&fw(s.value)||!s&&fw(Pe("order",r,o)))){if((L(s)||q(s))&&!n)return xR(s,{expr:"datum"});if(as(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function h_(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=et(i.clip,Rfe(e),Pfe(e)),a=bR(i),u=r.key,l=Dfe(e),c=Lfe(e),f=Pe("aria",i,o),d=i0[n].postEncodingTransform?i0[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:i0[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ze.Main)},encode:{update:i0[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Rfe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Pfe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Lfe(e){if(!e.component.selection)return null;const t=B(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=B(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class EP extends pP{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,s6(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=yr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=_ae(s,o,{graticule:t.data&&ME(t.data)}));const u=this.encoding=Fse(t.encoding||{},a,s.filled,o);this.markDef=g6(s,u,o),this.size=pfe({encoding:u,size:s6(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=p6(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>yE(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===a5,i=t&&Tie.some(r=>le(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return $w.reduce((i,r)=>{const o=lt(n[r]);return o&&(i[r]=this.initScale(o.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=Mt(t);return L(n)&&(r.domain=n.map(zn)),L(i)&&(r.range=i.map(zn)),r}initAxes(t){return eo.reduce((n,i)=>{const r=t[i];if(le(r)||i===We&&le(t.x2)||i===yt&&le(t.y2)){const o=le(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=B(t),i={};for(const r of n){const o=t[r];i[r]=Zf(o)?gR(o):zn(o)}return i}initLegends(t){return Uie.reduce((n,i)=>{const r=lt(t[i]);if(r&&qie(i)){const o=r.legend;n[i]=o&&Mt(o)}return n},{})}parseData(){this.component.data=t0(this)}parseLayoutSize(){Zce(this)}parseSelections(){this.component.selection=Uue(this,this.selection)}parseMarkGroup(){this.component.mark=Tfe(this)}parseAxesAndHeaders(){this.component.axes=sfe(this)}assembleSelectionTopLevelSignals(t){return fue(this,t)}assembleSignals(){return[...b4(this),...lue(this,[])]}assembleSelectionData(t){return due(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return HE(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!_l(this.parent))&&(t=L6(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return _a(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Di(n)}typedFieldDef(t){const n=this.fieldDef(t);return fn(n)?n:null}}class p_ extends u_{constructor(t,n,i,r,o){super(t,"layer",n,i,o,t.resolve,t.view);const s={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(Fm(a))return new p_(a,this,this.getName(`layer_${u}`),s,o);if(ro(a))return new EP(a,this,this.getName(`layer_${u}`),s,o);throw new Error(Mw(a))})}parseData(){this.component.data=t0(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Xce(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){ufe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),b4(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),HE(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of X(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return hue(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),U4(this))}}function g_(e,t,n,i,r){if(mm(e))return new ad(e,t,n,r);if(Fm(e))return new p_(e,t,n,i,r);if(ro(e))return new EP(e,t,n,i,r);if(Qse(e))return new nfe(e,t,n,r);throw new Error(Mw(e))}function Ife(e,t={}){t.logger&&aoe(t.logger),t.fieldTitle&&F5(t.fieldTitle);try{const n=d6(Wa(t.config,e.config)),i=C6(e,n),r=g_(i,null,"",void 0,n);return r.parse(),lce(r.component.data,r),{spec:Bfe(r,zfe(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&uoe(),t.fieldTitle&&Ese()}}function zfe(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):K(t)&&(t={type:t}),r&&o&&rue(t.type)){if(r==="step"&&o==="step")j(AR()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(AR(nm(s)));const a=s==="width"?"height":"width";t.type=oue(a)}}return{...B(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...F6(n,!1),...F6(e,!0)}}function Bfe(e,t,n={},i){const r=e.config?fae(e.config):void 0,o=[].concat(e.assembleSelectionData([]),Hce(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...r6(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Ufe=Sie.version,jfe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Ju,accessPathWithDatum:mw,compile:Ife,contains:ye,deepEqual:In,deleteNestedProperty:Xg,duplicate:ue,entries:Jo,every:dw,fieldIntersection:gw,flatAccessWithDatum:YD,getFirstDefined:et,hasIntersection:hw,hasProperty:U,hash:be,internalField:ZD,isBoolean:Rf,isEmpty:De,isEqual:kie,isInternalField:JD,isNullOrFalse:fw,isNumeric:Kg,keys:B,logicalExpr:Pf,mergeDeep:GD,never:HD,normalize:C6,normalizeAngle:If,omit:_n,pick:Xu,prefixGenerator:pw,removePathFromField:Zu,replaceAll:la,replacePathInField:ii,resetIdCounter:Mie,setEqual:VD,some:Ku,stringify:Re,titleCase:Lf,unique:ur,uniqueId:KD,vals:kt,varName:qe,version:Ufe},Symbol.toStringTag,{value:"Module"}));function _P(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var qfe="vega-themes",Wfe="2.15.0",Hfe="Themes for stylized Vega and Vega-Lite visualizations.",Gfe=["vega","vega-lite","themes","style"],Vfe="BSD-3-Clause",Yfe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},Xfe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],Kfe="build/vega-themes.js",Zfe="build/vega-themes.module.js",Jfe="build/vega-themes.min.js",Qfe="build/vega-themes.min.js",ede="build/vega-themes.module.d.ts",tde={type:"git",url:"https://github.com/vega/vega-themes.git"},nde=["src","build"],ide={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},rde={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},ode={vega:"*","vega-lite":"*"},sde={},ade={name:qfe,version:Wfe,description:Hfe,keywords:Gfe,license:Vfe,author:Yfe,contributors:Xfe,main:Kfe,module:Zfe,unpkg:Jfe,jsdelivr:Qfe,types:ede,repository:tde,files:nde,scripts:ide,devDependencies:rde,peerDependencies:ode,dependencies:sde};const Sl="#fff",$P="#888",ude={background:"#333",view:{stroke:$P},title:{color:Sl,subtitleColor:Sl},style:{"guide-label":{fill:Sl},"guide-title":{fill:Sl}},axis:{domainColor:Sl,gridColor:$P,tickColor:Sl}},Ta="#4572a7",lde={background:"#fff",arc:{fill:Ta},area:{fill:Ta},line:{stroke:Ta,strokeWidth:2},path:{stroke:Ta},rect:{fill:Ta},shape:{stroke:Ta},symbol:{fill:Ta,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"]}},Oa="#30a2da",m_="#cbcbcb",cde="#999",fde="#333",SP="#f0f0f0",AP="#333",dde={arc:{fill:Oa},area:{fill:Oa},axis:{domainColor:m_,grid:!0,gridColor:m_,gridWidth:1,labelColor:cde,labelFontSize:10,titleColor:fde,tickColor:m_,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:SP,group:{fill:SP},legend:{labelColor:AP,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:AP,titleFontSize:14,titlePadding:10},line:{stroke:Oa,strokeWidth:2},path:{stroke:Oa,strokeWidth:.5},rect:{fill:Oa},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:Oa},bar:{binSpacing:2,fill:Oa,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Na="#000",hde={group:{fill:"#e5e5e5"},arc:{fill:Na},area:{fill:Na},line:{stroke:Na},path:{stroke:Na},rect:{fill:Na},shape:{stroke:Na},symbol:{fill:Na,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"]}},pde=22,gde="normal",kP="Benton Gothic, sans-serif",CP=11.5,mde="normal",Da="#82c6df",y_="Benton Gothic Bold, sans-serif",MP="normal",FP=13,ud={"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"]},yde={background:"#ffffff",title:{anchor:"start",color:"#000000",font:y_,fontSize:pde,fontWeight:gde},arc:{fill:Da},area:{fill:Da},line:{stroke:Da,strokeWidth:2},path:{stroke:Da},rect:{fill:Da},shape:{stroke:Da},symbol:{fill:Da,size:30},axis:{labelFont:kP,labelFontSize:CP,labelFontWeight:mde,titleFont:y_,titleFontSize:FP,titleFontWeight:MP},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:kP,labelFontSize:CP,symbolType:"square",titleFont:y_,titleFontSize:FP,titleFontWeight:MP},range:{category:ud["category-6"],diverging:ud["fireandice-6"],heatmap:ud["fire-7"],ordinal:ud["fire-7"],ramp:ud["fire-7"]}},Ra="#ab5787",r0="#979797",bde={background:"#f9f9f9",arc:{fill:Ra},area:{fill:Ra},line:{stroke:Ra},path:{stroke:Ra},rect:{fill:Ra},shape:{stroke:Ra},symbol:{fill:Ra,size:30},axis:{domainColor:r0,domainWidth:.5,gridWidth:.2,labelColor:r0,tickColor:r0,tickWidth:.2,titleColor:r0},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"]}},Pa="#3e5c69",vde={background:"#fff",arc:{fill:Pa},area:{fill:Pa},line:{stroke:Pa},path:{stroke:Pa},rect:{fill:Pa},shape:{stroke:Pa},symbol:{fill:Pa},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"]}},ui="#1696d2",TP="#000000",xde="#FFFFFF",o0="Lato",b_="Lato",wde="Lato",Ede="#DEDDDD",_de=18,ld={"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"]},$de={background:xde,title:{anchor:"start",fontSize:_de,font:o0},axisX:{domain:!0,domainColor:TP,domainWidth:1,grid:!1,labelFontSize:12,labelFont:b_,labelAngle:0,tickColor:TP,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:o0},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Ede,gridWidth:1,labelFontSize:12,labelFont:b_,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:o0,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:b_,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:o0,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ld["six-groups-cat-1"],diverging:ld["diverging-colors"],heatmap:ld["diverging-colors"],ordinal:ld["six-groups-seq"],ramp:ld["shades-blue"]},area:{fill:ui},rect:{fill:ui},line:{color:ui,stroke:ui,strokeWidth:5},trail:{color:ui,stroke:ui,strokeWidth:0,size:1},path:{stroke:ui,strokeWidth:.5},point:{filled:!0},text:{font:wde,color:ui,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:ui,stroke:null}},arc:{fill:ui},shape:{stroke:ui},symbol:{fill:ui,size:30}},La="#3366CC",OP="#ccc",s0="Arial, sans-serif",Sde={arc:{fill:La},area:{fill:La},path:{stroke:La},rect:{fill:La},shape:{stroke:La},symbol:{stroke:La},circle:{fill:La},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:s0,fontSize:12},"guide-title":{font:s0,fontSize:12},"group-title":{font:s0,fontSize:12}},title:{font:s0,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:OP,tickColor:OP,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},v_=e=>e*(1/3+1),NP=v_(9),DP=v_(10),RP=v_(12),cd="Segoe UI",PP="wf_standard-font, helvetica, arial, sans-serif",LP="#252423",fd="#605E5C",IP="transparent",Ade="#C8C6C4",Ii="#118DFF",kde="#12239E",Cde="#E66C37",Mde="#6B007B",Fde="#E044A7",Tde="#744EC2",Ode="#D9B300",Nde="#D64550",zP=Ii,BP="#DEEFFF",UP=[BP,zP],Dde={view:{stroke:IP},background:IP,font:cd,header:{titleFont:PP,titleFontSize:RP,titleColor:LP,labelFont:cd,labelFontSize:DP,labelColor:fd},axis:{ticks:!1,grid:!1,domain:!1,labelColor:fd,labelFontSize:NP,titleFont:PP,titleColor:LP,titleFontSize:RP,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Ade,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ii},line:{stroke:Ii,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:cd,fontSize:NP,fill:fd},arc:{fill:Ii},area:{fill:Ii,line:!0,opacity:.6},path:{stroke:Ii},rect:{fill:Ii},point:{fill:Ii,filled:!0,size:75},shape:{stroke:Ii},symbol:{fill:Ii,strokeWidth:1.5,size:50},legend:{titleFont:cd,titleFontWeight:"bold",titleColor:fd,labelFont:cd,labelFontSize:DP,labelColor:fd,symbolType:"circle",symbolSize:75},range:{category:[Ii,kde,Cde,Mde,Fde,Tde,Ode,Nde],diverging:UP,heatmap:UP,ordinal:[BP,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",zP]}},x_='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Rde='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',w_=400,a0={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Pde=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Lde=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function u0({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=a0.gridBg[e],r=a0.textPrimary[e],o=a0.textSecondary[e],s=n==="dark"?Pde:Lde,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:x_,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:Rde,labelFontWeight:w_,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:a0.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:x_,fill:o,fontWeight:w_},"guide-title":{font:x_,fill:o,fontWeight:w_}},range:{category:s,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 Ide=u0({theme:"white",background:"#ffffff"}),zde=u0({theme:"g10",background:"#f4f4f4"}),Bde=u0({theme:"g90",background:"#262626"}),Ude=u0({theme:"g100",background:"#161616"}),jde=ade.version,qde=Object.freeze(Object.defineProperty({__proto__:null,carbong10:zde,carbong100:Ude,carbong90:Bde,carbonwhite:Ide,dark:ude,excel:lde,fivethirtyeight:dde,ggplot2:hde,googlecharts:Sde,latimes:yde,powerbi:Dde,quartz:bde,urbaninstitute:$de,version:jde,vox:vde},Symbol.toStringTag,{value:"Module"}));function Wde(e,t,n,i){if(L(e))return`[${e.map(r=>t(K(r)?r:jP(r,n))).join(", ")}]`;if(Y(e)){let r="";const{title:o,image:s,...a}=e;o&&(r+=`<h2>${t(o)}</h2>`),s&&(r+=`<img src="${new URL(t(s),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(Y(c)&&(c=jP(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function Hde(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function jP(e,t){return JSON.stringify(e,Hde(t))}var Gde=`#vg-tooltip-element {
53
+ : v !== v && u === u ? ${i} : `}var JJ={operator:(e,t)=>$f(e,["_"],t.code),parameter:(e,t)=>$f(e,["datum","_"],t.code),event:(e,t)=>$f(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return $f(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const s="o["+H(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=YJ(i,n),r+="return m;",$f(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(o,s)=>{const a=t[s];let u,l;return o.path?(u=`a${o.path}`,l=`b${o.path}`):((n=n||{})["f"+s]=o,u=`this.f${s}(a)`,l=`this.f${s}(b)`),ZJ(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function QJ(e){const t=this;XJ(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function eQ(e){const t=this;if(e.params){const n=t.get(e.id);n||R("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function tQ(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=L(r)?r.map(o=>vD(o,n,t)):vD(r,n,t)}return t}function vD(e,t,n){if(!e||!Y(e))return e;for(let i=0,r=xD.length,o;i<r;++i)if(o=xD[i],Z(e,o.key))return o.parse(e,t,n);return e}var xD=[{key:"$ref",parse:nQ},{key:"$key",parse:rQ},{key:"$expr",parse:iQ},{key:"$field",parse:oQ},{key:"$encode",parse:aQ},{key:"$compare",parse:sQ},{key:"$context",parse:uQ},{key:"$subflow",parse:lQ},{key:"$tupleid",parse:cQ}];function nQ(e,t){return t.get(e.$ref)||R("Operator not defined: "+e.$ref)}function iQ(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=hn(t.parameterExpression(e.$expr),e.$fields))}function rQ(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=z0(e.$key,e.$flat,t.expr.codegen))}function oQ(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=qn(e.$field,e.$name,t.expr.codegen))}function sQ(e,t){const n="c:"+e.$compare+"_"+e.$order,i=X(e.$compare).map(r=>r&&r.$tupleid?ie:r);return t.fn[n]||(t.fn[n]=L0(i,e.$order,t.expr.codegen))}function aQ(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=hn(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function uQ(e,t){return t}function lQ(e,t){const n=e.$subflow;return function(i,r,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),u=s.signals.parent;return u&&u.set(o),a.detachSubflow=()=>t.detach(s),a}}function cQ(){return ie}function fQ(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(o=>t.get(o)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(o=>t.get(o)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&R("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function dQ(e){var t=this,n=Y(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||R("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,i,r,o,s)}const hQ={skip:!0};function pQ(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(i[o]=s.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(r[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function gQ(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(o=>{n.update(t.signals[o],r[o],hQ)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Wn).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function wD(e,t,n,i){return new ED(e,t,n,i)}function ED(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||JJ,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function _D(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)}ED.prototype=_D.prototype={fork(){const e=new _D(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==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,i=n.dataflow,r=e.value;if(n.set(e.id,t),KJ(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(i.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),i.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=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[C2(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,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:GJ,parseOperator:QJ,parseOperatorParameters:eQ,parseParameters:tQ,parseStream:fQ,parseUpdate:dQ,getState:pQ,setState:gQ};function mQ(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),$D(t,e.description()))}function $D(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function yQ(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const M2="default";function bQ(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:M2,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?K(r)?r:r.user:M2,s=i.item&&i.item.cursor||null;return r&&o===r.user&&s==r.item?r:{user:o,item:s}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),F2(e,i&&i!==M2?i:r||i),r},{cursor:t})}function F2(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Sg(e,t){var n=e._runtime.data;return Z(n,t)||R("Unrecognized data set: "+t),n[t]}function vQ(e,t){return arguments.length<2?Sg(this,e).values.value:Ag.call(this,e,Cs().remove(Wn).insert(t))}function Ag(e,t){tA(t)||R("Second argument to changes must be a changeset.");const n=Sg(this,e);return n.modified=!0,this.pulse(n.input,t)}function xQ(e,t){return Ag.call(this,e,Cs().insert(t))}function wQ(e,t){return Ag.call(this,e,Cs().remove(t))}function SD(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function AD(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function kg(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function EQ(e){var t=kg(e),n=SD(e),i=AD(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(o){e.error(o)}})}function _Q(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=kg(e),s=t.changedTouches?t.changedTouches[0]:t,o=Jh(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=$Q(e,n,o),t}function $Q(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(s){var a=i,u;if(s){for(u=t;u;u=u.mark.group)if(u.mark.name===s){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;K(s)&&(s=r(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:Lt(e),item:Lt(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const kD="view",SQ="timer",AQ="window",kQ={trap:!1};function CQ(e){const t=fe({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{L(i[o])&&(i[o]=li(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function CD(e,t,n,i){e._eventListeners.push({type:n,sources:X(t),handler:i})}function MQ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Cg(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||Y(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function FQ(e,t,n){var i=this,r=new Yd(n),o=function(l,c){i.runAsync(null,()=>{e===kD&&MQ(i,t)&&l.preventDefault(),r.receive(_Q(i,l,c))})},s;if(e===SQ)Cg(i,"timer",t)&&i.timer(o,t);else if(e===kD)Cg(i,"view",t)&&i.addEventListener(t,o,kQ);else if(e===AQ?Cg(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Cg(i,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=s.length;a<u;++a)s[a].addEventListener(t,o);CD(i,s,t,o)}return r}function MD(e){return e.item}function FD(e){return e.item.mark.source}function TD(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function TQ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",MD),FD,TD(e)),this.on(this.events("view","pointerout",MD),FD,TD(t)),this}function OQ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,o,s,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(s=i[r],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Pn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const DQ="vega-bind",NQ="vega-bind-name",RQ="vega-bind-radio";function PQ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,s)})}},i.debounce&&(r.update=I0(i.debounce,r.update))),(i.input==null&&i.element?LQ:zQ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function LQ(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),CD(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(IQ(r))}}function IQ(e){return typeof Event<"u"?new Event(e):{type:e}}function zQ(e,t,n,i){const r=i.signal(n.signal),o=Pn("div",{class:DQ}),s=n.input==="radio"?o:o.appendChild(Pn("label"));s.appendChild(Pn("span",{class:NQ},n.name||n.signal)),t.appendChild(o);let a=BQ;switch(n.input){case"checkbox":a=UQ;break;case"select":a=jQ;break;case"radio":a=qQ;break;case"range":a=WQ;break}a(e,s,n,r)}function BQ(e,t,n,i){const r=Pn("input");for(const o in n)o!=="signal"&&o!=="element"&&r.setAttribute(o==="input"?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=o=>r.value=o}function UQ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Pn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function jQ(e,t,n,i){const r=Pn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};Mg(s,i)&&(u.selected=!0),r.appendChild(Pn("option",u,(o[a]||s)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=s=>{for(let a=0,u=n.options.length;a<u;++a)if(Mg(n.options[a],s)){r.selectedIndex=a;return}}}function qQ(e,t,n,i){const r=Pn("span",{class:RQ}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};Mg(s,i)&&(u.checked=!0);const l=Pn("input",u);l.addEventListener("change",()=>e.update(s));const c=Pn("label",{},(o[a]||s)+"");return c.prepend(l),r.appendChild(c),l}),e.set=s=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)Mg(a[l].value,s)&&(a[l].checked=!0)}}function WQ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,s=n.step||xo(o,r,100),a=Pn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Pn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function Mg(e,t){return e===t||e+""==t+""}function OD(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,SD(e),AD(e),kg(e),r,o).background(e.background())}function T2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function HQ(e,t,n,i){const r=new i(e.loader(),T2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,kg(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function GQ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=fp(i);e=n._el=e?O2(n,e,!0):null,mQ(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Nc,a=e?o.renderer:o.headless;return n._renderer=a?OD(n,n._renderer,e,a):null,n._handler=HQ(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=O2(n,t,!0):e.appendChild(Pn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=O2(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{PQ(n,u.element||t,u)})),n}function O2(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Sf=e=>+e||0,VQ=e=>({top:e,bottom:e,left:e,right:e});function DD(e){return Y(e)?{top:Sf(e.top),bottom:Sf(e.bottom),left:Sf(e.left),right:Sf(e.right)}:VQ(Sf(e))}async function D2(e,t,n,i){const r=fp(t),o=r&&r.headless;return o||R("Unrecognized renderer type: "+t),await e.runAsync(),OD(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function YQ(e,t){e!==Uo.Canvas&&e!==Uo.SVG&&e!==Uo.PNG&&R("Unrecognized image type: "+e);const n=await D2(this,e,t);return e===Uo.SVG?XQ(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function XQ(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function KQ(e,t){return(await D2(this,Uo.Canvas,e,t)).canvas()}async function ZQ(e){return(await D2(this,Uo.SVG,e)).svg()}function JQ(e,t,n){return wD(e,au,_f,n).parse(t)}function QQ(e){var t=this._runtime.scales;return Z(t,e)||R("Unrecognized scale or projection: "+e),t[e].value}var ND="width",RD="height",N2="padding",PD={skip:!0};function LD(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===N2?i.left+i.right:0)}function ID(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===N2?i.top+i.bottom:0)}function eee(e){var t=e._signals,n=t[ND],i=t[RD],r=t[N2];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=LD(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=ID(e,a.size),o()},{size:i});const s=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,s.rank=r.rank+1}function tee(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(ND,n,PD),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(RD,i,PD),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==r[0]||s._origin[1]!==r[1])&&(s._resize=1,s._origin=r),a&&s.run("enter"),o&&s.runAfter(u=>u.resize())},!1,1)}function nee(e){return this._runtime.getState(e||{data:iee,signals:ree,recurse:!0})}function iee(e,t){return t.modified&&L(t.input.value)&&!e.startsWith("_:vega:_")}function ree(e,t){return!(e==="parent"||t instanceof au.proxy)}function oee(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function see(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(LV(n,t))}function aee(e,t,n,i){const r=e.element();r&&r.setAttribute("title",uee(i))}function uee(e){return e==null?"":L(e)?zD(e):Y(e)&&!yo(e)?lee(e):e+""}function lee(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(L(n)?zD(n):BD(n))}).join(`
54
+ `)}function zD(e){return"["+e.map(BD).join(", ")+"]"}function BD(e){return L(e)?"[…]":Y(e)&&!yo(e)?"{…}":e}function cee(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function UD(e,t){const n=this;if(t=t||{},su.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=fe({},e.locale,t.locale);n.locale(qS(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Uo.Canvas,n._scenegraph=new qM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||aee,n._redraw=!0,n._handler=new Nc().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=CQ(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=JQ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:fe({},o)})),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=LD(n,n._width),n._viewHeight=ID(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,eee(n),yQ(n),bQ(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Fg(e,t){return Z(e._signals,t)?e._signals[t]:R("Unrecognized signal name: "+H(t))}function jD(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function qD(e,t,n,i){let r=jD(n,i);return r||(r=T2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function WD(e,t,n){const i=jD(t,n);return i&&t._targets.remove(i),e}G(UD,su,{async evaluate(e,t,n){if(await su.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,EQ(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&qd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&$D(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 i=Fg(this,e);return arguments.length===1?i.value:this.update(i,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",DD(e)):DD(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?(fp(e)||R("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&&(su.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Fg(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:tee,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=T2(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,o;--i>=0;)if(o=n[i].type,r=n[i].handler,e===o&&(t===r||t===r.raw)){this._handler.off(o,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||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 qD(this,e,Fg(this,e),t)},removeSignalListener(e,t){return WD(this,Fg(this,e),t)},addDataListener(e,t){return qD(this,e,Sg(this,e).values,t)},removeDataListener(e,t){return WD(this,Sg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=F2(this,null);this._globalCursor=!!e,t&&F2(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:see,events:FQ,finalize:OQ,hover:TQ,data:vQ,change:Ag,insert:xQ,remove:wQ,scale:QQ,initialize:GQ,toImageURL:YQ,toCanvas:KQ,toSVG:ZQ,getState:nee,setState:oee,_watchPixelRatio:cee});const fee="view",Tg="[",Og="]",HD="{",GD="}",dee=":",VD=",",hee="@",pee=">",gee=/[[\]{}]/,mee={"*":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 YD,XD;function Ko(e,t,n){return YD=t||fee,XD=n||mee,KD(e.trim()).map(R2)}function yee(e){return XD[e]}function Af(e,t,n,i,r){const o=e.length;let s=0,a;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function KD(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Af(e,r,VD,Tg+HD,Og+GD),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function R2(e){return e[0]==="["?bee(e):vee(e)}function bee(e){const t=e.length;let n=1,i;if(n=Af(e,n,Og,Tg,Og),n===t)throw"Empty between selector: "+e;if(i=KD(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==pee)throw"Expected '>' after between selector: "+e;i=i.map(R2);const r=R2(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function vee(e){const t={source:YD},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===GD){if(a=e.lastIndexOf(HD),a>=0){try{i=xee(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===hee&&(r=++a),u=Af(e,a,dee),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=Af(e,a,Tg),a===s)n.push(e.substring(o,s).trim());else if(n.push(e.substring(o,a).trim()),l=[],o=++a,o===s)throw"Unmatched left bracket: "+e;for(;a<s;){if(a=Af(e,a,Og),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==Tg)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||gee.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):yee(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function xee(e){const t=e.split(VD);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function wee(e){return Y(e)?e:{type:e||"pad"}}const kf=e=>+e||0,Eee=e=>({top:e,bottom:e,left:e,right:e});function _ee(e){return Y(e)?e.signal?e:{top:kf(e.top),bottom:kf(e.bottom),left:kf(e.left),right:kf(e.right)}:Eee(kf(e))}const gt=e=>Y(e)&&!L(e)?fe({},e):{value:e};function ZD(e,t,n,i){return n!=null?(Y(n)&&!L(n)||L(n)&&n.length&&Y(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function At(e,t,n){for(const i in t)ZD(e,i,t[i]);for(const i in n)ZD(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&Z(n,i)||(e[i]=fe(e[i]||{},t[i]));return e}function Uu(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const P2="mark",L2="frame",I2="scope",$ee="axis",See="axis-domain",Aee="axis-grid",kee="axis-label",Cee="axis-tick",Mee="axis-title",Fee="legend",Tee="legend-band",Oee="legend-entry",Dee="legend-gradient",JD="legend-label",Nee="legend-symbol",Ree="legend-title",Pee="title",Lee="title-text",Iee="title-subtitle";function zee(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Uu(u,e)&&z2(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===L2?r.group:n===P2?fe({},r.mark,r[t]):null;for(u in c)l=Uu(u,e)||(u==="fill"||u==="stroke")&&(Uu("fill",e)||Uu("stroke",e)),l||z2(o,u,c[u]);X(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Uu(h,e)||z2(o,h,d[h])}),e=fe({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=fe(s,e.enter),a&&(e.update=fe(a,e.update)),e}function z2(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const QD=e=>K(e)?H(e):e.signal?`(${e.signal})`:eN(e);function Dg(e){if(e.gradient!=null)return Uee(e);let t=e.signal?`(${e.signal})`:e.color?Bee(e.color):e.field!=null?eN(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=jee(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${Rg(e.exponent)})`),e.mult!=null&&(t+=`*${Rg(e.mult)}`),e.offset!=null&&(t+=`+${Rg(e.offset)}`),e.round&&(t=`round(${t})`),t}const Ng=(e,t,n,i)=>`(${e}(${[t,n,i].map(Dg).join(",")})+'')`;function Bee(e){return e.c?Ng("hcl",e.h,e.c,e.l):e.h||e.s?Ng("hsl",e.h,e.s,e.l):e.l||e.a?Ng("lab",e.l,e.a,e.b):e.r||e.g||e.b?Ng("rgb",e.r,e.g,e.b):null}function Uee(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&ve(t)==null;)t.pop();return t.unshift(QD(e.gradient)),`gradient(${t.join(",")})`}function Rg(e){return Y(e)?"("+Dg(e)+")":e}function eN(e){return tN(Y(e)?e:{datum:e})}function tN(e){let t,n,i;if(e.signal)t="datum",i=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?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):R("Invalid field reference: "+H(e));return e.signal||(i=K(i)?zi(i).map(H).join("]["):tN(i)),t+"["+i+"]"}function jee(e,t){const n=QD(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+Rg(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function qee(e){let t="";return e.forEach(n=>{const i=Dg(n);t+=n.test?`(${n.test})?${i}:`:i}),ve(t)===":"&&(t+="null"),t}function nN(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=zee(e,t,n,i,r.config);for(const a in e)s[a]=Wee(e[a],t,o,r);return o}function Wee(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=Gee(Hee(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function Hee(e){return L(e)?qee(e):Dg(e)}function Gee(e,t,n,i){const r=ar(e,t);return r.$fields.forEach(o=>i[o]=1),fe(n,r.$params),r.$expr}const Vee="outer",Yee=["value","update","init","react","bind"];function iN(e,t){R(e+' for "outer" push: '+H(t))}function rN(e,t){const n=e.name;if(e.push===Vee)t.signals[n]||iN("No prior signal definition",n),Yee.forEach(i=>{e[i]!==void 0&&iN("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function B2(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Pg(e,t,n,i){return new B2(e,t,n,i)}function Lg(e,t){return Pg("operator",e,t)}function oe(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Cf(e,t){return t?{$field:e,$name:t}:{$field:e}}const U2=Cf("key");function oN(e,t){return{$compare:e,$order:t}}function Xee(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Kee="ascending",Zee="descending";function Jee(e){return Y(e)?(e.order===Zee?"-":"+")+Ig(e.op,e.field):""}function Ig(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const j2="scope",q2="view";function ut(e){return e&&e.signal}function Qee(e){return e&&e.expr}function zg(e){if(ut(e))return!0;if(Y(e)){for(const t in e)if(zg(e[t]))return!0}return!1}function wi(e,t){return e??t}function ia(e){return e&&e.signal||e}const sN="timer";function Mf(e,t){return(e.merge?tte:e.stream?nte:e.type?ite:R("Invalid stream specification: "+H(e)))(e,t)}function ete(e){return e===j2?q2:e||q2}function tte(e,t){const n=e.merge.map(r=>Mf(r,t)),i=W2({merge:n},e,t);return t.addStream(i).id}function nte(e,t){const n=Mf(e.stream,t),i=W2({stream:n},e,t);return t.addStream(i).id}function ite(e,t){let n;e.type===sN?(n=t.event(sN,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(ete(e.source),e.type);const i=W2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function W2(e,t,n){let i=t.between;return i&&(i.length!==2&&R('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[Mf(i[0],n),Mf(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(rte(t.marktype,t.markname,t.markrole)),t.source===j2&&i.push("inScope(event.item)"),i.length&&(e.filter=ar("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function rte(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const ote={code:"_.$value",ast:{type:"Identifier",value:"value"}};function ste(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||R("Signal update missing events specification."),K(o)&&(o=Ko(o,t.isSubscope()?j2:q2)),o=X(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[ute(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&R("Signal encode and update are mutually exclusive."),s="encode(item(),"+H(i)+")"),r.update=K(s)?ar(s,t):s.expr!=null?ar(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:ote,$params:{$value:t.signalRef(s.signal)}}:R("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(fe(ate(u,t),r)))}function ate(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Mf(e,t)}}function ute(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function lte(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?R("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=ar(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>ste(r,t,n.id))}const De=e=>(t,n,i)=>Pg(e,n,t||void 0,i),aN=De("aggregate"),cte=De("axisticks"),uN=De("bound"),Ei=De("collect"),lN=De("compare"),fte=De("datajoin"),cN=De("encode"),dte=De("expression"),hte=De("facet"),pte=De("field"),gte=De("key"),mte=De("legendentries"),yte=De("load"),bte=De("mark"),vte=De("multiextent"),xte=De("multivalues"),wte=De("overlap"),Ete=De("params"),fN=De("prefacet"),_te=De("projection"),$te=De("proxy"),Ste=De("relay"),dN=De("render"),Ate=De("scale"),ra=De("sieve"),kte=De("sortitems"),hN=De("viewlayout"),Cte=De("values");let Mte=0;const pN={min:"min",max:"max",count:"sum"};function Fte(e,t){const n=e.type||"linear";IC(n)||R("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function Tte(e,t){const n=t.getScale(e.name).params;let i;n.domain=gN(e.domain,e,t),e.range!=null&&(n.range=yN(e,t,n)),e.interpolate!=null&&Ute(e.interpolate,n),e.nice!=null&&(n.nice=Bte(e.nice,t)),e.bins!=null&&(n.bins=zte(e.bins,t));for(i in e)Z(n,i)||i==="name"||(n[i]=ei(e[i],t))}function ei(e,t){return Y(e)?e.signal?t.signalRef(e.signal):R("Unsupported object: "+H(e)):e}function Bg(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>ei(n,t))}function Ug(e){R("Can not find data set: "+H(e))}function gN(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&R("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(L(e)?Ote:e.fields?Nte:Dte)(e,t,n)}function Ote(e,t,n){return e.map(i=>ei(i,n))}function Dte(e,t,n){const i=n.getData(e.data);return i||Ug(e.data),yu(t.type)?i.valuesRef(n,e.field,mN(e.sort,!1)):UC(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Nte(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=K(s)?{data:i,field:s}:L(s)||s.signal?Rte(s,n):s,o.push(s),o),[]);return(yu(t.type)?Pte:UC(t.type)?Lte:Ite)(e,n,r)}function Rte(e,t){const n="_:vega:_"+Mte++,i=Ei({});if(L(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+H(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,ra({})]),{data:n,field:"data"}}function Pte(e,t,n){const i=mN(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||Ug(l.data),c.countsRef(t,l.field,i)}),a={groupby:U2,pulse:s};i&&(r=i.op||"count",o=i.field?Ig(r,i.field):"count",a.ops=[pN[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(aN(a));const u=t.add(Ei({pulse:oe(r)}));return o=t.add(Cte({field:U2,sort:t.sortRef(i),pulse:oe(u)})),oe(o)}function mN(e,t){return e&&(!e.field&&!e.op?Y(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?R("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!pN[e.op]&&R("Multiple domain scales can not be sorted using "+e.op)),e}function Lte(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Ug(r.data),o.domainRef(t,r.field)});return oe(t.add(xte({values:i})))}function Ite(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Ug(r.data),o.extentRef(t,r.field)});return oe(t.add(vte({extents:i})))}function zte(e,t){return e.signal||L(e)?Bg(e,t):t.objectProperty(e)}function Bte(e,t){return e.signal?t.signalRef(e.signal):Y(e)?{interval:ei(e.interval),step:ei(e.step)}:ei(e)}function Ute(e,t){t.interpolate=ei(e.type||e),e.gamma!=null&&(t.interpolateGamma=ei(e.gamma))}function yN(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(K(r)){if(i&&Z(i,r))return e=fe({},e,{range:i[r]}),yN(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=yu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:R("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=L(r.scheme)?Bg(r.scheme,t):ei(r.scheme,t),r.extent&&(n.schemeExtent=Bg(r.extent,t)),r.count&&(n.schemeCount=ei(r.count,t));return}else if(r.step){n.rangeStep=ei(r.step,t);return}else{if(yu(e.type)&&!L(r))return gN(r,e,t);L(r)||R("Unsupported range type: "+H(r))}return r.map(o=>(L(o)?Bg:ei)(o,t))}function jte(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=H2(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=H2(n[r],r,t));t.addProjection(e.name,i)}function H2(e,t,n){return L(e)?e.map(i=>H2(i,t,n)):Y(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:R("Unsupported parameter object: "+H(e)):e}const _i="top",ju="left",qu="right",Zo="bottom",bN="center",qte="vertical",Wte="start",Hte="middle",Gte="end",G2="index",V2="label",Vte="offset",Wu="perc",Yte="perc2",ti="value",Ff="guide-label",Y2="guide-title",Xte="group-title",Kte="group-subtitle",vN="symbol",jg="gradient",X2="discrete",K2="size",Z2=[K2,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Tf={name:1,style:1,interactive:1},we={value:0},ni={value:1},qg="group",xN="rect",J2="rule",Zte="symbol",oa="text";function Of(e){return e.type=qg,e.interactive=e.interactive||!1,e}function En(e,t){const n=(i,r)=>wi(e[i],wi(t[i],r));return n.isVertical=i=>qte===wi(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>wi(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>wi(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>wi(e.columns,wi(t.columns,+n.isVertical(!0))),n}function wN(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 Jte(e,t,n){const i=t.config.style[n];return i&&i[e]}function Wg(e,t,n){return`item.anchor === '${Wte}' ? ${e} : item.anchor === '${Gte}' ? ${t} : ${n}`}const Q2=Wg(H(ju),H(qu),H(bN));function Qte(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},Y(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function EN(e,t){return t?e?Y(e)?Object.assign({},e,{offset:EN(e.offset,t)}):{value:e,offset:t}:t:e}function Ln(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,Tf)):e.interactive=!1,e}function ene(e,t,n,i){const r=En(e,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=s,d=a):(l=[0,0],c=[1,0],f=a,d=s);const h={enter:u={opacity:we,x:we,y:we,width:gt(f),height:gt(d)},update:fe({},u,{opacity:ni,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:we}};return At(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Ln({type:xN,role:Dee,encode:h},i)}function tne(e,t,n,i,r){const o=En(e,n),s=o.isVertical(),a=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";s?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:we,fill:{scale:t,field:ti}};p[l]={signal:h+"datum."+Wu,mult:u},p[c]=we,p[f]={signal:h+"datum."+Yte,mult:u},p[d]=gt(a);const g={enter:p,update:fe({},p,{opacity:ni}),exit:{opacity:we}};return At(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Ln({type:xN,role:Tee,key:ti,from:r,encode:g},i)}const nne=`datum.${Wu}<=0?"${ju}":datum.${Wu}>=1?"${qu}":"${bN}"`,ine=`datum.${Wu}<=0?"${Zo}":datum.${Wu}>=1?"${_i}":"${Hte}"`;function _N(e,t,n,i){const r=En(e,t),o=r.isVertical(),s=gt(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:we},update:c={opacity:ni,text:{field:V2}},exit:{opacity:we}};return At(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:wi(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:ine},f="y",d="x",h="1-"):(l.align=c.align={signal:nne},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Wu,mult:a},l[d]=c[d]=s,s.offset=wi(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+G2}:void 0,Ln({type:oa,role:JD,style:Ff,key:ti,from:i,encode:p,overlap:u},n)}function rne(e,t,n,i,r){const o=En(e,t),s=n.entries,a=!!(s&&s.interactive),u=s?s.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Vte} : datum.${K2}`,h=l?gt(l):{field:K2},p=`datum.${G2}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:we,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:ni,x:y.x,y:y.y},exit:{opacity:we}};let w=null,_=null;e.fill||(w=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),At(m,{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")}),Z2.forEach(M=>{e[M]&&(b[M]=y[M]={scale:e[M],field:ti})});const E=Ln({type:Zte,role:Nee,key:ti,from:f,clip:l?!0:void 0,encode:m},n.symbols),$=gt(c);$.offset=o("labelOffset"),m={enter:y={opacity:we,x:{signal:d,offset:$},y:h},update:b={opacity:ni,text:{field:V2},x:y.x,y:y.y},exit:{opacity:we}},At(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 S=Ln({type:oa,role:JD,style:Ff,key:ti,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:we,height:l?gt(l):we,opacity:we},exit:{opacity:we},update:b={opacity:ni,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:G2}},Of({role:I2,from:i,encode:Bu(m,s,Tf),marks:[E,S],name:u,interactive:a,sort:x})}function one(e,t){const n=En(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ew='item.orient === "left"',tw='item.orient === "right"',Hg=`(${ew} || ${tw})`,sne=`datum.vgrad && ${Hg}`,ane=Wg('"top"','"bottom"','"middle"'),une=Wg('"right"','"left"','"center"'),lne=`datum.vgrad && ${tw} ? (${une}) : (${Hg} && !(datum.vgrad && ${ew})) ? "left" : ${Q2}`,cne=`item._anchor || (${Hg} ? "middle" : "start")`,fne=`${sne} ? (${ew} ? -90 : 90) : 0`,dne=`${Hg} ? (datum.vgrad ? (${tw} ? "bottom" : "top") : ${ane}) : "top"`;function hne(e,t,n,i){const r=En(e,t),o={enter:{opacity:we},update:{opacity:ni,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:we}};return At(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:cne},angle:{signal:fne},align:{signal:lne},baseline:{signal:dne},text:e.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")}),Ln({type:oa,role:Ree,style:Y2,from:i,encode:o},n)}function pne(e,t){let n;return Y(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+$N(e.path)+")":e.sphere&&(n="geoShape("+$N(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function $N(e){return Y(e)&&e.signal?e.signal:H(e)}function SN(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===qg?I2:t||P2}function gne(e){return{marktype:e.type,name:e.name||void 0,role:e.role||SN(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function mne(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function nw(e,t){const n=cA(e.type);n||R("Unrecognized transform type: "+H(e.type));const i=Pg(n.type.toLowerCase(),null,AN(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function AN(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=yne(s,t,n)}return i}function yne(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return bne(e,t,n);if(r===void 0){e.required&&R("Missing required "+H(t.type)+" parameter: "+H(e.name));return}else{if(i==="param")return vne(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!ut(r)?r.map(o=>kN(e,o,n)):kN(e,r,n)}function kN(e,t,n){const i=e.type;if(ut(t))return MN(i)?R("Expression references can not be signals."):iw(i)?n.fieldRef(t):FN(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||iw(i);return r&&xne(t)?n.exprRef(t.expr,t.as):r&&wne(t)?Cf(t.field,t.as):MN(i)?ar(t,n):Ene(i)?oe(n.getData(t).values):iw(i)?Cf(t):FN(i)?n.compareRef(t):t}}function bne(e,t,n){return K(t.from)||R('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function vne(e,t,n){const i=t[e.name];return e.array?(L(i)||R("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>CN(e,r,n))):CN(e,i,n)}function CN(e,t,n){const i=e.params.length;let r;for(let s=0;s<i;++s){r=e.params[s];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||R("Unsupported parameter: "+H(t));const o=fe(AN(r,t,n),r.key);return oe(n.add(Ete(o)))}const xne=e=>e&&e.expr,wne=e=>e&&e.field,Ene=e=>e==="data",MN=e=>e==="expr",iw=e=>e==="field",FN=e=>e==="compare";function _ne(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||R("Only group marks can be faceted."),i.field!=null?s=a=Gg(i,n):(e.data?a=oe(n.getData(e.data).aggregate):(o=nw(fe({type:"aggregate",groupby:X(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Gg(i,n),s=a=oe(n.add(o))),r=n.keyRef(i.groupby,!0))):s=oe(n.add(Ei(null,[{}]))),s||(s=Gg(e,n)),{key:r,pulse:s,parent:a}}function Gg(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:oe(t.getData(e.data).output)}function sa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}sa.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=oe(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new sa(e,o,r,i,s)};function TN(e){return K(e)?e:null}function ON(e,t,n){const i=Ig(n.op,n.field);let r;if(t.ops){for(let o=0,s=t.as.length;o<s;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function Df(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=Jee(o);let l=TN(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:U2,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:oe(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(Pg(i,void 0,d)),s&&(t.index[r]=f),c=oe(f),l!=null&&(a[l]=c)}return c}sa.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=TN(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&ON(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:oe(i.output)},n&&n.field&&ON(e,u,n),a=e.add(aN(u)),s=e.add(Ei({pulse:oe(a)})),s={agg:a,ref:oe(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return oe(this.values)},extentRef(e,t){return Df(e,this,"extent","extent",t,!1)},domainRef(e,t){return Df(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Df(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Df(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Df(e,this,"indata","tupleindex",t,!0,!0)}};function $ne(e,t,n){const i=e.from.facet,r=i.name,o=Gg(i,t);let s;i.name||R("Facet must have a name: "+H(i)),i.data||R("Facet must reference a data set: "+H(i)),i.field?s=t.add(fN({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(hte({key:t.keyRef(i.groupby),group:oe(t.proxy(n.parent)),pulse:o})):R("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add(Ei()),l=a.add(ra({pulse:oe(u)}));a.addData(r,new sa(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function Sne(e,t,n){const i=t.add(fN({pulse:n.pulse})),r=t.fork();r.add(ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function DN(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(Lg()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=ar(l,t);u.update=c.$expr,u.params=c.$params}function Vg(e,t){const n=SN(e),i=e.type===qg,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===I2||n===L2,a,u,l,c,f,d,h;const p=n===P2||s||r,g=_ne(e.from,i,t);u=t.add(fte({key:g.key||(e.key?Cf(e.key):void 0),pulse:g.pulse,clean:!i}));const m=oe(u);u=l=t.add(Ei({pulse:m})),u=t.add(bte({markdef:gne(e),interactive:mne(e.interactive,t),clip:pne(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:oe(u)}));const y=oe(u);u=c=t.add(cN(nN(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{const E=nw(_,t),$=E.metadata;($.generates||$.changes)&&R("Mark transforms should not generate new data."),$.nomod||(c.params.mod=!0),E.params.pulse=oe(u),t.add(u=E)}),e.sort&&(u=t.add(kte({sort:t.compareRef(e.sort),pulse:oe(u)})));const b=oe(u);(r||s)&&(s=t.add(hN({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=oe(s));const v=t.add(uN({mark:y,pulse:d||b}));h=oe(v),i&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?$ne(e,t,g):p?Sne(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(v))),o&&(h=Ane(o,h,t));const x=t.add(dN({pulse:h})),w=t.add(ra({pulse:oe(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new sa(t,l,x,w)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&R("Marks only support modify triggers."),DN(_,t,f)}))}function Ane(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:ut(o)?n.signalRef(o.signal):o,method:ut(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;s.boundTolerance=ut(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return oe(n.add(wte(s)))}function kne(e,t){const n=t.config.legend,i=e.encode||{},r=En(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;Z2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||R("Missing valid scale for legend.");const p=Cne(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=oe(t.add(Ei(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=oe(t.add(mte(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===jg?(h=[ene(e,c,n,i.gradient),_N(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ia(r.gradientLength())})/100))`)):p===X2?h=[tne(e,c,n,i.gradient,b),_N(e,n,i.labels,b)]:(f=one(e,n),h=[rne(e,n,i,b,ia(f.columns))],d.size=Tne(e,t,h[0].marks)),h=[Of({role:Oee,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(hne(e,n,i.title,m)),Vg(Of({role:Fee,from:m,encode:Bu(Fne(r,e,n),o,Tf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function Cne(e,t){let n=e.type||vN;return!e.type&&Mne(e)===1&&(e.fill||e.stroke)&&(n=ub(t)?jg:lb(t)?X2:vN),n!==jg?n:lb(t)?X2:jg}function Mne(e){return Z2.reduce((t,n)=>t+(e[n]?1:0),0)}function Fne(e,t,n){const i={enter:{},update:{}};return At(i,{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}),i}function Tne(e,t,n){const i=ia(NN("size",e,n)),r=ia(NN("strokeWidth",e,n)),o=ia(One(n[1].encode,t,Ff));return ar(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function NN(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wN(e,n[0].encode)}function One(e,t,n){return wN("fontSize",e)||Jte("fontSize",t,n)}const Dne=`item.orient==="${ju}"?-90:item.orient==="${qu}"?90:0`;function Nne(e,t){e=K(e)?{text:e}:e;const n=En(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=oe(t.add(Ei(null,[l])));return u.push(Lne(e,n,Rne(e),c)),e.subtitle&&u.push(Ine(e,n,i.subtitle,c)),Vg(Of({role:Pee,from:c,encode:Pne(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Rne(e){const t=e.encode;return t&&t.title||fe({name:e.name,interactive:e.interactive,style:e.style},t)}function Pne(e,t){const n={enter:{},update:{}};return At(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:Q2},angle:{signal:Dne},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,Tf)}function Lne(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return At(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ln({type:oa,role:Lee,style:Xte,from:i,encode:s},n)}function Ine(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return At(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ln({type:oa,role:Iee,style:Kte,from:i,encode:s},n)}function zne(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(nw(i,t))}),e.on&&e.on.forEach(i=>{DN(i,t,e.name)}),t.addDataPipeline(e.name,Bne(e,t,n))}function Bne(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?ut(e.values)||zg(e.format)?(i.push(RN(t,e)),i.push(r=aa())):i.push(r=aa({$ingest:e.values,$format:e.format})):e.url?zg(e.url)||zg(e.format)?(i.push(RN(t,e)),i.push(r=aa())):i.push(r=aa({$request:e.url,$format:e.format})):e.source&&(r=a=X(e.source).map(d=>oe(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=aa()),i.push(c),f.generates&&(s=!0),f.modifies&&!s&&(o=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=Ste({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,aa())),r||i.push(aa()),i.push(ra({})),i}function aa(e){const t=Ei({},e);return t.metadata={source:!0},t}function RN(e,t){return yte({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const PN=e=>e===Zo||e===_i,Yg=(e,t,n)=>ut(e)?Wne(e.signal,t,n):e===ju||e===_i?t:n,mt=(e,t,n)=>ut(e)?jne(e.signal,t,n):PN(e)?t:n,$i=(e,t,n)=>ut(e)?qne(e.signal,t,n):PN(e)?n:t,LN=(e,t,n)=>ut(e)?Hne(e.signal,t,n):e===_i?{value:t}:{value:n},Une=(e,t,n)=>ut(e)?Gne(e.signal,t,n):e===qu?{value:t}:{value:n},jne=(e,t,n)=>IN(`${e} === '${_i}' || ${e} === '${Zo}'`,t,n),qne=(e,t,n)=>IN(`${e} !== '${_i}' && ${e} !== '${Zo}'`,t,n),Wne=(e,t,n)=>rw(`${e} === '${ju}' || ${e} === '${_i}'`,t,n),Hne=(e,t,n)=>rw(`${e} === '${_i}'`,t,n),Gne=(e,t,n)=>rw(`${e} === '${qu}'`,t,n),IN=(e,t,n)=>(t=t!=null?gt(t):t,n=n!=null?gt(n):n,zN(t)&&zN(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[fe({test:e},t)].concat(n||[])),zN=e=>e==null||Object.keys(e).length===1,rw=(e,t,n)=>({signal:`${e} ? (${Hu(t)}) : (${Hu(n)})`}),Vne=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${ju}' ? (${Hu(i)}) : `:"")+(n!=null?`${e} === '${Zo}' ? (${Hu(n)}) : `:"")+(r!=null?`${e} === '${qu}' ? (${Hu(r)}) : `:"")+(t!=null?`${e} === '${_i}' ? (${Hu(t)}) : `:"")+"(null)"}),Hu=e=>ut(e)?e.signal:e==null?null:H(e),Yne=(e,t)=>t===0?0:ut(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Gu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Vu(e,t,n,i){let r;if(t&&Z(t,e))return t[e];if(Z(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[Y2][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Ff][r]}return null}function BN(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Xne(e,t){var n=t.config,i=n.style,r=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,u,l;if(ut(s)){const f=BN([n.axisX,n.axisY]),d=BN([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=mt(s,Vu(l,n.axisX,r,i),Vu(l,n.axisY,r,i));u={};for(l of d)u[l]=Vne(s.signal,Vu(l,n.axisTop,r,i),Vu(l,n.axisBottom,r,i),Vu(l,n.axisLeft,r,i),Vu(l,n.axisRight,r,i))}else a=s===_i||s===Zo?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?fe({},r,a,u,o):r}function Kne(e,t,n,i){const r=En(e,t),o=e.orient;let s,a;const u={enter:s={opacity:we},update:a={opacity:ni},exit:{opacity:we}};At(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=UN(e,0),c=UN(e,1);return s.x=a.x=mt(o,l,we),s.x2=a.x2=mt(o,c),s.y=a.y=$i(o,l,we),s.y2=a.y2=$i(o,c),Ln({type:J2,role:See,from:i,encode:u},n)}function UN(e,t){return{scale:e.scale,range:t}}function Zne(e,t,n,i,r){const o=En(e,t),s=e.orient,a=e.gridScale,u=Yg(s,1,-1),l=Jne(e.offset,u);let c,f,d;const h={enter:c={opacity:we},update:d={opacity:ni},exit:f={opacity:we}};At(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:ti,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=mt(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:fe(g,{mult:u,offset:l});return c.x=d.x=mt(s,p,m),c.y=d.y=$i(s,p,m),c.x2=d.x2=$i(s,y),c.y2=d.y2=mt(s,y),f.x=mt(s,p),f.y=$i(s,p),Ln({type:J2,role:Aee,key:ti,from:i,encode:h},n)}function Jne(e,t){if(t!==1)if(!Y(e))e=ut(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=fe({},e);for(;n.mult!=null;)if(Y(n.mult))n=n.mult=fe({},n.mult);else return n.mult=ut(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Qne(e,t,n,i,r,o){const s=En(e,t),a=e.orient,u=Yg(a,-1,1);let l,c,f;const d={enter:l={opacity:we},update:f={opacity:ni},exit:c={opacity:we}};At(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=gt(r);h.mult=u;const p={scale:e.scale,field:ti,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=mt(a,we,p),f.y2=l.y2=mt(a,h),c.x=mt(a,p),f.x=l.x=$i(a,we,p),f.x2=l.x2=$i(a,h),c.y=$i(a,p),Ln({type:J2,role:Cee,key:ti,from:i,encode:d},n)}function ow(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function eie(e,t,n,i,r,o){const s=En(e,t),a=e.orient,u=e.scale,l=Yg(a,-1,1),c=ia(s("labelFlush")),f=ia(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=c===0||!!c,g;const m=gt(r);m.mult=l,m.offset=gt(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:ti,band:.5,offset:EN(o.offset,s("labelOffset"))},b=mt(a,p?ow(u,c,'"left"','"right"','"center"'):{value:"center"},Une(a,"left","right")),v=mt(a,LN(a,"bottom","top"),p?ow(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=ow(u,c,`-(${f})`,f,0);p=p&&f;const w={opacity:we,x:mt(a,y,m),y:$i(a,y,m)},_={enter:w,update:g={opacity:ni,text:{field:V2},x:w.x,y:w.y,align:b,baseline:v},exit:{opacity:we,x:w.x,y:w.y}};At(_,{dx:!d&&p?mt(a,x):null,dy:!h&&p?$i(a,x):null}),At(_,{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:d,baseline:h});const E=s("labelBound");let $=s("labelOverlap");return $=$||E?{separation:s("labelSeparation"),method:$,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,g.align!==b&&(g.align=Gu(g.align,b)),g.baseline!==v&&(g.baseline=Gu(g.baseline,v)),Ln({type:oa,role:kee,style:Ff,key:ti,from:i,encode:_,overlap:$},n)}function tie(e,t,n,i){const r=En(e,t),o=e.orient,s=Yg(o,-1,1);let a,u;const l={enter:a={opacity:we,anchor:gt(r("titleAnchor",null)),align:{signal:Q2}},update:u=fe({},a,{opacity:ni,text:gt(e.title)}),exit:{opacity:we}},c={signal:`lerp(range("${e.scale}"), ${Wg(0,1,.5)})`};return u.x=mt(o,c),u.y=$i(o,c),a.angle=mt(o,we,Yne(s,90)),a.baseline=mt(o,LN(o,Zo,_i),{value:Zo}),u.angle=a.angle,u.baseline=a.baseline,At(l,{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")}),nie(r,o,l,n),l.update.align=Gu(l.update.align,a.align),l.update.angle=Gu(l.update.angle,a.angle),l.update.baseline=Gu(l.update.baseline,a.baseline),Ln({type:oa,role:Mee,style:Y2,from:i,encode:l},n)}function nie(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Gu(gt(a),n.update[u]),!1):!Uu(u,i),o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?gt(s):mt(t,gt(s),gt(o))}function iie(e,t){const n=Xne(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=En(e,n),l=Qte(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=oe(t.add(Ei({},[c]))),d=oe(t.add(cte({scale:t.scaleRef(e.scale),extra:t.property(l.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(Zne(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(Qne(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(eie(e,n,i.labels,d,p,l))),c.domain&&h.push(Kne(e,n,i.domain,f)),c.title&&h.push(tie(e,n,i.title,f)),Vg(Of({role:$ee,from:f,encode:Bu(rie(u,e),r,Tf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function rie(e,t){const n={enter:{},update:{}};return At(n,{orient:e("orient"),offset:e("offset")||0,position:wi(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 jN(e,t,n){const i=X(e.signals),r=X(e.scales);return n||i.forEach(o=>rN(o,t)),X(e.projections).forEach(o=>jte(o,t)),r.forEach(o=>Fte(o,t)),X(e.data).forEach(o=>zne(o,t)),r.forEach(o=>Tte(o,t)),(n||i).forEach(o=>lte(o,t)),X(e.axes).forEach(o=>iie(o,t)),X(e.marks).forEach(o=>Vg(o,t)),X(e.legends).forEach(o=>kne(o,t)),e.title&&Nne(e.title,t),t.parseLambdas(),t}const oie=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function sie(e,t){const n=t.config,i=oe(t.root=t.add(Lg())),r=aie(e,n);r.forEach(l=>rN(l,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(Ei()),s=t.add(cN(nN(oie(e.encode),qg,L2,e.style,t,{pulse:oe(o)}))),a=t.add(hN({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:oe(s)}));t.operators.pop(),t.pushState(oe(s),oe(a),null),jN(e,t,r),t.operators.push(a);let u=t.add(uN({mark:i,pulse:oe(a)}));return u=t.add(dN({pulse:oe(u)})),u=t.add(ra({pulse:oe(u)})),t.addData("root",new sa(t,o,o,u)),t}function Nf(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function aie(e,t){const n=s=>wi(e[s],t[s]),i=[Nf("background",n("background")),Nf("autosize",wee(n("autosize"))),Nf("padding",_ee(n("padding"))),Nf("width",n("width")||0),Nf("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return X(e.signals).forEach(s=>{Z(r,s.name)?s=fe(r[s.name],s):i.push(s),o[s.name]=s}),X(t.signals).forEach(s=>{!Z(o,s.name)&&!Z(r,s.name)&&i.push(s)}),i}function qN(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 WN(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}qN.prototype=WN.prototype={parse(e){return jN(e,this)},fork(){return new WN(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 B2?oe(e):e;return this.add($te({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;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,o){let s,a;i&&(s=i.data||(i.data={}),a=s[r]||(s[r]=[]),a.push(o))}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 i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(oe(this.add(ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?oe(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ve(this._parent)},encode(){return ve(this._encode)},lookup(){return ve(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return Cf(e,t);e.signal||R("Unsupported field reference: "+H(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=oe(this.add(pte(r)))}return i},compareRef(e){let t=!1;const n=o=>ut(o)?(t=!0,this.signalRef(o.signal)):Qee(o)?(t=!0,this.exprRef(o.expr)):o,i=X(e.field).map(n),r=X(e.order).map(n);return t?oe(this.add(lN({fields:i,orders:r}))):oN(i,r)},keyRef(e,t){let n=!1;const i=o=>ut(o)?(n=!0,oe(r[o.signal])):o,r=this.signals;return e=X(e).map(i),n?oe(this.add(gte({fields:e,flat:t}))):Xee(e,t)},sortRef(e){if(!e)return e;const t=Ig(e.op,e.field),n=e.order||Kee;return n.signal?oe(this.add(lN({fields:t,orders:this.signalRef(n.signal)}))):oN(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return Z(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&R("Duplicate signal name: "+H(e));const n=t instanceof B2?t:this.add(Lg(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||R("Unrecognized signal name: "+H(e)),this.signals[e]},signalRef(e){return this.signals[e]?oe(this.signals[e]):(Z(this.lambdas,e)||(this.lambdas[e]=this.add(Lg(null))),oe(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=ar(i,this),o=this.lambdas[i];o.params=r.$params,o.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!Y(e)?e:this.signalRef(e.signal||sw(e))},exprRef(e,t){const n={expr:ar(e,this)};return t&&(n.expr.$name=t),oe(this.add(dte(n)))},addBinding(e,t){this.bindings||R("Nested signals do not support binding: "+H(e)),this.bindings.push(fe({signal:e},t))},addScaleProj(e,t){Z(this.scales,e)&&R("Duplicate scale or projection name: "+H(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,Ate(t))},addProjection(e,t){this.addScaleProj(e,_te(t))},getScale(e){return this.scales[e]||R("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return oe(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return Z(this.data,e)&&R("Duplicate data set name: "+H(e)),this.data[e]=t},getData(e){return this.data[e]||R("Undefined data set name: "+H(e)),this.data[e]},addDataPipeline(e,t){return Z(this.data,e)&&R("Duplicate data set name: "+H(e)),this.addData(e,sa.fromEntries(this,t))}};function sw(e){return(L(e)?uie:lie)(e)}function uie(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(Y(r)?r.signal||sw(r):H(r))}return n+"]"}function lie(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(Y(r)?r.signal||sw(r):H(r));return t+"}"}function cie(){const e="sans-serif",i="#4c78a8",r="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function fie(e,t,n){return Y(e)||R("Input Vega specification must be an object."),t=Wa(cie(),t,e.config),sie(e,new qN(t,n)).toRuntime()}var die="5.30.0";fe(au,x7,ZW,EH,aV,tY,CX,aX,FX,eK,cK,yK);const hie=Object.freeze(Object.defineProperty({__proto__:null,Bounds:nt,CanvasHandler:Nc,CanvasRenderer:ap,DATE:mn,DAY:zt,DAYOFYEAR:qi,Dataflow:su,Debug:e$,Error:T0,EventStream:Yd,Gradient:oM,GroupItem:Lh,HOURS:Fn,Handler:Hb,HybridHandler:xF,HybridRenderer:iv,Info:Q_,Item:Ph,MILLISECONDS:ci,MINUTES:Tn,MONTH:It,Marks:Dn,MultiPulse:A1,None:J_,Operator:Le,Parameters:Vd,Pulse:$o,QUARTER:gn,RenderType:Uo,Renderer:Oc,ResourceLoader:mM,SECONDS:Gn,SVGHandler:tF,SVGRenderer:nv,SVGStringRenderer:vF,Scenegraph:qM,TIME_UNITS:i1,Transform:O,View:UD,WEEK:rt,Warn:O0,YEAR:Et,accessor:hn,accessorFields:Nt,accessorName:Ye,array:X,ascending:$d,bandwidthNRD:F1,bin:hA,bootstrapCI:pA,boundClip:FF,boundContext:Sc,boundItem:qb,boundMark:zM,boundStroke:Lr,changeset:Cs,clampRange:d$,codegenExpression:ZO,compare:L0,constant:Lt,cumulativeLogNormal:P1,cumulativeNormal:Jd,cumulativeUniform:B1,dayofyear:Q$,debounce:I0,defaultLocale:v1,definition:cA,densityLogNormal:R1,densityNormal:T1,densityUniform:z1,domChild:st,domClear:Kn,domCreate:zo,domFind:Wb,dotbin:gA,error:R,expressionFunction:Qe,extend:fe,extent:Bi,extentIndex:h$,falsy:go,fastmap:Ga,field:qn,flush:p$,font:Kh,fontFamily:Fc,fontSize:Qi,format:Bd,formatLocale:Id,formats:_1,hasOwnProperty:Z,id:Ll,identity:Rt,inferType:GS,inferTypes:VS,ingest:Ce,inherits:G,inrange:Va,interpolate:cb,interpolateColors:Th,interpolateRange:jC,intersect:AF,intersectBoxLine:wu,intersectPath:Cb,intersectPoint:Mb,intersectRule:$M,isArray:L,isBoolean:mo,isDate:yo,isFunction:ce,isIterable:g$,isNumber:_e,isObject:Y,isRegExp:m$,isString:K,isTuple:Wd,key:z0,lerp:y$,lineHeight:Lo,loader:Ud,locale:qS,logger:D0,lruCache:b$,markup:tv,merge:v$,mergeConfig:Wa,multiLineOffset:Bb,one:qa,pad:x$,panLinear:s$,panLog:a$,panPow:u$,panSymlog:l$,parse:fie,parseExpression:p2,parseSelector:Ko,path:oh,pathCurves:mb,pathEqual:TF,pathParse:bu,pathRectangle:dM,pathRender:xc,pathSymbols:fM,pathTrail:hM,peek:ve,point:Jh,projection:ex,quantileLogNormal:L1,quantileNormal:Qd,quantileUniform:U1,quantiles:C1,quantizeInterpolator:qC,quarter:c$,quartiles:M1,get random(){return Vn},randomInteger:$9,randomKDE:D1,randomLCG:_9,randomLogNormal:yA,randomMixture:bA,randomNormal:O1,randomUniform:vA,read:ZS,regressionConstant:j1,regressionExp:wA,regressionLinear:q1,regressionLoess:AA,regressionLog:xA,regressionPoly:_A,regressionPow:EA,regressionQuad:W1,renderModule:fp,repeat:Il,resetDefaultLocale:x8,resetSVGClipId:gM,resetSVGDefIds:gW,responseType:KS,runtimeContext:wD,sampleCurve:th,sampleLogNormal:N1,sampleNormal:Zd,sampleUniform:I1,scale:Se,sceneEqual:ov,sceneFromJSON:UM,scenePickVisit:Wh,sceneToJSON:BM,sceneVisit:pi,sceneZOrder:Fb,scheme:fb,serializeXML:dF,setHybridRendererOptions:fW,setRandom:w9,span:zl,splitAccessPath:zi,stringValue:H,textMetrics:On,timeBin:bS,timeFloor:sS,timeFormatLocale:tc,timeInterval:nu,timeOffset:lS,timeSequence:dS,timeUnitSpecifier:J$,timeUnits:o1,toBoolean:B0,toDate:U0,toNumber:Pt,toSet:li,toString:j0,transform:fA,transforms:au,truncate:w$,truthy:Wn,tupleid:ie,typeParsers:x1,utcFloor:aS,utcInterval:iu,utcOffset:cS,utcSequence:hS,utcdayofyear:nS,utcquarter:f$,utcweek:iS,version:die,visitArray:bo,week:eS,writeConfig:Ha,zero:po,zoomLinear:N0,zoomLog:R0,zoomPow:_d,zoomSymlog:P0},Symbol.toStringTag,{value:"Module"}));function pie(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),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&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var gie={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},mie={"*":(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,"==":(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,">>>":(e,t)=>e>>>t},yie={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const bie=Array.prototype.slice,ua=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,bie.call(t,1))},vie=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var xie={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:vie,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 ua("join",arguments)},indexof:function(){return ua("indexOf",arguments)},lastindexof:function(){return ua("lastIndexOf",arguments)},slice:function(){return ua("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ua("substring",arguments,String)},split:function(){return ua("split",arguments,String)},replace:function(){return ua("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const wie=["view","item","group","xy","x","y"],aw=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&aw.add(setImmediate);const Eie={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:gie[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),aw.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||xie[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>mie[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>yie[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((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,aw.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Rf(e,t,n,i,r,o){const s=a=>Eie[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=i,s.event=r,s.item=o,wie.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var _ie={operator(e,t){const n=t.ast,i=e.functions;return r=>Rf(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Rf(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Rf(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,o)=>{const s=o.item&&o.item.datum;return Rf(n,i,r,s,o)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const u=s.datum;let l=0,c;for(const f in i)c=Rf(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&pie(s,i,o),l}}};const $ie={name:"vega-lite",author:'Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',version:"5.21.0",collaborators:["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],homepage:"https://vega.github.io/vega-lite/",description:"Vega-Lite is a concise high-level language for interactive visualization.",keywords:["vega","chart","visualization"],main:"build/vega-lite.js",unpkg:"build/vega-lite.min.js",jsdelivr:"build/vega-lite.min.js",module:"build/src/index",types:"build/src/index.d.ts",bin:{vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},files:["bin","build","src","vega-lite*","tsconfig.json"],scripts:{changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},repository:{type:"git",url:"https://github.com/vega/vega-lite.git"},license:"BSD-3-Clause",bugs:{url:"https://github.com/vega/vega-lite/issues"},devDependencies:{"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},dependencies:{"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},peerDependencies:{vega:"^5.24.0"},engines:{node:">=18"},packageManager:"yarn@1.22.19"};function uw(e){return U(e,"or")}function lw(e){return U(e,"and")}function cw(e){return U(e,"not")}function Xg(e,t){if(cw(e))Xg(e.not,t);else if(lw(e))for(const n of e.and)Xg(n,t);else if(uw(e))for(const n of e.or)Xg(n,t);else t(e)}function Yu(e,t){return cw(e)?{not:Yu(e.not,t)}:lw(e)?{and:e.and.map(n=>Yu(n,t))}:uw(e)?{or:e.or.map(n=>Yu(n,t))}:t(e)}const ue=structuredClone;function HN(e){throw new Error(e)}function Xu(e,t){const n={};for(const i of t)Z(e,i)&&(n[i]=e[i]);return n}function _n(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Re(e)).join(",")})`};function be(e){if(_e(e))return e;const t=K(e)?e:Re(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function fw(e){return e===!1||e===null}function ye(e,t){return e.includes(t)}function Ku(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function dw(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function GN(e,...t){for(const n of t)Sie(e,n??{});return e}function Sie(e,t){for(const n of B(t))Ha(e,n,t[n],!0)}function ur(e,t){const n=[],i={};let r;for(const o of e)r=t(o),!(r in i)&&(i[r]=1,n.push(o));return n}function Aie(e,t){const n=B(e),i=B(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function VN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hw(e,t){for(const n of e)if(t.has(n))return!0;return!1}function pw(e){const t=new Set;for(const n of e){const r=zi(n).map((s,a)=>a===0?s:`[${s}]`),o=r.map((s,a)=>r.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function gw(e,t){return e===void 0||t===void 0?!0:hw(pw(e),pw(t))}function Ne(e){return B(e).length===0}const B=Object.keys,kt=Object.values,Jo=Object.entries;function Pf(e){return e===!0||e===!1}function qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Lf(e,t){return cw(e)?`!(${Lf(e.not,t)})`:lw(e)?`(${e.and.map(n=>Lf(n,t)).join(") && (")})`:uw(e)?`(${e.or.map(n=>Lf(n,t)).join(") || (")})`:t(e)}function Kg(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Kg(e[n],t)&&delete e[n],Ne(e)}function If(e){return e.charAt(0).toUpperCase()+e.substr(1)}function mw(e,t="datum"){const n=zi(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(H).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function YN(e,t="datum"){return`${t}[${H(zi(e).join("."))}]`}function kie(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ii(e){return`${zi(e).map(kie).join("\\.")}`}function la(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Zu(e){return`${zi(e).join(".")}`}function Ju(e){return e?zi(e).length:0}function et(...e){return e.find(t=>t!==void 0)}let XN=42;function KN(e){const t=++XN;return e?String(e)+t:t}function Cie(){XN=42}function ZN(e){return JN(e)?e:`__${e}`}function JN(e){return e.startsWith("__")}function zf(e){if(e!==void 0)return(e%360+360)%360}function Zg(e){return _e(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const QN=Object.getPrototypeOf(structuredClone({}));function In(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!In(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!In(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])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!==QN.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==QN.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!In(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Re(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,o;if(Array.isArray(i)){for(o="[",r=0;r<i.length;r++)r&&(o+=","),o+=n(i[r])||"null";return o+"]"}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const s=t.push(i)-1,a=Object.keys(i).sort();for(o="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(o&&(o+=","),o+=JSON.stringify(u)+":"+l)}return t.splice(s,1),`{${o}}`}(e)}function U(e,t){return Y(e)&&Z(e,t)&&e[t]!==void 0}const Yr="row",Xr="column",Jg="facet",We="x",yt="y",Si="x2",lr="y2",Qo="xOffset",Qu="yOffset",Ai="radius",Kr="radius2",ri="theta",Zr="theta2",ki="latitude",Ci="longitude",Mi="latitude2",oi="longitude2",$n="color",cr="fill",fr="stroke",Sn="shape",Jr="size",ca="angle",Qr="opacity",es="fillOpacity",ts="strokeOpacity",ns="strokeWidth",is="strokeDash",Bf="text",el="order",Uf="detail",Qg="key",fa="tooltip",em="href",tm="url",nm="description",Mie={x:1,y:1,x2:1,y2:1},eR={theta:1,theta2:1,radius:1,radius2:1};function tR(e){return Z(eR,e)}const yw={longitude:1,longitude2:1,latitude:1,latitude2:1};function nR(e){switch(e){case ki:return"y";case Mi:return"y2";case Ci:return"x";case oi:return"x2"}}function iR(e){return Z(yw,e)}const Fie=B(yw),bw={...Mie,...eR,...yw,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function tl(e){return e===$n||e===cr||e===fr}const rR={row:1,column:1,facet:1},si=B(rR),vw={...bw,...rR},Tie=B(vw),{order:Ype,detail:Xpe,tooltip:Kpe,...Oie}=vw,{row:Zpe,column:Jpe,facet:Qpe,...Die}=Oie;function Nie(e){return Z(Die,e)}function oR(e){return Z(vw,e)}const Rie=[Si,lr,Mi,oi,Zr,Kr];function sR(e){return da(e)!==e}function da(e){switch(e){case Si:return We;case lr:return yt;case Mi:return ki;case oi:return Ci;case Zr:return ri;case Kr:return Ai}return e}function rs(e){if(tR(e))switch(e){case ri:return"startAngle";case Zr:return"endAngle";case Ai:return"outerRadius";case Kr:return"innerRadius"}return e}function dr(e){switch(e){case We:return Si;case yt:return lr;case ki:return Mi;case Ci:return oi;case ri:return Zr;case Ai:return Kr}}function An(e){switch(e){case We:case Si:return"width";case yt:case lr:return"height"}}function aR(e){switch(e){case We:return"xOffset";case yt:return"yOffset";case Si:return"x2Offset";case lr:return"y2Offset";case ri:return"thetaOffset";case Ai:return"radiusOffset";case Zr:return"theta2Offset";case Kr:return"radius2Offset"}}function xw(e){switch(e){case We:return"xOffset";case yt:return"yOffset"}}function Pie(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Lie=B(bw),{x:ege,y:tge,x2:nge,y2:ige,xOffset:rge,yOffset:oge,latitude:sge,longitude:age,latitude2:uge,longitude2:lge,theta:cge,theta2:fge,radius:dge,radius2:hge,...ww}=bw,Iie=B(ww),Ew={x:1,y:1},eo=B(Ew);function tt(e){return Z(Ew,e)}const _w={theta:1,radius:1},zie=B(_w);function im(e){return e==="width"?We:yt}const uR={xOffset:1,yOffset:1};function jf(e){return Z(uR,e)}const{text:pge,tooltip:gge,href:mge,url:yge,description:bge,detail:vge,key:xge,order:wge,...lR}=ww,Bie=B(lR);function Uie(e){return Z(ww,e)}function jie(e){switch(e){case $n:case cr:case fr:case Jr:case Sn:case Qr:case ns:case is:return!0;case es:case ts:case ca:return!1}}const cR={...Ew,..._w,...uR,...lR},$w=B(cR);function hr(e){return Z(cR,e)}function qie(e,t){return Hie(e)[t]}const fR={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Ege,...Wie}=fR;function Hie(e){switch(e){case $n:case cr:case fr:case nm:case Uf:case Qg:case fa:case em:case el:case Qr:case es:case ts:case ns:case Jg:case Yr:case Xr:return fR;case We:case yt:case Qo:case Qu:case ki:case Ci:return Wie;case Si:case lr:case Mi:case oi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Jr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case is:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Sn:return{point:"always",geoshape:"always"};case Bf:return{text:"always"};case ca:return{point:"always",square:"always",text:"always"};case tm:return{image:"always"};case ri:return{text:"always",arc:"always"};case Ai:return{text:"always",arc:"always"};case Zr:case Kr:return{arc:"always"}}}function Sw(e){switch(e){case We:case yt:case ri:case Ai:case Qo:case Qu:case Jr:case ca:case ns:case Qr:case es:case ts:case Si:case lr:case Zr:case Kr:return;case Jg:case Yr:case Xr:case Sn:case is:case Bf:case fa:case em:case tm:case nm:return"discrete";case $n:case cr:case fr:return"flexible";case ki:case Ci:case Mi:case oi:case Uf:case Qg:case el:return}}const Gie={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Vie={count:1,min:1,max:1};function to(e){return U(e,"argmin")}function os(e){return U(e,"argmax")}function Aw(e){return K(e)&&Z(Gie,e)}const Yie=new Set(["count","valid","missing","distinct"]);function rm(e){return K(e)&&Yie.has(e)}function Xie(e){return K(e)&&ye(["min","max"],e)}const Kie=new Set(["count","sum","distinct","valid","missing"]),Zie=new Set(["mean","average","median","q1","q3","min","max"]);function dR(e){return mo(e)&&(e=_m(e,void 0)),"bin"+B(e).map(t=>om(e[t])?qe(`_${t}_${Jo(e[t])}`):qe(`_${t}_${e[t]}`)).join("")}function ze(e){return e===!0||ha(e)&&!e.binned}function Ct(e){return e==="binned"||ha(e)&&e.binned===!0}function ha(e){return Y(e)}function om(e){return U(e,"param")}function hR(e){switch(e){case Yr:case Xr:case Jr:case $n:case cr:case fr:case ns:case Qr:case es:case ts:case Sn:return 6;case is:return 4;default:return 10}}function qf(e){return U(e,"expr")}function Mt(e,{level:t}={level:0}){const n=B(e||{}),i={};for(const r of n)i[r]=t===0?zn(e[r]):Mt(e[r],{level:t-1});return i}function pR(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:s,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Xu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function ss(e){return K(e)||L(e)&&K(e[0])}function ee(e){return U(e,"signal")}function pa(e){return U(e,"step")}function Jie(e){return L(e)?!1:U(e,"fields")&&!U(e,"data")}function Qie(e){return L(e)?!1:U(e,"fields")&&U(e,"data")}function no(e){return L(e)?!1:U(e,"field")&&U(e,"data")}const ere=B({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}),tre={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},kw=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function gR(e){const t=L(e.condition)?e.condition.map(mR):mR(e.condition);return{...zn(e),condition:t}}function zn(e){if(qf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function mR(e){if(qf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ue(e){if(qf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ee(e)?e:e!==void 0?{value:e}:void 0}function nre(e){return ee(e)?e.signal:H(e)}function yR(e){return ee(e)?e.signal:H(e.value)}function Fi(e){return ee(e)?e.signal:e==null?null:H(e)}function ire(e,t,n){for(const i of n){const r=pr(i,t.markDef,t.config);r!==void 0&&(e[i]=Ue(r))}return e}function bR(e){return[].concat(e.type,e.style??[])}function Pe(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&U(t,r)?t[r]:t[e]!==void 0?t[e]:o&&(!r||r===e)?void 0:pr(e,t,n,i)}function pr(e,t,n,{vgChannel:i}={}){const r=Cw(e,t,n.style);return et(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Cw(e,t,n){return vR(e,bR(t),n)}function vR(e,t,n){t=X(t);let i;for(const r of t){const o=n[r];U(o,e)&&(i=o[e])}return i}function xR(e,t){return X(e).reduce((n,i)=>(n.field.push(V(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function wR(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(In(r,i))return;n.push(i)}),n}function ER(e,t){return In(e,t)||!t?e:e?[...X(e),...X(t)].join(", "):t}function _R(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((ss(n)||ee(n))&&(ss(i)||ee(i)))return{explicit:e.explicit,value:ER(n,i)};if(ss(n)||ee(n))return{explicit:e.explicit,value:n};if(ss(i)||ee(i))return{explicit:e.explicit,value:i};if(!ss(n)&&!ee(n)&&!ss(i)&&!ee(i))return{explicit:e.explicit,value:wR(n,i)};throw new Error("It should never reach here")}function Mw(e){return`Invalid specification ${Re(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const rre='Autosize "fit" only works for single views and layered views.';function $R(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function SR(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function AR(e){return e?`Dropping "fit-${e}" because spec has discrete ${An(e)}.`:'Dropping "fit" because spec has discrete size.'}function Fw(e){return`Unknown field for ${e}. Cannot calculate view size.`}function kR(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function ore(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function sre(e){return`The "nearest" transform is not supported for ${e} marks.`}function CR(e){return`Selection not supported for ${e} yet.`}function are(e){return`Cannot find a selection named "${e}".`}const ure="Scale bindings are currently only supported for scales with unbinned, continuous domains.",lre="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",cre="Legend bindings are only supported for selections over an individual field or encoding channel.";function fre(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function dre(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const hre="The same selection must be used to override scale domains in a layered view.",pre='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function gre(e){return`Unknown repeated value "${e}".`}function MR(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const mre="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function yre(e){return`Unrecognized parse "${e}".`}function FR(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const bre="Attempt to add the same child twice.";function vre(e){return`Ignoring an invalid transform: ${Re(e)}.`}const xre='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.';function TR(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function wre(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Re(t)} is overridden by a child projection ${Re(n)}.`}const Ere="Arc marks uses theta channel rather than angle, replacing angle with theta.";function _re(e){return`${e}Offset dropped because ${e} is continuous`}function $re(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Re(n)}}.`}function OR(e){return`Invalid field type "${e}".`}function Sre(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Are(e){return`Invalid aggregation operator "${e}".`}function DR(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function kre(e){return`Position range does not support relative band size for ${e}.`}function Tw(e,t){return`Dropping ${Re(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Cre="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function sm(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Mre(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Fre(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Tre(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Ore(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Ow(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Dre(e){return`The ${e} for range marks cannot be an expression`}function Nre(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Rre(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Pre(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Lre(e){return`Cannot use the relative band size with ${e} scale.`}function Ire(e){return`Using unaggregated domain with raw field has no effect (${Re(e)}).`}function zre(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Bre(e){return`Unaggregated domain is currently unsupported for log scale (${Re(e)}).`}function Ure(e){return`Cannot apply size to non-oriented mark "${e}".`}function jre(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function qre(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function NR(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function RR(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Wre(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using ${Re(n)}.`}function Hre(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using the union of the two domains.`}function Gre(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Vre(e){return`Dropping sort property ${Re(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const PR="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Yre="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.",Xre="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.",Kre="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.";function Zre(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Jre(e){return`Stack is applied to a non-linear scale (${e}).`}function Qre(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function am(e,t){return`Invalid ${e}: ${Re(t)}.`}function eoe(e){return`Dropping day from datetime ${Re(e)} as day cannot be combined with other units.`}function toe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function noe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function ioe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function LR(e){return`1D error band does not support ${e}.`}function IR(e){return`Channel ${e} is required for "binned" bin.`}function roe(e){return`Channel ${e} should not be used with "binned" bin.`}function ooe(e){return`Domain for ${e} is required for threshold scale.`}const zR=D0(O0);let nl=zR;function soe(e){return nl=e,nl}function aoe(){return nl=zR,nl}function j(...e){nl.warn(...e)}function uoe(...e){nl.debug(...e)}function ga(e){if(e&&Y(e)){for(const t of Nw)if(U(e,t))return!0}return!1}const BR=["january","february","march","april","may","june","july","august","september","october","november","december"],loe=BR.map(e=>e.substr(0,3)),UR=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],coe=UR.map(e=>e.substr(0,3));function foe(e){if(Zg(e)&&(e=+e),_e(e))return e>4&&j(am("quarter",e)),e-1;throw new Error(am("quarter",e))}function doe(e){if(Zg(e)&&(e=+e),_e(e))return e-1;{const t=e.toLowerCase(),n=BR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=loe.indexOf(i);if(r!==-1)return r;throw new Error(am("month",e))}}function hoe(e){if(Zg(e)&&(e=+e),_e(e))return e%7;{const t=e.toLowerCase(),n=UR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=coe.indexOf(i);if(r!==-1)return r;throw new Error(am("day",e))}}function Dw(e,t){const n=[];if(t&&e.day!==void 0&&B(e).length>1&&(j(eoe(e)),e=ue(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?doe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?foe(e.quarter):e.quarter;n.push(_e(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?hoe(e.day):e.day;n.push(_e(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ma(e){const n=Dw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function poe(e){const n=Dw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function goe(e){const t=Dw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const jR={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Nw=B(jR);function moe(e){return Z(jR,e)}function ya(e){return Y(e)?e.binned:qR(e)}function qR(e){return e&&e.startsWith("binned")}function Rw(e){return e.startsWith("utc")}function yoe(e){return e.substring(3)}const boe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function um(e){return Nw.filter(t=>HR(e,t))}function WR(e){const t=um(e);return t[t.length-1]}function HR(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function voe(e,t,{end:n}={end:!1}){const i=mw(t),r=Rw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of Nw)HR(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),poe(a)}function GR(e){if(!e)return;const t=um(e);return`timeUnitSpecifier(${Re(t)}, ${Re(boe)})`}function xoe(e,t,n){if(!e)return;const i=GR(e);return`${n||Rw(e)?"utc":"time"}Format(${t}, ${i})`}function bt(e){if(!e)return;let t;return K(e)?qR(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Y(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Rw(t.unit)&&(t.utc=!0,t.unit=yoe(t.unit)),t}function woe(e){const{utc:t,...n}=bt(e);return n.unit?(t?"utc":"")+B(n).map(i=>qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+B(n).map(i=>qe(`_${i}_${n[i]}`)).join("")}function VR(e,t=n=>n){const n=bt(e),i=WR(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=YR(i,n.step),a={...r,[s]:+r[s]+o};return`${t(ma(a))} - ${t(ma(r))}`}}const Eoe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function _oe(e){return Z(Eoe,e)}function YR(e,t=1){if(_oe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function $oe(e){return U(e,"param")}function Pw(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Lw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Iw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function zw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Bw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Uw(e){if(e!=null&&e.field){if(L(e.range)&&e.range.length===2)return!0;if(ee(e.range))return!0}return!1}function jw(e){return!!(e!=null&&e.field)&&(L(e.oneOf)||L(e.in))}function Soe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function XR(e){return jw(e)||Pw(e)||Uw(e)||Lw(e)||zw(e)||Iw(e)||Bw(e)}function gr(e,t){return $m(e,{timeUnit:t,wrapTime:!0})}function Aoe(e,t){return e.map(n=>gr(n,t))}function KR(e,t=!0){const{field:n}=e,i=bt(e.timeUnit),{unit:r,binned:o}=i||{},s=V(e,{expr:"datum"}),a=r?`time(${o?s:voe(r,n)})`:s;if(Pw(e))return`${a}===${gr(e.equal,r)}`;if(Lw(e)){const u=e.lt;return`${a}<${gr(u,r)}`}else if(zw(e)){const u=e.gt;return`${a}>${gr(u,r)}`}else if(Iw(e)){const u=e.lte;return`${a}<=${gr(u,r)}`}else if(Bw(e)){const u=e.gte;return`${a}>=${gr(u,r)}`}else{if(jw(e))return`indexof([${Aoe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Soe(e))return lm(a,e.valid);if(Uw(e)){const{range:u}=Mt(e),l=ee(u)?{signal:`${u.signal}[0]`}:u[0],c=ee(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+gr(l,r)+", "+gr(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${gr(l,r)}`),c!==null&&f.push(`${a} <= ${gr(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Re(e)}`)}function lm(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function koe(e){return XR(e)&&e.timeUnit?{...e,timeUnit:bt(e.timeUnit)}:e}const Wf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Coe(e){return e==="quantitative"||e==="temporal"}function ZR(e){return e==="ordinal"||e==="nominal"}const ba=Wf.quantitative,qw=Wf.ordinal,il=Wf.temporal,Ww=Wf.nominal,rl=Wf.geojson;function Moe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case ba:return"quantitative";case"t":case il:return"temporal";case"o":case qw:return"ordinal";case"n":case Ww:return"nominal";case rl:return"geojson"}}const Ft={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"},Hw={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 Foe(e,t){const n=Hw[e],i=Hw[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Toe={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 JR(e){return Toe[e]}const QR=new Set(["linear","log","pow","sqrt","symlog"]),e5=new Set([...QR,"time","utc"]);function t5(e){return QR.has(e)}const n5=new Set(["quantile","quantize","threshold"]),Ooe=new Set([...e5,...n5,"sequential","identity"]),Doe=new Set(["ordinal","bin-ordinal","point","band"]);function vt(e){return Doe.has(e)}function Ti(e){return Ooe.has(e)}function mr(e){return e5.has(e)}function ol(e){return n5.has(e)}const Noe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Roe(e){return!K(e)&&U(e,"name")}function i5(e){return U(e,"param")}function Poe(e){return U(e,"unionWith")}function Loe(e){return Y(e)&&"field"in e}const Ioe={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},{type:$ge,domain:Sge,range:Age,rangeMax:kge,rangeMin:Cge,scheme:Mge,...zoe}=Ioe,Boe=B(zoe);function Gw(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 mr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return mr(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return mr(e);case"nice":return mr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ti(e)&&!ye(["log","time","utc","threshold","quantile"],e)}}function r5(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return tl(e)?void 0:Pre(t);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}}function Uoe(e,t){return ye([qw,Ww],t)?e===void 0||vt(e):t===il?ye([Ft.TIME,Ft.UTC,void 0],e):t===ba?t5(e)||ol(e)||e===void 0:!0}function joe(e,t,n=!1){if(!hr(e))return!1;switch(e){case We:case yt:case Qo:case Qu:case ri:case Ai:return mr(t)||t==="band"?!0:t==="point"?!n:!1;case Jr:case ns:case Qr:case es:case ts:case ca:return mr(t)||ol(t)||ye(["band","point","ordinal"],t);case $n:case cr:case fr:return t!=="band";case is:case Sn:return t==="ordinal"||ol(t)}}function qoe(e){return Y(e)&&"value"in e}const cn={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"},o5=cn.arc,cm=cn.area,fm=cn.bar,Woe=cn.image,dm=cn.line,hm=cn.point,Hoe=cn.rect,pm=cn.rule,s5=cn.text,Vw=cn.tick,Goe=cn.trail,Yw=cn.circle,Xw=cn.square,a5=cn.geoshape;function as(e){return["line","area","trail"].includes(e)}function Hf(e){return["rect","bar","image","arc","tick"].includes(e)}const Voe=new Set(B(cn));function yr(e){return U(e,"type")}const Yoe=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Xoe=["fill","fillOpacity"],Koe=[...Yoe,...Xoe],u5=B({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Kw=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Zoe={area:["line","point"],bar:Kw,rect:Kw,line:["point"],tick:["bandSize","thickness",...Kw]},Joe={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},l5=B({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 va(e){return U(e,"band")}const Qoe={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Zw={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},ese={...Zw,binSpacing:1},tse={...Zw,thickness:1};function nse(e){return yr(e)?e.type:e}function c5(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Jw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Ti(i)||r)return"always-valid";const o=c5(Pe("invalid",e,t),{isPath:as(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function ise(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function f5({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,o=`peek(${i})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:o})`}}function d5({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=Ni(t),u=rm(a==null?void 0:a.aggregate),l=Jw({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const f=((c=o.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:lm(V(a,{expr:"datum"}),!1),...rse(f,n,i)}}}function rse(e,t,n){if(qoe(e)){const{value:i}=e;return ee(i)?{signal:i.signal}:{value:i}}return f5({scale:t,scaleName:n,mode:"zeroOrMin"})}function Qw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=da(t),u=eE(e),l=d5({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function ose(e){const{datum:t}=e;return ga(t)?ma(t):`${Re(t)}`}function xa(e,t,n,i){const r={};if(t&&(r.scale=t),br(e)){const{datum:o}=e;ga(o)?r.signal=ma(o):ee(o)?r.signal=o.signal:qf(o)?r.signal=o.expr:r.value=o}else r.field=V(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function gm({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!ee(s)&&0<s&&s<1?"datum":void 0,u=V(t,{expr:a,suffix:r}),l=n!==void 0?V(n,{expr:a}):V(t,{suffix:o,expr:a}),c={};if(s===0||s===1){c.scale=e;const f=s===0?u:l;c.field=f}else{const f=ee(s)?`(1-${s.signal}) * ${u} + ${s.signal} * ${l}`:`${1-s} * ${u} + ${s} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function sse({scaleName:e,fieldDef:t}){const n=V(t,{expr:"datum"}),i=V(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function eE({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(le(t)){const f=s==null?void 0:s.get("type");if(fn(t)){c??(c=us({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:p}=t;if(ze(d)||c&&h&&p===il)return a!=null&&a.impute?xa(t,o,{binSuffix:"mid"},{offset:u}):c&&!vt(f)?gm({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):xa(t,o,Zf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Ct(d)){if(q(n))return gm({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(IR(e===We?Si:lr))}}return xa(t,o,vt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Di(t)){const f=t.value,d=u?{offset:u}:{};return{...Gf(e,f),...d}}}return ce(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Gf(e,t){return ye(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ye(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ue(t)}function wa(e){return e&&e!=="number"&&e!=="time"}function h5(e,t,n){return`${e}(${t}${n?`, ${Re(n)}`:""})`}const ase=" – ";function tE({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(wa(n))return Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=p5(e,i,r),a=sl(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return Oi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Oi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return Oi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(cl(e)){const c=lse({field:s,timeUnit:q(e)?(u=bt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:Ea(e)&&((l=e.scale)==null?void 0:l.type)===Ft.UTC});return c?{signal:c}:void 0}if(t=nE({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&ze(e.bin)){const c=V(e,{expr:i,binSuffix:"end"});return{signal:Vf(s,c,t,n,o)}}else return t||sl(e)==="quantitative"?{signal:`${y5(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function p5(e,t,n){return q(e)?n?`${V(e,{expr:t,suffix:"end"})}-${V(e,{expr:t,suffix:"start"})}`:V(e,{expr:t}):ose(e)}function Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=p5(e,i,r)),s!=="datum.value"&&q(e)&&ze(e.bin)){const a=V(e,{expr:i,binSuffix:"end"});return{signal:Vf(s,a,t,n,o)}}return{signal:h5(n,s,t)}}function g5(e,t,n,i,r,o){var s;if(!(K(i)&&wa(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&sl(e)==="quantitative"&&(r.normalizedNumberFormatType&&al(e)&&e.stack==="normalize"||r.numberFormatType))){if(al(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return nE({type:"quantitative",config:r,normalizeStack:!0});if(cl(e)){const a=q(e)?(s=bt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:use({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return nE({type:t,specifiedFormat:n,config:r})}}function m5(e,t,n){var i;if(e&&(ee(e)||e==="number"||e==="time"))return e;if(cl(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=bt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function nE({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===ba)return i?n.normalizedNumberFormat:n.numberFormat}function use({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:GR(t)}:i?void 0:n.timeFormat)}function y5(e,t){return`format(${e}, "${t||""}")`}function b5(e,t,n,i){return wa(n)?h5(n,e,t):y5(e,(K(t)?t:void 0)??i.numberFormat)}function Vf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Vf(e,t,r.numberFormat,r.numberFormatType,r);const o=b5(e,n,i,r),s=b5(t,n,i,r);return`${lm(e,!1)} ? "null" : ${o} + "${ase}" + ${s}`}function lse({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=K(n)?n:r,`${o?"utc":"time"}Format(${e}, '${n}')`):xoe(t,e,o)}const mm="min",cse={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function v5(e){return Z(cse,e)}function fse(e){return U(e,"encoding")}function io(e){return e&&(e.op==="count"||U(e,"field"))}function x5(e){return e&&L(e)}function Yf(e){return U(e,"row")||U(e,"column")}function iE(e){return U(e,"header")}function ym(e){return U(e,"facet")}function dse(e){return U(e,"param")}function hse(e){return!K(e)&&U(e,"repeat")}function w5(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function rE(e){return U(e,"sort")}function us({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(le(e)&&e.bandPosition!==void 0)return e.bandPosition;if(q(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return pr("timeUnitBandPosition",n,i);if(ze(o))return .5}}function E5({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=An(e),u=Pe(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:pr("timeUnitBandSize",i,r)};if(ze(h)&&!vt(o))return{band:1}}if(Hf(i.type))return o?vt(o)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function _5(e,t,n,i){return ze(e.bin)||e.timeUnit&&fn(e)&&e.type==="temporal"?us({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function $5(e){return U(e,"sort")&&!U(e,"field")}function Xf(e){return U(e,"condition")}function bm(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&q(t)}function Kf(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&le(t)}function pse(e){const t=e==null?void 0:e.condition;return!!t&&(L(t)||Di(t))}function q(e){return U(e,"field")||(e==null?void 0:e.aggregate)==="count"}function sl(e){return e==null?void 0:e.type}function br(e){return U(e,"datum")}function ls(e){return fn(e)&&!xm(e)||vm(e)}function S5(e){return fn(e)&&e.type==="quantitative"&&!e.bin||vm(e)}function vm(e){return br(e)&&_e(e.datum)}function le(e){return q(e)||br(e)}function fn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function Di(e){return U(e,"value")}function Ea(e){return U(e,"scale")||U(e,"sort")}function al(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function A5(e){return U(e,"legend")}function k5(e){return U(e,"format")||U(e,"formatType")}function gse(e){return _n(e,["legend","axis","header","scale"])}function mse(e){return U(e,"op")}function V(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(bse(e))n=ZN("count");else{let s;if(!t.nofn)if(mse(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;ze(a)?(s=dR(a),r=(t.binSuffix??"")+(t.suffix??"")):u?os(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):to(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!ya(l)&&(s=woe(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}s&&(n=n?`${s}_${n}`:s)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?Zu(n):t.expr?YN(n,t.expr)+o:ii(n)+o}function xm(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return q(e)&&!!e.bin;case"temporal":return!1}throw new Error(OR(e.type))}function yse(e){var t;return Ea(e)&&ol((t=e.scale)==null?void 0:t.type)}function bse(e){return e.aggregate==="count"}function vse(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(ze(i))return`${n} (binned)`;if(r&&!ya(r)){const a=(s=bt(r))==null?void 0:s.unit;if(a)return`${n} (${um(a).join("-")})`}else if(o)return os(o)?`${n} for max ${o.argmax}`:to(o)?`${n} for min ${o.argmin}`:`${If(o)} of ${n}`;return n}function xse(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(os(t))return`${r} for argmax(${t.argmax})`;if(to(t))return`${r} for argmin(${t.argmin})`;const o=i&&!ya(i)?bt(i):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||ze(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const C5=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return xse(e);default:return vse(e,t)}};let M5=C5;function F5(e){M5=e}function wse(){F5(C5)}function ul(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=oE(e))==null?void 0:a.title;if(!q(e))return r??e.title;const o=e,s=i?sE(o,t):void 0;return n?et(r,o.title,s):r??o.title??s}function oE(e){if(al(e)&&e.axis)return e.axis;if(A5(e)&&e.legend)return e.legend;if(iE(e)&&e.header)return e.header}function sE(e,t){return M5(e,t)}function wm(e){if(k5(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=oE(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Ese(e,t){var o;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(rE(e)&&L(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!os(n)&&!to(n))return"quantitative";if(Ea(e)&&((o=e.scale)!=null&&o.type))switch(Hw[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ni(e){if(q(e))return e;if(bm(e))return e.condition}function lt(e){if(le(e))return e;if(Kf(e))return e.condition}function T5(e,t,n,i={}){if(K(e)||_e(e)||mo(e)){const r=K(e)?"string":_e(e)?"number":"boolean";return j($re(t,r,e)),{value:e}}return le(e)?Em(e,t,n,i):Kf(e)?{...e,condition:Em(e.condition,t,n,i)}:e}function Em(e,t,n,i){if(k5(e)){const{format:r,formatType:o,...s}=e;if(wa(o)&&!n.customFormatTypes)return j(TR(t)),Em(s,t,n,i)}else{const r=al(e)?"axis":A5(e)?"legend":iE(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(wa(s)&&!n.customFormatTypes)return j(TR(t)),Em({...e,[r]:a},t,n,i)}}return q(e)?aE(e,t,i):_se(e)}function _se(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=_e(n)?"quantitative":K(n)?"nominal":ga(n)?"temporal":void 0,{...e,type:t}}function aE(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!Aw(i)&&!os(i)&&!to(i)&&(j(Are(i)),delete a.aggregate),r&&(a.timeUnit=bt(r)),s&&(a.field=`${s}`),ze(o)&&(a.bin=_m(o,t)),Ct(o)&&!tt(t)&&j(roe(t)),fn(a)){const{type:u}=a,l=Moe(u);u!==l&&(a.type=l),u!=="quantitative"&&rm(i)&&(j(Sre(u,i)),a.type="quantitative")}else if(!sR(t)){const u=Ese(a,t);a.type=u}if(fn(a)){const{compatible:u,warning:l}=$se(a,t)||{};u===!1&&j(l)}if(rE(a)&&K(a.sort)){const{sort:u}=a;if(v5(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&v5(l))return{...a,sort:{encoding:l,order:"descending"}}}if(iE(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function _m(e,t){return mo(e)?{maxbins:hR(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:hR(t)}:e}const ll={compatible:!0};function $se(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Yr:case Xr:case Jg:return xm(e)?ll:{compatible:!1,warning:Fre(t)};case We:case yt:case Qo:case Qu:case $n:case cr:case fr:case Bf:case Uf:case Qg:case fa:case em:case tm:case ca:case ri:case Ai:case nm:return ll;case Ci:case oi:case ki:case Mi:return n!==ba?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ll;case Qr:case es:case ts:case ns:case Jr:case Zr:case Kr:case Si:case lr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:ll;case Sn:case is:return!xm(e)&&!yse(e)?{compatible:!1,warning:Tre(t)}:ll;case el:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:ll}}function cl(e){const{formatType:t}=wm(e);return t==="time"||!t&&Sse(e)}function Sse(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function $m(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const o=t&&((u=bt(t))==null?void 0:u.unit);let s=o||n==="temporal",a;return qf(e)?a=e.expr:ee(e)?a=e.signal:ga(e)?(s=!0,a=ma(e)):(K(e)||_e(e))&&s&&(a=`datetime(${Re(e)})`,moe(o)&&(_e(e)&&e<1e4||K(e)&&isNaN(Date.parse(e)))&&(a=ma({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:Re(e)}function O5(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!ya(e.timeUnit)?e.timeUnit:void 0,o=$m(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function Zf(e,t){return ze(e.bin)?hr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const D5={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 Jf(e){return e==null?void 0:e.condition}const N5=["domain","grid","labels","ticks","title"],Ase={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"},R5={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},kse={...R5,style:1,labelExpr:1,encoding:1};function P5(e){return Z(kse,e)}const L5=B({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 ro(e){return U(e,"mark")}class Sm{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ro(t)?nse(t.mark)===this.name:!1}}function _a(e,t){const n=e&&e[t];return n?L(n)?Ku(n,i=>!!i.field):q(n)||bm(n):!1}function I5(e,t){const n=e&&e[t];return n?L(n)?Ku(n,i=>!!i.field):q(n)||br(n)||Kf(n):!1}function z5(e,t){if(tt(t)){const n=e[t];if((q(n)||br(n))&&(ZR(n.type)||q(n)&&n.timeUnit)){const i=xw(t);return I5(e,i)}}return!1}function B5(e){return Ku(Tie,t=>{if(_a(e,t)){const n=e[t];if(L(n))return Ku(n,i=>!!i.aggregate);{const i=Ni(n);return i&&!!i.aggregate}}return!1})}function U5(e,t){const n=[],i=[],r=[],o=[],s={};return uE(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=oE(a),g=p==null?void 0:p.title;let m=V(a,{forAs:!0});const y={...g?[]:{title:ul(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(os(c)?(b="argmax",m=V({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):to(c)?(b="argmin",m=V({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),o.push(v)}}else if(n.push(m),fn(a)&&ze(f)){if(i.push({bin:f,field:l,as:m}),n.push(V(a,{binSuffix:"end"})),Zf(a,u)&&n.push(V(a,{binSuffix:"range"})),tt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",sR(u)||(y.type=ba)}else if(d&&!ya(d)){r.push({timeUnit:d,field:l,as:m});const b=fn(a)&&a.type!==il&&"time";b&&(u===Bf||u===fa?y.formatType=b:Uie(u)?y.legend={formatType:b,...y.legend}:tt(u)&&(y.axis={formatType:b,...y.axis}))}s[u]=y}else n.push(l),s[u]=e[u]}else s[u]=e[u]}),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function Cse(e,t,n){const i=qie(t,n);if(i){if(i==="binned"){const r=e[t===Si?We:yt];return!!(q(r)&&q(e[t])&&Ct(r.bin))}}else return!1;return!0}function Mse(e,t,n,i){const r={};for(const o of B(e))oR(o)||j(Mre(o));for(let o of Lie){if(!e[o])continue;const s=e[o];if(jf(o)){const a=Pie(o),u=r[a];if(q(u)&&Coe(u.type)&&q(s)&&!u.timeUnit){j(_re(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(Ere),o=ri),!Cse(e,o,t)){j(sm(o,t));continue}if(o===Jr&&t==="line"){const a=Ni(e[o]);if(a!=null&&a.aggregate){j(Cre);continue}}if(o===$n&&(n?"fill"in e:"stroke"in e)){j(DR("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Uf||o===el&&!L(s)&&!Di(s)||o===fa&&L(s)){if(s){if(o===el){const a=e[o];if($5(a)){r[o]=a;continue}}r[o]=X(s).reduce((a,u)=>(q(u)?a.push(aE(u,o)):j(Tw(u,o)),a),[])}}else{if(o===fa&&s===null)r[o]=null;else if(!q(s)&&!br(s)&&!Di(s)&&!Xf(s)&&!ee(s)){j(Tw(s,o));continue}r[o]=T5(s,o,i)}}return r}function Am(e,t){const n={};for(const i of B(e)){const r=T5(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Fse(e){const t=[];for(const n of B(e))if(_a(e,n)){const i=e[n],r=X(i);for(const o of r)q(o)?t.push(o):bm(o)&&t.push(o.condition)}return t}function uE(e,t,n){if(e)for(const i of B(e)){const r=e[i];if(L(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function Tse(e,t,n,i){return e?B(e).reduce((r,o)=>{const s=e[o];return L(s)?s.reduce((a,u)=>t.call(i,a,u,o),r):t.call(i,r,s,o)},n):n}function j5(e,t){return B(t).reduce((n,i)=>{switch(i){case We:case yt:case em:case nm:case tm:case Si:case lr:case Qo:case Qu:case ri:case Zr:case Ai:case Kr:case ki:case Ci:case Mi:case oi:case Bf:case Sn:case ca:case fa:return n;case el:if(e==="line"||e==="trail")return n;case Uf:case Qg:{const r=t[i];if(L(r)||q(r))for(const o of X(r))o.aggregate||n.push(V(o,{}));return n}case Jr:if(e==="trail")return n;case $n:case cr:case fr:case Qr:case es:case ts:case is:case ns:{const r=Ni(t[i]);return r&&!r.aggregate&&n.push(V(r,{})),n}}},[])}function Ose(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(L(t)){for(const o of t)o.aggregate?(i||(i=[]),i.push(o)):(r||(r=[]),r.push(o));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return L(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function lE(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:s,titlePrefix:a})=>{const u=i?` of ${cE(t)}`:"";return{field:s+t.field,type:t.type,title:ee(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=Fse(n).map(gse);return{tooltip:[...r,...ur(o,be)]}}function cE(e){const{title:t,field:n}=e;return et(t,n)}function fE(e,t,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=cE(n);return q5(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...K(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function q5(e,t,n,i){const{clip:r,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...s?{opacity:s}:{},...yr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...mo(e[t])?{}:e[t]}}]:[]}function W5(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",o=i[r],s=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:km(o,n),continuousAxisChannelDef2:km(s,n),continuousAxisChannelDefError:km(a,n),continuousAxisChannelDefError2:km(u,n),continuousAxis:r}}function km(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(ioe(n,t)),i}else return e}function H5(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(yr(n)&&n.orient)return n.orient;if(ls(r)){if(ls(o)){const s=q(r)&&r.aggregate,a=q(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return cl(o)&&!cl(r)?"horizontal":"vertical"}return"horizontal"}else{if(ls(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Cm="boxplot",Dse=["box","median","outliers","rule","ticks"],Nse=new Sm(Cm,V5);function G5(e){return _e(e)?"tukey":e}function V5(e,{config:t}){e={...e,encoding:Am(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=yr(n)?n:{type:n};r&&j(CR("boxplot"));const u=a.extent??t.boxplot.extent,l=Pe("size",a,t),c=a.invalid,f=G5(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:_}=Rse(e,u,t),E=Zu(g.field),{color:$,size:S,...M}=v,k=m0=>fE(a,m,g,m0,t.boxplot),D=k(M),A=k(v),F=(Y(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",C=k({...M,...S?{size:S}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...$||{value:F}}}}),T=lE([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),P={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},I=f==="min-max"?T:lE([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),z=[...D({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:I}),...D({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:I}),...D({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:I}),...D({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:I})],te=[...f!=="tukey"?z:[],...A({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:w,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...C({partName:"median",mark:{type:"tick",invalid:c,...Y(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:te};const ne=`datum["lower_box_${g.field}"]`,de=`datum["upper_box_${g.field}"]`,ke=`(${de} - ${ne})`,Ee=`${ne} - ${u} * ${ke}`,Ie=`${de} + ${u} * ${ke}`,$r=`datum["${g.field}"]`,Ia={joinaggregate:Y5(g.field),groupby:y},ms={transform:[{filter:`(${Ee} <= ${$r}) && (${$r} <= ${Ie})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${E}`},{op:"max",field:g.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${E}`},...b],groupby:y}],layer:z},{tooltip:J,...he}=M,{scale:me,axis:W}=g,Ot=cE(g),Oe=_n(W,["title"]),Yt=q5(a,"outliers",t.boxplot,{transform:[{filter:`(${$r} < ${Ee}) || (${$r} > ${Ie})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Ot!==void 0?{title:Ot}:{},...me!==void 0?{scale:me}:{},...Ne(Oe)?{}:{axis:Oe}},...he,...$?{color:$}:{},..._?{tooltip:_}:{}}})[0];let wt;const Sr=[...d,...h,Ia];return Yt?wt={transform:Sr,layer:[Yt,ms]}:(wt=ms,wt.transform.unshift(...Sr)),{...s,layer:[wt,{transform:p,layer:te}]}}function Y5(e){const t=Zu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Rse(e,t,n){const i=H5(e,Cm),{continuousAxisChannelDef:r,continuousAxis:o}=W5(e,i,Cm),s=r.field,a=Zu(s),u=G5(t),l=[...Y5(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{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]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Ose(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=U5(p,n),x=i==="vertical"?"horizontal":"vertical",w=i,_=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:_,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:h}}const dE="errorbar",Pse=["ticks","rule"],Lse=new Sm(dE,X5);function X5(e,{config:t}){e={...e,encoding:Am(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=K5(e,dE,t);delete o.size;const c=fE(a,r,i,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Ise(e,t){const{encoding:n}=e;if(zse(n))return{orient:H5(e,t),inputType:"raw"};const i=Bse(n),r=Use(n),o=n.x,s=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(le(a)&&le(u))throw new Error(`${t} cannot have both x2 and y2`);if(le(a)){if(ls(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(le(u)){if(ls(s))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")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(le(u)&&!le(a))throw new Error(`${t} cannot have xError2 without xError`);if(le(c)&&!le(l))throw new Error(`${t} cannot have yError2 without yError`);if(le(a)&&le(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(le(a)){if(ls(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(le(l)){if(ls(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 zse(e){return(le(e.x)||le(e.y))&&!le(e.x2)&&!le(e.y2)&&!le(e.xError)&&!le(e.xError2)&&!le(e.yError)&&!le(e.yError2)}function Bse(e){return le(e.x2)||le(e.y2)}function Use(e){return le(e.xError)||le(e.xError2)||le(e.yError)||le(e.yError2)}function K5(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=yr(i)?i:{type:i};o&&j(CR(t));const{orient:l,inputType:c}=Ise(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=W5(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=jse(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:E,...$}=r,{bins:S,timeUnits:M,aggregate:k,groupby:D,encoding:A}=U5($,n),F=[...k,...m],C=c!=="raw"?[]:D,T=lE(b,f,A,v);return{transform:[...a.transform??[],...S,...M,...F.length===0?[]:[{aggregate:F,groupby:C}],...y],groupby:C,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:A,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:T}}function jse(e,t,n,i,r,o,s,a){let u=[],l=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&j(noe(h,p,s)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:If(h)},{fieldPrefix:"upper_",titlePrefix:Z5(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:Z5(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:ul({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ul({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ul({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(toe(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:la(la(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function Z5(e,t,n){return`${If(e)} ${n} ${t}`}const hE="errorband",qse=["band","borders"],Wse=new Sm(hE,J5);function J5(e,{config:t}){e={...e,encoding:Am(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=K5(e,hE,t),l=s,c=fE(l,r,i,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?j(LR("interpolate")):l.tension&&j(LR("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const Q5={};function pE(e,t,n){const i=new Sm(e,t);Q5[e]={normalizer:i,parts:n}}function Hse(){return B(Q5)}pE(Cm,V5,Dse),pE(dE,X5,Pse),pE(hE,J5,qse);const Gse=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],e6={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"},t6={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"},Vse=B(e6),Yse=B(t6),n6=B({header:1,headerRow:1,headerColumn:1,headerFacet:1}),i6=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Xse={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Kse={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},Ri="_vgsid_",Zse={point:{on:"click",fields:[Ri],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 gE(e){return e==="legend"||!!(e!=null&&e.legend)}function mE(e){return gE(e)&&Y(e)}function yE(e){return!!(e!=null&&e.select)}function r6(e){const t=[];for(const n of e||[]){if(yE(n))continue;const{expr:i,bind:r,...o}=n;if(r&&i){const s={...o,bind:r,init:i};t.push(s)}else{const s={...o,...i?{update:i}:{},...r?{bind:r}:{}};t.push(s)}}return t}function Jse(e){return Mm(e)||vE(e)||bE(e)}function bE(e){return U(e,"concat")}function Mm(e){return U(e,"vconcat")}function vE(e){return U(e,"hconcat")}function o6({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function vr(e){return U(e,"step")}function s6(e){return U(e,"view")||U(e,"width")||U(e,"height")}const a6=20,Qse=B({align:1,bounds:1,center:1,columns:1,spacing:1});function eae(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(ym(e)&&!Yf(e.facet)||bE(e))&&(r.columns=s),Mm(e)&&(r.columns=1);for(const a of Qse)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=_e(u)?u:{row:u.row??o,column:u.column??o}}else r[a]=e[a];return r}function xE(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function wE(e,t){const n=Fm(e,t);return vr(n)?n.step:u6}function Fm(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return et(n,{step:e.step})}const u6=20,tae={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:u6},mark:Joe,arc:{},area:{},bar:ese,circle:{},geoshape:{},image:{},line:{},point:{},rect:Zw,rule:{color:"black"},square:{},text:{color:"black"},tick:tse,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:Noe,projection:{},legend:Xse,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Zse,style:{},title:{},facet:{spacing:a6},concat:{spacing:a6},normalizedNumberFormat:".0%"},oo=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],l6={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},c6={blue:oo[0],orange:oo[1],red:oo[2],teal:oo[3],green:oo[4],yellow:oo[5],purple:oo[6],pink:oo[7],brown:oo[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 nae(e={}){return{signals:[{name:"color",value:Y(e)?{...c6,...e}:c6}],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"}]}}}function iae(e){return{signals:[{name:"fontSize",value:Y(e)?{...l6,...e}:l6}],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"}}}}}function rae(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function f6(e){const t=B(e||{}),n={};for(const i of t){const r=e[i];n[i]=Jf(r)?gR(r):zn(r)}return n}function oae(e){const t=B(e),n={};for(const i of t)n[i]=f6(e[i]);return n}const sae=[...l5,...L5,...n6,"background","padding","legend","lineBreak","scale","style","title","view"];function d6(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=Wa({},ue(tae),n?rae(n):{},t?nae(t):{},i?iae(i):{},o||{});r&&Ha(s,"selection",r,!0);const a=_n(s,sae);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=zn(s[u]));for(const u of l5)s[u]&&(a[u]=Mt(s[u]));for(const u of L5)s[u]&&(a[u]=f6(s[u]));for(const u of n6)s[u]&&(a[u]=Mt(s[u]));if(s.legend&&(a.legend=Mt(s.legend)),s.scale){const{invalid:u,...l}=s.scale,c=Mt(u,{level:1});a.scale={...Mt(l),...B(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=oae(s.style)),s.title&&(a.title=Mt(s.title)),s.view&&(a.view=Mt(s.view)),a}const aae=new Set(["view",...Voe]),uae=["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"],lae={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Zoe};function cae(e){e=ue(e);for(const t of uae)delete e[t];if(e.axis)for(const t in e.axis)Jf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Gse)delete e.legend[t];if(e.mark){for(const t of u5)delete e.mark[t];e.mark.tooltip&&Y(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(r6(e.params)),delete e.params);for(const t of aae){for(const i of u5)delete e[t][i];const n=lae[t];if(n)for(const i of n)delete e[t][i];dae(e,t)}for(const t of Hse())delete e[t];fae(e);for(const t in e)Y(e[t])&&Ne(e[t])&&delete e[t];return Ne(e)?void 0:e}function fae(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=pR(e.title);Ne(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ne(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ne(i)?delete e.title:e.title=i}function dae(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};Ne(o)||(e.style[n??t]=o),delete e[t]}function Tm(e){return U(e,"layer")}function hae(e){return U(e,"repeat")}function pae(e){return!L(e.repeat)&&U(e.repeat,"layer")}class EE{map(t,n){return ym(t)?this.mapFacet(t,n):hae(t)?this.mapRepeat(t,n):vE(t)?this.mapHConcat(t,n):Mm(t)?this.mapVConcat(t,n):bE(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Tm(t))return this.mapLayer(t,n);if(ro(t))return this.mapUnit(t,n);throw new Error(Mw(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const gae={zero:1,center:1,normalize:1};function mae(e){return Z(gae,e)}const yae=new Set([o5,fm,cm,pm,hm,Yw,Xw,dm,s5,Vw]),bae=new Set([fm,cm,o5]);function fl(e){return q(e)&&sl(e)==="quantitative"&&!e.bin}function h6(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(i),s=e[t],a=e[r];if(q(s)&&q(a))if(fl(s)&&fl(a)){if(s.stack)return t;if(a.stack)return r;const u=q(s)&&!!s.aggregate,l=q(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(o){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(fl(s))return t;if(fl(a))return r}else{if(fl(s))return o&&n==="vertical"?void 0:t;if(fl(a))return o&&n==="horizontal"?void 0:r}}function vae(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function p6(e,t){var g,m;const n=yr(e)?e:{type:e},i=n.type;if(!yae.has(i))return null;const r=h6(t,"x",n)||h6(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?V(o,{}):void 0,a=vae(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?V(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?V(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=Iie.reduce((y,b)=>{if(b!=="tooltip"&&_a(t,b)){const v=t[b];for(const x of X(v)){const w=Ni(x);if(w.aggregate)continue;const _=V(w,{});(!_||!l.has(_))&&y.push({channel:b,fieldDef:w})}}return y},[]);let p;return o.stack!==void 0?mo(o.stack)?p=o.stack?"zero":null:p=o.stack:bae.has(i)&&(p="zero"),!p||!mae(p)||B5(t)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Ft.LINEAR&&o!=null&&o.stack&&j(Jre(o.scale.type)),le(t[dr(r)])?(o.stack!==void 0&&j(Zre(r)),null):(q(o)&&o.aggregate&&!Kie.has(o.aggregate)&&j(Qre(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:as(i),stackBy:h,offset:p}))}function g6(e,t,n){const i=Mt(e),r=Pe("orient",i,n);if(i.orient=_ae(i.type,t,r),r!==void 0&&r!==i.orient&&j(Rre(i.orient,r)),i.type==="bar"&&i.orient){const u=Pe("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Qoe[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Pe("opacity",i,n),s=Pe("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=wae(i.type,t)),Pe("cursor",i,n)===void 0&&(i.cursor=xae(i,t,n)),i}function xae(e,t,n){return t.href||e.href||Pe("href",e,n)?"pointer":e.cursor}function wae(e,t){if(ye([hm,Vw,Yw,Xw],e)&&!B5(t))return .7}function Eae(e,t,{graticule:n}){if(n)return!1;const i=pr("filled",e,t),r=e.type;return et(i,r!==hm&&r!==dm&&r!==pm)}function _ae(e,t,n){switch(e){case hm:case Yw:case Xw:case s5:case Hoe:case Woe:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case fm:if(q(i)&&(Ct(i.bin)||q(r)&&r.aggregate&&!i.aggregate))return"vertical";if(q(r)&&(Ct(r.bin)||q(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(q(i)&&i.type===ba&&!ze(i.bin)||vm(i))&&q(r)&&Ct(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===ba&&!ze(r.bin)||vm(r))&&q(i)&&Ct(i.bin)?"vertical":"horizontal"}case pm:if(o&&!(q(i)&&Ct(i.bin))&&s&&!(q(r)&&Ct(r.bin)))return;case cm:if(s)return q(r)&&Ct(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Ct(i.bin)?"vertical":"horizontal";if(e===pm){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case dm:case Vw:{const a=S5(i),u=S5(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=fn(i)&&i.type===il,c=fn(r)&&r.type===il;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function $ae(e){const{point:t,line:n,...i}=e;return B(i).length>1?i:i.type}function Sae(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:_n(e[t],["point","line"])});return e}function _E(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Y(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Y(t.point)?t.point:{}:void 0}function m6(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class Aae{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ro(t)){const{mark:i,encoding:r}=t,o=yr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!_E(o,n[o.type],r);case"area":return!!_E(o,n[o.type],r)||!!m6(o,n[o.type])}}return!1}run(t,n,i){const{config:r}=n,{params:o,projection:s,mark:a,name:u,encoding:l,...c}=t,f=Am(l,r),d=yr(a)?a:{type:a},h=_E(d,r[d.type],f),p=d.type==="area"&&m6(d,r[d.type]),g=[{name:u,...o?{params:o}:{},mark:$ae({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:_n(f,["shape"])}],m=p6(g6(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=_n(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...Xu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...Xu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Sae(r)})}}function kae(e,t){return t?Yf(e)?x6(e,t):y6(e,t):e}function $E(e,t){return t?x6(e,t):e}function SE(e,t,n){const i=t[e];if(hse(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(gre(i.repeat));return}return t}function y6(e,t){if(e=SE("field",e,t),e!==void 0){if(e===null)return null;if(rE(e)&&io(e.sort)){const n=SE("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function b6(e,t){if(q(e))return y6(e,t);{const n=SE("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function v6(e,t){if(le(e)){const n=b6(e,t);if(n)return n;if(Xf(e))return{condition:e.condition}}else{if(Kf(e)){const n=b6(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function x6(e,t){const n={};for(const i in e)if(U(e,i)){const r=e[i];if(L(r))n[i]=r.map(o=>v6(o,t)).filter(o=>o);else{const o=v6(r,t);o!==void 0&&(n[i]=o)}}return n}class Cae{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ro(t)){const{encoding:n,mark:i}=t;if(i==="line"||yr(i)&&i.type==="line")for(const r of Rie){const o=da(r),s=n[o];if(n[r]&&(q(s)&&!Ct(s.bin)||br(s)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:o}=t;return j(Nre(!!r.x2,!!r.y2)),i({...t,mark:Y(o)?{...o,type:"rule"}:"rule"},n)}}class Mae extends EE{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Nse,Lse,Wse,new Aae,new Cae]}map(t,n){if(ro(t)){const i=_a(t.encoding,Yr),r=_a(t.encoding,Xr),o=_a(t.encoding,Jg);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=$E(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(s,n.config))return u.run(s,n,a);return s}mapRepeat(t,n){return pae(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...o}=t,{row:s,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...o,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${qe(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!L(i)&&t.columns&&(t=_n(t,["columns"]),j(MR("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!L(i)&&i.row||[u?u.row:null],f=!L(i)&&i.column||[u?u.column:null],d=L(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(L(i)?`${qe(p)}`:(i.row?`row_${qe(g)}`:"")+(i.column?`column_${qe(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(_n(v,["data"]))}const h=L(i)?t.columns:i.column?i.column.length:1;return{data:r.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Yf(i)&&t.columns&&(t=_n(t,["columns"]),j(MR("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=E6({parentProjection:s,projection:r}),l=w6({parentEncoding:o,encoding:$E(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:o,...s}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=$E(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:o}=t;if(i||r){o&&j(Ore([...i?[Yr]:[],...r?[Xr]:[]]));const s={},a={};for(const u of[Yr,Xr]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;s[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:kae(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:o,projection:s,...a}=t,u={...r,parentEncoding:w6({parentEncoding:n,encoding:o,layer:!0}),parentProjection:E6({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function w6({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...B(e),...B(t)]);for(const o of r){const s=t[o],a=e[o];if(le(s)){const u={...a,...s};i[o]=u}else Kf(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Di(a)||ee(a)||le(a)||L(a))&&(i[o]=a)}}else i=t;return!i||Ne(i)?void 0:i}function E6(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(wre({parentProjection:t,projection:n})),n??t}function AE(e){return U(e,"filter")}function Fae(e){return U(e,"stop")}function _6(e){return U(e,"lookup")}function Tae(e){return U(e,"data")}function Oae(e){return U(e,"param")}function Dae(e){return U(e,"pivot")}function Nae(e){return U(e,"density")}function Rae(e){return U(e,"quantile")}function Pae(e){return U(e,"regression")}function Lae(e){return U(e,"loess")}function Iae(e){return U(e,"sample")}function zae(e){return U(e,"window")}function Bae(e){return U(e,"joinaggregate")}function Uae(e){return U(e,"flatten")}function jae(e){return U(e,"calculate")}function $6(e){return U(e,"bin")}function qae(e){return U(e,"impute")}function Wae(e){return U(e,"timeUnit")}function Hae(e){return U(e,"aggregate")}function Gae(e){return U(e,"stack")}function Vae(e){return U(e,"fold")}function Yae(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function Xae(e){return e.map(t=>AE(t)?{filter:Yu(t.filter,koe)}:t)}class Kae extends EE{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=S6(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=S6(t,n),t.encoding){const i={};for(const[r,o]of Jo(t.encoding))i[r]=A6(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Jo(i).map(([o,s])=>{const{init:a,bind:u,empty:l,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=l!=="none";for(const f of kt(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function S6(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(AE(o))return{filter:kE(o,t)};if($6(o)&&ha(o.bin))return{...o,bin:k6(o.bin)};if(_6(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function A6(e,t){var i,r;const n=ue(e);if(q(n)&&ha(n.bin)&&(n.bin=k6(n.bin)),Ea(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(Xf(n))if(L(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:kE(o,t)}});else{const{selection:o,param:s,test:a,...u}=A6(n.condition,t);n.condition=s?n.condition:{...u,test:kE(n.condition,t)}}return n}function k6(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function kE(e,t){const n=i=>Yu(i,r=>{var o;const s=t.emptySelections[r]??!0,a={param:r,empty:s};return(o=t.selectionPredicates)[r]??(o[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):Yu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class CE extends EE{map(t,n){const i=n.selections??[];if(t.params&&!ro(t)){const r=[];for(const o of t.params)yE(o)?i.push(o):r.push(o);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),o=[];for(const s of i)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(K(a)&&(a===t.name||r.includes(a))||L(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=CE.prototype[e];CE.prototype[e]=function(n,i){return t.call(this,n,Zae(n,i))}}function Zae(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function C6(e,t){t===void 0&&(t=d6(e.config));const n=tue(e,t),{width:i,height:r}=e,o=nue(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Jae=new Mae,Qae=new Kae,eue=new CE;function tue(e,t={}){const n={config:t};return eue.map(Jae.map(Qae.map(e,n),n),n)}function M6(e){return K(e)?{type:e}:e??{}}function nue(e,t,n){let{width:i,height:r}=t;const o=ro(e)||Tm(e),s={};o?i=="container"&&r=="container"?(s.type="fit",s.contains="padding"):i=="container"?(s.type="fit-x",s.contains="padding"):r=="container"&&(s.type="fit-y",s.contains="padding"):(i=="container"&&(j($R("width")),i=void 0),r=="container"&&(j($R("height")),r=void 0));const a={type:"pad",...s,...n?M6(n.autosize):{},...M6(e.autosize)};if(a.type==="fit"&&!o&&(j(rre),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(SR("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(SR("height")),!In(a,{type:"pad"}))return a}function iue(e){return["fit","fit-x","fit-y"].includes(e)}function rue(e){return e?`fit-${im(e)}`:"fit"}const oue=["background","padding"];function F6(e,t){const n={};for(const i of oue)e&&e[i]!==void 0&&(n[i]=zn(e[i]));return t&&(n.params=e.params),n}class so{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new so(ue(this.explicit),ue(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return et(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of B(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function xr(e){return{explicit:!0,value:e}}function Bn(e){return{explicit:!1,value:e}}function T6(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Om(t,n,i,r)}}function Om(e,t,n,i){return e.explicit&&t.explicit&&j(Wre(n,i,e.value,t.value)),e}function cs(e,t,n,i,r=Om){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:In(e.value,t.value)?e:r(e,t,n,i)}class sue extends so{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function dl(e){return U(e,"url")}function Qf(e){return U(e,"values")}function O6(e){return U(e,"name")&&!dl(e)&&!Qf(e)&&!fs(e)}function fs(e){return e&&(D6(e)||N6(e)||ME(e))}function D6(e){return U(e,"sequence")}function N6(e){return U(e,"sphere")}function ME(e){return U(e,"graticule")}var Ze;(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",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ze||(Ze={}));function R6({invalid:e,isPath:t}){switch(c5(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function aue(e){const{marks:t,scales:n}=R6(e);return t===n?Ze.Main:n==="include-invalid-values"?Ze.PreFilterInvalid:Ze.PostFilterInvalid}function P6(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ii(r.field),r}function $a(e,t=!0,n=Rt){if(L(e)){const i=e.map(r=>$a(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ga(e))return n(t?ma(e):goe(e));return t?n(Re(e)):e}function uue(e,t){for(const n of kt(e.component.selection??{})){const i=n.name;let r=`${i}${ds}, ${n.resolve==="global"?"true":`{unit: ${Aa(e)}}`}`;for(const o of zm)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Iue,on:[{events:{signal:n.name+ds},update:`modify(${H(n.name+Sa)}, ${r})`}]})}return FE(t)}function lue(e,t){if(e.component.selection&&B(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Ko("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return FE(t)}function cue(e,t){let n=!1;for(const i of kt(e.component.selection??{})){const r=i.name,o=H(r+Sa);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${d4}(${o}, ${H(a)}${u}`})}n=!0;for(const a of zm)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),FE(t)}function fue(e,t){const n=[...t],i=Aa(e,{escape:!1});for(const r of kt(e.component.selection??{})){const o={name:r.name+Sa};if(r.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Ri}}]),r.init){const a=r.project.items.map(P6);o.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[Ri]:$a(u,!1)[0]})):r.init.map(u=>({unit:i,fields:a,values:$a(u,!1)}))}n.filter(a=>a.name===r.name+Sa).length||n.push(o)}return n}function L6(e,t){for(const n of kt(e.component.selection??{}))for(const i of zm)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function due(e,t){for(const n of e.children)Ge(n)&&(t=L6(n,t));return t}function hue(e,t,n,i){const r=y4(e,t.param,t);return{signal:Ti(n.get("type"))&&L(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function FE(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class Te{constructor(t,n){this.debugName=n,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,n){if(this._children.includes(t)){j(bre);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class kn extends Te{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,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${KN()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function TE(e){return e.as!==void 0}function I6(e){return`${e}_end`}class wr extends Te{clone(){return new wr(null,ue(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{const{field:a,timeUnit:u}=o;if(u){let l;if(ya(u)){if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=us({fieldDef:o,markDef:f,config:d});(Hf(c)||h)&&(l={timeUnit:bt(u),field:a})}}else l={as:V(o,{forAs:!0}),field:a,timeUnit:u};if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=us({fieldDef:o,markDef:f,config:d});Hf(c)&&tt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[be(l)]=l)}return r},{});return Ne(i)?null:new wr(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=bt(i),s={...r,timeUnit:o};return new wr(t,{[be(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of Jo(this.timeUnits)){const o=TE(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(kt(this.timeUnits).map(t=>TE(t)?t.as:I6(t.field)))}dependentFields(){return new Set(kt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${be(this.timeUnits)}`}assemble(){const t=[];for(const n of kt(this.timeUnits)){const{rectBandPosition:i}=n,r=bt(n.timeUnit);if(TE(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:ii(o),type:"timeunit",...a?{units:um(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...B6(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=z6({timeUnit:r,field:s}),u=I6(s);t.push({type:"formula",expr:a,as:u}),t.push(...B6([s,u],i,r))}}return t}}const Dm="offsetted_rect_start",Nm="offsetted_rect_end";function z6({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=WR(i),{part:s,step:a}=YR(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function B6([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:U6([z6({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Dm}`},{type:"formula",expr:U6([r,o],n+.5),as:`${e}_${Nm}`}]}return[]}function U6([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ed="_tuple_fields";class pue{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const gue={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new pue),o={},s={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=qe(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?X(n.value):null;let{fields:d,encodings:h}=Y(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(Y(p))for(const g of B(p))Nie(g)?(h||(h=[])).push(g):l==="interval"?(j(pre),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){j(ore(p,g.aggregate));continue}else if(!m){j(kR(p));continue}if(g.timeUnit&&!ya(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};s[be(y)]=y}if(!o[m]){const y=l==="interval"&&hr(p)&&Ti(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(o[m]=b),r.hasField[m]=o[m],r.hasSelectionId=r.hasSelectionId||m===Ri,iR(p)?(b.geoChannel=p,b.channel=nR(p),r.hasChannel[b.channel]=o[m]):r.hasChannel[p]=o[m]}}else j(kR(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Ri}f&&(t.init=f.map(p=>r.items.map(g=>Y(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Ne(s)||(r.timeUnit=new wr(null,s))},signals:(e,t,n)=>{const i=t.name+ed;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(P6)})}},ao={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!hr(r))continue;const o=e.getScaleComponent(r),s=o?o.get("type"):void 0;if(s=="sequential"&&j(lre),!o||!Ti(s)){j(ure);continue}o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||j6(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(d4))r.update=`{${i.map(s=>`${H(ii(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${H(ii(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}r.update=o}return n.concat(i.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!j6(e))for(const i of t.scales){const r=n.find(o=>o.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function OE(e,t){return`domain(${H(e.scaleName(t))})`}function j6(e){return e.parent&&_l(e.parent)&&!e.parent.parent}const hl="_brush",q6="_scale_trigger",td="geo_interval_init_tick",W6="_init",mue="_center",yue={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Y(n.select)?n.select:{}};r.fields=[Ri],r.encodings||(r.encodings=n.value?B(n.value):[Ci,ki]),n.select={type:"interval",...r}}if(t.translate&&!ao.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+hl)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=X((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+ds,o=kt(t.project.hasChannel).filter(a=>a.channel===We||a.channel===yt),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(bue(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+mue,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?s&&s[l.index]:`${u}[0]`,p=c?s&&s[c.index]:`${u}[1]`,g=w=>e.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:i+W6,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(_=>_.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${H(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Aa(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=o.map(w=>w.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...s?[{signal:td}]:[]],update:v}]})}else{if(!ao.defined(t)){const l=i+q6,c=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=H(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Ti(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=o.map(l=>l.signals.data),u=`unit: ${Aa(e)}, fields: ${i+ed}, values`;return n.concat({name:r,...s?{init:`{${u}: ${$a(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ge(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===td).length||n.unshift({name:td,value:null,on:[{events:"timer{1}",update:`${td} === null ? {} : ${td}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r==null?void 0:r.signals.visual,a=o==null?void 0:o.signals.visual,u=`data(${H(t.name+Sa)})`;if(ao.defined(t)||!r&&!o)return n;const l={x:r!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of B(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Aa(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=B(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+hl}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+hl,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function bue(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=H(r?e.scaleName(o):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(o===We?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=ao.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=i?{init:$a(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+q6},update:Ti(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:$a(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===We?0:1,h=t.name+W6,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const vue={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+ed,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=kt(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+hl):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Aa(e)}, `;if(t.project.hasSelectionId)l+=`${Ri}: ${s}[${H(Ri)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${H(e.vgField(d.channel,{}))}], ${s}[${H(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${H(d.field)}]`}).join(", ");l+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+ds,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function pl({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=Xf(t)&&t.condition;let s=[];o&&(s=X(o).map(l=>{const c=r(l);if(dse(l)){const{param:f,empty:d}=l;return{test:m4(e,{param:f,empty:d}),...c}}else return{test:Bm(e,l.test),...c}})),i!==void 0&&s.push(i);const a=r(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function DE(e,t="text"){const n=e.encoding[t];return pl({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>Rm(i,e.config),invalidValueRef:void 0})}function Rm(e,t,n="datum"){if(e){if(Di(e))return Ue(e.value);if(le(e)){const{format:i,formatType:r}=wm(e);return tE({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function H6(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(L(s))return{tooltip:V6({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return pl({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=Rm(l,r,a);if(c)return c;if(l===null)return;let f=Pe("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(Y(f))return ee(f)?f:f.content==="encoding"?V6(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function G6(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o=new Set,s=i?"datum.datum":"datum",a=[];function u(c,f){const d=da(f),h=fn(c)?c:{...c,type:e[d].type},p=h.title||sE(h,r),g=X(p).join(", ").replaceAll(/"/g,'\\"');let m;if(tt(f)){const y=f==="x"?"x2":"y2",b=Ni(e[y]);if(Ct(h.bin)&&b){const v=V(h,{expr:s}),x=V(b,{expr:s}),{format:w,formatType:_}=wm(h);m=Vf(v,x,w,_,r),o.add(y)}}if((tt(f)||f===ri||f===Ai)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=wm(h);m=tE({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??(m=Rm(h,r,s).signal),a.push({channel:f,key:g,value:m})}uE(e,(c,f)=>{q(c)?u(c,f):bm(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!o.has(c)&&!l[f]&&(l[f]=d);return l}function V6(e,t,n,{reactiveGeom:i}={}){const r=G6(e,t,n,{reactiveGeom:i}),o=Jo(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function xue(e){const{markDef:t,config:n}=e,i=Pe("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...wue(e),...Eue(e)}}function wue(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Pe("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:Z(tre,t)?{}:{ariaRoleDescription:{value:t}}}function Eue(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return pl({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>Rm(u,e.config),invalidValueRef:void 0});const s=Pe("description",n,i);if(s!=null)return{description:Ue(s)};if(i.aria===!1)return{};const a=G6(t,r,i);if(!Ne(a))return{description:{signal:Jo(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function Tt(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=Pe(e,i,o,{vgChannel:s,ignoreVgConfig:!Xf(l)})),u!==void 0&&(a=Ue(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=d5({...c,scaleChannel:e,channelDef:l});return pl({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>eE({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function Y6(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Pe("filled",n,r),a=ye(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Pe(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Pe(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ue(u)}:{},...l?{stroke:Ue(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(DR("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Tt("color",e,{vgChannel:c,defaultValue:s?u:l}),...Tt("fill",e,{defaultValue:i.fill?u:void 0}),...Tt("stroke",e,{defaultValue:i.stroke?l:void 0})}}function _ue(e){const{encoding:t,mark:n}=e,i=t.order;return!as(n)&&Di(i)?pl({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ue(r.value),invalidValueRef:void 0}):{}}function gl({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:eE({channel:o,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ue(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function dn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=t,u=r[e],l=r[dr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=gl({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),p=NE({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&tt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:$ue({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function $ue(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(le(n)&&r&&t===r.fieldChannel){if(q(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return gm({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return xa(n,i,{suffix:"end"},{offset:o})}return Qw(e)}function NE({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=da(n),u=rs(n),l=Pe(n,o,s,{vgChannel:u});if(l!==void 0)return Gf(n,l);switch(t){case"zeroOrMin":return X6({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return X6({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[An(n)],mult:.5}}}}function X6({mainChannel:e,config:t,...n}){const i=f5(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=r.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Sue={left:"x",center:"xc",right:"x2"},Aue={top:"y",middle:"yc",bottom:"y2"};function K6(e,t,n,i="middle"){if(e==="radius"||e==="theta")return rs(e);const r=e==="x"?"align":"baseline",o=Pe(r,t,n);let s;return ee(o)?(j(Dre(r)),s=void 0):s=o,e==="x"?Sue[s||(i==="top"?"left":"center")]:Aue[s||i]}function Pm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Z6(e,t,{defaultPos:n,defaultPos2:i}):dn(e,t,{defaultPos:n})}function Z6(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=dr(e),a=An(e),u=kue(t,i,s),l=u[a]?K6(e,r,o):rs(e);return{...dn(e,t,{defaultPos:n,vgChannel:l}),...u}}function kue(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=da(n),l=An(n),c=rs(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in o?gl({channel:n,markDef:o,encoding:i,model:e}):gl({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=An(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Cue({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:Lm(n,o)||Lm(n,{[n]:Cw(n,o,a.style),[l]:Cw(l,o,a.style)})||Lm(n,a[r])||Lm(n,a.mark)||{[c]:NE({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Cue({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?xa(t,o,{suffix:"start"},{offset:u}):Qw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Lm(e,t){const n=An(e),i=rs(e);if(t[i]!==void 0)return{[i]:Gf(e,t[i])};if(t[e]!==void 0)return{[i]:Gf(e,t[e])};if(t[n]){const r=t[n];if(va(r))j(kre(n));else return{[n]:Gf(e,r)}}}function uo(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=dr(t),a=An(t),u=i[t],l=i[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??Pe("size",r,n,{vgChannel:a}),p=aR(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(ze(u.bin)||Ct(u.bin)||u.timeUnit&&!l)&&!(h&&!va(h))&&!i[p]&&!vt(f)?Tue({fieldDef:u,fieldDef2:l,channel:t,model:e}):(le(u)&&vt(f)||g)&&!l?Fue(u,t,e):Z6(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Mue(e,t,n,i,r,o,s){if(va(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=pr("minBandSize",{type:s},i);return{signal:c?`max(${Fi(c)}, ${l})`:l}}else r.band!==1&&(j(Lre(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(ee(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(pa(u)&&_e(u.step))return{value:u.step-2}}if(!o){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=et(u,s==="tick"?f:s==="bar"?l:c);if(ee(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(_e(d))return{signal:`${1-d} * ${e}`}}return{value:wE(i.view,e)-2}}function Fue(e,t,n){var S,M;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=An(t),f=dr(t),d=aR(t),h=n.scaleName(d),p=n.getScaleComponent(xw(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=Tt("size",n,{vgChannel:c,defaultRef:Ue(i.size)}):j(Ure(i.type)));const y=!!m,b=E5({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(S=l||p)==null?void 0:S.get("type"),useVlSizeChannel:g});m=m||{[c]:Mue(c,h||u,p||l,o,b,!!e,i.type)};const v=((M=l||p)==null?void 0:M.get("type"))==="band"&&va(b)&&!y?"top":"middle",x=K6(t,i,o,v),w=x==="xc"||x==="yc",{offset:_,offsetType:E}=gl({channel:t,markDef:i,encoding:r,model:n,bandPosition:w?.5:0}),$=Qw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:_,defaultRef:NE({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:w?E==="encoding"?0:.5:ee(b)?{signal:`(1-${b})/2`}:va(b)?(1-b.band)/2:0});if(c)return{[x]:$,...m};{const k=rs(f),D=m[c],A=_?{...D,offset:_}:D;return{[x]:$,[k]:L($)?[$[0],{...$[1],offset:A}]:{...$,offset:A}}}}function J6(e,t,n,i,r,o,s){if(tR(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(ee(n)||ee(r)||ee(i)||o){const l=Fi(n),c=Fi(r),f=Fi(i),d=Fi(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function Tue({fieldDef:e,fieldDef2:t,channel:n,model:i}){var M;const{config:r,markDef:o,encoding:s}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=E5({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(M=i.component.axes[n])==null?void 0:M[0],h=(d==null?void 0:d.get("translate"))??.5,p=tt(n)?Pe("binSpacing",o,r)??0:0,g=dr(n),m=rs(n),y=rs(g),b=pr("minBandSize",o,r),{offset:v}=gl({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:x}=gl({channel:g,markDef:o,encoding:s,model:i,bandPosition:0}),w=sse({fieldDef:e,scaleName:u}),_=J6(n,p,c,h,v,b,w),E=J6(g,p,c,h,x??v,b,w),$=ee(f)?{signal:`(1-${f.signal})/2`}:va(f)?(1-f.band)/2:.5,S=us({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(ze(e.bin)||e.timeUnit){const k=e.timeUnit&&S!==.5;return{[y]:Q6({fieldDef:e,scaleName:u,bandPosition:$,offset:E,useRectOffsetField:k}),[m]:Q6({fieldDef:e,scaleName:u,bandPosition:ee($)?{signal:`1-${$.signal}`}:1-$,offset:_,useRectOffsetField:k})}}else if(Ct(e.bin)){const k=xa(e,u,{},{offset:E});if(q(t))return{[y]:k,[m]:xa(t,u,{},{offset:_})};if(ha(e.bin)&&e.bin.step)return{[y]:k,[m]:{signal:`scale("${u}", ${V(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}j(IR(g))}function Q6({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return gm({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Dm,endSuffix:Nm}:{}})}const Oue=new Set(["aria","width","height"]);function ai(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?Y6(e):{};return{...Due(e.markDef,t),...e4("fill",n),...e4("stroke",i),...Tt("opacity",e),...Tt("fillOpacity",e),...Tt("strokeOpacity",e),...Tt("strokeWidth",e),...Tt("strokeDash",e),..._ue(e),...H6(e),...DE(e,"href"),...xue(e)}}function e4(e,t){return t?{[e]:t}:{}}function Due(e,t){return ere.reduce((n,i)=>(!Oue.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ue(e[i])),n),{})}function RE(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!hr(o)||!(s=e.getScaleType(o)))return;const a=rm(r.aggregate),u=Jw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(ise(u)){const c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(o=>lm(o,!0)).join(" && ")}}}function t4(e,t){if(t!==void 0)return{[e]:Ue(t)}}const PE="voronoi",n4={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(PE)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(as(o))return j(sre(o)),n;const s={name:e.getName(PE),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...H6(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(PE)&&(u=!0)}),u||n.splice(a+1,0,s),n}},i4={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!gE(e.bind),parse:(e,t,n)=>h4(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=n4.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=qe(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:$a(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${H(u.field)}] : null`}]:[],bind:o[u.field]??o[u.channel]??o})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(l=>l.name===i+ds),s=i+ed,a=r.items.map(l=>qe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(o.update=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},Im="_toggle",r4={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Im,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+ds,i=t.name+Im;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Aa(e)}}, `)+`${i} ? ${n} : null`}},Nue={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Ko(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(i4.defined(t))for(const i of t.project.items){const r=n.findIndex(o=>o.name===qe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,o){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const r of t.project.items){const o=n.findIndex(s=>s.name===r.signals.visual);if(i(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===r.signals.data);i(s,"null")}}else{let r=n.findIndex(o=>o.name===t.name+ds);i(r,"null"),r4.defined(t)&&(r=n.findIndex(o=>o.name===t.name+Im),i(r,"false"))}return n}},o4={defined:e=>{const t=e.resolve==="global"&&e.bind&&gE(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Ri;return t&&!n&&j(cre),t&&n},parse:(e,t,n)=>{const i=ue(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},h4(t,i),Y(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=X(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const r=mE(t.bind)?t.bind.legend:"click",o=K(r)?Ko(r,"view"):X(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=mE(t.bind)&&t.bind.legend,o=s=>a=>{const u=ue(a);return u.markname=s,u};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${qe(s.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(o(`${a}_symbols`)).concat(r.merge.map(o(`${a}_labels`))).concat(r.merge.map(o(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(d=>d.name===i+ds),s=i+ed,a=r.items.filter(d=>d.hasLegend).map(d=>qe(`${i}_${qe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(o.update=l,delete o.value,delete o.on);const c=n.find(d=>d.name===i+Im),f=mE(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Rue(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const o of kt(e.component.selection??{})){const s=o.project.hasField[i]??o.project.hasChannel[t];if(s&&o4.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const s4="_translate_anchor",a4="_translate_delta",Pue={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+s4,{x:s,y:a}=t.project.hasChannel;let u=Ko(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+hl,l))),n.push({name:o,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${r?OE(e,We):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?OE(e,yt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+a4,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&u4(e,t,s,"width",n),a!==void 0&&u4(e,t,a,"height",n),n}};function u4(e,t,n,i,r){const o=t.name,s=o+s4,a=o+a4,u=n.channel,l=ao.defined(t),c=r.find(w=>w.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===We?p?"":"-":p?"-":"":"",m=`${s}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const l4="_zoom_anchor",c4="_zoom_delta",Lue={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+c4,{x:s,y:a}=t.project.hasChannel,u=H(e.scaleName(We)),l=H(e.scaleName(yt));let c=Ko(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+hl,f))),n.push({name:i+l4,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&f4(e,t,s,"width",n),a!==void 0&&f4(e,t,a,"height",n),n}};function f4(e,t,n,i,r){const o=t.name,s=n.channel,a=ao.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?OE(e,s):u.name,h=o+c4,p=`${o}${l4}.${s}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Sa="_store",ds="_tuple",Iue="_modify",d4="vlSelectionResolve",zm=[vue,yue,gue,r4,i4,ao,o4,Nue,Pue,Lue,n4];function zue(e){let t=e.parent;for(;t&&!Un(t);)t=t.parent;return t}function Aa(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=zue(e);if(i){const{facet:r}=i;for(const o of si)r[o]&&(n+=` + '__facet_${o}_' + (facet[${H(i.vgField(o))}])`)}return n}function LE(e){return kt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function h4(e,t){(K(t.select)||!t.select.on)&&delete e.events,(K(t.select)||!t.select.clear)&&delete e.clear,(K(t.select)||!t.select.toggle)&&delete e.toggle}function IE(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...IE(e.object)),t.push(...IE(e.property))),t)}function p4(e){return e.object.type==="MemberExpression"?p4(e.object):e.object.name==="datum"}function g4(e){const t=p2(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&p4(i)&&n.add(IE(i).slice(1).join("."))}),n}class ml extends Te{clone(){return new ml(null,this.model,ue(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Bm(this.model,this.filter,this),this._dependentFields=g4(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Bue(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const o=qe(r.name),s=r.select,a=K(s)?s:s.type,u=Y(s)?ue(s):{type:a},l=i[a];for(const d in l)d==="fields"||d==="encodings"||(d==="mark"&&(u.mark={...l.mark,...u.mark}),(u[d]===void 0||u[d]===!0)&&(u[d]=ue(l[d]??u[d])));const c=n[o]={...u,name:o,type:a,init:r.value,bind:r.bind,events:K(u.on)?Ko(u.on,"scope"):X(ue(u.on))},f=ue(r);for(const d of zm)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function m4(e,t,n,i="datum"){const r=K(t)?t:t.param,o=qe(r),s=H(o+Sa);let a;try{a=e.getSelectionComponent(o,r)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${H(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function y4(e,t,n){const i=qe(t),r=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!o)o=s.project.items[0].field,s.project.items.length>1&&j(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${H(o)}.`);else if(r&&!o){const a=s.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(o=s.project.items[0].field,j((a.length?"Multiple ":"No ")+`matching ${H(r)} encoding found for selection ${H(n.param)}. Using "field": ${H(o)}.`)):o=a[0].field}return`${s.name}[${H(ii(o))}]`}function Uue(e,t){for(const[n,i]of Jo(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new kn(new ml(t,e,{param:n}),r,Ze.Lookup,e.component.data.outputNodeRefCounts)}}function Bm(e,t,n){return Lf(t,i=>K(i)?i:$oe(i)?m4(e,i,n):KR(i))}function jue(e,t){if(e)return L(e)&&!ss(e)?e.map(n=>sE(n,t)).join(", "):e}function zE(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function nd(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=Ase[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(Jf(m)){const{condition:y,...b}=m,v=X(y),x=D5[p];if(x){const{vgProp:w,part:_}=x,E=[...v.map($=>{const{test:S,...M}=$;return{test:Bm(null,S),...M}}),b];zE(c,_,w,E),delete c[p]}else if(x===null){const w={signal:v.map(_=>{const{test:E,...$}=_;return`${Bm(null,E)} ? ${yR($)} : `}).join("")+yR(b)};c[p]=w}}else if(ee(m)){const y=D5[p];if(y){const{vgProp:b,part:v}=y;zE(c,v,b,m),delete c[p]}}ye(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Ne(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:et(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&ee(c.encode.labels.update.text)&&(p=la(a,"datum.label",c.encode.labels.update.text.signal)),zE(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of N5)e.hasAxisPart(p)||delete c.encode[p];Ne(c.encode)&&delete c.encode}const h=jue(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:et(l,0)}}}}function b4(e){const{axes:t}=e.component,n=[];for(const i of eo)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const o=i==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function que(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>nd(r,"grid",t)),...i.map(r=>nd(r,"grid",t)),...n.map(r=>nd(r,"main",t)),...i.map(r=>nd(r,"main",t))].filter(r=>r)}function v4(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...B(s),...B(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${Fi(s[c])} : ${Fi(a[c])}`};return l}return t[r]})])}function Wue(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:t5(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=ee(n)?"axisOrient":`axis${If(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:v4(a,i,e,n),vgAxisConfig:v4(u,i,e,n),axisConfigStyle:Hue([...u,...a],i)}}function Hue(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=X(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function BE(e,t,n,i={}){var o;const r=vR(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=i[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const x4={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??Gue(n,e),gridScale:({model:e,channel:t})=>Vue(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||E4(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||w4(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Xue(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Kue(t.type,n,q(t)&&!!t.timeUnit,q(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??Jue({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:Que,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=_4(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return wR(r?[w5(r)]:[],q(s)?[w5(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>ele(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??tle(n,t)};function Gue(e,t){return!vt(e)&&q(t)&&!ze(t==null?void 0:t.bin)&&!Ct(t==null?void 0:t.bin)}function Vue(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Yue(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return ee(o)?o:zf(o);{const{configValue:s}=BE("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?zf(s):n===We&&ye([Ww,qw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function UE(e){return`(((${e.signal} % 360) + 360) % 360)`}function w4(e,t,n,i){if(e!==void 0)if(n==="x"){if(ee(e)){const r=UE(e),o=ee(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ee(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(ee(e)){const r=UE(e),o=ee(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ee(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function E4(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,o=i?"bottom":"left";if(ee(e)){const s=UE(e),a=ee(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${r?`(${s} + 90)`:s} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${s} && ${s} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ee(t)){const s=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${s} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===o)?"left":"right"}function Xue(e,t){if(t==="x"&&ye(["quantitative","temporal"],e))return!0}function Kue(e,t,n,i){if(n&&!Y(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Zue(e){return e==="x"?"bottom":"left"}function Jue({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!vt(t)&&t!=="log"){if(q(e)){if(ze(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ye(["month","hours","day","quarter"],(r=bt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Que({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=VR(n);if(i)return{signal:i}}}}function _4(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,s=r?r.title:void 0;if(o&&s)return ER(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function ele(e,t){const n=e.values;if(L(n))return O5(t,n);if(ee(n))return n}function tle(e,t){return e==="rect"&&xm(t)?1:0}class yl extends Te{clone(){return new yl(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=g4(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Ea(i)&&x5(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${KR({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new yl(t,{calculate:u,as:bl(i,r,{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 ${be(this.transform)}`}}function bl(e,t,n){return V(e,{prefix:t,suffix:"sort_index",...n})}function Um(e,t){return ye(["top","bottom"],t)?"column":ye(["left","right"],t)||e==="row"?"row":"column"}function vl(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return et((t||{})[e],r[e],n.header[e])}function jm(e,t,n,i){const r={};for(const o of e){const s=vl(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const jE=["row","column"],qE=["header","footer"];function nle(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=jm(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Um(t,a),l=zf(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...S4(l,u),...$4(u,l,o),...A4(i,r,t,Vse,e6)}}}function $4(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=E4(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function S4(e,t){const n=w4(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function ile(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of qE)if(n[r])for(const o of n[r]){const s=ole(e,t,r,n,o);s!=null&&i.push(s)}return i}function rle(e,t){const{sort:n}=e;return io(n)?{field:V(n,{expr:"datum"}),order:n.order??"ascending"}:L(n)?{field:bl(e,t,{expr:"datum"}),order:"ascending"}:{field:V(e,{expr:"datum"}),order:n??"ascending"}}function WE(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=jm(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=tE({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Um(t,a);return{text:{signal:u?la(la(u,"datum.label",l),"datum.value",V(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...S4(o,c),...$4(c,o,s),...A4(n,e,t,Yse,t6)}}function ole(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i,a=e.config?e.config:void 0;if(s&&r.labels){const{labelOrient:f}=jm(["labelOrient"],s.header,a,t);(t==="row"&&!ye(["top","bottom"],f)||t==="column"&&!ye(["left","right"],f))&&(o=WE(s,t,a))}const u=Un(e)&&!Yf(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:rle(s,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const sle={column:{start:0,end:1},row:{start:1,end:0}};function ale(e,t){return sle[t][e]}function ule(e,t){const n={};for(const i of si){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=jm(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=Um(i,s),u=ale(o,a);u!==void 0&&(n[a]=u)}}return Ne(n)?void 0:n}function A4(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=vl(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function HE(e){return[...qm(e,"width"),...qm(e,"height"),...qm(e,"childWidth"),...qm(e,"childHeight")]}function qm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(vt(s)&&pa(a)){const u=e.scaleName(n);return Un(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[k4(u,a)]:[k4(u,a),{name:r,update:C4(u,o,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const o=r.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=xE(e.config.view,o?"width":"height"),u=`isFinite(${s}) ? ${s} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function k4(e,t){const n=`${e}_step`;return ee(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function C4(e,t,n){const i=t.get("type"),r=t.get("padding"),o=et(t.get("paddingOuter"),r);let s=t.get("paddingInner");return s=i==="band"?s!==void 0?s:r:1,`bandspace(${n}, ${Fi(s)}, ${Fi(o)}) * ${e}_step`}function M4(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function F4(e,t){return B(e).reduce((n,i)=>({...n,...pl({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ue(r.value),invalidValueRef:void 0})}),{})}function T4(e,t){if(Un(t))return e==="theta"?"independent":"shared";if(_l(t))return"shared";if(a_(t))return tt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function GE(e,t){const n=e.scale[t],i=tt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(Gre(t)),"independent"):e[i][t]||"shared"}const lle={...Kse,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},O4=B(lle);class cle extends so{}const D4={symbols:fle,gradient:dle,labels:hle,entries:ple};function fle(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:u,mark:l}=n,c=s.filled&&l!=="trail";let f={...ire({},n,Koe),...Y6(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?N4(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===$n)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ue(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ue(g??1));else if(L(f.fill)){const m=VE(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ue(m))}}if(f.stroke){if(i==="stroke"||!c&&i===$n)delete f.stroke;else if(U(f.stroke,"field")||p)delete f.stroke;else if(L(f.stroke)){const m=et(VE(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Qr){const m=q(t)&&P4(n,r,t);m?f.opacity=[{test:m,...Ue(g??1)},Ue(u.legend.unselectedOpacity)]:g&&(f.opacity=Ue(g))}return f={...f,...e},Ne(f)?void 0:f}function dle(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:o,encoding:s}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?N4(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ue(l)),a={...a,...e},Ne(a)?void 0:a}function hle(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?P4(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;wa(c)?f=Oi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:s}):l===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&q(t)&&t.timeUnit===void 0&&(f=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ne(d)?void 0:d}function ple(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function N4(e){return R4(e,(t,n)=>Math.max(t,n.value))}function VE(e){return R4(e,(t,n)=>et(t,n.value))}function R4(e,t){if(pse(e))return X(e.condition).reduce(t,e.value);if(Di(e))return e.value}function P4(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=H(n.field);return i.map(o=>`(!length(data(${H(qe(o)+Sa)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const L4={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return g5(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return m5(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??wle(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Ele(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??mle(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>ul(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(tl(n)&&mr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>gle(t,e)};function gle(e,t){const n=e.values;if(L(n))return O5(t,n);if(ee(n))return n}function mle(e,t,n,i){if(t!=="shape"){const r=VE(n)??i;if(r)return r}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"}}function yle(e){const{legend:t}=e;return et(t.type,ble(e))}function ble({channel:e,timeUnit:t,scaleType:n}){if(tl(e)){if(ye(["quarter","month","day"],t))return"symbol";if(mr(n))return"gradient"}return"symbol"}function vle({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??xle(n,t)}function xle(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function wle({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(mr(r))return n==="horizontal"?i==="top"||i==="bottom"?I4(t,"width",s,o):s:I4(t,"height",u,a)}function I4(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Ele(e){if(ye(["quantile","threshold","log","symlog"],e))return"greedy"}function z4(e){const t=Ge(e)?_le(e):kle(e);return e.component.legends=t,t}function _le(e){const{encoding:t}=e,n={};for(const i of[$n,...i6]){const r=lt(t[i]);!r||!e.getScaleComponent(i)||i===Sn&&q(r)&&r.type===rl||(n[i]=Ale(e,i))}return n}function $le(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Sle(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function Ale(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new cle({},$le(e,t));Rue(e,t,a);const u=n!==void 0?!n:s.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=lt(r[t]),f=q(c)?(x=bt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||o.legend.orient||"right",h=yle({legend:n,channel:t,timeUnit:f,scaleType:l}),p=vle({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:p};for(const w of O4){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in L4?L4[w](g):n[w];if(_!==void 0){const E=Sle(_,w,n,e.fieldDef(t));(E||o.legend[w]===void 0)&&a.set(w,_,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=F4(m[w]??{},e),E=w in D4?D4[w](_,v):_;E!==void 0&&!Ne(E)&&(b[w]={...y!=null&&y.length&&q(c)?{name:`${qe(c.field)}_legend_${w}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Ne(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function kle(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){z4(i);for(const r of B(i.component.legends))n.legend[r]=GE(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=B4(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of B(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function B4(e,t){var o,s,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of O4){const c=cs(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return Cle(f,d);case"title":return _R(f,d);case"type":return r=!0,Bn("symbol")}return Om(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&Kg(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Kg(e.explicit,["encode","gradient"])),e}function Cle(e,t){return t.value==="circle"?t:e}function Mle(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function U4(e){const t=e.component.legends,n={};for(const r of B(t)){const o=e.getScaleComponent(r),s=Re(o.get("domains"));if(n[s])for(const a of n[s])B4(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return kt(n).flat().map(r=>Fle(r,e.config)).filter(r=>r!==void 0)}function Fle(e,t){var s,a,u;const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const l=o.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!o.stroke&&(l.stroke={value:"transparent"});for(const c of i6)o[c]&&delete l[c]}if(o.title||delete o.title,i!==void 0){let l=i;(u=(a=o.encode)==null?void 0:a.labels)!=null&&u.update&&ee(o.encode.labels.update.text)&&(l=la(i,"datum.label",o.encode.labels.update.text.signal)),Mle(o,"labels","text",{signal:l})}return o}}function Tle(e){return _l(e)||a_(e)?Ole(e):j4(e)}function Ole(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),j4(e))}function j4(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const u=ee(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ye(s,u)||s.push(u),s},[]);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}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Dle=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class q4 extends so{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function W4(e){e.component.projection=Ge(e)?Nle(e):Lle(e)}function Nle(e){if(e.hasProjection){const t=Mt(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Rle(e):void 0,o=new q4(e.projectionName(!0),{...Mt(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function Rle(e){const t=[],{encoding:n}=e;for(const i of[[Ci,ki],[oi,Mi]])(lt(n[i[0]])||lt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Sn)&&e.typedFieldDef(Sn).type===rl&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ze.Main)),t}function Ple(e,t){const n=dw(Dle,r=>!!(!Z(e.explicit,r)&&!Z(t.explicit,r)||Z(e.explicit,r)&&Z(t.explicit,r)&&In(e.get(r),t.get(r))));if(In(e.size,t.size)){if(n)return e;if(In(e.explicit,{}))return t;if(In(t.explicit,{}))return e}return null}function Lle(e){if(e.children.length===0)return;let t;for(const i of e.children)W4(i);const n=dw(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=Ple(t,r);return o&&(t=o),!!o}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new q4(i,t.specifiedProjection,t.size,ue(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&r.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),i),s.merged=!0)}return r}}function Ile(e,t,n,i){if(Zf(t,n)){const r=Ge(e)?e.axis(n)??e.legend(n)??{}:{},o=V(t,{expr:"datum"}),s=V(t,{expr:"datum",binSuffix:"end"});return{formulaAs:V(t,{binSuffix:"range",forAs:!0}),formula:Vf(o,s,r.format,r.formatType,i)}}return{}}function H4(e,t){return`${dR(e)}_${t}`}function zle(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function YE(e,t,n){const i=_m(n,void 0)??{},r=H4(i,t);return e.getName(`${r}_bins`)}function Ble(e){return"as"in e}function G4(e,t,n){let i,r;Ble(e)?i=K(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[V(e,{forAs:!0}),V(e,{binSuffix:"end",forAs:!0})];const o={..._m(t,void 0)},s=H4(o,e.field),{signal:a,extentSignal:u}=zle(n,s);if(om(o.extent)){const c=o.extent;r=y4(n,c.param,c),delete o.extent}const l={bin:o,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:s,binComponent:l}}class Er extends Te{clone(){return new Er(null,ue(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(fn(o)&&ze(o.bin)){const{key:a,binComponent:u}=G4(o,o.bin,n);r[a]={...u,...r[a],...Ile(n,o,s,n.config)}}return r},{});return Ne(i)?null:new Er(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=G4(n,n.bin,i);return new Er(t,{[r]:o})}merge(t,n){for(const i of B(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ur([...this.bins[i].as,...t.bins[i].as],be)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(kt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(kt(this.bins).map(t=>t.field))}hash(){return`Bin ${be(this.bins)}`}assemble(){return kt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:ii(t.field),as:i,signal:t.signal,...om(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:ii(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:V({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Ule(e,t,n,i){var o;const r=Ge(i)?i.encoding[dr(t)]:void 0;if(fn(n)&&Ge(i)&&_5(n,r,i.markDef,i.config)){e.add(V(n,{})),e.add(V(n,{suffix:"end"}));const{mark:s,markDef:a,config:u}=i,l=us({fieldDef:n,markDef:a,config:u});Hf(s)&&l!==.5&&tt(t)&&(e.add(V(n,{suffix:Dm})),e.add(V(n,{suffix:Nm}))),n.bin&&Zf(n,t)&&e.add(V(n,{binSuffix:"range"}))}else if(iR(t)){const s=nR(t);e.add(i.getName(s))}else e.add(V(n));return Ea(n)&&Loe((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function jle(e,t){for(const n of B(t)){const i=t[n];for(const r of B(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Pi extends Te{clone(){return new Pi(null,new Set(this.dimensions),ue(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(s=>{s.aggregate&&(i=!0)});const r={},o=new Set;return!i||(n.forEachFieldDef((s,a)=>{const{aggregate:u,field:l}=s;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([V(s,{forAs:!0})]);else{if(to(u)||os(u)){const c=to(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([V({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([V(s,{forAs:!0})]);hr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([V({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([V({field:l,aggregate:"max"},{forAs:!0})]))}else Ule(o,a,s,n)}),o.size+B(r).length===0)?null:new Pi(t,o,r)}static makeFromTransform(t,n){var i;const r=new Set,o={};for(const s of n.aggregate){const{op:a,field:u,as:l}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([l||V(s,{forAs:!0})])):(o[u]??(o[u]={}),(i=o[u])[a]??(i[a]=new Set),o[u][a].add(l||V(s,{forAs:!0}))))}for(const s of n.groupby??[])r.add(s);return r.size+B(o).length===0?null:new Pi(t,r,o)}merge(t){return VN(this.dimensions,t.dimensions)?(jle(this.measures,t.measures),!0):(uoe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...B(this.measures)])}producedFields(){const t=new Set;for(const n of B(this.measures))for(const i of B(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${be({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of B(this.measures))for(const s of B(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:ii(o));return{type:"aggregate",groupby:[...this.dimensions].map(ii),ops:t,fields:n,as:i}}}class xl extends Te{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of si){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[V(s),...ze(a)?[V(s,{binSuffix:"end"})]:[]],...io(u)?{sortField:u}:L(u)?{sortIndexField:bl(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of si)this[n]&&(t+=` ${n.charAt(0)}:${be(this[n])}`);return t}get fields(){var n;const t=[];for(const i of si)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of si)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of eo){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(vt(r)&&pa(o)){const s=Hm(this.childModel,n),a=o_(s);a?t[n]=a:j(Fw(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];r&&i&&i[r]&&(n?(o.push(`distinct_${i[r]}`),s.push("max")):(o.push(i[r]),s.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=mm,field:f}=u;o.push(f),s.push(c),a.push(V(u,{forAs:!0}))}else l&&(o.push(l),s.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const l of jE){for(const c of qE){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:o,facet:s}=this;if(r&&o&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Xr,Yr])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function V4(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function qle(e,t){const n=mw(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=V4(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=V4(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(yre(t)),null}function Wle(e){const t={};return Xg(e.filter,n=>{if(XR(n)){let i=null;Pw(n)?i=zn(n.equal):Iw(n)?i=zn(n.lte):Lw(n)?i=zn(n.lt):zw(n)?i=zn(n.gt):Bw(n)?i=zn(n.gte):Uw(n)?i=n.range[0]:jw(n)&&(i=(n.oneOf??n.in)[0]),i&&(ga(i)?t[n.field]="date":_e(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Hle(e){const t={};function n(i){cl(i)?t[i.field]="date":i.type==="quantitative"&&Xie(i.aggregate)?t[i.field]="number":Ju(i.field)>1?i.field in t||(t[i.field]="flatten"):Ea(i)&&io(i.sort)&&Ju(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ge(e)||Un(e))&&e.forEachFieldDef((i,r)=>{if(fn(i))n(i);else{const o=da(r),s=e.fieldDef(o);n({...i,type:s.type})}}),Ge(e)){const{mark:i,markDef:r,encoding:o}=e;if(as(i)&&!e.encoding.order){const s=r.orient==="horizontal"?"y":"x",a=o[s];q(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Gle(e){const t={};if(Ge(e)&&e.component.selection)for(const n of B(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Ju(r.field)>1&&(t[r.field]="flatten")}return t}class Vt extends Te{clone(){return new Vt(null,ue(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${be(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!fs(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of B(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(FR(a,i[a],u.value)))}for(const a of B(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(FR(a,n[a],u)))}const o=new so(n,i);r.copyAll(o);const s={};for(const a of B(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return B(s).length===0||r.parseNothing?null:new Vt(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of B(this._parse)){const i=this._parse[n];Ju(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(B(this._parse))}dependentFields(){return new Set(B(this._parse))}assembleTransforms(t=!1){return B(this._parse).filter(n=>t?Ju(n)>1:!0).map(n=>{const i=qle(n,this._parse[n]);return i?{type:"formula",expr:i,as:Zu(n)}:null}).filter(n=>n!==null)}}class hs extends Te{clone(){return new hs(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Ri])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ri}}}class id extends Te{clone(){return new id(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${be(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class rd extends Te{clone(){return new rd(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${be(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class ka extends Te{constructor(t){super(null),t??(t={name:"source"});let n;if(fs(t)||(n=t.format?{..._n(t.format,["parse"])}:{}),Qf(t))this._data={values:t.values};else if(dl(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ye(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else N6(t)?this._data={values:[{type:"Sphere"}]}:(O6(t)||fs(t))&&(this._data={});this._generator=fs(t),t.name&&(this._name=t.name),n&&!Ne(n)&&(this._data.format=n)}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 Y4=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Vle=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},od;function XE(e){return e instanceof ka||e instanceof id||e instanceof rd}class KE{constructor(){od.set(this,void 0),Y4(this,od,!1,"f")}setModified(){Y4(this,od,!0,"f")}get modifiedFlag(){return Vle(this,od,"f")}}od=new WeakMap;class Ca extends KE{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,o)=>o[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class ZE extends KE{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Yle extends ZE{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of B(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Xle extends ZE{constructor(t){super(),this.requiresSelectionId=t&&LE(t)}run(t){t instanceof hs&&(this.requiresSelectionId&&(XE(t.parent)||t.parent instanceof Pi||t.parent instanceof Vt)||(this.setModified(),t.remove()))}}class Kle extends KE{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof wr&&(i=t.producedFields(),hw(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class Zle extends ZE{constructor(){super()}run(t){t instanceof kn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Jle extends Ca{run(t){if(!XE(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Vt)if(t instanceof Vt)this.setModified(),t.merge(n);else{if(gw(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Qle extends Ca{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Vt);if(t.numChildren()>1&&i.length>=1){const r={},o=new Set;for(const s of i){const a=s.parse;for(const u of B(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!Ne(r)){this.setModified();const s=new Vt(t,r);for(const a of n){if(a instanceof Vt)for(const u of B(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof Vt&&B(a.parse).length===0&&a.remove()}}}}}class ece extends Ca{run(t){t instanceof kn||t.numChildren()>0||t instanceof xl||t instanceof ka||(this.setModified(),t.remove())}}class tce extends Ca{run(t){const n=t.children.filter(r=>r instanceof wr),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class nce extends Ca{run(t){const n=t.children.filter(r=>r instanceof Pi),i={};for(const r of n){const o=be(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of B(i)){const o=i[r];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class ice extends Ca{constructor(t){super(),this.model=t}run(t){const n=!(XE(t)||t instanceof ml||t instanceof Vt||t instanceof hs),i=[],r=[];for(const o of t.children)o instanceof Er&&(n&&!gw(t.producedFields(),o.dependentFields())?i.push(o):r.push(o));if(i.length>0){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Er?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(r.length>1){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class rce extends Ca{run(t){const n=[...t.children];if(!Ku(n,s=>s instanceof kn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof kn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof kn)a=u;else break}r.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else r.push(s);if(r.length){this.setModified();for(const s of r)s.parent.removeChild(s),s.parent=o}}}class Ma extends Te{clone(){return new Ma(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`JoinAggregateTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const o of this.transform.joinaggregate)n.push(o.op),i.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class wl extends Te{clone(){return new wl(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:o}=n,{marks:s,scales:a}=i;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=hr(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=Jw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:rm(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return B(u).length?new wl(t,u):null}dependentFields(){return new Set(B(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${be(this.filter)}`}assemble(){const t=B(this.filter).reduce((n,i)=>{const r=this.filter[i],o=V(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${JE(o)}))`):r.type==="quantitative"&&n.push(JE(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function JE(e){return`isValid(${e}) && isFinite(+${e})`}function oce(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=V(i);return r&&t.push(r),t},[])}function sce(e){return L(e)&&e.every(t=>K(t))&&e.length>1}class lo extends Te{clone(){return new lo(null,ue(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:o,offset:s="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(et(f.order,"ascending"));const l={field:a,order:u};let c;return sce(o)?c=o:K(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new lo(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:s,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:u}=i,l=o.map(h=>{const p=r[h];return Ni(p)}).filter(h=>!!h),c=oce(n),f=n.encoding.order;let d;if(L(f)||q(f))d=xR(f);else{const h=$5(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new lo(t,{dimensionFieldDefs:l,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{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 ${be(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[V(r,{binSuffix:"mid"})]:[V(r,{}),V(r,{binSuffix:"end"})]:[V(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:o,sort:s,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=V(c,{expr:"datum"}),p=V(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${JE(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:V(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:V(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:s,as:l,offset:a}),t}}class El extends Te{clone(){return new El(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`WindowTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>Aw(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function ace(e){function t(n){if(!(n instanceof xl)){const i=n.clone();if(i instanceof kn){const r=e_+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Pi||i instanceof lo||i instanceof El||i instanceof Ma)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function QE(e){if(e instanceof xl)if(e.numChildren()===1&&!(e.children[0]instanceof kn)){const t=e.children[0];(t instanceof Pi||t instanceof lo||t instanceof El||t instanceof Ma)&&t.addDimensions(e.fields),t.swapWithParent(),QE(e)}else{const t=e.model.component.data.main;X4(t);const n=ace(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(QE)}function X4(e){if(e instanceof kn&&e.type===Ze.Main&&e.numChildren()===1){const t=e.children[0];t instanceof xl||(t.swapWithParent(),X4(e))}}const e_="scale_",Wm=5;function t_(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!t_(t.children))return!1}return!0}function Li(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function K4(e,t,n){let i=e.sources,r=!1;return r=Li(new Zle,i)||r,r=Li(new Xle(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=Li(new ece,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=Li(new Jle,i)||r,r=Li(new ice(t),i)||r,r=Li(new Kle,i)||r,r=Li(new Qle,i)||r,r=Li(new nce,i)||r,r=Li(new tce,i)||r,r=Li(new Yle,i)||r,r=Li(new rce,i)||r),e.sources=i,r}function uce(e,t){t_(e.sources);let n=0,i=0;for(let r=0;r<Wm&&K4(e,t,!0);r++)n++;e.sources.map(QE);for(let r=0;r<Wm&&K4(e,t,!1);r++)i++;t_(e.sources),Math.max(n,i)===Wm&&j(`Maximum optimization runs(${Wm}) reached.`)}class xt{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new xt(()=>t(n))}}function Z4(e){Ge(e)?lce(e):cce(e)}function lce(e){const t=e.component.scales;for(const n of B(t)){const i=dce(e,n);if(t[n].setWithExplicit("domains",i),pce(e,n),e.component.data.isFaceted){let o=e;for(;!Un(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of i.value)no(a)&&(a.data=e_+a.data.replace(e_,""))}}}function cce(e){for(const n of e.children)Z4(n);const t=e.component.scales;for(const n of B(t)){let i,r=null;for(const o of e.children){const s=o.component.scales[n];if(s){i===void 0?i=s.getWithExplicit("domains"):i=cs(i,s.getWithExplicit("domains"),"domains","scale",r_);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(hre),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function fce(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=J4(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=J4(t,n);if(r)return"unaggregated"}return e}function dce(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=fce(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&lt(i.x2)?lt(i.x)?cs(ps(n,r,e,"x"),ps(n,r,e,"x2"),"domain","scale",r_):ps(n,r,e,"x2"):t==="y"&&lt(i.y2)?lt(i.y)?cs(ps(n,r,e,"y"),ps(n,r,e,"y2"),"domain","scale",r_):ps(n,r,e,"y2"):ps(n,r,e,t)}function hce(e,t,n){return e.map(i=>({signal:`{data: ${$m(i,{timeUnit:n,type:t})}}`}))}function n_(e,t,n){var r;const i=(r=bt(n))==null?void 0:r.unit;return t==="temporal"||i?hce(e,t,i):[e]}function ps(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=lt(r[i]),{type:c}=l,f=l.timeUnit,d=aue({invalid:pr("invalid",o,a),isPath:as(s)});if(Poe(t)){const g=ps(e,void 0,n,i),m=n_(t.unionWith,c,f);return xr([...m,...g.value])}else{if(ee(t))return xr([t]);if(t&&t!=="unaggregated"&&!i5(t))return xr(n_(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Bn([[0,1]]);const g=n.requestDataName(d);return Bn([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=hr(i)&&q(l)?gce(n,i,e):void 0;if(br(l)){const g=n_([l.datum],c,f);return Bn(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Bn([{data:n.requestDataName(d),field:V({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:V({field:g,aggregate:"max"})}])}else if(ze(p.bin)){if(vt(e))return Bn(e==="bin-ordinal"?[]:[{data:Pf(h)?n.requestDataName(d):n.requestDataName(Ze.Raw),field:n.vgField(i,Zf(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!Y(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(ze(g)){const m=YE(n,p.field,g);return Bn([new xt(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Bn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&ye(["time","utc"],e)){const g=r[dr(i)];if(_5(p,g,o,a)){const m=n.requestDataName(d),y=us({fieldDef:p,fieldDef2:g,markDef:o,config:a}),b=Hf(s)&&y!==.5&&tt(i);return Bn([{data:m,field:n.vgField(i,b?{suffix:Dm}:{})},{data:m,field:n.vgField(i,{suffix:b?Nm:"end"})}])}}return Bn(h?[{data:Pf(h)?n.requestDataName(d):n.requestDataName(Ze.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function i_(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":mm),...i?{field:ii(i)}:{},...r?{order:r}:{}}}function pce(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,o=i5(i)?i:void 0,s=ha(r)&&om(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function gce(e,t,n){if(!vt(n))return;const i=e.fieldDef(t),r=i.sort;if(x5(r))return{op:"min",field:bl(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(io(r)){const a=o&&!s.has(r.field);return i_(r,a)}else if(fse(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(to(c)||os(c))return i_({field:V(l),order:u},d);if(Aw(c)||!c)return i_({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ye(["ascending",void 0],r))return!0}}function J4(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!Zie.has(n)?{valid:!1,reason:zre(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Bre(e)}:{valid:!0}:{valid:!1,reason:Ire(e)}}function r_(e,t,n,i){return e.explicit&&t.explicit&&j(Hre(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function mce(e){const t=ur(e.map(s=>{if(no(s)){const{sort:a,...u}=s;return u}return s}),be),n=ur(e.map(s=>{if(no(s)){const a=s.sort;return a!==void 0&&!Pf(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),be);if(t.length===0)return;if(t.length===1){const s=e[0];if(no(s)&&n.length>0){let a=n[0];if(n.length>1){j(PR);const u=n.filter(l=>Y(l)&&"op"in l&&l.op!=="min");n.every(l=>Y(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Y(a)&&"field"in a){const u=a.field;s.field===u&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const i=ur(n.map(s=>Pf(s)||!("op"in s)||K(s.op)&&Z(Vie,s.op)?s:(j(Vre(s)),!0)),be);let r;i.length===1?r=i[0]:i.length>1&&(j(PR),r=!0);const o=ur(e.map(s=>no(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function o_(e){if(no(e)&&K(e.field))return e.field;if(Jie(e)){let t;for(const n of e.fields)if(no(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(Yre),t}return j(Xre),t}else if(Qie(e)){j(Kre);const t=e.fields[0];return K(t)?t:void 0}}function Hm(e,t){const i=e.component.scales[t].get("domains").map(r=>(no(r)&&(r.data=e.lookupDataSource(r.data)),r));return mce(i)}function Q4(e){return _l(e)||a_(e)?e.children.reduce((t,n)=>t.concat(Q4(n)),eP(e)):eP(e)}function eP(e){return B(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:s,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=yce(r.range,o,n,e),h=Hm(e,n),p=a?hue(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function yce(e,t,n,i){if(tt(n)){if(pa(e))return{step:{signal:`${t}_step`}}}else if(Y(e)&&no(e))return{...e,data:i.lookupDataSource(e.data)};return e}class tP extends so{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ye([Ft.LOG,Ft.TIME,Ft.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ye([Ft.LINEAR,Ft.SQRT,Ft.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,o=!1,s=!1;for(const a of i){if(L(a)){const u=a[0],l=a[a.length-1];if(_e(u)&&_e(l))if(u<=0&&l>=0){r=!0;continue}else{o=!0;continue}}s=!0}if(r)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const bce=["range","scheme"];function vce(e){const t=e.component.scales;for(const n of $w){const i=t[n];if(!i)continue;const r=xce(n,e);i.setWithExplicit("range",r)}}function nP(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=An(t),s=e.getName(o);if(Y(i)&&i.binned&&i.step!==void 0)return new xt(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(s)} / (${u})`});if(ze(i)){const a=YE(e,r,i);return new xt(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function xce(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of bce)if(n[f]!==void 0){const d=Gw(o,f),h=r5(e,f);if(!d)j(NR(o,f,e));else if(h)j(h);else switch(f){case"range":{const p=n.range;if(L(p)){if(tt(e))return xr(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return xt.fromName(y,m)}return g}))}else if(Y(p))return xr({data:t.requestDataName(Ze.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return xr(p)}case"scheme":return xr(wce(n[f]))}}const s=e===We||e==="xOffset"?"width":"height",a=i[s];if(vr(a)){if(tt(e))if(vt(o)){const f=rP(a,t,e);if(f)return xr({step:f})}else j(RR(s));else if(jf(e)){const f=e===Qo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=oP(a,o);if(p)return xr(p)}}}const{rangeMin:u,rangeMax:l}=n,c=Ece(e,t);return(u!==void 0||l!==void 0)&&Gw(o,"rangeMin")&&L(c)&&c.length===2?xr([u??c[0],l??c[1]]):Bn(c)}function wce(e){return Roe(e)?{scheme:e.name,..._n(e,["name"])}:{scheme:e}}function iP(e,t,n,{center:i}={}){const r=An(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===yt&&Ti(n)?i?[xt.fromName(a=>`${s(a)}/2`,o),xt.fromName(a=>`-${s(a)}/2`,o)]:[xt.fromName(s,o),0]:i?[xt.fromName(a=>`-${s(a)}/2`,o),xt.fromName(a=>`${s(a)}/2`,o)]:[0,xt.fromName(s,o)]}function Ece(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=lt(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case We:case yt:{if(ye(["point","band"],u)){const f=sP(e,n,i.view);if(vr(f))return{step:rP(f,t,e)}}return iP(e,t,u)}case Qo:case Qu:return _ce(e,t,u);case Jr:{const f=Ace(r,i),d=kce(r,n,t,i);return ol(u)?Sce(f,d,$ce(u,i,l,e)):[f,d]}case ri:return[0,Math.PI*2];case ca:return[0,360];case Ai:return[0,new xt(()=>{const f=t.getSignalName(Un(t.parent)?"child_width":"width"),d=t.getSignalName(Un(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case ns:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case is:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Sn:return"symbol";case $n:case cr:case fr:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Qr:case es:case ts:return[i.scale.minOpacity,i.scale.maxOpacity]}}function rP(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=xw(n),s=i[o];if(o6({step:e,offsetIsDiscrete:le(s)&&ZR(s.type)})==="offset"&&I5(i,o)){const u=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${nre(f)})`}}else return e.step}function oP(e,t){if(o6({step:e,offsetIsDiscrete:vt(t)})==="offset")return{step:e.step}}function _ce(e,t,n){const i=e===Qo?"x":"y",r=t.getScaleComponent(i);if(!r)return iP(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=sP(i,t.size,t.config.view);if(vr(l)){const c=oP(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=VR(l.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=us({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=ee(f)?`${f.signal}/2`+h:`${f/2+d}`,g=ee(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return HN(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function sP(e,t,n){const i=e===We?"width":"height",r=t[i];return r||Fm(n,i)}function $ce(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&L(n)?n.length+1:(j(ooe(i)),3)}}function Sce(e,t,n){const i=()=>{const r=Fi(t),o=Fi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return ee(t)?new xt(i):{signal:i()}}function Ace(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(sm("size",e))}const aP=.95;function kce(e,t,n,i){const r={x:nP(n,"x"),y:nP(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=uP(t,r,i.view);return _e(o)?o-1:new xt(()=>`${o.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 o=uP(t,r,i.view);return _e(o)?Math.pow(aP*o,2):new xt(()=>`pow(${aP} * ${o.signal}, 2)`)}}throw new Error(sm("size",e))}function uP(e,t,n){const i=vr(e.width)?e.width.step:wE(n,"width"),r=vr(e.height)?e.height.step:wE(n,"height");return t.x||t.y?new xt(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function lP(e,t){Ge(e)?Cce(e,t):dP(e,t)}function Cce(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of B(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=lt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Gw(h,t),y=r5(a,t);if(d!==void 0&&(m?y&&j(y):j(NR(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ga(u[t])||v==="temporal"||b?l.set(t,{signal:$m(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(cP,t)?cP[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:z5(r,a),hasSecondaryRangeChannel:!!r[dr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const cP={bins:({model:e,fieldOrDatumDef:t})=>q(t)?Mce(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Fce(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>Tce(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Oce(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>Dce(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>Nce(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=q(e)?e.sort:void 0;return Rce(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>Pce(e,t,n,i,r,o.scale,s)};function fP(e){Ge(e)?vce(e):dP(e,"range")}function dP(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?fP(i):lP(i,t);for(const i of B(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=cs(r,a,t,"scale",T6((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Mce(e,t){const n=t.bin;if(ze(n)){const i=YE(e,t.field,n);return new xt(()=>e.getSignalName(i))}else if(Ct(n)&&ha(n)&&n.step!==void 0)return{step:n.step}}function Fce(e,t){if(ye([$n,cr,fr],e)&&t!=="nominal")return"hcl"}function Tce(e,t,n,i,r,o){var s;if(!((s=Ni(o))!=null&&s.bin||L(n)||r!=null||i!=null||ye([Ft.TIME,Ft.UTC],e)))return tt(t)?!0:void 0}function Oce(e,t,n,i,r,o){if(tt(e)){if(mr(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=r;if(s==="bar"&&!(q(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Ft.POINT)return n.pointPadding}}function Dce(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return o?c:et(s,n==="bar"?a:n==="tick"?l:u)}else if(jf(t)&&i===Ft.BAND)return r.offsetBandPaddingInner}}function Nce(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=r;if(o)return a;if(n===Ft.BAND)return et(s,ee(i)?{signal:`${i.signal}/2`}:i/2)}else if(jf(t)){if(n===Ft.POINT)return .5;if(n===Ft.BAND)return r.offsetBandPaddingOuter}}}function Rce(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ti(e)&&t==="descending"?ee(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ti(e)&&t==="descending")return!0}function Pce(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Ti(r)){if(L(n)){const u=n[0],l=n[n.length-1];if(_e(u)&&u<=0&&_e(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ol(r))return!0;if(!(q(t)&&t.bin)&&ye([...eo,...zie],e)){const{orient:u,type:l}=i;return ye(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ye(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function Lce(e,t,n,i,r=!1){const o=Ice(t,n,i,r),{type:s}=e;return hr(t)?s!==void 0?joe(t,s)?q(n)&&!Uoe(s,n.type)?(j(qre(s,o)),o):s:(j(jre(t,s,o)),o):o:null}function Ice(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(tl(e)||Sw(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(Ow(e,"ordinal")),"ordinal";if(tt(e)||jf(e)){if(ye(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in _w)return"band";const o=n[An(e)];return va(o)||al(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return tl(e)?"time":Sw(e)==="discrete"?(j(Ow(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&bt(t.timeUnit).utc?"utc":"time";case"quantitative":return tl(e)?q(t)&&ze(t.bin)?"bin-ordinal":"linear":Sw(e)==="discrete"?(j(Ow(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(OR(t.type))}function zce(e,{ignoreRange:t}={}){hP(e),Z4(e);for(const n of Boe)lP(e,n);t||fP(e)}function hP(e){Ge(e)?e.component.scales=Bce(e):e.component.scales=jce(e)}function Bce(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of $w){const s=lt(t[o]);if(s&&n===a5&&o===Sn&&s.type===rl)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=z5(t,o),l=Lce(a,o,s,i,u);r[o]=new tP(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const Uce=T6((e,t)=>JR(e)-JR(t));function jce(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){hP(o);for(const s of B(o.component.scales))if((t=r.scale)[s]??(t[s]=T4(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?Foe(a.value,u.value)?i[s]=cs(a,u,"type","scale",Uce):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of B(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new tP(s,a);for(const u of e.children){const l=u.component.scales[o];l&&(u.renameScale(l.get("name"),s),l.merged=!0)}}return n}class s_{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ge(e){return(e==null?void 0:e.type)==="unit"}function Un(e){return(e==null?void 0:e.type)==="facet"}function a_(e){return(e==null?void 0:e.type)==="concat"}function _l(e){return(e==null?void 0:e.type)==="layer"}class u_{constructor(t,n,i,r,o,s,a){this.type=n,this.parent=i,this.config=o,this.correctDataNames=u=>{var l,c,f;return(l=u.from)!=null&&l.data&&(u.from.data=this.lookupDataSource(u.from.data)),(f=(c=u.from)==null?void 0:c.facet)!=null&&f.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u},this.parent=i,this.config=o,this.view=Mt(a),this.name=t.name??r,this.title=ss(t.title)?{text:t.title}:t.title?Mt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new s_,this.projectionNameMap=i?i.projectionNameMap:new s_,this.signalNameMap=i?i.signalNameMap:new s_,this.data=t.data,this.description=t.description,this.transforms=Xae(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:eae(t,n,o),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:ym(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new so,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?ue(s):{}},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(){zce(this)}parseProjection(){W4(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){z4(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of B(i)){const s=i[o];s!==void 0&&(r[o]=Ue(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ue(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ne(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=ule(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of si)t[i].title&&n.push(nle(this,i));for(const i of jE)n=n.concat(ile(this,i));return n}assembleAxes(){return que(this.component.axes,this.config)}assembleLegends(){return U4(this)}assembleProjections(){return Tle(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...pR(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ye(["unit","layer"],this.type)?ye(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Ne(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Un(this.parent)?Q4(this):[];r.length>0&&(n.scales=r);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return qe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ze[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Un(this.parent)){const n=M4(t),i=im(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(vt(o)&&pa(s)){const a=r.get("name"),u=Hm(this,i),l=o_(u);if(l){const c=V({aggregate:"distinct",field:l},{expr:"datum"});return{signal:C4(a,r,c)}}else return j(Fw(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(oR(t)&&hr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}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 n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(are(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class pP extends u_{vgField(t,n={}){const i=this.fieldDef(t);if(i)return V(i,n)}reduceFieldDef(t,n){return Tse(this.getMapping(),(i,r,o)=>{const s=Ni(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){uE(this.getMapping(),(i,r)=>{const o=Ni(i);o&&t(o,r)},n)}}class Gm extends Te{clone(){return new Gm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${be(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class Vm extends Te{clone(){return new Vm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${be(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class Ym extends Te{clone(){return new Ym(this.parent,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((o,s)=>r[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${be(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Xm extends Te{clone(){return new Xm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${be(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class $l extends Te{clone(){return new $l(null,ue(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Ci,ki],[oi,Mi]]){const o=r.map(s=>{const a=lt(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:Di(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new $l(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Sn)){const r=n.typedFieldDef(Sn);r.type===rl&&(t=new $l(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(K);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${be(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 sd extends Te{clone(){return new sd(null,this.projection,ue(this.fields),ue(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Ci,ki],[oi,Mi]]){const r=i.map(s=>{const a=lt(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:Di(a)?{expr:`${a.value}`}:void 0}),o=i[0]===oi?"2":"";(r[0]||r[1])&&(t=new sd(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(K))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${be(this.fields)} ${be(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Fa extends Te{clone(){return new Fa(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Fa(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,o=i.y;if(q(r)&&q(o)){const s=r.impute?r:o.impute?o:void 0;if(s===void 0)return;const a=r.impute?o:o.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=s.impute,d=j5(n.mark,i);return new Fa(t,{impute:s.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${be(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:o,value:s,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Fae(i)?this.processSequence(i):i}:{},method:"value",...o?{groupby:o}:{},value:!r||r==="value"?s:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Km extends Te{clone(){return new Km(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${be(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class ad extends Te{clone(){return new ad(null,ue(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const o=n.component.data.sources,{from:s}=i;let a=null;if(Tae(s)){let u=bP(s.data,o);u||(u=new ka(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new kn(u,l,Ze.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Oae(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(qe(u),u)}catch{throw new Error(fre(u))}if(a=l.materialized,!a)throw new Error(dre(u))}return new ad(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?X(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${be({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:X(this.transform.as)}:{}};else{let n=this.transform.as;K(n)||(j(xre),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Zm extends Te{clone(){return new Zm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${be(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Jm extends Te{clone(){return new Jm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${be(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Qm extends Te{clone(){return new Qm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ur((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${be(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:o}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...o!==void 0?{op:o}:{},...i!==void 0?{groupby:i}:{}}}}class e0 extends Te{clone(){return new e0(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${be(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function gP(e){let t=0;function n(i,r){if(i instanceof ka&&!i.isGenerator&&!dl(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Vt&&(i.parent instanceof ka&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof xl){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof id||i instanceof rd||i instanceof wl||i instanceof ml||i instanceof yl||i instanceof sd||i instanceof Pi||i instanceof ad||i instanceof El||i instanceof Ma||i instanceof Xm||i instanceof Ym||i instanceof Gm||i instanceof Km||i instanceof Zm||i instanceof Jm||i instanceof hs||i instanceof e0||i instanceof Qm||i instanceof Vm)&&r.transform.push(i.assemble()),(i instanceof Er||i instanceof wr||i instanceof Fa||i instanceof lo||i instanceof $l)&&r.transform.push(...i.assemble()),i instanceof kn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof kn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof kn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const s of i.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function qce(e){const t=[],n=gP(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Wce(e,t){const n=[],i=gP(n);let r=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${r++}`);const a=s.assemble();i(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function Hce(e){return e==="top"||e==="left"||ee(e)?"header":"footer"}function Gce(e){for(const t of si)Vce(e,t);yP(e,"x"),yP(e,"y")}function Vce(e,t){var s;const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],u=vl("title",null,i,t);let l=ul(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=L(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=vl("labelOrient",a.header,i,t),f=a.header!==null?et((s=a.header)==null?void 0:s.labels,i.header.labels,!0):!1,d=ye(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[mP(e,t,f)]}}}function mP(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function yP(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=GE(r,t),r.axis[t]==="shared"){const o=t==="x"?"column":"row",s=i[o];for(const a of n.component.axes[t]){const u=Hce(a.get("orient"));s[u]??(s[u]=[mP(e,o,!1)]);const l=nd(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function Yce(e){l_(e),t0(e,"width"),t0(e,"height")}function Xce(e){l_(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";t0(e,t),t0(e,n)}function l_(e){for(const t of e.children)t.parseLayoutSize()}function t0(e,t){const n=M4(t),i=im(n),r=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??T4(i,e);if(l==="independent"&&u.value==="step"){s=void 0;break}if(s){if(l==="independent"&&s.value!==u.value){s=void 0;break}s=cs(s,u,n,"")}else s=u}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Kce(e){const{size:t,component:n}=e;for(const i of eo){const r=An(i);if(t[r]){const o=t[r];n.layoutSize.set(r,vr(o)?"step":o,!0)}else{const o=Zce(e,r);n.layoutSize.set(r,o,!1)}}}function Zce(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const o=r.get("type"),s=r.get("range");if(vt(o)){const a=Fm(i.view,t);return pa(s)||vr(a)?"step":a}else return xE(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return xE(i.view,t);{const o=Fm(i.view,t);return vr(o)?o.step:o}}}function c_(e,t,n){return V(t,{suffix:`by_${V(e)}`,...n})}class ud extends pP{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=g_(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Yf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=B(t),i={};for(const r of n){if(![Yr,Xr].includes(r)){j(sm(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Tw(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=aE(t,n);return i.header?i.header=Mt(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return U(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=n0(this),this.child.parseData()}parseLayoutSize(){l_(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Gce(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 n of si)for(const i of qE){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=vl("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=Um(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof ud))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof ud?{...this.channelHasField("column")?{encode:{update:{columns:{field:V(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof ud){if(this.child.channelHasField("column")){const r=V(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of eo){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(vt(s)&&pa(a)){const u=Hm(this.child,r),l=o_(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(Fw(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of si){const f=this.facet[c];if(f){u.push(V(f));const{bin:d,sort:h}=f;if(ze(d)&&u.push(V(f,{binSuffix:"end"})),io(h)){const{field:p,op:g=mm}=h,m=c_(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(L(h)){const p=bl(f,c);o.push(p),s.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?io(i.sort)?[c_(i,i.sort,{expr:"datum"})]:L(i.sort)?[bl(i,t,{expr:"datum"})]:[V(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(io(r)?r.order:!L(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return WE(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of jE)if(t[o]){const s=vl("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return WE(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=qce(n),r=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:si.map(u=>this.facetSortFields(u)).flat(),order:si.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(lue(this,[]))}]}getMapping(){return this.facet}}function Jce(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(io(o.sort)){const{field:s,op:a=mm}=o.sort;e=r=new Ma(e,{joinaggregate:[{op:a,field:s,as:c_(o,o.sort,{forAs:!0})}],groupby:[V(o)]})}return r}return null}function bP(e,t){var n,i,r,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((u||f)&&u!==f)){if(Qf(e)&&Qf(a)){if(In(e.values,a.values))return s}else if(dl(e)&&dl(a)){if(e.url===a.url)return s}else if(O6(e)&&e.name===s.dataName)return s}}return null}function Qce(e,t){if(e.data||!e.parent){if(e.data===null){const i=new ka({values:[]});return t.push(i),i}const n=bP(e.data,t);if(n)return fs(e.data)||(n.data.format=GN({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new ka(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function efe(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(jae(r))s=e=new yl(e,r),o="derived";else if(AE(r)){const a=Wle(r);s=e=Vt.makeWithAncestors(e,{},a,n)??e,e=new ml(e,t,r.filter)}else if($6(r))s=e=Er.makeFromTransform(e,r,t),o="number";else if(Wae(r))o="date",n.getWithExplicit(r.field).value===void 0&&(e=new Vt(e,{[r.field]:o}),n.set(r.field,o,!1)),s=e=wr.makeFromTransform(e,r);else if(Hae(r))s=e=Pi.makeFromTransform(e,r),o="number",LE(t)&&(e=new hs(e));else if(_6(r))s=e=ad.make(e,t,r,i++),o="derived";else if(zae(r))s=e=new El(e,r),o="number";else if(Bae(r))s=e=new Ma(e,r),o="number";else if(Gae(r))s=e=lo.makeFromTransform(e,r),o="derived";else if(Vae(r))s=e=new Xm(e,r),o="derived";else if(Yae(r))s=e=new Vm(e,r),o="derived";else if(Uae(r))s=e=new Ym(e,r),o="derived";else if(Dae(r))s=e=new Qm(e,r),o="derived";else if(Iae(r))e=new e0(e,r);else if(qae(r))s=e=Fa.makeFromTransform(e,r),o="derived";else if(Nae(r))s=e=new Gm(e,r),o="derived";else if(Rae(r))s=e=new Zm(e,r),o="derived";else if(Pae(r))s=e=new Jm(e,r),o="derived";else if(Lae(r))s=e=new Km(e,r),o="derived";else{j(vre(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function n0(e){var m;let t=Qce(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(fs(r)||dl(r)||Qf(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new sue;fs(r)?(D6(r)?t=new rd(t,r.sequence):ME(r)&&(t=new id(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=Vt.makeExplicit(t,e,s)??t,t=new hs(t);const a=e.parent&&_l(e.parent);(Ge(e)||Un(e))&&a&&(t=Er.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=efe(t,e,s));const u=Gle(e),l=Hle(e);t=Vt.makeWithAncestors(t,{},{...u,...l},s)??t,Ge(e)&&(t=$l.parseAll(t,e),t=sd.parseAll(t,e)),(Ge(e)||Un(e))&&(a||(t=Er.makeFromEncoding(t,e)??t),t=wr.makeFromEncoding(t,e)??t,t=yl.parseAllForSortIndex(t,e));const c=t=i0(Ze.Raw,e,t);if(Ge(e)){const y=Pi.makeFromEncoding(t,e);y&&(t=y,LE(e)&&(t=new hs(t))),t=Fa.makeFromEncoding(t,e)??t,t=lo.makeFromEncoding(t,e)??t}let f,d;if(Ge(e)){const{markDef:y,mark:b,config:v}=e,x=Pe("invalid",y,v),{marks:w,scales:_}=d=R6({invalid:x,isPath:as(b)});w!==_&&_==="include-invalid-values"&&(f=t=i0(Ze.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=wl.make(t,e,d)??t)}const h=t=i0(Ze.Main,e,t);let p;if(Ge(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=wl.make(t,e,d)??t,p=t=i0(Ze.PostFilterInvalid,e,t))}Ge(e)&&Uue(e,h);let g=null;if(Un(e)){const y=e.getName("facet");t=Jce(t,e.facet)??t,g=new xl(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function i0(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new kn(n,o,e,r);return i[o]=s,s}class tfe extends u_{constructor(t,n,i,r){var o,s,a,u;super(t,"concat",n,i,r,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(mre),this.children=this.getChildren(t).map((l,c)=>g_(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=n0(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Mm(t)?t.vconcat:vE(t)?t.hconcat:t.concat}parseLayoutSize(){Xce(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=HE(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function nfe(e){return e===!1||e===null}const ife={disable:1,gridScale:1,scale:1,...R5,labelExpr:1,encode:1},vP=B(ife);class f_ extends so{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new f_(ue(this.explicit),ue(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!nfe(this.get(t))}hasOrientSignalRef(){return ee(this.explicit.orient)}}function rfe(e,t,n){const{encoding:i,config:r}=e,o=lt(i[t])??lt(i[dr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(wa(u))return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(sl(o)==="quantitative"){if(al(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(sl(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function ofe(e){return eo.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[dfe(n,e)]),t),{})}const sfe={bottom:"top",top:"bottom",left:"right",right:"left"};function afe(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const o of B(r.component.axes))n.axis[o]=GE(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=ufe(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of eo){for(const o of e.children)if(o.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const s of o.component.axes[r]){const{value:a,explicit:u}=s.getWithExplicit("orient");if(!ee(a)){if(i[a]>0&&!u){const l=sfe[a];i[a]>i[l]&&s.set("orient",l,!1)}i[a]++}}}delete o.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[o,s]of(t[r]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function ufe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],o=t[i];if(!!r!=!!o)return;if(r&&o){const s=r.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value)return;e[i]=lfe(r,o)}}}else return t.map(n=>n.clone());return e}function lfe(e,t){for(const n of vP){const i=cs(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return _R(r,o);case"gridScale":return{explicit:r.explicit,value:et(r.value,o.value)}}return Om(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function cfe(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ee(n.labelAngle)?n.labelAngle:zf(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===_4(i,r))return!0}return e===n[t]}const ffe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function dfe(e,t){var y,b;let n=t.axis(e);const i=new f_,r=lt(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=s.axis)==null?void 0:b.orient)||Zue(e),u=t.getScaleComponent(e).get("type"),l=Wue(e,u,a,t.config),c=n!==void 0?!n:BE("disable",s.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Yue(r,n,e,s.style,l),d=m5(n.formatType,r,u),h=g5(r,r.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const v of vP){const x=v in x4?x4[v](p):P5(v)?n[v]:void 0,w=x!==void 0,_=cfe(x,v,n,t,e);if(w&&_)i.set(v,x,_);else{const{configValue:E=void 0,configFrom:$=void 0}=P5(v)&&v!=="values"?BE(v,s.style,n.style,l):{},S=E!==void 0;w&&!S?i.set(v,x,_):($!=="vgAxisConfig"||ffe.has(v)&&S||Jf(E)||ee(E))&&i.set(v,E,!1)}}const g=n.encoding??{},m=N5.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const w=F4(g[x]??{},t),_=x==="labels"?rfe(t,e,w):w;return _!==void 0&&!Ne(_)&&(v[x]={update:_}),v},{});return Ne(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function hfe({encoding:e,size:t}){for(const n of eo){const i=An(n);vr(t[i])&&ls(e[n])&&(delete t[i],j(RR(i)))}return t}const pfe={vgMark:"arc",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...uo(e,"radius"),...uo(e,"theta")})},gfe={vgMark:"area",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Pm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Pm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...RE(e)})},mfe={vgMark:"rect",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y")})},yfe={vgMark:"shape",encodeEntry:e=>({...ai(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&&q(n)&&n.type===rl?{field:V(n,{expr:"datum"})}:{}}]}},bfe={vgMark:"image",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y"),...DE(e,"url")})},vfe={vgMark:"line",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e,{vgChannel:"strokeWidth"}),...RE(e)})},xfe={vgMark:"trail",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e),...RE(e)})};function d_(e,t){const{config:n}=e;return{...ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...Tt("size",e),...Tt("angle",e),...wfe(e,n,t)}}function wfe(e,t,n){return n?{shape:{value:n}}:Tt("shape",e)}const Efe={vgMark:"symbol",encodeEntry:e=>d_(e)},_fe={vgMark:"symbol",encodeEntry:e=>d_(e,"circle")},$fe={vgMark:"symbol",encodeEntry:e=>d_(e,"square")},Sfe={vgMark:"rect",encodeEntry:e=>({...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,"x"),...uo(e,"y")})},Afe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Pm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Tt("size",e,{vgChannel:"strokeWidth"})}}},kfe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...ai(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...dn("x",e,{defaultPos:"mid"}),...dn("y",e,{defaultPos:"mid"}),...DE(e),...Tt("size",e,{vgChannel:"fontSize"}),...Tt("angle",e),...t4("align",Cfe(e.markDef,n,t)),...t4("baseline",Mfe(e.markDef,n,t)),...dn("radius",e,{defaultPos:null}),...dn("theta",e,{defaultPos:null})}}};function Cfe(e,t,n){if(Pe("align",e,n)===void 0)return"center"}function Mfe(e,t,n){if(Pe("baseline",e,n)===void 0)return"middle"}const r0={arc:pfe,area:gfe,bar:mfe,circle:_fe,geoshape:yfe,image:bfe,line:vfe,point:Efe,rect:Sfe,rule:Afe,square:$fe,text:kfe,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",o=i==="horizontal"?"y":"x",s=i==="horizontal"?"height":"width";return{...ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uo(e,r),...dn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ue(Pe("thickness",n,t))}}},trail:xfe};function Ffe(e){if(ye([dm,cm,Goe],e.mark)){const t=j5(e.mark,e.encoding);if(t.length>0)return Tfe(e,t)}else if(e.mark===fm){const t=kw.some(n=>Pe(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Ofe(e)}return h_(e)}const xP="faceted_path_";function Tfe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:xP+e.requestDataName(Ze.Main),data:e.requestDataName(Ze.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:h_(e,{fromPrefix:xP})}]}const wP="stack_group_";function Ofe(e){var l;const[t]=h_(e,{fromPrefix:wP}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...Xu(t.encode.update,["y","yc","y2","height",...kw]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={..._n(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...Xu(t.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"}}},t.encode.update={..._n(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of kw){const f=pr(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Ue(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=V(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(V(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=pr(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ue(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ze.Main),name:wP+e.requestDataName(Ze.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:[t]}]}]}function Dfe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!L(s)&&Di(s)&&fw(s.value)||!s&&fw(Pe("order",r,o)))){if((L(s)||q(s))&&!n)return xR(s,{expr:"datum"});if(as(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function h_(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=et(i.clip,Nfe(e),Rfe(e)),a=bR(i),u=r.key,l=Dfe(e),c=Pfe(e),f=Pe("aria",i,o),d=r0[n].postEncodingTransform?r0[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:r0[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ze.Main)},encode:{update:r0[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Nfe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Rfe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Pfe(e){if(!e.component.selection)return null;const t=B(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=B(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class EP extends pP{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,s6(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=yr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=Eae(s,o,{graticule:t.data&&ME(t.data)}));const u=this.encoding=Mse(t.encoding||{},a,s.filled,o);this.markDef=g6(s,u,o),this.size=hfe({encoding:u,size:s6(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=p6(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>yE(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===a5,i=t&&Fie.some(r=>le(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return $w.reduce((i,r)=>{const o=lt(n[r]);return o&&(i[r]=this.initScale(o.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=Mt(t);return L(n)&&(r.domain=n.map(zn)),L(i)&&(r.range=i.map(zn)),r}initAxes(t){return eo.reduce((n,i)=>{const r=t[i];if(le(r)||i===We&&le(t.x2)||i===yt&&le(t.y2)){const o=le(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=B(t),i={};for(const r of n){const o=t[r];i[r]=Jf(o)?gR(o):zn(o)}return i}initLegends(t){return Bie.reduce((n,i)=>{const r=lt(t[i]);if(r&&jie(i)){const o=r.legend;n[i]=o&&Mt(o)}return n},{})}parseData(){this.component.data=n0(this)}parseLayoutSize(){Kce(this)}parseSelections(){this.component.selection=Bue(this,this.selection)}parseMarkGroup(){this.component.mark=Ffe(this)}parseAxesAndHeaders(){this.component.axes=ofe(this)}assembleSelectionTopLevelSignals(t){return cue(this,t)}assembleSignals(){return[...b4(this),...uue(this,[])]}assembleSelectionData(t){return fue(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return HE(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!_l(this.parent))&&(t=L6(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return _a(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ni(n)}typedFieldDef(t){const n=this.fieldDef(t);return fn(n)?n:null}}class p_ extends u_{constructor(t,n,i,r,o){super(t,"layer",n,i,o,t.resolve,t.view);const s={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(Tm(a))return new p_(a,this,this.getName(`layer_${u}`),s,o);if(ro(a))return new EP(a,this,this.getName(`layer_${u}`),s,o);throw new Error(Mw(a))})}parseData(){this.component.data=n0(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Yce(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){afe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),b4(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),HE(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of X(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return due(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),U4(this))}}function g_(e,t,n,i,r){if(ym(e))return new ud(e,t,n,r);if(Tm(e))return new p_(e,t,n,i,r);if(ro(e))return new EP(e,t,n,i,r);if(Jse(e))return new tfe(e,t,n,r);throw new Error(Mw(e))}function Lfe(e,t={}){t.logger&&soe(t.logger),t.fieldTitle&&F5(t.fieldTitle);try{const n=d6(Wa(t.config,e.config)),i=C6(e,n),r=g_(i,null,"",void 0,n);return r.parse(),uce(r.component.data,r),{spec:zfe(r,Ife(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&aoe(),t.fieldTitle&&wse()}}function Ife(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):K(t)&&(t={type:t}),r&&o&&iue(t.type)){if(r==="step"&&o==="step")j(AR()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(AR(im(s)));const a=s==="width"?"height":"width";t.type=rue(a)}}return{...B(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...F6(n,!1),...F6(e,!0)}}function zfe(e,t,n={},i){const r=e.config?cae(e.config):void 0,o=[].concat(e.assembleSelectionData([]),Wce(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...r6(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Bfe=$ie.version,Ufe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Ju,accessPathWithDatum:mw,compile:Lfe,contains:ye,deepEqual:In,deleteNestedProperty:Kg,duplicate:ue,entries:Jo,every:dw,fieldIntersection:gw,flatAccessWithDatum:YN,getFirstDefined:et,hasIntersection:hw,hasProperty:U,hash:be,internalField:ZN,isBoolean:Pf,isEmpty:Ne,isEqual:Aie,isInternalField:JN,isNullOrFalse:fw,isNumeric:Zg,keys:B,logicalExpr:Lf,mergeDeep:GN,never:HN,normalize:C6,normalizeAngle:zf,omit:_n,pick:Xu,prefixGenerator:pw,removePathFromField:Zu,replaceAll:la,replacePathInField:ii,resetIdCounter:Cie,setEqual:VN,some:Ku,stringify:Re,titleCase:If,unique:ur,uniqueId:KN,vals:kt,varName:qe,version:Bfe},Symbol.toStringTag,{value:"Module"}));function _P(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var jfe="vega-themes",qfe="2.15.0",Wfe="Themes for stylized Vega and Vega-Lite visualizations.",Hfe=["vega","vega-lite","themes","style"],Gfe="BSD-3-Clause",Vfe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},Yfe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],Xfe="build/vega-themes.js",Kfe="build/vega-themes.module.js",Zfe="build/vega-themes.min.js",Jfe="build/vega-themes.min.js",Qfe="build/vega-themes.module.d.ts",ede={type:"git",url:"https://github.com/vega/vega-themes.git"},tde=["src","build"],nde={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},ide={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},rde={vega:"*","vega-lite":"*"},ode={},sde={name:jfe,version:qfe,description:Wfe,keywords:Hfe,license:Gfe,author:Vfe,contributors:Yfe,main:Xfe,module:Kfe,unpkg:Zfe,jsdelivr:Jfe,types:Qfe,repository:ede,files:tde,scripts:nde,devDependencies:ide,peerDependencies:rde,dependencies:ode};const Sl="#fff",$P="#888",ade={background:"#333",view:{stroke:$P},title:{color:Sl,subtitleColor:Sl},style:{"guide-label":{fill:Sl},"guide-title":{fill:Sl}},axis:{domainColor:Sl,gridColor:$P,tickColor:Sl}},Ta="#4572a7",ude={background:"#fff",arc:{fill:Ta},area:{fill:Ta},line:{stroke:Ta,strokeWidth:2},path:{stroke:Ta},rect:{fill:Ta},shape:{stroke:Ta},symbol:{fill:Ta,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"]}},Oa="#30a2da",m_="#cbcbcb",lde="#999",cde="#333",SP="#f0f0f0",AP="#333",fde={arc:{fill:Oa},area:{fill:Oa},axis:{domainColor:m_,grid:!0,gridColor:m_,gridWidth:1,labelColor:lde,labelFontSize:10,titleColor:cde,tickColor:m_,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:SP,group:{fill:SP},legend:{labelColor:AP,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:AP,titleFontSize:14,titlePadding:10},line:{stroke:Oa,strokeWidth:2},path:{stroke:Oa,strokeWidth:.5},rect:{fill:Oa},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:Oa},bar:{binSpacing:2,fill:Oa,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Da="#000",dde={group:{fill:"#e5e5e5"},arc:{fill:Da},area:{fill:Da},line:{stroke:Da},path:{stroke:Da},rect:{fill:Da},shape:{stroke:Da},symbol:{fill:Da,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"]}},hde=22,pde="normal",kP="Benton Gothic, sans-serif",CP=11.5,gde="normal",Na="#82c6df",y_="Benton Gothic Bold, sans-serif",MP="normal",FP=13,ld={"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"]},mde={background:"#ffffff",title:{anchor:"start",color:"#000000",font:y_,fontSize:hde,fontWeight:pde},arc:{fill:Na},area:{fill:Na},line:{stroke:Na,strokeWidth:2},path:{stroke:Na},rect:{fill:Na},shape:{stroke:Na},symbol:{fill:Na,size:30},axis:{labelFont:kP,labelFontSize:CP,labelFontWeight:gde,titleFont:y_,titleFontSize:FP,titleFontWeight:MP},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:kP,labelFontSize:CP,symbolType:"square",titleFont:y_,titleFontSize:FP,titleFontWeight:MP},range:{category:ld["category-6"],diverging:ld["fireandice-6"],heatmap:ld["fire-7"],ordinal:ld["fire-7"],ramp:ld["fire-7"]}},Ra="#ab5787",o0="#979797",yde={background:"#f9f9f9",arc:{fill:Ra},area:{fill:Ra},line:{stroke:Ra},path:{stroke:Ra},rect:{fill:Ra},shape:{stroke:Ra},symbol:{fill:Ra,size:30},axis:{domainColor:o0,domainWidth:.5,gridWidth:.2,labelColor:o0,tickColor:o0,tickWidth:.2,titleColor:o0},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"]}},Pa="#3e5c69",bde={background:"#fff",arc:{fill:Pa},area:{fill:Pa},line:{stroke:Pa},path:{stroke:Pa},rect:{fill:Pa},shape:{stroke:Pa},symbol:{fill:Pa},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"]}},ui="#1696d2",TP="#000000",vde="#FFFFFF",s0="Lato",b_="Lato",xde="Lato",wde="#DEDDDD",Ede=18,cd={"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"]},_de={background:vde,title:{anchor:"start",fontSize:Ede,font:s0},axisX:{domain:!0,domainColor:TP,domainWidth:1,grid:!1,labelFontSize:12,labelFont:b_,labelAngle:0,tickColor:TP,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:s0},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:wde,gridWidth:1,labelFontSize:12,labelFont:b_,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:s0,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:b_,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:s0,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:cd["six-groups-cat-1"],diverging:cd["diverging-colors"],heatmap:cd["diverging-colors"],ordinal:cd["six-groups-seq"],ramp:cd["shades-blue"]},area:{fill:ui},rect:{fill:ui},line:{color:ui,stroke:ui,strokeWidth:5},trail:{color:ui,stroke:ui,strokeWidth:0,size:1},path:{stroke:ui,strokeWidth:.5},point:{filled:!0},text:{font:xde,color:ui,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:ui,stroke:null}},arc:{fill:ui},shape:{stroke:ui},symbol:{fill:ui,size:30}},La="#3366CC",OP="#ccc",a0="Arial, sans-serif",$de={arc:{fill:La},area:{fill:La},path:{stroke:La},rect:{fill:La},shape:{stroke:La},symbol:{stroke:La},circle:{fill:La},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:a0,fontSize:12},"guide-title":{font:a0,fontSize:12},"group-title":{font:a0,fontSize:12}},title:{font:a0,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:OP,tickColor:OP,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},v_=e=>e*(1/3+1),DP=v_(9),NP=v_(10),RP=v_(12),fd="Segoe UI",PP="wf_standard-font, helvetica, arial, sans-serif",LP="#252423",dd="#605E5C",IP="transparent",Sde="#C8C6C4",Ii="#118DFF",Ade="#12239E",kde="#E66C37",Cde="#6B007B",Mde="#E044A7",Fde="#744EC2",Tde="#D9B300",Ode="#D64550",zP=Ii,BP="#DEEFFF",UP=[BP,zP],Dde={view:{stroke:IP},background:IP,font:fd,header:{titleFont:PP,titleFontSize:RP,titleColor:LP,labelFont:fd,labelFontSize:NP,labelColor:dd},axis:{ticks:!1,grid:!1,domain:!1,labelColor:dd,labelFontSize:DP,titleFont:PP,titleColor:LP,titleFontSize:RP,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Sde,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ii},line:{stroke:Ii,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:fd,fontSize:DP,fill:dd},arc:{fill:Ii},area:{fill:Ii,line:!0,opacity:.6},path:{stroke:Ii},rect:{fill:Ii},point:{fill:Ii,filled:!0,size:75},shape:{stroke:Ii},symbol:{fill:Ii,strokeWidth:1.5,size:50},legend:{titleFont:fd,titleFontWeight:"bold",titleColor:dd,labelFont:fd,labelFontSize:NP,labelColor:dd,symbolType:"circle",symbolSize:75},range:{category:[Ii,Ade,kde,Cde,Mde,Fde,Tde,Ode],diverging:UP,heatmap:UP,ordinal:[BP,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",zP]}},x_='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Nde='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',w_=400,u0={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Rde=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Pde=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function l0({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=u0.gridBg[e],r=u0.textPrimary[e],o=u0.textSecondary[e],s=n==="dark"?Rde:Pde,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:x_,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:Nde,labelFontWeight:w_,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:u0.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:x_,fill:o,fontWeight:w_},"guide-title":{font:x_,fill:o,fontWeight:w_}},range:{category:s,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 Lde=l0({theme:"white",background:"#ffffff"}),Ide=l0({theme:"g10",background:"#f4f4f4"}),zde=l0({theme:"g90",background:"#262626"}),Bde=l0({theme:"g100",background:"#161616"}),Ude=sde.version,jde=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Ide,carbong100:Bde,carbong90:zde,carbonwhite:Lde,dark:ade,excel:ude,fivethirtyeight:fde,ggplot2:dde,googlecharts:$de,latimes:mde,powerbi:Dde,quartz:yde,urbaninstitute:_de,version:Ude,vox:bde},Symbol.toStringTag,{value:"Module"}));function qde(e,t,n,i){if(L(e))return`[${e.map(r=>t(K(r)?r:jP(r,n))).join(", ")}]`;if(Y(e)){let r="";const{title:o,image:s,...a}=e;o&&(r+=`<h2>${t(o)}</h2>`),s&&(r+=`<img src="${new URL(t(s),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(Y(c)&&(c=jP(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function Wde(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function jP(e,t){return JSON.stringify(e,Wde(t))}var Hde=`#vg-tooltip-element {
55
55
  visibility: hidden;
56
56
  padding: 8px;
57
57
  position: fixed;
@@ -105,7 +105,7 @@
105
105
  #vg-tooltip-element.dark-theme td.key {
106
106
  color: #bfbfbf;
107
107
  }
108
- `;const qP="vg-tooltip-element",Vde={offsetX:10,offsetY:10,id:qP,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Yde,maxDepth:2,formatTooltip:Wde,baseURL:""};function Yde(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function Xde(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Gde.toString().replace(qP,e)}function Kde(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let o=e.clientY+i;return o+t.height>window.innerHeight&&(o=+e.clientY-i-t.height),{x:r,y:o}}class Zde{constructor(t){this.options={...Vde,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=Xde(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,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)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=Kde(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}function Jde(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}class Qde{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}}var ehe=Qde;const the=Object.freeze({loose:!0}),nhe=Object.freeze({});var E_=e=>e?typeof e!="object"?the:e:nhe,__={exports:{}};const ihe="2.0.0",WP=256,rhe=Number.MAX_SAFE_INTEGER||9007199254740991,ohe=16,she=WP-6;var $_={MAX_LENGTH:WP,MAX_SAFE_COMPONENT_LENGTH:ohe,MAX_SAFE_BUILD_LENGTH:she,MAX_SAFE_INTEGER:rhe,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:ihe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},l0=typeof process=="object"&&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:i,MAX_LENGTH:r}=$_,o=l0;t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;o(g,v,m),l[g]=v,u[v]=m,s[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(__,__.exports);var S_=__.exports;const HP=/^[0-9]+$/,GP=(e,t)=>{const n=HP.test(e),i=HP.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var ahe={compareIdentifiers:GP,rcompareIdentifiers:(e,t)=>GP(t,e)};const c0=l0,{MAX_LENGTH:VP,MAX_SAFE_INTEGER:f0}=$_,{safeRe:YP,t:XP}=S_,uhe=E_,{compareIdentifiers:Al}=ahe;var A_=class Ar{constructor(t,n){if(n=uhe(n),t instanceof Ar){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>VP)throw new TypeError(`version is longer than ${VP} characters`);c0("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?YP[XP.LOOSE]:YP[XP.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>f0||this.major<0)throw new TypeError("Invalid major version");if(this.minor>f0||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>f0||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const o=+r;if(o>=0&&o<f0)return o}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(c0("SemVer.compare",this.version,this.options,t),!(t instanceof Ar)){if(typeof t=="string"&&t===this.version)return 0;t=new Ar(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ar||(t=new Ar(t,this.options)),Al(this.major,t.major)||Al(this.minor,t.minor)||Al(this.patch,t.patch)}comparePre(t){if(t instanceof Ar||(t=new Ar(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(c0("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Al(i,r)}while(++n)}compareBuild(t){t instanceof Ar||(t=new Ar(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(c0("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Al(i,r)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const r=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];i===!1&&(o=[n]),Al(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const KP=A_;var kl=(e,t,n)=>new KP(e,n).compare(new KP(t,n));const lhe=kl;var che=(e,t,n)=>lhe(e,t,n)===0;const fhe=kl;var dhe=(e,t,n)=>fhe(e,t,n)!==0;const hhe=kl;var phe=(e,t,n)=>hhe(e,t,n)>0;const ghe=kl;var mhe=(e,t,n)=>ghe(e,t,n)>=0;const yhe=kl;var bhe=(e,t,n)=>yhe(e,t,n)<0;const vhe=kl;var xhe=(e,t,n)=>vhe(e,t,n)<=0;const whe=che,Ehe=dhe,_he=phe,$he=mhe,She=bhe,Ahe=xhe;var khe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return whe(e,n,i);case"!=":return Ehe(e,n,i);case">":return _he(e,n,i);case">=":return $he(e,n,i);case"<":return She(e,n,i);case"<=":return Ahe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}},k_,ZP;function Che(){if(ZP)return k_;ZP=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}k_=t;const n=E_,{safeRe:i,t:r}=S_,o=khe,s=l0,a=A_,u=QP();return k_}var C_,JP;function QP(){if(JP)return C_;JP=1;class e{constructor(F,C){if(C=i(C),F instanceof e)return F.loose===!!C.loose&&F.includePrerelease===!!C.includePrerelease?F:new e(F.raw,C);if(F instanceof r)return this.raw=F.value,this.set=[[F]],this.format(),this;if(this.options=C,this.loose=!!C.loose,this.includePrerelease=!!C.includePrerelease,this.raw=F.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(P=>!p(P[0])),this.set.length===0)this.set=[T];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&g(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(F=>F.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(F){const T=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+F,P=n.get(T);if(P)return P;const I=this.options.loose,z=I?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];F=F.replace(z,k(this.options.includePrerelease)),o("hyphen replace",F),F=F.replace(a[u.COMPARATORTRIM],l),o("comparator trim",F),F=F.replace(a[u.TILDETRIM],c),o("tilde trim",F),F=F.replace(a[u.CARETTRIM],f),o("caret trim",F);let te=F.split(" ").map(Ee=>y(Ee,this.options)).join(" ").split(/\s+/).map(Ee=>M(Ee,this.options));I&&(te=te.filter(Ee=>(o("loose invalid filter",Ee,this.options),!!Ee.match(a[u.COMPARATORLOOSE])))),o("range list",te);const ne=new Map,de=te.map(Ee=>new r(Ee,this.options));for(const Ee of de){if(p(Ee))return[Ee];ne.set(Ee.value,Ee)}ne.size>1&&ne.has("")&&ne.delete("");const ke=[...ne.values()];return n.set(T,ke),ke}intersects(F,C){if(!(F instanceof e))throw new TypeError("a Range is required");return this.set.some(T=>m(T,C)&&F.set.some(P=>m(P,C)&&T.every(I=>P.every(z=>I.intersects(z,C)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new s(F,this.options)}catch{return!1}for(let C=0;C<this.set.length;C++)if(N(this.set[C],F,this.options))return!0;return!1}}C_=e;const t=ehe,n=new t,i=E_,r=Che(),o=l0,s=A_,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=S_,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=$_,p=A=>A.value==="<0.0.0-0",g=A=>A.value==="",m=(A,F)=>{let C=!0;const T=A.slice();let P=T.pop();for(;C&&T.length;)C=T.every(I=>P.intersects(I,F)),P=T.pop();return C},y=(A,F)=>(o("comp",A,F),A=w(A,F),o("caret",A),A=v(A,F),o("tildes",A),A=E(A,F),o("xrange",A),A=S(A,F),o("stars",A),A),b=A=>!A||A.toLowerCase()==="x"||A==="*",v=(A,F)=>A.trim().split(/\s+/).map(C=>x(C,F)).join(" "),x=(A,F)=>{const C=F.loose?a[u.TILDELOOSE]:a[u.TILDE];return A.replace(C,(T,P,I,z,te)=>{o("tilde",A,T,P,I,z,te);let ne;return b(P)?ne="":b(I)?ne=`>=${P}.0.0 <${+P+1}.0.0-0`:b(z)?ne=`>=${P}.${I}.0 <${P}.${+I+1}.0-0`:te?(o("replaceTilde pr",te),ne=`>=${P}.${I}.${z}-${te} <${P}.${+I+1}.0-0`):ne=`>=${P}.${I}.${z} <${P}.${+I+1}.0-0`,o("tilde return",ne),ne})},w=(A,F)=>A.trim().split(/\s+/).map(C=>_(C,F)).join(" "),_=(A,F)=>{o("caret",A,F);const C=F.loose?a[u.CARETLOOSE]:a[u.CARET],T=F.includePrerelease?"-0":"";return A.replace(C,(P,I,z,te,ne)=>{o("caret",A,P,I,z,te,ne);let de;return b(I)?de="":b(z)?de=`>=${I}.0.0${T} <${+I+1}.0.0-0`:b(te)?I==="0"?de=`>=${I}.${z}.0${T} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.0${T} <${+I+1}.0.0-0`:ne?(o("replaceCaret pr",ne),I==="0"?z==="0"?de=`>=${I}.${z}.${te}-${ne} <${I}.${z}.${+te+1}-0`:de=`>=${I}.${z}.${te}-${ne} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.${te}-${ne} <${+I+1}.0.0-0`):(o("no pr"),I==="0"?z==="0"?de=`>=${I}.${z}.${te}${T} <${I}.${z}.${+te+1}-0`:de=`>=${I}.${z}.${te}${T} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.${te} <${+I+1}.0.0-0`),o("caret return",de),de})},E=(A,F)=>(o("replaceXRanges",A,F),A.split(/\s+/).map(C=>$(C,F)).join(" ")),$=(A,F)=>{A=A.trim();const C=F.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return A.replace(C,(T,P,I,z,te,ne)=>{o("xRange",A,T,P,I,z,te,ne);const de=b(I),ke=de||b(z),Ee=ke||b(te),Ie=Ee;return P==="="&&Ie&&(P=""),ne=F.includePrerelease?"-0":"",de?P===">"||P==="<"?T="<0.0.0-0":T="*":P&&Ie?(ke&&(z=0),te=0,P===">"?(P=">=",ke?(I=+I+1,z=0,te=0):(z=+z+1,te=0)):P==="<="&&(P="<",ke?I=+I+1:z=+z+1),P==="<"&&(ne="-0"),T=`${P+I}.${z}.${te}${ne}`):ke?T=`>=${I}.0.0${ne} <${+I+1}.0.0-0`:Ee&&(T=`>=${I}.${z}.0${ne} <${I}.${+z+1}.0-0`),o("xRange return",T),T})},S=(A,F)=>(o("replaceStars",A,F),A.trim().replace(a[u.STAR],"")),M=(A,F)=>(o("replaceGTE0",A,F),A.trim().replace(a[F.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=A=>(F,C,T,P,I,z,te,ne,de,ke,Ee,Ie)=>(b(T)?C="":b(P)?C=`>=${T}.0.0${A?"-0":""}`:b(I)?C=`>=${T}.${P}.0${A?"-0":""}`:z?C=`>=${C}`:C=`>=${C}${A?"-0":""}`,b(de)?ne="":b(ke)?ne=`<${+de+1}.0.0-0`:b(Ee)?ne=`<${de}.${+ke+1}.0-0`:Ie?ne=`<=${de}.${ke}.${Ee}-${Ie}`:A?ne=`<${de}.${ke}.${+Ee+1}-0`:ne=`<=${ne}`,`${C} ${ne}`.trim()),N=(A,F,C)=>{for(let T=0;T<A.length;T++)if(!A[T].test(F))return!1;if(F.prerelease.length&&!C.includePrerelease){for(let T=0;T<A.length;T++)if(o(A[T].semver),A[T].semver!==r.ANY&&A[T].semver.prerelease.length>0){const P=A[T].semver;if(P.major===F.major&&P.minor===F.minor&&P.patch===F.patch)return!0}return!1}return!0};return C_}const Mhe=QP();var Fhe=(e,t,n)=>{try{t=new Mhe(t,n)}catch{return!1}return t.test(e)},eL=Jde(Fhe);function The(e,t,n){const i=e.open(t),r=1e4,o=250,{origin:s}=new URL(t);let a=~~(r/o);function u(c){c.source===i&&(a=0,e.removeEventListener("message",u,!1))}e.addEventListener("message",u,!1);function l(){a<=0||(i.postMessage(n,s),setTimeout(l,o),a-=1)}setTimeout(l,o)}var Ohe=`.vega-embed {
108
+ `;const qP="vg-tooltip-element",Gde={offsetX:10,offsetY:10,id:qP,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Vde,maxDepth:2,formatTooltip:qde,baseURL:""};function Vde(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function Yde(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Hde.toString().replace(qP,e)}function Xde(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let o=e.clientY+i;return o+t.height>window.innerHeight&&(o=+e.clientY-i-t.height),{x:r,y:o}}class Kde{constructor(t){this.options={...Gde,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=Yde(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,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)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=Xde(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}function Zde(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}class Jde{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}}var Qde=Jde;const ehe=Object.freeze({loose:!0}),the=Object.freeze({});var E_=e=>e?typeof e!="object"?ehe:e:the,__={exports:{}};const nhe="2.0.0",WP=256,ihe=Number.MAX_SAFE_INTEGER||9007199254740991,rhe=16,ohe=WP-6;var $_={MAX_LENGTH:WP,MAX_SAFE_COMPONENT_LENGTH:rhe,MAX_SAFE_BUILD_LENGTH:ohe,MAX_SAFE_INTEGER:ihe,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:nhe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},c0=typeof process=="object"&&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:i,MAX_LENGTH:r}=$_,o=c0;t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;o(g,v,m),l[g]=v,u[v]=m,s[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(__,__.exports);var S_=__.exports;const HP=/^[0-9]+$/,GP=(e,t)=>{const n=HP.test(e),i=HP.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var she={compareIdentifiers:GP,rcompareIdentifiers:(e,t)=>GP(t,e)};const f0=c0,{MAX_LENGTH:VP,MAX_SAFE_INTEGER:d0}=$_,{safeRe:YP,t:XP}=S_,ahe=E_,{compareIdentifiers:Al}=she;var A_=class Ar{constructor(t,n){if(n=ahe(n),t instanceof Ar){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>VP)throw new TypeError(`version is longer than ${VP} characters`);f0("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?YP[XP.LOOSE]:YP[XP.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>d0||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d0||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d0||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const o=+r;if(o>=0&&o<d0)return o}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(f0("SemVer.compare",this.version,this.options,t),!(t instanceof Ar)){if(typeof t=="string"&&t===this.version)return 0;t=new Ar(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ar||(t=new Ar(t,this.options)),Al(this.major,t.major)||Al(this.minor,t.minor)||Al(this.patch,t.patch)}comparePre(t){if(t instanceof Ar||(t=new Ar(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(f0("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Al(i,r)}while(++n)}compareBuild(t){t instanceof Ar||(t=new Ar(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(f0("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Al(i,r)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const r=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];i===!1&&(o=[n]),Al(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const KP=A_;var kl=(e,t,n)=>new KP(e,n).compare(new KP(t,n));const uhe=kl;var lhe=(e,t,n)=>uhe(e,t,n)===0;const che=kl;var fhe=(e,t,n)=>che(e,t,n)!==0;const dhe=kl;var hhe=(e,t,n)=>dhe(e,t,n)>0;const phe=kl;var ghe=(e,t,n)=>phe(e,t,n)>=0;const mhe=kl;var yhe=(e,t,n)=>mhe(e,t,n)<0;const bhe=kl;var vhe=(e,t,n)=>bhe(e,t,n)<=0;const xhe=lhe,whe=fhe,Ehe=hhe,_he=ghe,$he=yhe,She=vhe;var Ahe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return xhe(e,n,i);case"!=":return whe(e,n,i);case">":return Ehe(e,n,i);case">=":return _he(e,n,i);case"<":return $he(e,n,i);case"<=":return She(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}},k_,ZP;function khe(){if(ZP)return k_;ZP=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}k_=t;const n=E_,{safeRe:i,t:r}=S_,o=Ahe,s=c0,a=A_,u=QP();return k_}var C_,JP;function QP(){if(JP)return C_;JP=1;class e{constructor(F,C){if(C=i(C),F instanceof e)return F.loose===!!C.loose&&F.includePrerelease===!!C.includePrerelease?F:new e(F.raw,C);if(F instanceof r)return this.raw=F.value,this.set=[[F]],this.format(),this;if(this.options=C,this.loose=!!C.loose,this.includePrerelease=!!C.includePrerelease,this.raw=F.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(P=>!p(P[0])),this.set.length===0)this.set=[T];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&g(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(F=>F.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(F){const T=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+F,P=n.get(T);if(P)return P;const I=this.options.loose,z=I?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];F=F.replace(z,k(this.options.includePrerelease)),o("hyphen replace",F),F=F.replace(a[u.COMPARATORTRIM],l),o("comparator trim",F),F=F.replace(a[u.TILDETRIM],c),o("tilde trim",F),F=F.replace(a[u.CARETTRIM],f),o("caret trim",F);let te=F.split(" ").map(Ee=>y(Ee,this.options)).join(" ").split(/\s+/).map(Ee=>M(Ee,this.options));I&&(te=te.filter(Ee=>(o("loose invalid filter",Ee,this.options),!!Ee.match(a[u.COMPARATORLOOSE])))),o("range list",te);const ne=new Map,de=te.map(Ee=>new r(Ee,this.options));for(const Ee of de){if(p(Ee))return[Ee];ne.set(Ee.value,Ee)}ne.size>1&&ne.has("")&&ne.delete("");const ke=[...ne.values()];return n.set(T,ke),ke}intersects(F,C){if(!(F instanceof e))throw new TypeError("a Range is required");return this.set.some(T=>m(T,C)&&F.set.some(P=>m(P,C)&&T.every(I=>P.every(z=>I.intersects(z,C)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new s(F,this.options)}catch{return!1}for(let C=0;C<this.set.length;C++)if(D(this.set[C],F,this.options))return!0;return!1}}C_=e;const t=Qde,n=new t,i=E_,r=khe(),o=c0,s=A_,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=S_,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=$_,p=A=>A.value==="<0.0.0-0",g=A=>A.value==="",m=(A,F)=>{let C=!0;const T=A.slice();let P=T.pop();for(;C&&T.length;)C=T.every(I=>P.intersects(I,F)),P=T.pop();return C},y=(A,F)=>(o("comp",A,F),A=w(A,F),o("caret",A),A=v(A,F),o("tildes",A),A=E(A,F),o("xrange",A),A=S(A,F),o("stars",A),A),b=A=>!A||A.toLowerCase()==="x"||A==="*",v=(A,F)=>A.trim().split(/\s+/).map(C=>x(C,F)).join(" "),x=(A,F)=>{const C=F.loose?a[u.TILDELOOSE]:a[u.TILDE];return A.replace(C,(T,P,I,z,te)=>{o("tilde",A,T,P,I,z,te);let ne;return b(P)?ne="":b(I)?ne=`>=${P}.0.0 <${+P+1}.0.0-0`:b(z)?ne=`>=${P}.${I}.0 <${P}.${+I+1}.0-0`:te?(o("replaceTilde pr",te),ne=`>=${P}.${I}.${z}-${te} <${P}.${+I+1}.0-0`):ne=`>=${P}.${I}.${z} <${P}.${+I+1}.0-0`,o("tilde return",ne),ne})},w=(A,F)=>A.trim().split(/\s+/).map(C=>_(C,F)).join(" "),_=(A,F)=>{o("caret",A,F);const C=F.loose?a[u.CARETLOOSE]:a[u.CARET],T=F.includePrerelease?"-0":"";return A.replace(C,(P,I,z,te,ne)=>{o("caret",A,P,I,z,te,ne);let de;return b(I)?de="":b(z)?de=`>=${I}.0.0${T} <${+I+1}.0.0-0`:b(te)?I==="0"?de=`>=${I}.${z}.0${T} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.0${T} <${+I+1}.0.0-0`:ne?(o("replaceCaret pr",ne),I==="0"?z==="0"?de=`>=${I}.${z}.${te}-${ne} <${I}.${z}.${+te+1}-0`:de=`>=${I}.${z}.${te}-${ne} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.${te}-${ne} <${+I+1}.0.0-0`):(o("no pr"),I==="0"?z==="0"?de=`>=${I}.${z}.${te}${T} <${I}.${z}.${+te+1}-0`:de=`>=${I}.${z}.${te}${T} <${I}.${+z+1}.0-0`:de=`>=${I}.${z}.${te} <${+I+1}.0.0-0`),o("caret return",de),de})},E=(A,F)=>(o("replaceXRanges",A,F),A.split(/\s+/).map(C=>$(C,F)).join(" ")),$=(A,F)=>{A=A.trim();const C=F.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return A.replace(C,(T,P,I,z,te,ne)=>{o("xRange",A,T,P,I,z,te,ne);const de=b(I),ke=de||b(z),Ee=ke||b(te),Ie=Ee;return P==="="&&Ie&&(P=""),ne=F.includePrerelease?"-0":"",de?P===">"||P==="<"?T="<0.0.0-0":T="*":P&&Ie?(ke&&(z=0),te=0,P===">"?(P=">=",ke?(I=+I+1,z=0,te=0):(z=+z+1,te=0)):P==="<="&&(P="<",ke?I=+I+1:z=+z+1),P==="<"&&(ne="-0"),T=`${P+I}.${z}.${te}${ne}`):ke?T=`>=${I}.0.0${ne} <${+I+1}.0.0-0`:Ee&&(T=`>=${I}.${z}.0${ne} <${I}.${+z+1}.0-0`),o("xRange return",T),T})},S=(A,F)=>(o("replaceStars",A,F),A.trim().replace(a[u.STAR],"")),M=(A,F)=>(o("replaceGTE0",A,F),A.trim().replace(a[F.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=A=>(F,C,T,P,I,z,te,ne,de,ke,Ee,Ie)=>(b(T)?C="":b(P)?C=`>=${T}.0.0${A?"-0":""}`:b(I)?C=`>=${T}.${P}.0${A?"-0":""}`:z?C=`>=${C}`:C=`>=${C}${A?"-0":""}`,b(de)?ne="":b(ke)?ne=`<${+de+1}.0.0-0`:b(Ee)?ne=`<${de}.${+ke+1}.0-0`:Ie?ne=`<=${de}.${ke}.${Ee}-${Ie}`:A?ne=`<${de}.${ke}.${+Ee+1}-0`:ne=`<=${ne}`,`${C} ${ne}`.trim()),D=(A,F,C)=>{for(let T=0;T<A.length;T++)if(!A[T].test(F))return!1;if(F.prerelease.length&&!C.includePrerelease){for(let T=0;T<A.length;T++)if(o(A[T].semver),A[T].semver!==r.ANY&&A[T].semver.prerelease.length>0){const P=A[T].semver;if(P.major===F.major&&P.minor===F.minor&&P.patch===F.patch)return!0}return!1}return!0};return C_}const Che=QP();var Mhe=(e,t,n)=>{try{t=new Che(t,n)}catch{return!1}return t.test(e)},eL=Zde(Mhe);function Fhe(e,t,n){const i=e.open(t),r=1e4,o=250,{origin:s}=new URL(t);let a=~~(r/o);function u(c){c.source===i&&(a=0,e.removeEventListener("message",u,!1))}e.addEventListener("message",u,!1);function l(){a<=0||(i.postMessage(n,s),setTimeout(l,o),a-=1)}setTimeout(l,o)}var The=`.vega-embed {
109
109
  position: relative;
110
110
  display: inline-block;
111
111
  box-sizing: border-box;
@@ -223,16 +223,16 @@
223
223
  transform: scale(1);
224
224
  }
225
225
  }
226
- `;function tL(e,...t){for(const n of t)Nhe(e,n);return e}function Nhe(e,t){for(const n of Object.keys(t))Ha(e,n,t[n],!0)}const _r=pie;let dd=jfe;const d0=typeof window<"u"?window:void 0;dd===void 0&&((dL=d0==null?void 0:d0.vl)!=null&&dL.compile)&&(dd=d0.vl);const Dhe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Rhe={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},hd={vega:"Vega","vega-lite":"Vega-Lite"},h0={vega:_r.version,"vega-lite":dd?dd.version:"not available"},Phe={vega:e=>e,"vega-lite":(e,t)=>dd.compile(e,{config:t}).spec},Lhe=`
226
+ `;function tL(e,...t){for(const n of t)Ohe(e,n);return e}function Ohe(e,t){for(const n of Object.keys(t))Ha(e,n,t[n],!0)}const _r=hie;let hd=Ufe;const h0=typeof window<"u"?window:void 0;hd===void 0&&((dL=h0==null?void 0:h0.vl)!=null&&dL.compile)&&(hd=h0.vl);const Dhe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Nhe={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},pd={vega:"Vega","vega-lite":"Vega-Lite"},p0={vega:_r.version,"vega-lite":hd?hd.version:"not available"},Rhe={vega:e=>e,"vega-lite":(e,t)=>hd.compile(e,{config:t}).spec},Phe=`
227
227
  <svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
228
228
  <circle r="2" cy="8" cx="2"></circle>
229
229
  <circle r="2" cy="8" cx="8"></circle>
230
230
  <circle r="2" cy="8" cx="14"></circle>
231
- </svg>`,Ihe="chart-wrapper";function zhe(e){return typeof e=="function"}function nL(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,s=window.open("");s.document.write(r+e+o),s.document.title=`${hd[i]} JSON Source`}function Bhe(e,t){if(e.$schema){const n=_P(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${hd[n.library]}, but mode argument sets ${hd[t]??t}.`);const i=n.library;return eL(h0[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${hd[i]} ${n.version}, but the current version of ${hd[i]} is v${h0[i]}.`),i}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"}function iL(e){return!!(e&&"load"in e)}function rL(e){return iL(e)?e:_r.loader(e)}function Uhe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function jhe(e,t,n={}){let i,r;K(t)?(r=rL(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=Uhe(i),s=o.loader;(!r||s)&&(r=rL(n.loader??s));const a=await oL(o,r),u=await oL(n,r),l={...tL(u,a),config:Wa(u.config??{},a.config??{})};return await Whe(e,i,l,r)}async function oL(e,t){const n=K(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=K(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function qhe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Whe(e,t,n={},i){const r=n.theme?Wa(qde[n.theme],n.config??{}):n.config,o=mo(n.actions)?n.actions:tL({},Dhe,n.actions??{}),s={...Rhe,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??_r.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:E}=qhe(c);if(!_.getElementById(w)){const $=document.createElement("style");$.id=w,$.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Ohe.toString():n.defaultStyle,E.appendChild($)}}const f=Bhe(t,n.mode);let d=Phe[f](t,r);if(f==="vega-lite"&&d.$schema){const w=_P(d.$schema);eL(h0.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${h0.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const w=document.createElement("div");w.classList.add(Ihe),c.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):yd(d,p,!0,!1).newDocument),n.formatLocale&&_r.formatLocale(n.formatLocale),n.timeFormatLocale&&_r.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?_r.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&_r.expressionFunction(w,_)}const{ast:g}=n,m=_r.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||_r.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:_r.expressionInterpreter??n.expr??$ie}:{}});if(y.addSignalListener("autosize",(w,_)=>{const{type:E}=_;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,E=w&&!iL(w)?w==null?void 0:w.baseURL:void 0,$=zhe(_)?_:new Zde({baseURL:E,..._===!0?{}:_}).call;y.tooltip($)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:w,updateSet:_}=typeof b=="boolean"?{}:b;y.hover(w,_)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(o!==!1){let w=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),w=E;const $=document.createElement("summary");$.innerHTML=Lhe,E.append($),v=S=>{E.contains(S.target)||E.removeAttribute("open")},document.addEventListener("click",v)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const E of["svg","png"])if(o===!0||o.export===!0||o.export[E]){const $=s[`${E.toUpperCase()}_ACTION`],S=document.createElement("a"),M=Y(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;S.text=$,S.href="#",S.target="_blank",S.download=`${l}.${E}`,S.addEventListener("mousedown",async function(k){k.preventDefault();const N=await y.toImageURL(E,M);this.href=N}),_.append(S)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function($){nL(F0(t),n.sourceHeader??"",n.sourceFooter??"",f),$.preventDefault()}),_.append(E)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const E=document.createElement("a");E.text=s.COMPILED_ACTION,E.href="#",E.addEventListener("click",function($){nL(F0(d),n.sourceHeader??"",n.sourceFooter??"","vega"),$.preventDefault()}),_.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",$=document.createElement("a");$.text=s.EDITOR_ACTION,$.href="#",$.addEventListener("click",function(S){The(window,E,{config:r,mode:p?"vega":f,renderer:a,spec:F0(p?d:t)}),S.preventDefault()}),_.append($)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const gs={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};gs.defaultMerge;function Hhe(e,t){return t}function Ghe(e,t){return e.filter(n=>n!==void 0)}var sL;(function(e){e[e.NOT=0]="NOT",e[e.RECORD=1]="RECORD",e[e.ARRAY=2]="ARRAY",e[e.SET=3]="SET",e[e.MAP=4]="MAP",e[e.OTHER=5]="OTHER"})(sL||(sL={}));function aL(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:Xhe(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Vhe(e){const t=new Set;for(const n of e)for(const i of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(i);return t}function Yhe(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function uL(e){var i;let t=0,n=(i=e[0])==null?void 0:i[Symbol.iterator]();return{[Symbol.iterator](){return{next(){var r;do{if(n===void 0)return{done:!0,value:void 0};const o=n.next();if(o.done===!0){t+=1,n=(r=e[t])==null?void 0:r[Symbol.iterator]();continue}return{done:!1,value:o.value}}while(!0)}}}}}const lL=["[object Object]","[object Module]"];function Xhe(e){if(!lL.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!lL.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function Khe(e,t,n){const i={};for(const r of Vhe(e)){const o=[];for(const u of e)Yhe(u,r)&&o.push(u[r]);if(o.length===0)continue;const s=t.metaDataUpdater(n,{key:r,parents:e}),a=cL(o,t,s);a!==gs.skip&&(r==="__proto__"?Object.defineProperty(i,r,{value:a,configurable:!0,enumerable:!0,writable:!0}):i[r]=a)}return i}function Zhe(e){return e.flat()}function Jhe(e){return new Set(uL(e))}function Qhe(e){return new Map(uL(e))}function epe(e){return e.at(-1)}const p0={mergeRecords:Khe,mergeArrays:Zhe,mergeSets:Jhe,mergeMaps:Qhe,mergeOthers:epe};function tpe(...e){return npe({})(...e)}function npe(e,t){const n=ipe(e,i);function i(...r){return cL(r,n,t)}return i}function ipe(e,t){return{defaultMergeFunctions:p0,mergeFunctions:{...p0,...Object.fromEntries(Object.entries(e).filter(([n,i])=>Object.hasOwn(p0,n)).map(([n,i])=>i===!1?[n,p0.mergeOthers]:[n,i]))},metaDataUpdater:e.metaDataUpdater??Hhe,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:e.filterValues===!1?void 0:e.filterValues??Ghe,actions:gs}}function cL(e,t,n){var o;const i=((o=t.filterValues)==null?void 0:o.call(t,e,n))??e;if(i.length===0)return;if(i.length===1)return M_(i,t,n);const r=aL(i[0]);if(r!==0&&r!==5){for(let s=1;s<i.length;s++)if(aL(i[s])!==r)return M_(i,t,n)}switch(r){case 1:return rpe(i,t,n);case 2:return ope(i,t,n);case 3:return spe(i,t,n);case 4:return ape(i,t,n);default:return M_(i,t,n)}}function rpe(e,t,n){const i=t.mergeFunctions.mergeRecords(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):i}function ope(e,t,n){const i=t.mergeFunctions.mergeArrays(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):i}function spe(e,t,n){const i=t.mergeFunctions.mergeSets(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):i}function ape(e,t,n){const i=t.mergeFunctions.mergeMaps(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):i}function M_(e,t,n){const i=t.mergeFunctions.mergeOthers(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):i}const upe={width:"container",height:"container",autosize:"fit",resize:!0},lpe=(e,t,n)=>{const i=tpe(upe,t);jhe(e.renderRoot.querySelector("#vis"),i).then(r=>{n&&(Object.keys(n).forEach(o=>{r.view.insert(o,n[o])}),r.view.run())})};class F_ extends Dl{constructor(){super(),this.spec=void 0,this.dataValues=void 0,this.noShadow=!1,this.unstyled=!1}async updated(t){(t.has("spec")||t.has("dataValues"))&&lpe(this,this.spec,this.dataValues)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){return CL`
231
+ </svg>`,Lhe="chart-wrapper";function Ihe(e){return typeof e=="function"}function nL(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,s=window.open("");s.document.write(r+e+o),s.document.title=`${pd[i]} JSON Source`}function zhe(e,t){if(e.$schema){const n=_P(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${pd[n.library]}, but mode argument sets ${pd[t]??t}.`);const i=n.library;return eL(p0[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${pd[i]} ${n.version}, but the current version of ${pd[i]} is v${p0[i]}.`),i}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"}function iL(e){return!!(e&&"load"in e)}function rL(e){return iL(e)?e:_r.loader(e)}function Bhe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Uhe(e,t,n={}){let i,r;K(t)?(r=rL(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=Bhe(i),s=o.loader;(!r||s)&&(r=rL(n.loader??s));const a=await oL(o,r),u=await oL(n,r),l={...tL(u,a),config:Wa(u.config??{},a.config??{})};return await qhe(e,i,l,r)}async function oL(e,t){const n=K(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=K(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function jhe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function qhe(e,t,n={},i){const r=n.theme?Wa(jde[n.theme],n.config??{}):n.config,o=mo(n.actions)?n.actions:tL({},Dhe,n.actions??{}),s={...Nhe,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??_r.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:E}=jhe(c);if(!_.getElementById(w)){const $=document.createElement("style");$.id=w,$.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?The.toString():n.defaultStyle,E.appendChild($)}}const f=zhe(t,n.mode);let d=Rhe[f](t,r);if(f==="vega-lite"&&d.$schema){const w=_P(d.$schema);eL(p0.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${p0.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const w=document.createElement("div");w.classList.add(Lhe),c.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):bd(d,p,!0,!1).newDocument),n.formatLocale&&_r.formatLocale(n.formatLocale),n.timeFormatLocale&&_r.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?_r.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&_r.expressionFunction(w,_)}const{ast:g}=n,m=_r.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||_r.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:_r.expressionInterpreter??n.expr??_ie}:{}});if(y.addSignalListener("autosize",(w,_)=>{const{type:E}=_;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,E=w&&!iL(w)?w==null?void 0:w.baseURL:void 0,$=Ihe(_)?_:new Kde({baseURL:E,..._===!0?{}:_}).call;y.tooltip($)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:w,updateSet:_}=typeof b=="boolean"?{}:b;y.hover(w,_)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(o!==!1){let w=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),w=E;const $=document.createElement("summary");$.innerHTML=Phe,E.append($),v=S=>{E.contains(S.target)||E.removeAttribute("open")},document.addEventListener("click",v)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const E of["svg","png"])if(o===!0||o.export===!0||o.export[E]){const $=s[`${E.toUpperCase()}_ACTION`],S=document.createElement("a"),M=Y(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;S.text=$,S.href="#",S.target="_blank",S.download=`${l}.${E}`,S.addEventListener("mousedown",async function(k){k.preventDefault();const D=await y.toImageURL(E,M);this.href=D}),_.append(S)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function($){nL(F0(t),n.sourceHeader??"",n.sourceFooter??"",f),$.preventDefault()}),_.append(E)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const E=document.createElement("a");E.text=s.COMPILED_ACTION,E.href="#",E.addEventListener("click",function($){nL(F0(d),n.sourceHeader??"",n.sourceFooter??"","vega"),$.preventDefault()}),_.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",$=document.createElement("a");$.text=s.EDITOR_ACTION,$.href="#",$.addEventListener("click",function(S){Fhe(window,E,{config:r,mode:p?"vega":f,renderer:a,spec:F0(p?d:t)}),S.preventDefault()}),_.append($)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const gs={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};gs.defaultMerge;function Whe(e,t){return t}function Hhe(e,t){return e.filter(n=>n!==void 0)}var sL;(function(e){e[e.NOT=0]="NOT",e[e.RECORD=1]="RECORD",e[e.ARRAY=2]="ARRAY",e[e.SET=3]="SET",e[e.MAP=4]="MAP",e[e.OTHER=5]="OTHER"})(sL||(sL={}));function aL(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:Yhe(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Ghe(e){const t=new Set;for(const n of e)for(const i of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(i);return t}function Vhe(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function uL(e){var i;let t=0,n=(i=e[0])==null?void 0:i[Symbol.iterator]();return{[Symbol.iterator](){return{next(){var r;do{if(n===void 0)return{done:!0,value:void 0};const o=n.next();if(o.done===!0){t+=1,n=(r=e[t])==null?void 0:r[Symbol.iterator]();continue}return{done:!1,value:o.value}}while(!0)}}}}}const lL=["[object Object]","[object Module]"];function Yhe(e){if(!lL.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!lL.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function Xhe(e,t,n){const i={};for(const r of Ghe(e)){const o=[];for(const u of e)Vhe(u,r)&&o.push(u[r]);if(o.length===0)continue;const s=t.metaDataUpdater(n,{key:r,parents:e}),a=cL(o,t,s);a!==gs.skip&&(r==="__proto__"?Object.defineProperty(i,r,{value:a,configurable:!0,enumerable:!0,writable:!0}):i[r]=a)}return i}function Khe(e){return e.flat()}function Zhe(e){return new Set(uL(e))}function Jhe(e){return new Map(uL(e))}function Qhe(e){return e.at(-1)}const g0={mergeRecords:Xhe,mergeArrays:Khe,mergeSets:Zhe,mergeMaps:Jhe,mergeOthers:Qhe};function epe(...e){return tpe({})(...e)}function tpe(e,t){const n=npe(e,i);function i(...r){return cL(r,n,t)}return i}function npe(e,t){return{defaultMergeFunctions:g0,mergeFunctions:{...g0,...Object.fromEntries(Object.entries(e).filter(([n,i])=>Object.hasOwn(g0,n)).map(([n,i])=>i===!1?[n,g0.mergeOthers]:[n,i]))},metaDataUpdater:e.metaDataUpdater??Whe,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:e.filterValues===!1?void 0:e.filterValues??Hhe,actions:gs}}function cL(e,t,n){var o;const i=((o=t.filterValues)==null?void 0:o.call(t,e,n))??e;if(i.length===0)return;if(i.length===1)return M_(i,t,n);const r=aL(i[0]);if(r!==0&&r!==5){for(let s=1;s<i.length;s++)if(aL(i[s])!==r)return M_(i,t,n)}switch(r){case 1:return ipe(i,t,n);case 2:return rpe(i,t,n);case 3:return ope(i,t,n);case 4:return spe(i,t,n);default:return M_(i,t,n)}}function ipe(e,t,n){const i=t.mergeFunctions.mergeRecords(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):i}function rpe(e,t,n){const i=t.mergeFunctions.mergeArrays(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):i}function ope(e,t,n){const i=t.mergeFunctions.mergeSets(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):i}function spe(e,t,n){const i=t.mergeFunctions.mergeMaps(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):i}function M_(e,t,n){const i=t.mergeFunctions.mergeOthers(e,t,n);return i===gs.defaultMerge||t.useImplicitDefaultMerging&&i===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):i}const ape={width:"container",height:"container",autosize:"fit",resize:!0},upe=(e,t,n)=>{const i=epe(ape,t);Uhe(e.renderRoot.querySelector("#vis"),i).then(r=>{n&&(Object.keys(n).forEach(o=>{r.view.insert(o,n[o])}),r.view.run())})};class F_ extends Rl{constructor(){super(),this.spec=void 0,this.dataValues=void 0,this.noShadow=!1,this.unstyled=!1}async updated(t){(t.has("spec")||t.has("dataValues"))&&upe(this,this.spec,this.dataValues)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){return kL`
232
232
  <style>
233
- ${PL}
234
- ${!this.unstyled&&IL}
233
+ ${RL}
235
234
  ${!this.unstyled&&LL}
235
+ ${!this.unstyled&&PL}
236
236
  </style>
237
237
  <div id="vis"></div>
238
238
  `}}hL(F_,"properties",{dataValues:{attribute:!1,type:Object},spec:{attribute:!1,type:Object},noShadow:{attribute:"no-shadow",type:Boolean},unstyled:{type:Boolean}}),customElements.define("eox-chart",F_),jn.EOxChart=F_,Object.defineProperty(jn,Symbol.toStringTag,{value:"Module"})});