1import{V as eh,p as Y3,a as K3,d as Jb,i as J3}from"./i18n-zlFzjs4f.js";import{M as Q3,Z as on,ac as Z3,S as eR,a as Qb,O as tR,a2 as th,v as nR,$ as Zb,Q as ex,R as h2,aa as tx,T as nx,t as iR,X as rR}from"./index-CU1DelDP.js";import{g as sR}from"./color-CjSR2pl-.js";import{f as aR,m as oR,a as uR,d as lR,b as p2,q as ix,c as cR,i as fR,l as dR,e as hR,s as pR,g as gR,u as mR,h as g2,j as yR,k as bR,n as xR,o as vR,r as ER,t as AR,v as CR,w as wR,x as FR,y as SR,z as $R,A as kR,B as DR,C as OR,D as RR,E as _R,F as TR,G as NR,H as MR,I as LR,J as BR,K as PR,p as IR,$ as zR,L as m2,S as UR,M as y2,a4 as b2,N as jR,O as qR,P as WR,Q as GR,R as HR,T as VR,U as XR,V as YR,W as KR,X as JR,Y as QR,Z as ZR,_ as e5,a0 as t5,a1 as n5,a2 as i5,a3 as r5,a5 as s5,a6 as a5,a7 as o5,a8 as u5,a9 as l5,aa as c5,ab as f5,ac as d5,ad as h5,ae as p5,af as rx,ag as g5,ah as m5,ai as y5,aj as b5,ak as x5,al as v5,am as E5,an as A5,ao as C5,ap as w5,aq as F5,ar as S5,as as $5,at as nh}from"./mollweide-XXUPULVr.js";import{c as sx,x as ax,v as Gl,l as Hl,w as x2,d as v2,p as E2,s as A2,o as k5,n as D5,q as O5,u as R5,r as _5,y as T5,z as N5,b as M5,A as L5,B as B5,C as P5,a as Yo,m as I5,t as z5,D as U5,E as j5}from"./time-BMaLdJ6b.js";import{b as em,t as au,p as q5,d as W5,e as G5,f as C2,l as H5,g as V5,h as mc,i as X5,j as Y5,k as K5}from"./linear-8mDBZVC7.js";import{c as J5,a as ox,f as Q5,b as Z5}from"./defaultLocale-CzDG__Ur.js";import{d as e_}from"./dsv-DB8NKgIY.js";import{r as Ms}from"./range-OtVwhkKS.js";import{o as w2,i as t_}from"./ordinal-BeghXfj9.js";import{d as n_}from"./arc-Bt_eNeYl.js";import{l as i_,V as tm,D as r_,E as s_,F as a_,G as o_,H as u_,I as l_,J as c_,K as f_,L as d_,M as h_,N as p_,O as g_,P as m_,Q as y_,S as b_,T as x_,U as v_,k as E_,W as yc,X as A_}from"./step-B-Gbak1k.js";import{h as C_,t as w_,a as F_,b as S_,c as $_}from"./index-BU4IRnz1.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./colors-Cc3OSVma.js";function k_(e,t,n,i){let r=t.getPropertyValue("--color-accent"),s=t.getPropertyValue("--body-text-color"),a=t.getPropertyValue("--border-color-primary"),o=t.fontFamily,u=t.getPropertyValue("--block-title-text-weight");const l=g=>g.endsWith("px")?parseFloat(g.slice(0,-2)):12;let c=l(t.getPropertyValue("--text-md")),f=l(t.getPropertyValue("--text-sm")),d={autosize:{type:"fit",contains:"padding"},axis:{labelFont:o,labelColor:s,titleFont:o,titleColor:s,tickColor:a,labelFontSize:f,gridColor:a,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",domain:!1,labelAngle:0},legend:{labelColor:s,labelFont:o,titleColor:s,titleFont:o,titleFontWeight:"normal",titleFontSize:f,labelFontWeight:"normal",offset:2},title:{color:s,font:o,fontSize:c,fontWeight:u,anchor:"middle"},view:{stroke:a}};e.config=d;let p=e.encoding,h=e.layer;switch(n){case"scatter":e.config.mark={stroke:r},p.color&&p.color.type=="nominal"?p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)):p.color&&p.color.type=="quantitative"&&(p.color.scale.range=["#eff6ff","#1e3a8a"],p.color.scale.range.interpolate="hsl");break;case"line":e.config.mark={stroke:r,cursor:"crosshair"},h.forEach(g=>{g.encoding.color&&(g.encoding.color.scale.range=g.encoding.color.scale.range.map((m,y)=>ih(i,y)))});break;case"bar":e.config.mark={opacity:.8,fill:r},p.color&&(p.color.scale.range=p.color.scale.range.map((g,m)=>ih(i,m)));break}return e}function ih(e,t){let n=e[t%e.length];return n&&n in eh?eh[n]?.primary:n||eh[sR(t)].primary}function Vt(e,t,n){return e.fields=t||[],e.fname=n,e}function ze(e){return e==null?null:e.fname}function Et(e){return e==null?null:e.fields}function F2(e){return e.length===1?D_(e[0]):O_(e)}const D_=e=>function(t){return t[e]},O_=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function S(e){throw Error(e)}function bi(e){const t=[],n=e.length;let i=null,r=0,s="",a,o,u;e=e+"";function l(){t.push(s+e.substring(a,o)),s="",a=o+1}for(a=o=0;o<n;++o)if(u=e[o],u==="\\")s+=e.substring(a,o++),a=o;else if(u===i)l(),i=null,r=-1;else{if(i)continue;a===r&&u==='"'||a===r&&u==="'"?(a=o+1,i=u):u==="."&&!r?o>a?l():a=o+1:u==="["?(o>a&&l(),r=a=o+1):u==="]"&&(r||S("Access path missing open bracket: "+e),r>0&&l(),r=0,a=o+1)}return r&&S("Access path missing closing bracket: "+e),i&&S("Access path missing closing quote: "+e),o>a&&(o++,l()),t}function gn(e,t,n){const i=bi(e);return e=i.length===1?i[0]:e,Vt((n&&n.get||F2)(i),[e],t||e)}const Ru=gn("id"),$t=Vt(e=>e,[],"identity"),cr=Vt(()=>0,[],"zero"),Ha=Vt(()=>1,[],"one"),mn=Vt(()=>!0,[],"true"),ir=Vt(()=>!1,[],"false"),nm=new Set(Object.getOwnPropertyNames(Object.prototype));function R_(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const S2=0,im=1,rm=2,$2=3,k2=4;function sm(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R_,i=e||S2;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=im&&n(t||"error","ERROR",arguments),this},warn(){return i>=rm&&n(t||"warn","WARN",arguments),this},info(){return i>=$2&&n(t||"log","INFO",arguments),this},debug(){return i>=k2&&n(t||"log","DEBUG",arguments),this}}}var D=Array.isArray;function j(e){return e===Object(e)}const ux=e=>e!=="__proto__";function Va(){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 s in r)if(s==="signals")i.signals=__(i.signals,r.signals);else{const a=s==="legend"?{layout:1}:s==="style"?!0:null;
vendor: 92,131 bytes, lines 1-2
1Xa(i,s,r[s],a)}return i},{})}function Xa(e,t,n,i){if(!ux(t))return;let r,s;if(j(n)&&!D(n)){s=j(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Xa(s,r,n[r]):ux(r)&&(s[r]=n[r])}else e[t]=n}function __(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function ce(e){return e[e.length-1]}function xt(e){return e==null||e===""?null:+e}const D2=e=>t=>e*Math.exp(t),O2=e=>t=>Math.log(e*t),R2=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),_2=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,bc=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function cf(e,t,n,i){const r=n(e[0]),s=n(ce(e)),a=(s-r)*t;return[i(r-a),i(s-a)]}function T2(e,t){return cf(e,t,xt,$t)}function N2(e,t){var n=Math.sign(e[0]);return cf(e,t,O2(n),D2(n))}function M2(e,t,n){return cf(e,t,bc(n),bc(1/n))}function L2(e,t,n){return cf(e,t,R2(n),_2(n))}function ff(e,t,n,i,r){const s=i(e[0]),a=i(ce(e)),o=t!=null?i(t):(s+a)/2;return[r(o+(s-o)*n),r(o+(a-o)*n)]}function am(e,t,n){return ff(e,t,n,xt,$t)}function om(e,t,n){const i=Math.sign(e[0]);return ff(e,t,n,O2(i),D2(i))}function xc(e,t,n,i){return ff(e,t,n,bc(i),bc(1/i))}function um(e,t,n,i){return ff(e,t,n,R2(i),_2(i))}function B2(e){return 1+~~(new Date(e).getMonth()/3)}function P2(e){return 1+~~(new Date(e).getUTCMonth()/3)}function W(e){return e!=null?D(e)?e:[e]:[]}function I2(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ae(e){return typeof e=="function"}const T_="descending";function lm(e,t,n){n=n||{},t=W(t)||[];const i=[],r=[],s={},a=n.comparator||N_;return W(e).forEach((o,u)=>{o!=null&&(i.push(t[u]===T_?-1:1),r.push(o=ae(o)?o:gn(o,null,n)),(Et(o)||[]).forEach(l=>s[l]=1))}),r.length===0?null:Vt(a(r,i),Object.keys(s))}const Ya=(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),N_=(e,t)=>e.length===1?M_(e[0],t[0]):L_(e,t,e.length),M_=(e,t)=>function(n,i){return Ya(e(n),e(i))*t},L_=(e,t,n)=>(t.push(0),function(i,r){let s,a=0,o=-1;for(;a===0&&++o<n;)s=e[o],a=Ya(s(i),s(r));return a*t[o]});function kt(e){return ae(e)?e:()=>e}function cm(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function se(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 di(e,t){let n=0,i,r,s,a;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=a=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>a&&(a=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=a=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>a&&(a=r))}return[s,a]}function z2(e,t){const n=e.length;let i=-1,r,s,a,o,u;if(t==null){for(;++i<n;)if(s=e[i],s!=null&&s>=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++i<n;)s=e[i],s!=null&&(r>s&&(r=s,o=i),a<s&&(a=s,u=i))}else{for(;++i<n;)if(s=t(e[i],i,e),s!=null&&s>=s){r=a=s;break}if(i===n)return[-1,-1];for(o=u=i;++i<n;)s=t(e[i],i,e),s!=null&&(r>s&&(r=s,o=i),a<s&&(a=s,u=i))}return[o,u]}function H(e,t){return Object.hasOwn(e,t)}const vl={};function Ka(e){let t={},n;function i(s){return H(t,s)&&t[s]!==vl}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,a){return i(s)||(++r.size,t[s]===vl&&--r.empty),t[s]=a,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=vl),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let a=0;for(const o in t){const u=t[o];u!==vl&&(!n||!n(u))&&(s[o]=u,++a)}r.size=a,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function U2(e,t,n,i,r,s){if(!n&&n!==0)return s;const a=+n;let o=e[0],u=ce(e),l;u<o&&(l=o,o=u,u=l),l=Math.abs(t-o);const c=Math.abs(u-t);return l<c&&l<=a?i:c<=a?r:s}function z(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),se(i,n)}function la(e,t,n,i){let r=t[0],s=t[t.length-1],a;return r>s&&(a=r,r=s,s=a),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function Mr(e){return typeof e=="boolean"}function xr(e){return Object.prototype.toString.call(e)==="[object Date]"}function j2(e){return e&&ae(e[Symbol.iterator])}function ge(e){return typeof e=="number"}function fm(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function q(e){return typeof e=="string"}function dm(e,t,n){e&&(e=t?W(e).map(o=>o.replace(/\\(.)/g,"$1")):W(e));const i=e&&e.length,r=n&&n.get||F2,s=o=>r(t?[o]:bi(o));let a;if(!i)a=function(){return""};else if(i===1){const o=s(e[0]);a=function(u){return""+o(u)}}else{const o=e.map(s);a=function(u){let l=""+o[0](u),c=0;for(;++c<i;)l+="|"+o[c](u);return l}}return Vt(a,e,"key")}function q2(e,t){const n=e[0],i=ce(e),r=+t;return r?r===1?i:n+r*(i-n):n}const B_=1e4;function W2(e){e=+e||B_;let t,n,i;const r=()=>{t={},n={},i=0},s=(a,o)=>(++i>e&&(n=t,t={},i=1),t[a]=o);return r(),{clear:r,has:a=>H(t,a)||H(n,a),get:a=>H(t,a)?t[a]:H(n,a)?s(a,n[a]):void 0,set:(a,o)=>H(t,a)?t[a]=o:s(a,o)}}function G2(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const a=i||new t.constructor(r+s);let o=0,u=0,l=0;for(;o<r&&u<s;++l)a[l]=e(t[o],n[u])>0?n[u++]:t[o++];for(;o<r;++o,++l)a[l]=t[o];for(;u<s;++u,++l)a[l]=n[u];return a}function To(e,t){let n="";for(;--t>=0;)n+=e;return n}function H2(e,t,n,i){const r=n||" ",s=e+"",a=t-s.length;return a<=0?s:i==="left"?To(r,a)+s:i==="center"?To(r,~~(a/2))+s+To(r,Math.ceil(a/2)):s+To(r,a)}function _u(e){return e&&ce(e)-e[0]||0}function P(e){return D(e)?"["+e.map(P)+"]":j(e)||q(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function hm(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const P_=e=>ge(e)||xr(e)?e:Date.parse(e);function pm(e,t){return t=t||P_,e==null||e===""?null:t(e)}function gm(e){return e==null||e===""?null:e+""}function Ln(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function V2(e,t,n,i){const r=i??"â¦",s=e+"",a=s.length,o=Math.max(0,t-r.length);return a<=t?s:n==="left"?r+s.slice(a-o):n==="center"?s.slice(0,Math.ceil(o/2))+r+s.slice(a-~~(o/2)):s.slice(0,o)+r}function ar(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}const ft="year",jt="quarter",At="month",Ve="week",qt="date",bt="day",hi="dayofyear",nn="hours",rn="minutes",yn="seconds",Bn="milliseconds",mm=[ft,jt,At,Ve,qt,bt,hi,nn,rn,yn,Bn],rh=mm.reduce((e,t,n)=>(e[t]=1+n,e),{});function ym(e){const t=W(e).slice(),n={};return t.length||S("Missing time unit."),t.forEach(r=>{H(rh,r)?n[r]=1:S(`Invalid time unit: ${r}.`)}),(n[Ve]||n[bt]?1:0)+(n[jt]||n[At]||n[qt]?1:0)+(n[hi]?1:0)>1&&S(`Incompatible time units: ${e}`),t.sort((r,s)=>rh[r]-rh[s]),t}const I_={[ft]:"%Y ",[jt]:"Q%q ",[At]:"%b ",[qt]:"%d ",[Ve]:"W%U ",[bt]:"%a ",[hi]:"%j ",[nn]:"%H:00",[rn]:"00:%M",[yn]:":%S",[Bn]:".%L",[`${ft}-${At}`]:"%Y-%m ",[`${ft}-${At}-${qt}`]:"%Y-%m-%d ",[`${nn}-${rn}`]:"%H:%M"};function X2(e,t){const n=se({},I_,t),i=ym(e),r=i.length;let s="",a=0,o,u;for(a=0;a<r;)for(o=i.length;o>a;--o)if(u=i.slice(a,o).join("-"),n[u]!=null){s+=n[u],a=o;break}return s.trim()}const rs=new Date;function bm(e){return rs.setFullYear(e),rs.setMonth(0),rs.setDate(1),rs.setHours(0,0,0,0),rs}function Y2(e){return J2(new Date(e))}function K2(e){return Ap(new Date(e))}function J2(e){return Hl.count(bm(e.getFullYear())-1,e)}function Ap(e){return v2.count(bm(e.getFullYear())-1,e)}function Cp(e){return bm(e).getDay()}function z_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(-1,t,n,i,r,s,a);return o.setFullYear(e),o}return new Date(e,t,n,i,r,s,a)}function Q2(e){return eC(new Date(e))}function Z2(e){return wp(new Date(e))}function eC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Gl.count(t-1,e)}function wp(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return x2.count(t-1,e)}function Fp(e){return rs.setTime(Date.UTC(e,0,1)),rs.getUTCDay()}function U_(e,t,n,i,r,s,a){if(0<=e&&e<100){const o=new Date(Date.UTC(-1,t,n,i,r,s,a));return o.setUTCFullYear(n.y),o}return new Date(Date.UTC(e,t,n,i,r,s,a))}function tC(e,t,n,i,r){const s=t||1,a=ce(e),o=(y,b,v)=>(v=v||y,j_(n[v],i[v],y===a&&s,b)),u=new Date,l=Ln(e),c=l[ft]?o(ft):kt(2012),f=l[At]?o(At):l[jt]?o(jt):cr,d=l[Ve]&&l[bt]?o(bt,1,Ve+bt):l[Ve]?o(Ve,1):l[bt]?o(bt,1):l[qt]?o(qt,1):l[hi]?o(hi,1):Ha,p=l[nn]?o(nn):cr,h=l[rn]?o(rn):cr,g=l[yn]?o(yn):cr,m=l[Bn]?o(Bn):cr;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),p(u),h(u),g(u),m(u))}}function j_(e,t,n,i){const r=n<=1?e:i?(s,a)=>i+n*Math.floor((e(s,a)-i)/n):(s,a)=>n*Math.floor(e(s,a)/n);return t?(s,a)=>t(r(s,a),a):r}function Ea(e,t,n){return t+e*7-(n+6)%7}const q_={[ft]:e=>e.getFullYear(),[jt]:e=>Math.floor(e.getMonth()/3),[At]:e=>e.getMonth(),[qt]:e=>e.getDate(),[nn]:e=>e.getHours(),[rn]:e=>e.getMinutes(),[yn]:e=>e.getSeconds(),[Bn]:e=>e.getMilliseconds(),[hi]:e=>J2(e),[Ve]:e=>Ap(e),[Ve+bt]:(e,t)=>Ea(Ap(e),e.getDay(),Cp(t)),[bt]:(e,t)=>Ea(1,e.getDay(),Cp(t))},W_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Cp(t))};function nC(e,t){return tC(e,t||1,q_,W_,z_)}const G_={[ft]:e=>e.getUTCFullYear(),[jt]:e=>Math.floor(e.getUTCMonth()/3),[At]:e=>e.getUTCMonth(),[qt]:e=>e.getUTCDate(),[nn]:e=>e.getUTCHours(),[rn]:e=>e.getUTCMinutes(),[yn]:e=>e.getUTCSeconds(),[Bn]:e=>e.getUTCMilliseconds(),[hi]:e=>eC(e),[Ve]:e=>wp(e),[bt]:(e,t)=>Ea(1,e.getUTCDay(),Fp(t)),[Ve+bt]:(e,t)=>Ea(wp(e),e.getUTCDay(),Fp(t))},H_={[jt]:e=>3*e,[Ve]:(e,t)=>Ea(e,0,Fp(t))};function iC(e,t){return tC(e,t||1,G_,H_,U_)}const V_={[ft]:O5,[jt]:sx.every(3),[At]:sx,[Ve]:v2,[qt]:Hl,[bt]:Hl,[hi]:Hl,[nn]:D5,[rn]:k5,[yn]:A2,[Bn]:E2},X_={[ft]:T5,[jt]:ax.every(3),[At]:ax,[Ve]:x2,[qt]:Gl,[bt]:Gl,[hi]:Gl,[nn]:_5,[rn]:R5,[yn]:A2,[Bn]:E2};function Ja(e){return V_[e]}function Qa(e){return X_[e]}function rC(e,t,n){return e?e.offset(t,n):void 0}function sC(e,t,n){return rC(Ja(e),t,n)}function aC(e,t,n){return rC(Qa(e),t,n)}function oC(e,t,n,i){return e?e.range(t,n,i):void 0}function uC(e,t,n,i){return oC(Ja(e),t,n,i)}function lC(e,t,n,i){return oC(Qa(e),t,n,i)}const No=1e3,Mo=No*60,Lo=Mo*60,df=Lo*24,Y_=df*7,lx=df*30,Sp=df*365,cC=[ft,At,qt,nn,rn,yn,Bn],Bo=cC.slice(0,-1),Po=Bo.slice(0,-1),Io=Po.slice(0,-1),K_=Io.slice(0,-1),J_=[ft,Ve],cx=[ft,At],fC=[ft],go=[[Bo,1,No],[Bo,5,5*No],[Bo,15,15*No],[Bo,30,30*No],[Po,1,Mo],[Po,5,5*Mo],[Po,15,15*Mo],[Po,30,30*Mo],[Io,1,Lo],[Io,3,3*Lo],[Io,6,6*Lo],[Io,12,12*Lo],[K_,1,df],[J_,1,Y_],[cx,1,lx],[cx,3,3*lx],[fC,1,Sp]];function dC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(_u(t))/n;let r=em(o=>o[2]).right(go,i),s,a;return r===go.length?(s=fC,a=au(t[0]/Sp,t[1]/Sp,n)):r?(r=go[i/go[r-1][2]<go[r][2]/i?r-1:r],s=r[0],a=r[1]):(s=cC,a=Math.max(au(t[0],t[1],n),1)),{units:s,step:a}}function zo(e){const t={};return n=>t[n]||(t[n]=e(n))}function Q_(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=Z_(i,r);const a=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+a}}function Z_(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 hC(e){const t=zo(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=ox(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return Q_(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,a){a=ox(a??",f");const o=au(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(a.precision==null)switch(a.type){case"s":return isNaN(l=G5(o,u))||(a.precision=l),n(a,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=W5(o,u))||(a.precision=l-(a.type==="e"));break}case"f":case"%":{isNaN(l=q5(o))||(a.precision=l-(a.type==="%")*2);break}}return t(a)}}}let $p;pC();function pC(){return $p=hC({format:Q5,formatPrefix:Z5})}function gC(e){return hC(J5(e))}function vc(e){return arguments.length?$p=gC(e):$p}function fx(e,t,n){n=n||{},j(n)||S(`Invalid time multi-format specifier: ${n}`);const i=t(yn),r=t(rn),s=t(nn),a=t(qt),o=t(Ve),u=t(At),l=t(jt),c=t(ft),f=e(n[Bn]||".%L"),d=e(n[yn]||":%S"),p=e(n[rn]||"%I:%M"),h=e(n[nn]||"%I %p"),g=e(n[qt]||n[bt]||"%a %d"),m=e(n[Ve]||"%b %d"),y=e(n[At]||"%B"),b=e(n[jt]||"%B"),v=e(n[ft]||"%Y");return A=>(i(A)<A?f:r(A)<A?d:s(A)<A?p:a(A)<A?h:u(A)<A?o(A)<A?g:m:c(A)<A?l(A)<A?y:b:v)(A)}function mC(e){const t=zo(e.format),n=zo(e.utcFormat);return{timeFormat:i=>q(i)?t(i):fx(t,Ja,i),utcFormat:i=>q(i)?n(i):fx(n,Qa,i),timeParse:zo(e.parse),utcParse:zo(e.utcParse)}}let kp;yC();function yC(){return kp=mC({format:M5,parse:P5,utcFormat:L5,utcParse:B5})}function bC(e){return mC(N5(e))}function ou(e){return arguments.length?kp=bC(e):kp}const Dp=(e,t)=>se({},e,t);function xC(e,t){const n=e?gC(e):vc(),i=t?bC(t):ou();return Dp(n,i)}function xm(e,t){const n=arguments.length;return n&&n!==2&&S("defaultLocale expects either zero or two arguments."),n?Dp(vc(e),ou(t)):Dp(vc(),ou())}function eT(){return pC(),yC(),xm()}const tT=/^(data:|([A-Za-z]+:)?\/\/)/,nT=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,iT=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,dx="file://";function rT(e,t){return n=>({options:n||{},sanitize:aT,load:sT,fileAccess:!1,file:oT(),http:lT(e)})}async function sT(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function aT(e,t){t=se({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,a;const o=nT.test(e.replace(iT,""));(e==null||typeof e!="string"||!o)&&S("Sanitize failure, invalid URI: "+P(e));const u=tT.test(e);return(a=t.baseURL)&&!u&&(!e.startsWith("/")&&!a.endsWith("/")&&(e="/"+e),e=a+e),s=(r=e.startsWith(dx))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(dx.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),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 oT(e){return uT}async function uT(){S("No file system access.")}function lT(e){return e?async function(t,n){const i=se({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?ae(s[r])?s[r]():s.text():S(s.status+""+s.statusText)}:cT}async function cT(){S("No HTTP fetch method available.")}const fT=e=>e!=null&&e===e,dT=e=>e==="true"||e==="false"||e===!0||e===!1,hT=e=>!Number.isNaN(Date.parse(e)),vC=e=>!Number.isNaN(+e)&&!(e instanceof Date),pT=e=>vC(e)&&Number.isInteger(+e),Op={boolean:hm,integer:xt,number:xt,date:pm,string:gm,unknown:$t},El=[dT,pT,vC,hT],gT=["boolean","integer","number","date"];function EC(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=El.length,r=El.map((s,a)=>a+1);for(let s=0,a=0,o,u;s<n;++s)for(u=t?e[s][t]:e[s],o=0;o<i;++o)if(r[o]&&fT(u)&&!El[o](u)&&(r[o]=0,++a,a===El.length))return"string";return gT[r.reduce((s,a)=>s===0?a:s,0)-1]}function AC(e,t){return t.reduce((n,i)=>(n[i]=EC(e,i),n),{})}function hx(e){const t=function(n,i){const r={delimiter:e};return vm(n,i?se(i,r):r)};return t.responseType="text",t}function vm(e,t){return t.header&&(e=t.header.map(P).join(t.delimiter)+` 2`+e),e_(t.delimiter).parse(e+"")}vm.responseType="text";function mT(e){return typeof Buffer=="function"&&ae(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Em(e,t){const n=t&&t.property?gn(t.property):$t;return j(e)&&!mT(e)?yT(n(e),t):n(JSON.parse(e))}Em.responseType="json";function yT(e,t){return!D(e)&&j2(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const bT={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function CC(e,t){let n,i,r,s;return e=Em(e,t),t&&t.feature?(n=aR,r=t.feature):t&&t.mesh?(n=oR,r=t.mesh,s=bT[t.filter]):S("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):S("Invalid TopoJSON object: "+r),i&&i.features||[i]}CC.responseType="json";const Vl={dsv:vm,csv:hx(","),tsv:hx(" "),json:Em,topojson:CC};function Am(e,t){return arguments.length>1?(Vl[e]=t,this):H(Vl,e)?Vl[e]:null}function wC(e){const t=Am(e);return t&&t.responseType||"text"}function FC(e,t,n,i){t=t||{};const r=Am(t.type||"json");return r||S("Unknown data format type: "+t.type),e=r(e,t),t.parse&&xT(e,t.parse,n,i),H(e,"columns")&&delete e.columns,e}function xT(e,t,n,i){if(!e.length)return;const r=ou();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),a,o,u,l,c,f;t==="auto"&&(t=AC(e,s)),s=Object.keys(t);const d=s.map(p=>{const h=t[p];let g,m;if(h&&(h.startsWith("date:")||h.startsWith("utc:")))return g=h.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(!Op[h])throw Error("Illegal format pattern: "+p+":"+h);return Op[h]});for(u=0,c=e.length,f=s.length;u<c;++u)for(a=e[u],l=0;l<f;++l)o=s[l],a[o]=d[l](a[o])}const hf=rT(typeof fetch<"u"&&fetch);function pf(e){const t=e||$t,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const a=n.indexOf(r);a>=0&&n.splice(a,1)}return n},n}async function Xl(e,t){try{await t(e)}catch(n){e.error(n)}}const SC=Symbol("vega_id");let vT=1;function gf(e){return!!(e&&ee(e))}function ee(e){return e[SC]}function $C(e,t){return e[SC]=t,e}function be(e){const t=e===Object(e)?e:{data:e};return ee(t)?t:$C(t,vT++)}function Cm(e){return mf(e,be({}))}function mf(e,t){for(const n in e)t[n]=e[n];return t}function kC(e,t){return $C(t,ee(e))}function Ls(e,t){return e?t?(n,i)=>e(n,i)||ee(t(n))-ee(t(i)):(n,i)=>e(n,i)||ee(n)-ee(i):null}function DC(e){return e&&e.constructor===Bs}function Bs(){const e=[],t=[],n=[],i=[],r=[];let s=null,a=!1;return{constructor:Bs,insert(o){const u=W(o),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(o){const u=ae(o)?i:t,l=W(o),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(o,u,l){const c={field:u,value:kt(l)};return ae(o)?(c.filter=o,r.push(c)):(c.tuple=o,n.push(c)),this},encode(o,u){return ae(o)?r.push({filter:o,field:u}):n.push({tuple:o,field:u}),this},clean(o){return s=o,this},reflow(){return a=!0,this},pulse(o,u){const l={},c={};let f,d,p,h,g,m;for(f=0,d=u.length;f<d;++f)l[ee(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[ee(g)]=-1;for(f=0,d=i.length;f<d;++f)h=i[f],u.forEach(b=>{h(b)&&(l[ee(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=ee(g),l[m]?l[m]=1:o.add.push(be(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[ee(g)]<0&&o.rem.push(g);function y(b,v,A){A?b[v]=A(b):o.encode=v,a||(c[ee(b)]=b)}for(f=0,d=n.length;f<d;++f)p=n[f],g=p.tuple,h=p.field,m=l[ee(g)],m>0&&(y(g,h,p.value),o.modifies(h));for(f=0,d=r.length;f<d;++f)p=r[f],h=p.filter,u.forEach(b=>{h(b)&&l[ee(b)]>0&&y(b,p.field,p.value)}),o.modifies(p.field);if(a)o.mod=t.length||i.length?u.filter(b=>l[ee(b)]>0):u.slice();else for(m in c)o.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&o.clean(!0),o}}}const Yl="_:mod:_";function yf(){Object.defineProperty(this,Yl,{writable:!0,value:{}})}yf.prototype={set(e,t,n,i){const r=this,s=r[e],a=r[Yl];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,a[t+":"+e]=-1,a[e]=-1):(s!==n||i)&&(r[e]=n,a[e]=D(n)?1+n.length:-1),r},modified(e,t){const n=this[Yl];if(arguments.length){if(D(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[Yl]={},this}};let ET=0;const AT="pulse",CT=new yf,wT=1,FT=2;function $e(e,t,n,i){this.id=++ET,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 px(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}$e.prototype={targets(){return this._targets||(this._targets=pf(Ru))},set(e){return this.value!==e?(this.value=e,1):0},skip:px(wT),modified:px(FT),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new yf,r=this._argops=this._argops||[],s=[];let a,o,u,l;const c=(f,d,p)=>{p instanceof $e?(p!==this&&(t&&p.targets().add(this),s.push(p)),r.push({op:p,name:f,index:d})):i.set(f,d,p)};for(a in e)if(o=e[a],a===AT)W(o).forEach(f=>{f instanceof $e?f!==this&&(f.targets().add(this),s.push(f)):S("Pulse parameters must be operator instances.")}),this.source=o;else if(D(o))for(i.set(a,-1,Array(u=o.length)),l=0;l<u;++l)c(a,l,o[l]);else c(a,-1,o);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||CT,n=this._argops;let i,r,s,a;if(n){const o=n.length;for(r=0;r<o;++r)i=n[r],s=i.op,a=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,a);if(n.initonly){for(r=0;r<o;++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 ST(e,t,n,i){let r=1,s;return e instanceof $e?s=e:e&&e.prototype instanceof $e?s=new e:ae(e)?s=new $e(null,e):(r=0,s=new $e(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function $T(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 kT=0;function bf(e,t,n){this.id=++kT,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function rr(e,t,n){return new bf(e,t,n)}bf.prototype={_filter:mn,_apply:$t,targets(){return this._targets||(this._targets=pf(Ru))},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=rr(e);return this.targets().add(t),t},apply(e){const t=rr(null,e);return this.targets().add(t),t},merge(){const e=rr();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=rr();return this.targets().add(rr(null,null,cm(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(rr(null,null,()=>n=!0)),t.targets().add(rr(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=mn,this._targets=null}};function DT(e,t,n,i){const r=this,s=rr(n,i),a=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let o;typeof e=="string"&&typeof document<"u"?o=document.querySelectorAll(e):o=W(e);const u=o.length;for(let l=0;l<u;++l)o[l].addEventListener(t,a);return s}function OT(e,t){const n=this.locale();return FC(e,t,n.timeParse,n.utcParse)}function RT(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function _T(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:wC(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function TT(e,t,n){const i=this,r=i._pending||NT(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(mn).insert(s.data||[])),r.done(),s}function NT(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 MT={skip:!0};function LT(e,t,n,i,r){return(e instanceof $e?PT:BT)(this,e,t,n,i,r),this}function BT(e,t,n,i,r,s){const a=se({},s,MT);let o,u;ae(n)||(n=kt(n)),i===void 0?o=l=>e.touch(n(l)):ae(i)?(u=new $e(null,i,r,!1),o=l=>{u.evaluate(l);const c=n(l),f=u.value;DC(f)?e.pulse(c,f,s):e.update(c,f,a)}):o=l=>e.update(n(l),i,a),t.apply(o)}function PT(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const a=s||{},o=new $e(null,IT(n,i),r,!1);o.modified(a.force),o.rank=t.rank,t.targets().add(o),n&&(o.skip(!0),o.value=n.value,o.targets().add(n),e.connect(n,[o]))}}function IT(e,t){return t=ae(t)?t:kt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function zT(e){e.rank=++this._rank}function UT(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&&S("Cycle detected in dataflow graph.")}const Ec={},ni=1,or=2,Ti=4,jT=ni|or,gx=ni|Ti,Qs=ni|or|Ti,mx=8,mo=16,yx=32,bx=64;function vr(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function sh(e,t){const n=[];return ar(e,t,i=>n.push(i)),n}function xx(e,t){const n={};return e.visit(t,i=>{n[ee(i)]=1}),i=>n[ee(i)]?null:i}function Al(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}vr.prototype={StopPropagation:Ec,ADD:ni,REM:or,MOD:Ti,ADD_REM:jT,ADD_MOD:gx,ALL:Qs,REFLOW:mx,SOURCE:mo,NO_SOURCE:yx,NO_FIELDS:bx,fork(e){return new vr(this.dataflow).init(this,e)},clone(){const e=this.fork(Qs);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(Qs|mo)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new vr(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&bx)&&(n.fields=e.fields),t&ni?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&or?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Ti?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&yx?(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||Qs;return t&ni&&this.add.length||t&or&&this.rem.length||t&Ti&&this.mod.length},reflow(e){if(e)return this.fork(Qs).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ti,xx(this,ni))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return D(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?D(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&ni&&(n.addF=Al(n.addF,t)),e&or&&(n.remF=Al(n.remF,t)),e&Ti&&(n.modF=Al(n.modF,t)),e&mo&&(n.srcF=Al(n.srcF,t)),n},materialize(e){e=e||Qs;const t=this;return e&ni&&t.addF&&(t.add=sh(t.add,t.addF),t.addF=null),e&or&&t.remF&&(t.rem=sh(t.rem,t.remF),t.remF=null),e&Ti&&t.modF&&(t.mod=sh(t.mod,t.modF),t.modF=null),e&mo&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&mo)return ar(n.source,n.srcF,i),n;e&ni&&ar(n.add,n.addF,i),e&or&&ar(n.rem,n.remF,i),e&Ti&&ar(n.mod,n.modF,i);const r=n.source;if(e&mx&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ar(r,xx(n,gx),i):ar(r,n.srcF,i))}return n}};function wm(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===t){if(a.fields){const o=r.fields||(r.fields={});for(const u in a.fields)o[u]=1}a.changed(r.ADD)&&(s|=r.ADD),a.changed(r.REM)&&(s|=r.REM),a.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}z(wm,vr,{fork(e){const t=new vr(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?D(e)?e.some(i=>n[i]):n[e]:0},filter(){S("MultiPulse does not support filtering.")},materialize(){S("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function qT(e,t,n){const i=this,r=[];if(i._pulse)return OC(i);if(i._pending&&await i._pending,t&&await Xl(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new vr(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=pf(Ru);let a=0,o,u,l;try{for(;i._heap.size()>0;){if(o=i._heap.pop(),o.rank!==o.qrank){i._enqueue(o,!0);continue}u=o.run(i._getPulse(o,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Ec),u!==Ec&&o._targets&&o._targets.forEach(c=>i._enqueue(c)),++a}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${a} 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 Xl(i,c[f].callback)}return n&&await Xl(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 WT(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 GT(e,t,n){return this._pulse?OC(this):(this.evaluate(e,t,n),this)}function HT(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 OC(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function VT(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function XT(e,t){const n=e.source,i=this._clock;return n&&D(n)?new wm(this,i,n.map(r=>r.pulse),t):this._input[e.id]||YT(this._pulse,n&&n.pulse)}function YT(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ec&&(e.source=t.source),e)}const Fm={skip:!1,force:!1};function KT(e,t){const n=t||Fm;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function JT(e,t,n){const i=n||Fm;return(e.set(t)||i.force)&&this.touch(e,i),this}function QT(e,t,n){this.touch(e,n||Fm);const i=new vr(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 ZT(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),RC(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,eN(t,0,e)):i=n,i}}}function RC(e,t,n,i){let r,s;const a=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(a,r)<0){e[n]=r,n=s;continue}break}return e[n]=a}function eN(e,t,n){const i=t,r=e.length,s=e[t];let a=(t<<1)+1,o;for(;a<r;)o=a+1,o<r&&n(e[a],e[o])>=0&&(a=o),e[t]=e[a],t=a,a=(t<<1)+1;return e[t]=s,RC(e,i,t,n)}function pa(){this.logger(sm()),this.logLevel(im),this._clock=0,this._rank=0,this._locale=xm();try{this._loader=hf()}catch{}this._touched=pf(Ru),this._input={},this._pulse=null,this._heap=ZT((e,t)=>e.qrank-t.qrank),this._postrun=[]}function yo(e){return function(){return this._log[e].apply(this,arguments)}}pa.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:yo("error"),warn:yo("warn"),info:yo("info"),debug:yo("debug"),logLevel:yo("level"),cleanThreshold:1e4,add:ST,connect:$T,rank:zT,rerank:UT,pulse:QT,touch:KT,update:JT,changeset:Bs,ingest:RT,parse:OT,preload:TT,request:_T,events:DT,on:LT,evaluate:qT,run:GT,runAsync:WT,runAfter:HT,_enqueue:VT,_getPulse:XT};function F(e,t){$e.call(this,e,null,t)}z(F,$e,{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 Aa={};function _C(e){const t=TC(e);return t&&t.Definition||null}function TC(e){return e=e&&e.toLowerCase(),H(Aa,e)?Aa[e]:null}function*NC(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 Sm(e,t,n){const i=Float64Array.from(NC(e,n));return i.sort(C2),t.map(r=>uR(i,r))}function $m(e,t){return Sm(e,[.25,.5,.75],t)}function km(e,t){const n=e.length,i=lR(e,t),r=$m(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function MC(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],a=e.extent[1],o,u,l,c,f,d;const p=e.span||a-s||Math.abs(s)||1;if(e.step)o=e.step;else if(e.steps){for(c=p/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);o=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,o=Math.max(l,Math.pow(n,Math.round(Math.log(p)/i)-u));Math.ceil(p/o)>t;)o*=n;for(f=0,d=r.length;f<d;++f)c=o/r[f],c>=l&&p/c<=t&&(o=c)}c=Math.log(o);const h=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-h-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/o+g)*o,s=s<c?c-o:c,a=Math.ceil(a/o)*o),{start:s,stop:a===s?s+o:a,step:o}}var bn=Math.random;function tN(e){bn=e}function LC(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(NC(e,i)),s=r.length,a=t;let o,u,l,c;for(l=0,c=Array(a);l<a;++l){for(o=0,u=0;u<s;++u)o+=r[~~(bn()*s)];c[l]=o/s}return c.sort(C2),[ix(c,n/2),ix(c,1-n/2)]}function BC(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let a=0,o=1,u=i(e[0]),l=u,c=u+t,f;for(;o<r;++o){if(f=i(e[o]),f>=c){for(l=(u+l)/2;a<o;++a)s[a]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;a<o;++a)s[a]=l;return n?nN(s,t+t/4):s}function nN(e,t){const n=e.length;let i=0,r=1,s,a;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(a=r+(i+s-r-r>>1);a<r;)e[a++]=e[r];for(;a>r;)e[a--]=e[i]}i=r,r=s}return e}function iN(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function rN(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(a){return arguments.length?(n=a||0,r=i-n,s):n},max(a){return arguments.length?(i=a||0,r=i-n,s):i},sample(){return n+Math.floor(r*bn())},pdf(a){return a===Math.floor(a)&&a>=n&&a<i?1/r:0},cdf(a){const o=Math.floor(a);return o<n?0:o>=i?1:(o-n+1)/r},icdf(a){return a>=0&&a<=1?n-1+Math.floor(a*r):NaN}};return s.min(e).max(t)}const PC=Math.sqrt(2*Math.PI),sN=Math.SQRT2;let bo=NaN;function xf(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(bo===bo)n=bo,bo=NaN;else{do n=bn()*2-1,i=bn()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,bo=i*s}return e+n*t}function Dm(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*PC)}function vf(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const a=Math.exp(-r*r/2);let o;r<7.07106781186547?(o=.0352624965998911*r+.700383064443688,o=o*r+6.37396220353165,o=o*r+33.912866078383,o=o*r+112.079291497871,o=o*r+221.213596169931,o=o*r+220.206867912376,s=a*o,o=.0883883476483184*r+1.75566716318264,o=o*r+16.064177579207,o=o*r+86.7807322029461,o=o*r+296.564248779674,o=o*r+637.333633378831,o=o*r+793.826512519948,o=o*r+440.413735824752,s=s/o):(o=r+.65,o=r+4/o,o=r+3/o,o=r+2/o,o=r+1/o,s=a/o/2.506628274631)}return i>0?1-s:s}function Ef(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*sN*aN(2*e-1)}function aN(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 Om(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>xf(n,i),pdf:s=>Dm(s,n,i),cdf:s=>vf(s,n,i),icdf:s=>Ef(s,n,i)};return r.mean(e).stdev(t)}function Rm(e,t){const n=Om();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=km(e)),r):t},sample(){return e[~~(bn()*i)]+t*n.sample()},pdf(s){let a=0,o=0;for(;o<i;++o)a+=n.pdf((s-e[o])/t);return a/t/i},cdf(s){let a=0,o=0;for(;o<i;++o)a+=n.cdf((s-e[o])/t);return a/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function _m(e,t){return e=e||0,t=t??1,Math.exp(e+xf()*t)}function Tm(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*PC*e)}function Nm(e,t,n){return vf(Math.log(e),t,n)}function Mm(e,t,n){return Math.exp(Ef(e,t,n))}function IC(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>_m(n,i),pdf:s=>Tm(s,n,i),cdf:s=>Nm(s,n,i),icdf:s=>Mm(s,n,i)};return r.mean(e).stdev(t)}function zC(e,t){let n=0,i;function r(a){const o=[];let u=0,l;for(l=0;l<n;++l)u+=o[l]=a[l]==null?1:+a[l];for(l=0;l<n;++l)o[l]/=u;return o}const s={weights(a){return arguments.length?(i=r(t=a||[]),s):t},distributions(a){return arguments.length?(a?(n=a.length,e=a):(n=0,e=[]),s.weights(t)):e},sample(){const a=bn();let o=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(a<u){o=e[l];break}return o.sample()},pdf(a){let o=0,u=0;for(;u<n;++u)o+=i[u]*e[u].pdf(a);return o},cdf(a){let o=0,u=0;for(;u<n;++u)o+=i[u]*e[u].cdf(a);return o},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Lm(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*bn()}function Bm(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Pm(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Im(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function UC(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Lm(n,i),pdf:s=>Bm(s,n,i),cdf:s=>Pm(s,n,i),icdf:s=>Im(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function zm(e,t,n){let i=0,r=0;for(const s of e){const a=n(s);t(s)==null||a==null||isNaN(a)||(i+=(a-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Tu(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Af(e,t,n,i){e=e.filter(p=>{let h=t(p),g=n(p);return h!=null&&(h=+h)>=h&&g!=null&&(g=+g)>=g}),i&&e.sort((p,h)=>t(p)-t(h));const r=e.length,s=new Float64Array(r),a=new Float64Array(r);let o=0,u=0,l=0,c,f,d;for(d of e)s[o]=c=+t(d),a[o]=f=+n(d),++o,u+=(c-u)/o,l+=(f-l)/o;for(o=0;o<r;++o)s[o]-=u,a[o]-=l;return[s,a,u,l]}function Nu(e,t,n,i){let r=-1,s,a;for(const o of e)s=t(o),a=n(o),s!=null&&(s=+s)>=s&&a!=null&&(a=+a)>=a&&i(s,a,++r)}function Za(e,t,n,i,r){let s=0,a=0;return Nu(e,t,n,(o,u)=>{const l=u-r(o),c=u-i;s+=l*l,a+=c*c}),1-s/a}function Um(e,t,n){let i=0,r=0,s=0,a=0,o=0;Nu(e,t,n,(c,f)=>{++o,i+=(c-i)/o,r+=(f-r)/o,s+=(c*f-s)/o,a+=(c*c-a)/o});const u=Tu(i,r,s,a),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Za(e,t,n,r,l)}}function jC(e,t,n){let i=0,r=0,s=0,a=0,o=0;Nu(e,t,n,(c,f)=>{++o,c=Math.log(c),i+=(c-i)/o,r+=(f-r)/o,s+=(c*f-s)/o,a+=(c*c-a)/o});const u=Tu(i,r,s,a),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Za(e,t,n,r,l)}}function qC(e,t,n){const[i,r,s,a]=Af(e,t,n);let o=0,u=0,l=0,c=0,f=0,d,p,h;Nu(e,t,n,(b,v)=>{d=i[f++],p=Math.log(v),h=d*v,o+=(v*p-o)/f,u+=(h-u)/f,l+=(h*p-l)/f,c+=(d*h-c)/f});const[g,m]=Tu(u/a,o/a,l/a,c/a),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Za(e,t,n,a,y)}}function WC(e,t,n){let i=0,r=0,s=0,a=0,o=0,u=0;Nu(e,t,n,(f,d)=>{const p=Math.log(f),h=Math.log(d);++u,i+=(p-i)/u,r+=(h-r)/u,s+=(p*h-s)/u,a+=(p*p-a)/u,o+=(d-o)/u});const l=Tu(i,r,s,a),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Za(e,t,n,o,c)}}function jm(e,t,n){const[i,r,s,a]=Af(e,t,n),o=i.length;let u=0,l=0,c=0,f=0,d=0,p,h,g,m;for(p=0;p<o;)h=i[p],g=r[p++],m=h*h,u+=(m-u)/p,l+=(m*h-l)/p,c+=(m*m-c)/p,f+=(h*g-f)/p,d+=(m*g-d)/p;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,A=(f*y-d*l)/b,E=-v*u,C=x=>(x=x-s,v*x*x+A*x+E+a);return{coef:[E-A*s+v*s*s+a,A-2*v*s,v],predict:C,rSquared:Za(e,t,n,a,C)}}function GC(e,t,n,i){if(i===0)return zm(e,t,n);if(i===1)return Um(e,t,n);if(i===2)return jm(e,t,n);const[r,s,a,o]=Af(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,p,h,g,m;for(d=0;d<f;++d){for(h=0,g=0;h<u;++h)g+=Math.pow(r[h],d)*s[h];for(l.push(g),m=new Float64Array(f),p=0;p<f;++p){for(h=0,g=0;h<u;++h)g+=Math.pow(r[h],d+p);m[p]=g}c.push(m)}c.push(l);const y=uN(c),b=v=>{v-=a;let A=o+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)A+=y[d]*Math.pow(v,d);return A};return{coef:oN(f,y,-a,o),predict:b,rSquared:Za(e,t,n,o,b)}}function oN(e,t,n,i){const r=Array(e);let s,a,o,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(o=t[s],u=1,r[s]+=o,a=1;a<=s;++a)u*=(s+1-a)/a,r[s-a]+=o*Math.pow(n,a)*u;return r[0]+=i,r}function uN(e){const t=e.length-1,n=[];let i,r,s,a,o;for(i=0;i<t;++i){for(a=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][a])&&(a=r);for(s=i;s<t+1;++s)o=e[s][i],e[s][i]=e[s][a],e[s][a]=o;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(o=0,s=r+1;s<t;++s)o+=e[s][r]*n[s];n[r]=(e[t][r]-o)/e[r][r]}return n}const vx=2,Ex=1e-12;function HC(e,t,n,i){const[r,s,a,o]=Af(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 p=-1;++p<=vx;){const h=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=h[0],v=h[1],A=y-r[b]>r[v]-y?b:v;let E=0,C=0,x=0,w=0,R=0;const L=1/Math.abs(r[A]-y||1);for(let de=b;de<=v;++de){const N=r[de],O=s[de],I=lN(Math.abs(y-N)*L)*d[de],G=N*I;E+=I,C+=G,x+=O*I,w+=O*G,R+=N*G}const[J,ne]=Tu(C/E,x/E,w/E,R/E);c[m]=J+ne*y,f[m]=Math.abs(s[m]-c[m]),cN(r,m+1,h)}if(p===vx)break;const g=p2(f);if(Math.abs(g)<Ex)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?Ex:(b=1-y*y)*b}return fN(r,c,a,o)}function lN(e){return(e=1-e*e*e)*e*e}function cN(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function fN(e,t,n,i){const r=e.length,s=[];let a=0,o=0,u=[],l;for(;a<r;++a)l=e[a]+n,u[0]===l?u[1]+=(t[a]-u[1])/++o:(o=0,u[1]+=i,u=[l,t[a]],s.push(u));return u[1]+=i,s}const dN=.5*Math.PI/180;function Cf(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],a=t[1],o=a-s,u=o/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*o));return l.push(r(a)),l}else{c.push(r(a));for(let g=n;--g>0;)c.push(r(s+g/n*o))}let f=l[0],d=c[c.length-1];const p=1/o,h=hN(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&pN(f,g,d,p,h)>dN?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function hN(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const a=t[s][1];a<n&&(n=a),a>i&&(i=a)}return 1/(i-n)}function pN(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),a=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-a)}function gN(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 Rp(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:gN(e)}function VC(e,t,n){return n||e+(t?"_"+t:"")}const ah=()=>{},mN={init:ah,add:ah,rem:ah,idx:0},uu={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}},Mu=Object.keys(uu).filter(e=>e!=="__count__");function yN(e,t){return(n,i)=>se({name:e,aggregate_param:i,out:n||e},mN,t)}[...Mu,"__count__"].forEach(e=>{uu[e]=yN(e,uu[e])});function XC(e,t,n){return uu[e](n,t)}function YC(e,t){return e.idx-t.idx}function bN(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=uu[r]())})};return e.forEach(n),Object.values(t).sort(YC)}function xN(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function vN(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function EN(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function AN(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function KC(e,t){const n=t||$t,i=bN(e),r=e.slice().sort(YC);function s(a){this._ops=i,this._out=r,this.cell=a,this.init()}return s.prototype.init=xN,s.prototype.add=vN,s.prototype.rem=EN,s.prototype.set=AN,s.prototype.get=n,s.fields=e.map(a=>a.out),s}function qm(e){this._key=e?gn(e):ee,this.reset()}const pt=qm.prototype;pt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};pt.add=function(e){this._add.push(e)};pt.rem=function(e){this._rem.push(e)};pt.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,s=Array(i-r),a={};let o,u,l;for(o=0;o<r;++o)a[n(t[o])]=1;for(o=0,u=0;o<i;++o)a[n(l=e[o])]?a[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};pt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",H(n,s)||(n[s]=1,++r);return r};pt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=z2(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};pt.argmin=function(e){return this.extent(e)[0]||{}};pt.argmax=function(e){return this.extent(e)[1]||{}};pt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};pt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};pt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=$m(this.values(),e),this._get=e),this._q};pt.q1=function(e){return this.quartile(e)[0]};pt.q2=function(e){return this.quartile(e)[1]};pt.q3=function(e){return this.quartile(e)[2]};pt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=LC(this.values(),1e3,.05,e),this._get=e),this._ci};pt.ci0=function(e){return this.ci(e)[0]};pt.ci1=function(e){return this.ci(e)[1]};function wr(e){F.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}wr.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Mu},{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"}]};z(wr,F,{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,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),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 s(o){let u,l,c,f;for(u in o)for(c=o[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function a(o,u,l){const c=n[l],f=i[l++];for(const d in f){const p=o?o+"|"+d:d;u[c]=f[d],l<r?a(p,u,l):t[p]||e.cell(p,u)}}a("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=W(Et(b)),A=v.length;let E=0,C;for(;E<A;++E)i[C=v[E]]||(i[C]=1,t.push(C))}this._dims=W(e.groupby),this._dnames=this._dims.map(b=>{const v=ze(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Rp(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],a=e.ops||["count"],o=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,p,h,g,m,y;for(l!==a.length&&S("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=a[y],p=o[y]||null,f==null&&d!=="count"&&S("Null aggregate field specified."),g=ze(f),m=VC(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}h=c[g],h||(r(f),h=c[g]=[],h.field=f,this._measures.push(h)),d!=="count"&&(this._countOnly=!1),h.push(XC(d,p,m))}return this._measures=this._measures.map(b=>KC(b,b.field)),Object.create(null)},cellkey:Rp(),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 s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new qm),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let a=0;a<r;++a)s[n[a]]=i[a](e);return t?kC(t.tuple,s):be(s)},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,s=i.length;r<s;++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,s=i.length;r<s;++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,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,a=e.rem,o=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&a.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?a:o).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const CN=1e-14;function Wm(e){F.call(this,null,e)}Wm.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"]}]};z(Wm,F,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,a=e.as||["bin0","bin1"],o=a[0],u=a[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Et(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[o]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[o]=i(c)),t.modifies(n?a:o)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=MC(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,a,o;(a=e.anchor)!=null&&(o=a-(r+i*Math.floor((a-r)/i)),r+=o,s+=o);const u=function(l){let c=xt(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(CN+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=Vt(u,Et(t),e.name||"bin_"+ze(t))}});function JC(e,t,n){const i=e;let r=t||[],s=n||[],a={},o=0;return{add:u=>s.push(u),remove:u=>a[i(u)]=++o,size:()=>r.length,data:(u,l)=>(o&&(r=r.filter(c=>!a[i(c)]),a={},o=0),l&&u&&r.sort(u),s.length&&(r=u?G2(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Gm(e){F.call(this,[],e)}Gm.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};z(Gm,F,{transform(e,t){const n=t.fork(t.ALL),i=JC(ee,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(Ls(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function QC(e){$e.call(this,null,wN,e)}z(QC,$e);function wN(e){return this.value&&!e.modified()?this.value:lm(e.fields,e.orders)}function Hm(e){F.call(this,null,e)}Hm.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 FN(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}z(Hm,F,{transform(e,t){const n=f=>d=>{for(var p=FN(o(d),e.case,s)||[],h,g=0,m=p.length;g<m;++g)a.test(h=p[g])||f(h)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,a=this._stop,o=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],s=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let o,u,l;for(o in n)u=i[o],l=n[o]||0,!u&&l?(i[o]=u=be({}),u[r]=o,u[s]=l,a.add.push(u)):l===0?(u&&a.rem.push(u),n[o]=null,i[o]=null):u[s]!==l&&(u[s]=l,a.mod.push(u));return a.modifies(t)}});function Vm(e){F.call(this,null,e)}Vm.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};z(Vm,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let o=this.value;return a?(o&&(n.rem=o),o=t.materialize(t.SOURCE).source,n.add=this.value=SN(o,r,s,e.filter||mn)):n.mod=o,n.source=this.value,n.modifies(i)}});function SN(e,t,n,i){for(var r=[],s={},a=e.length,o=0,u,l;o<a;++o)for(s[t]=l=e[o],u=0;u<a;++u)s[n]=e[u],i(s)&&(r.push(be(s)),s={},s[t]=l);return r}const Ax={kde:Rm,mixture:zC,normal:Om,lognormal:IC,uniform:UC},$N="distributions",Cx="function",kN="field";function ZC(e,t){const n=e[Cx];H(Ax,n)||S("Unknown distribution function: "+n);const i=Ax[n]();for(const r in e)r===kN?i.data((e.from||t()).map(e[r])):r===$N?i[r](e[r].map(s=>ZC(s,t))):typeof i[r]===Cx&&i[r](e[r]);return i}function Xm(e){F.call(this,null,e)}const ew=[{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}]}],DN={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:ew},{name:"weights",type:"number",array:!0}]};Xm.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:ew.concat(DN)},{name:"as",type:"string",array:!0,default:["value","density"]}]};z(Xm,F,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ZC(e.distribution,ON(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let a=e.method||"pdf";a!=="pdf"&&a!=="cdf"&&S("Invalid density method: "+a),!e.extent&&!i.data&&S("Missing density extent parameter."),a=i[a];const o=e.as||["value","density"],u=e.extent||di(i.data()),l=Cf(a,u,r,s).map(c=>{const f={};return f[o[0]]=c[0],f[o[1]]=c[1],be(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function ON(e){return()=>e.materialize(e.SOURCE).source}function tw(e,t){return e?e.map((n,i)=>t[i]||ze(n)):null}function Ym(e,t,n){const i=[],r=f=>f(u);let s,a,o,u,l,c;if(t==null)i.push(e.map(n));else for(s={},a=0,o=e.length;a<o;++a)u=e[a],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const nw="bin";function Km(e){F.call(this,null,e)}Km.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:nw}]};const RN=(e,t)=>_u(di(e,t))/30;z(Km,F,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Ym(t.source,e.groupby,$t),r=e.smooth||!1,s=e.field,a=e.step||RN(n,s),o=Ls((h,g)=>s(h)-s(g)),u=e.as||nw,l=i.length;let c=1/0,f=-1/0,d=0,p;for(;d<l;++d){const h=i[d].sort(o);p=-1;for(const g of BC(h,a,r,s))g<c&&(c=g),g>f&&(f=g),h[++p][u]=g}return this.value={start:c,stop:f,step:a},t.reflow(!0).modifies(u)}});function iw(e){$e.call(this,null,_N,e),this.modified(!0)}z(iw,$e);function _N(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Vt(n=>t(n,e),Et(t),ze(t))}function Jm(e){F.call(this,[void 0,void 0],e)}Jm.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};z(Jm,F,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],a=n[1];if((r||s==null)&&(s=1/0,a=-1/0),t.visit(r?t.SOURCE:t.ADD,o=>{const u=xt(i(o));u!=null&&(u<s&&(s=u),u>a&&(a=u))}),!Number.isFinite(s)||!Number.isFinite(a)){let o=ze(i);o&&(o=` for field "${o}"`),t.dataflow.warn(`Infinite extent${o}: [${s}, ${a}]`),s=a=void 0}this.value=[s,a]}});function Qm(e,t){$e.call(this,e),this.parent=t,this.count=0}z(Qm,$e,{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 wf(e){F.call(this,{},e),this._keys=Ka();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)}}z(wf,F,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=H(r,e)&&r[e],a,o;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(o=i||(o=this._group[e])&&o.tuple,a=n.dataflow,s=new Qm(n.fork(n.NO_SOURCE),this),a.add(s).connect(t(a,e,o)),r[e]=s,this.activate(s)),s},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,s=this._keys,a=e.modified("key"),o=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ee(u),c=s.get(l);c!==void 0&&(s.delete(l),o(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(ee(u),l),o(l).add(u)}),a||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ee(u),c=s.get(l),f=i(u);c===f?o(f).mod(u):(s.set(l,f),o(c).rem(u),o(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{o(s.get(ee(u))).mod(u)}),a&&t.visit(t.REFLOW,u=>{const l=ee(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),o(c).rem(u),o(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function rw(e){$e.call(this,null,TN,e)}z(rw,$e);function TN(e){return this.value&&!e.modified()?this.value:D(e.name)?W(e.name).map(t=>gn(t)):gn(e.name,e.as)}function Zm(e){F.call(this,Ka(),e)}Zm.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};z(Zm,F,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,a=r.rem,o=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ee(f);i.has(d)?i.delete(d):a.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(ee(f),1)});function c(f){const d=ee(f),p=u(f,e),h=i.get(d);p&&h?(i.delete(d),s.push(f)):!p&&!h?(i.set(d,1),a.push(f)):l&&p&&!h&&o.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 e0(e){F.call(this,[],e)}e0.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}]};z(e0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=tw(i,e.as||[]),s=e.index||null,a=r.length;return n.rem=this.value,t.visit(t.SOURCE,o=>{const u=i.map(h=>h(o)),l=u.reduce((h,g)=>Math.max(h,g.length),0);let c=0,f,d,p;for(;c<l;++c){for(d=Cm(o),f=0;f<a;++f)d[r[f]]=(p=u[f][c])==null?null:p;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function t0(e){F.call(this,[],e)}t0.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"]}]};z(t0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(ze),s=e.as||["key","value"],a=s[0],o=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Cm(l),f[a]=r[c],f[o]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function n0(e){F.call(this,null,e)}n0.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};z(n0,F,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=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(s,a=>a[i]=n(a,e))}});function sw(e){F.call(this,[],e)}z(sw,F,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,a,o,u;if(s>0){for(a=[];--s>=0;)a.push(u=be(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(a):a}else o=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,r=r.slice(-s);return n.source=this.value=r,n}});const Cl={value:"value",median:p2,mean:cR,min:I5,max:Yo},NN=[];function i0(e){F.call(this,[],e)}i0.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 MN(e){var t=e.method||Cl.value,n;if(Cl[t]==null)S("Unrecognized imputation method: "+t);else return t===Cl.value?(n=e.value!==void 0?e.value:0,()=>n):Cl[t]}function LN(e){const t=e.field;return n=>n?t(n):NaN}z(i0,F,{transform(e,t){var n=t.fork(t.ALL),i=MN(e),r=LN(e),s=ze(e.field),a=ze(e.key),o=(e.groupby||[]).map(ze),u=BN(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,p,h,g,m,y,b,v,A,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],h=d.values,p=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,A=h.length;y<A;++y)E[o[y]]=h[y];E[a]=g,E[s]=Number.isNaN(p)?p=i(d,r):p,l.push(be(E))}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 BN(e,t,n,i){var r=y=>y(m),s=[],a=i?i.slice():[],o={},u={},l,c,f,d,p,h,g,m;for(a.forEach((y,b)=>o[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],h=n(m),p=o[h]||(o[h]=a.push(h)),c=(l=t?t.map(r):NN)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[p-1]=m;return s.domain=a,s}function r0(e){wr.call(this,e)}r0.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:Mu},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};z(r0,wr,{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,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{se(s,r[n.cellkey(s)].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 s0(e){F.call(this,null,e)}s0.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"]}]};z(s0,F,{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=Ym(i,e.groupby,e.field),s=(e.groupby||[]).map(ze),a=e.bandwidth,o=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;o!=="pdf"&&o!=="cdf"&&S("Invalid density method: "+o),e.resolve==="shared"&&(c||(c=di(i,e.field)),f=d=e.steps||d),r.forEach(p=>{const h=Rm(p,a)[o],g=e.counts?p.length:1,m=c||di(p);Cf(h,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=p.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(be(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function aw(e){$e.call(this,null,PN,e)}z(aw,$e);function PN(e){return this.value&&!e.modified()?this.value:dm(e.fields,e.flat)}function ow(e){F.call(this,[],e),this._pending=null}z(ow,F,{transform(e,t){const n=t.dataflow;return this._pending?oh(this,t,this._pending):IN(e)?t.StopPropagation:e.values?oh(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=W(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>oh(this,t,W(i.data)))}});function IN(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function oh(e,t,n){n.forEach(be);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 a0(e){F.call(this,{},e)}a0.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}]};z(a0,F,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,a=e.modified(),o=n.length;let u=a?t.SOURCE:t.ADD,l=t,c=e.as,f,d,p;return r?(d=r.length,o>1&&!c&&S('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==o*d&&S('The "as" parameter has too few output field names.'),c=c||r.map(ze),f=function(h){for(var g=0,m=0,y,b;g<o;++g)if(b=i.get(n[g](h)),b==null)for(y=0;y<d;++y,++m)h[c[m]]=s;else for(y=0;y<d;++y,++m)h[c[m]]=r[y](b)}):(c||S("Missing output field names."),f=function(h){for(var g=0,m;g<o;++g)m=i.get(n[g](h)),h[c[g]]=m??s}),a?l=t.reflow(!0):(p=n.some(h=>t.modified(h.fields)),u|=p?t.MOD:0),t.visit(u,f),l.modifies(c)}});function uw(e){$e.call(this,null,zN,e)}z(uw,$e);function zN(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,a;for(s=0;s<n;++s)a=t[s],a[0]<i&&(i=a[0]),a[1]>r&&(r=a[1]);return[i,r]}function lw(e){$e.call(this,null,UN,e)}z(lw,$e);function UN(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function cw(e){F.call(this,null,e)}z(cw,F,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function o0(e){wr.call(this,e)}o0.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:Mu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};z(o0,wr,{_transform:wr.prototype.transform,transform(e,t){return this._transform(jN(e,t),t)}});function jN(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Et(n).concat(Et(i)),a=WN(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map(()=>r),fields:a.map(o=>qN(o,n,i,s)),as:a.map(o=>o+""),modified:e.modified.bind(e)}}function qN(e,t,n,i){return Vt(r=>t(r)===e?n(r):NaN,i,e+"")}function WN(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const a=e(s);i[a]||(i[a]=1,r.push(a))}),r.sort(Ya),t?r.slice(0,t):r}function fw(e){wf.call(this,e)}z(fw,wf,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(ee(s),n,t,s);return(e.modified("field")||i&&t.modified(Et(i)))&&S("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const a=r(s);i(s).forEach(o=>a.mod(o))}),t.visit(t.ADD,s=>{const a=r(s);i(s).forEach(o=>a.add(be(o)))}),t.visit(t.REM,s=>{const a=r(s);i(s).forEach(o=>a.rem(o))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function u0(e){F.call(this,null,e)}u0.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};z(u0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=tw(e.fields,e.as||[]),s=i?(o,u)=>GN(o,u,i,r):mf;let a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,o=>{const u=ee(o);n.rem.push(a[u]),a[u]=null}),t.visit(t.ADD,o=>{const u=s(o,be({}));a[ee(o)]=u,n.add.push(u)}),t.visit(t.MOD,o=>{n.mod.push(s(o,a[ee(o)]))}),n}});function GN(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function dw(e){F.call(this,null,e)}z(dw,F,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function l0(e){F.call(this,null,e)}l0.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 HN=1e-14;z(l0,F,{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,s=Ym(r,e.groupby,e.field),a=(e.groupby||[]).map(ze),o=[],u=e.step||.01,l=e.probs||Ms(u/2,1-HN,u),c=l.length;return s.forEach(f=>{const d=Sm(f,l);for(let p=0;p<c;++p){const h={};for(let g=0;g<a.length;++g)h[a[g]]=f.dims[g];h[i[0]]=l[p],h[i[1]]=d[p],o.push(be(h))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=o,n}});function hw(e){F.call(this,null,e)}z(hw,F,{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 s=ee(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Cm(r);i[ee(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[ee(r)];for(const a in r)s[a]=r[a],n.modifies(a);n.mod.push(s)})),n}});function c0(e){F.call(this,[],e),this.count=0}c0.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};z(c0,F,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[ee(f)]=1,c),{});let a=this.value,o=this.count,u=0;function l(c){let f,d;a.length<r?a.push(c):(d=~~((o+1)*bn()),d<a.length&&d>=u&&(f=a[d],s[ee(f)]&&n.rem.push(f),a[d]=c)),++o}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ee(c);s[f]&&(s[f]=-1,n.rem.push(c)),--o}),a=a.filter(c=>s[ee(c)]!==-1)),(t.rem.length||i)&&a.length<r&&t.source&&(u=o=a.length,t.visit(t.SOURCE,c=>{s[ee(c)]||l(c)}),u=-1),i&&a.length>r){const c=a.length-r;for(let f=0;f<c;++f)s[ee(a[f])]=-1,n.rem.push(a[f]);a=a.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[ee(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(c=>!s[ee(c)])),this.count=o,this.value=n.source=a,n}});function f0(e){F.call(this,null,e)}f0.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"}]};z(f0,F,{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=Ms(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,be(s)}),n.add=t.add.concat(this.value),n}});function pw(e){F.call(this,null,e),this.modified(!0)}z(pw,F,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function d0(e){F.call(this,null,e)}const gw=["unit0","unit1"];d0.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:mm,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:gw}]};z(d0,F,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),a=(r?Qa:Ja)(s.unit).offset,o=e.as||gw,u=o[0],l=o[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,p=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Et(n)))&&(t=t.reflow(!0),p=t.SOURCE,f=1/0,d=-1/0),t.visit(p,h=>{const g=n(h);let m,y;g==null?(h[u]=null,i&&(h[l]=null)):(h[u]=m=y=s(g),i&&(h[l]=y=a(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?o:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:dC({extent:e.extent||di(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=ym(i),a=this.value||{},o=(n?iC:nC)(s,r);return o.unit=ce(s),o.units=s,o.step=r,o.start=a.start,o.stop=a.stop,this.value=o}});function mw(e){F.call(this,Ka(),e)}z(mw,F,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=o=>r.set(i(o),o);let a=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,o=>r.delete(i(o))),t.visit(t.ADD,s)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function yw(e){F.call(this,null,e)}z(yw,F,{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(Ls(e.sort)):t.source).map(e.field))}});function VN(e,t,n,i){const r=lu[e](t,n);return{init:r.init||cr,update:function(s,a){a[i]=r.next(s)}}}const lu={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=lu.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||S("ntile num must be greater than zero.");const n=lu.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||S("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=XN(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function XN(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const YN=Object.keys(lu);function bw(e){const t=W(e.ops),n=W(e.fields),i=W(e.params),r=W(e.aggregate_params),s=W(e.as),a=this.outputs=[],o=this.windows=[],u={},l={},c=[],f=[];let d=!0;function p(h){W(Et(h)).forEach(g=>u[g]=1)}p(e.sort),t.forEach((h,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=ze(m),A=VC(h,v,s[g]);if(p(m),a.push(A),H(lu,h))o.push(VN(h,m,y,A));else{if(m==null&&h!=="count"&&S("Null aggregate field specified."),h==="count"){c.push(A);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(XC(h,b,A))}}),(c.length||f.length)&&(this.cell=KN(f,c,d)),this.inputs=Object.keys(u)}const xw=bw.prototype;xw.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};xw.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let a;if(n){for(a=e.p0;a<e.i0;++a)n.rem(r[a]);for(a=e.p1;a<e.i1;++a)n.add(r[a]);n.set(t)}for(a=0;a<s;++a)i[a].update(e,t)};function KN(e,t,n){e=e.map(u=>KC(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),a=0;a<r;++a)s[a]=new e[a](i);if(i.store)var o=i.data=new qm;return i.add=function(u){if(i.num+=1,!n){o&&o.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){o&&o.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(o&&o.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,o&&o.reset();for(let u=0;u<r;++u)s[u].init()},i}function h0(e){F.call(this,{},e),this._mlen=0,this._mods=[]}h0.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:YN.concat(Mu)},{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}]};z(h0,F,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=Ls(e.sort),r=Rp(e.groupby),s=o=>this.group(r(o));let a=this.state;(!a||n)&&(a=this.state=new bw(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,o=>s(o).add(o))):(t.visit(t.REM,o=>s(o).remove(o)),t.visit(t.ADD,o=>s(o).add(o)));for(let o=0,u=this._mlen;o<u;++o)JN(this._mods[o],a,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(a.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=JC(ee),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function JN(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,a=i.frame||[null,0],o=e.data(n),u=o.length,l=s?em(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:o,compare:r||kt(-1)};t.init();for(let f=0;f<u;++f)QN(c,a,f,u),s&&ZN(c,l),t.update(c,o[f])}function QN(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 ZN(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,a=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<a&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const e6=Object.freeze(Object.defineProperty({__proto__:null,aggregate:wr,bin:Wm,collect:Gm,compare:QC,countpattern:Hm,cross:Vm,density:Xm,dotbin:Km,expression:iw,extent:Jm,facet:wf,field:rw,filter:Zm,flatten:e0,fold:t0,formula:n0,generate:sw,impute:i0,joinaggregate:r0,kde:s0,key:aw,load:ow,lookup:a0,multiextent:uw,multivalues:lw,params:cw,pivot:o0,prefacet:fw,project:u0,proxy:dw,quantile:l0,relay:hw,sample:c0,sequence:f0,sieve:pw,subflow:Qm,timeunit:d0,tupleindex:mw,values:yw,window:h0},Symbol.toStringTag,{value:"Module"}));function Er(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 t6=()=>typeof Image<"u"?Image:null;function p0(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const n6="identity",Ca="linear",qi="log",Lu="pow",Bu="sqrt",Ff="symlog",ms="time",ys="utc",ui="sequential",eo="diverging",wa="quantile",Sf="quantize",$f="threshold",g0="ordinal",_p="point",vw="band",m0="bin-ordinal",Ke="continuous",Pu="discrete",Iu="discretizing",En="interpolating",y0="temporal";function i6(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 r6(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,a,o,u,l;for(r<i&&(o=i,i=r,r=o),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),a=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[a]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function b0(){const e=w2().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,a=!1,o=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],p=i[1-d],h=p0(f,o,u);let g=i[d-0];r=(p-g)/(h||1),a&&(r=Math.floor(r)),g+=(p-g-r*(f-o))*l,s=r*(1-o),a&&(g=Math.round(g),s=Math.round(s));const m=Ms(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]],a=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(a=!!f,c()):a},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),o=u,c()):o},e.paddingInner=function(f){return arguments.length?(o=Math.max(0,Math.min(1,f)),c()):o},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],p=d?n().reverse():n(),h=p.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<p[0]||g>i[1-d])))return y=Math.max(0,mc(p,g)-1),b=g===m?y:mc(p,m)-1,g-p[y]>s+1e-10&&++y,d&&(v=y,y=h-b,b=h-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 b0().domain(t()).range(i).round(a).paddingInner(o).paddingOuter(u).align(l)},c()}function Ew(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Ew(t())},e}function s6(){return Ew(b0().paddingInner(1))}var a6=Array.prototype.map;function o6(e){return a6.call(e,xt)}const u6=Array.prototype.slice;function Aw(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(mc(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=o6(i),n):e.slice()},n.range=function(i){return arguments.length?(t=u6.call(i),n):t.slice()},n.tickFormat=function(i,r){return V5(e[0],ce(e),i??10,r)},n.copy=function(){return Aw().domain(n.domain()).range(n.range())},n}const Ac=new Map,Cw=Symbol("vega_scale");function ww(e){return e[Cw]=!0,e}function wx(e){return e&&e[Cw]===!0}function l6(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?i6(s):s.invertExtent?r6(s):void 0),s.type=e,ww(s)};return i.metadata=Ln(W(n)),i}function me(e,t,n){return arguments.length>1?(Ac.set(e,l6(e,t,n)),this):Fw(e)?Ac.get(e):void 0}me(n6,fR);me(Ca,H5,Ke);me(qi,dR,[Ke,qi]);me(Lu,hR,Ke);me(Bu,pR,Ke);me(Ff,gR,Ke);me(ms,z5,[Ke,y0]);me(ys,mR,[Ke,y0]);me(ui,g2,[Ke,En]);me(`${ui}-${Ca}`,g2,[Ke,En]);me(`${ui}-${qi}`,yR,[Ke,En,qi]);me(`${ui}-${Lu}`,bR,[Ke,En]);me(`${ui}-${Bu}`,xR,[Ke,En]);me(`${ui}-${Ff}`,vR,[Ke,En]);me(`${eo}-${Ca}`,ER,[Ke,En]);me(`${eo}-${qi}`,AR,[Ke,En,qi]);me(`${eo}-${Lu}`,CR,[Ke,En]);me(`${eo}-${Bu}`,wR,[Ke,En]);me(`${eo}-${Ff}`,FR,[Ke,En]);me(wa,SR,[Iu,wa]);me(Sf,$R,Iu);me($f,kR,Iu);me(m0,Aw,[Pu,Iu]);me(g0,w2,Pu);me(vw,b0,Pu);me(_p,s6,Pu);function Fw(e){return Ac.has(e)}function Ps(e,t){const n=Ac.get(e);return n&&n.metadata[t]}function x0(e){return Ps(e,Ke)}function Fa(e){return Ps(e,Pu)}function Tp(e){return Ps(e,Iu)}function Sw(e){return Ps(e,qi)}function c6(e){return Ps(e,y0)}function $w(e){return Ps(e,En)}function kw(e){return Ps(e,wa)}const f6=["clamp","base","constant","exponent"];function Dw(e,t){const n=t[0],i=ce(t)-n;return function(r){return e(n+r*i)}}function kf(e,t,n){return IR(v0(t||"rgb",n),e)}function Ow(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function Rw(e,t,n){const i=n-t;let r,s,a;return!i||!Number.isFinite(i)?kt(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),a=me(s)().domain([t,n]).range([0,1]),f6.forEach(o=>e[o]?a[o](e[o]()):0),a)}function v0(e,t){const n=zR[d6(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function d6(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const h6={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:"0d088723069033
2059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",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"},p6={accent:PR,category10:BR,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:LR,observable10:MR,paired:NR,pastel1:TR,pastel2:_R,set1:RR,set2:OR,set3:DR,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function _w(e){if(D(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 Tw(e,t){for(const n in e)E0(n,t(e[n]))}const Fx={};Tw(p6,_w);Tw(h6,e=>kf(_w(e)));function E0(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Fx[e]=t,this):Fx[e]}const Kl="symbol",g6="discrete",m6="gradient",y6=e=>D(e)?e.map(t=>String(t)):String(e),b6=(e,t)=>e[1]-t[1],x6=(e,t)=>t[1]-e[1];function A0(e,t,n){let i;return ge(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(_u(e.domain())/n||1)+1))),j(t)&&(i=t.step,t=t.interval),q(t)&&(t=e.type===ms?Ja(t):e.type==ys?Qa(t):S("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function Nw(e,t,n){let i=e.range(),r=i[0],s=ce(i),a=b6;if(r>s&&(i=s,s=r,r=i,a=x6),r=Math.floor(r),s=Math.ceil(s),t=t.map(o=>[o,e(o)]).filter(o=>r<=o[1]&&o[1]<=s).sort(a).map(o=>o[0]),n>0&&t.length>1){const o=[t[0],ce(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=o)}return t}function C0(e,t){return e.bins?Nw(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Mw(e,t,n,i,r,s){const a=t.type;let o=y6;if(a===ms||r===ms)o=e.timeFormat(i);else if(a===ys||r===ys)o=e.utcFormat(i);else if(Sw(a)){const u=e.formatFloat(i);if(s||t.bins)o=u;else{const l=Lw(t,n,!1);o=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();o=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(o=e.format(i));return o}function Lw(e,t,n){const i=C0(e,t),r=e.base(),s=Math.log(r),a=Math.max(1,r*t/i.length),o=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=a};return n?i.filter(o):o}const Np={[wa]:"quantiles",[Sf]:"thresholds",[$f]:"domain"},Bw={[wa]:"quantiles",[Sf]:"domain"};function Pw(e,t){return e.bins?A6(e.bins):e.type===qi?Lw(e,t,!0):Np[e.type]?E6(e[Np[e.type]]()):C0(e,t)}function v6(e,t,n){const i=t[Bw[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],a;for(a=1;a<r;++a)s=Math.min(s,i[a]-i[a-1]);return e.formatSpan(0,s,30,n)}function E6(e){const t=[-1/0].concat(e);return t.max=1/0,t}function A6(e){const t=e.slice(0,-1);return t.max=ce(e),t}
vendor: 33,616 bytes, line 2
2const C6=e=>Np[e.type]||e.bins;function Iw(e,t,n,i,r,s,a){const o=Bw[t.type]&&s!==ms&&s!==ys?v6(e,t,r):Mw(e,t,n,r,s,a);return i===Kl&&C6(t)?w6(o):i===g6?F6(o):S6(o)}const w6=e=>(t,n,i)=>{const r=Sx(i[n+1],Sx(i.max,1/0)),s=$x(t,e),a=$x(r,e);return s&&a?s+" â "+a:a?"< "+a:"⥠"+s},Sx=(e,t)=>e??t,F6=e=>(t,n)=>n?e(t):null,S6=e=>t=>e(t),$x=(e,t)=>Number.isFinite(e)?t(e):null;function $6(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ce(t),s=r-i;if(e.type===$f){const a=n?s/n:.1;i-=a,r+=a,s=r-i}return a=>(a-i)/s}function k6(e,t,n,i){const r=i||t.type;return q(n)&&c6(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===ms?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===ys?e.utcFormat("%A, %d %B %Y, %X UTC"):Iw(e,t,5,null,n,i,!0)}function zw(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=k6(e,t,n.format,n.formatType);if(Tp(t.type)){const s=Pw(t).slice(1).map(r),a=s.length;return`${a} boundar${a===1?"y":"ies"}: ${s.join(", ")}`}else if(Fa(t.type)){const s=t.domain(),a=s.length,o=a>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${a} value${a===1?"":"s"}: ${o}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(ce(s))}`}}let Uw=0;function D6(){Uw=0}const Cc="p_";function w0(e){return e&&e.gradient}function jw(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Cc:"";return r||(r=e.id="gradient_"+Uw++,i==="radial"?(e.x1=Zn(e.x1,.5),e.y1=Zn(e.y1,.5),e.r1=Zn(e.r1,0),e.x2=Zn(e.x2,.5),e.y2=Zn(e.y2,.5),e.r2=Zn(e.r2,.5),s=Cc):(e.x1=Zn(e.x1,0),e.y1=Zn(e.y1,0),e.x2=Zn(e.x2,1),e.y2=Zn(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Zn(e,t){return e??t}function qw(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,s){return n.push({offset:r,color:s}),i}}}const kx={basis:{curve:E_},"basis-closed":{curve:v_},"basis-open":{curve:x_},bundle:{curve:b_,tension:"beta",value:.85},cardinal:{curve:y_,tension:"tension",value:0},"cardinal-open":{curve:m_,tension:"tension",value:0},"cardinal-closed":{curve:g_,tension:"tension",value:0},"catmull-rom":{curve:p_,tension:"alpha",value:.5},"catmull-rom-closed":{curve:h_,tension:"alpha",value:.5},"catmull-rom-open":{curve:d_,tension:"alpha",value:.5},linear:{curve:f_},"linear-closed":{curve:c_},monotone:{horizontal:l_,vertical:u_},natural:{curve:o_},step:{curve:a_},"step-after":{curve:s_},"step-before":{curve:r_}};function F0(e,t,n){var i=H(kx,e)&&kx[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const O6={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},R6=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,_6=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,T6=/^((\s+,?\s*)|(,\s*))/,N6=/^[01]/;function Sa(e){const t=[];return(e.match(R6)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),a=O6[s],o=M6(s,a,i.slice(1).trim()),u=o.length;if(u<a||u&&u%a!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...o.slice(0,a)]),u!==a){s==="m"&&(r=r==="M"?"L":"l");for(let l=a;l<u;l+=a)t.push([r,...o.slice(l,l+a)])}}),t}function M6(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const a=e==="a"&&(s===3||s===4)?N6:_6,o=n.slice(r).match(a);if(o===null)throw Error("Invalid SVG path, incorrect parameter type");r+=o[0].length,i.push(+o[0]);const u=n.slice(r).match(T6);u!==null&&(r+=u[0].length)}return i}const Fr=Math.PI/180,L6=1e-14,ss=Math.PI/2,si=Math.PI*2,Zs=Math.sqrt(3)/2;var uh={},lh={},Ww=[].join;function B6(e,t,n,i,r,s,a,o,u){const l=Ww.call(arguments);if(uh[l])return uh[l];const c=a*Fr,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const p=d*(o-e)*.5+f*(u-t)*.5,h=d*(u-t)*.5-f*(o-e)*.5;let g=p*p/(n*n)+h*h/(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,A=m*o+y*u,E=b*o+v*u,C=m*e+y*t,x=b*e+v*t;let R=1/((C-A)*(C-A)+(x-E)*(x-E))-.25;R<0&&(R=0);let L=Math.sqrt(R);s==r&&(L=-L);const J=.5*(A+C)-L*(x-E),ne=.5*(E+x)+L*(C-A),de=Math.atan2(E-ne,A-J);let O=Math.atan2(x-ne,C-J)-de;O<0&&s===1?O+=si:O>0&&s===0&&(O-=si);const I=Math.ceil(Math.abs(O/(ss+.001))),G=[];for(let X=0;X<I;++X){const V=de+X*O/I,te=de+(X+1)*O/I;G[X]=[J,ne,V,te,n,i,f,d]}return uh[l]=G}function P6(e){const t=Ww.call(e);if(lh[t])return lh[t];var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7];const c=l*a,f=-u*o,d=u*a,p=l*o,h=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),A=8/3*v*v/Math.sin(b),E=n+h-A*g,C=i+g+A*h,x=n+m,w=i+y,R=x+A*y,L=w-A*m;return lh[t]=[c*E+f*C,d*E+p*C,c*R+f*L,d*R+p*L,c*x+f*w,d*x+p*w]}const un=["l",0,0,0,0,0,0,0];function I6(e,t,n){const i=un[0]=e[0];if(i==="a"||i==="A")un[1]=t*e[1],un[2]=n*e[2],un[3]=e[3],un[4]=e[4],un[5]=e[5],un[6]=t*e[6],un[7]=n*e[7];else if(i==="h"||i==="H")un[1]=t*e[1];else if(i==="v"||i==="V")un[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)un[r]=(r%2==1?t:n)*e[r];return un}function cu(e,t,n,i,r,s){var a,o=null,u=0,l=0,c=0,f=0,d,p,h,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(a=t[b],(r!==1||s!==1)&&(a=I6(a,r,s)),a[0]){case"l":u+=a[1],l+=a[2],e.lineTo(u+n,l+i);break;case"L":u=a[1],l=a[2],e.lineTo(u+n,l+i);break;case"h":u+=a[1],e.lineTo(u+n,l+i);break;case"H":u=a[1],e.lineTo(u+n,l+i);break;case"v":l+=a[1],e.lineTo(u+n,l+i);break;case"V":l=a[1],e.lineTo(u+n,l+i);break;case"m":u+=a[1],l+=a[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=a[1],l=a[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+a[5],p=l+a[6],c=u+a[3],f=l+a[4],e.bezierCurveTo(u+a[1]+n,l+a[2]+i,c+n,f+i,d+n,p+i),u=d,l=p;break;case"C":u=a[5],l=a[6],c=a[3],f=a[4],e.bezierCurveTo(a[1]+n,a[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+a[3],p=l+a[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+a[1]+n,l+a[2]+i,d+n,p+i),c=u+a[1],f=l+a[2],u=d,l=p;break;case"S":d=a[3],p=a[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,a[1]+n,a[2]+i,d+n,p+i),u=d,l=p,c=a[1],f=a[2];break;case"q":d=u+a[3],p=l+a[4],c=u+a[1],f=l+a[2],e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p;break;case"Q":d=a[3],p=a[4],e.quadraticCurveTo(a[1]+n,a[2]+i,d+n,p+i),u=d,l=p,c=a[1],f=a[2];break;case"t":d=u+a[1],p=l+a[2],o[0].match(/[QqTt]/)===null?(c=u,f=l):o[0]==="t"?(c=2*u-h,f=2*l-g):o[0]==="q"&&(c=2*u-c,f=2*l-f),h=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p,c=u+a[1],f=l+a[2];break;case"T":d=a[1],p=a[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p;break;case"a":Dx(e,u+n,l+i,[a[1],a[2],a[3],a[4],a[5],a[6]+u+n,a[7]+l+i]),u+=a[6],l+=a[7];break;case"A":Dx(e,u+n,l+i,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+i]),u=a[6],l=a[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}o=a}}function Dx(e,t,n,i){const r=B6(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const a=P6(r[s]);e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}const Ox=.5773502691896257,Rx={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,si)}},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,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Zs*n,r=i-n*Ox,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Zs*n,r=i-n*Ox;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=Zs*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=Zs*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=Zs*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=Zs*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 Gw(e){return H(Rx,e)?Rx[e]:z6(e)}var ch={};function z6(e){if(!H(ch,e)){const t=Sa(e);ch[e]={draw:function(n,i){cu(n,t,0,0,Math.sqrt(i)/2)}}}return ch[e]}const nr=.448084975506;function U6(e){return e.x}function j6(e){return e.y}function q6(e){return e.width}function W6(e){return e.height}function Di(e){return typeof e=="function"?e:()=>+e}function wl(e,t,n){return Math.max(t,Math.min(e,n))}function Hw(){var e=U6,t=j6,n=q6,i=W6,r=Di(0),s=r,a=r,o=r,u=null;function l(c,f,d){var p,h=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=wl(+r.call(this,c),0,b),A=wl(+s.call(this,c),0,b),E=wl(+a.call(this,c),0,b),C=wl(+o.call(this,c),0,b);if(u||(u=p=tm()),v<=0&&A<=0&&E<=0&&C<=0)u.rect(h,g,m,y);else{var x=h+m,w=g+y;u.moveTo(h+v,g),u.lineTo(x-A,g),u.bezierCurveTo(x-nr*A,g,x,g+nr*A,x,g+A),u.lineTo(x,w-C),u.bezierCurveTo(x,w-nr*C,x-nr*C,w,x-C,w),u.lineTo(h+E,w),u.bezierCurveTo(h+nr*E,w,h,w-nr*E,h,w-E),u.lineTo(h,g+v),u.bezierCurveTo(h,g+nr*v,h+nr*v,g,h+v,g),u.closePath()}if(p)return u=null,p+""||null}return l.x=function(c){return arguments.length?(e=Di(c),l):e},l.y=function(c){return arguments.length?(t=Di(c),l):t},l.width=function(c){return arguments.length?(n=Di(c),l):n},l.height=function(c){return arguments.length?(i=Di(c),l):i},l.cornerRadius=function(c,f,d,p){return arguments.length?(r=Di(c),s=f!=null?Di(f):r,o=d!=null?Di(d):r,a=p!=null?Di(p):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function Vw(){var e,t,n,i,r=null,s,a,o,u;function l(f,d,p){const h=p/2;if(s){var g=o-d,m=f-a;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,A=Math.atan2(m,g);r.moveTo(a-b,o-v),r.lineTo(f-g*h,d-m*h),r.arc(f,d,h,A-Math.PI,A),r.lineTo(a+b,o+v),r.arc(a,o,u,A,A+Math.PI)}else r.arc(f,d,h,0,si);r.closePath()}else s=1;a=f,o=d,u=h}function c(f){var d,p=f.length,h,g=!1,m;for(r==null&&(r=m=tm()),d=0;d<=p;++d)!(d<p&&i(h=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(h,d,f),+t(h,d,f),+n(h,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 zu(e,t){return e??t}const Uu=e=>e.x||0,ju=e=>e.y||0,G6=e=>e.width||0,H6=e=>e.height||0,V6=e=>(e.x||0)+(e.width||0),X6=e=>(e.y||0)+(e.height||0),Y6=e=>e.startAngle||0,K6=e=>e.endAngle||0,J6=e=>e.padAngle||0,Q6=e=>e.innerRadius||0,Z6=e=>e.outerRadius||0,eM=e=>e.cornerRadius||0,tM=e=>zu(e.cornerRadiusTopLeft,e.cornerRadius)||0,nM=e=>zu(e.cornerRadiusTopRight,e.cornerRadius)||0,iM=e=>zu(e.cornerRadiusBottomRight,e.cornerRadius)||0,rM=e=>zu(e.cornerRadiusBottomLeft,e.cornerRadius)||0,sM=e=>zu(e.size,64),aM=e=>e.size||1,Df=e=>e.defined!==!1,oM=e=>Gw(e.shape||"circle"),uM=n_().startAngle(Y6).endAngle(K6).padAngle(J6).innerRadius(Q6).outerRadius(Z6).cornerRadius(eM),lM=m2().x(Uu).y1(ju).y0(X6).defined(Df),cM=m2().y(ju).x1(Uu).x0(V6).defined(Df),fM=i_().x(Uu).y(ju).defined(Df),dM=Hw().x(Uu).y(ju).width(G6).height(H6).cornerRadius(tM,nM,iM,rM),hM=UR().type(oM).size(sM),pM=Vw().x(Uu).y(ju).defined(Df).size(aM);function S0(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function gM(e,t){return uM.context(e)(t)}function mM(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?cM:lM).curve(F0(i,n.orient,n.tension)).context(e)(t)}function yM(e,t){const n=t[0],i=n.interpolate||"linear";return fM.curve(F0(i,n.orient,n.tension)).context(e)(t)}function to(e,t,n,i){return dM.context(e)(t,n,i)}function bM(e,t){return(t.mark.shape||t.shape).context(e)(t)}function xM(e,t){return hM.context(e)(t)}function vM(e,t){return pM.context(e)(t)}var Xw=1;function Yw(){Xw=1}function $0(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+Xw++),a=r.clipping[s]||(r.clipping[s]={id:s});return ae(i)?a.path=i(null):S0(n)?a.path=to(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+s+")"}function We(e){this.clear(),e&&this.union(e)}We.prototype={clone(){return new We(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:s,y2:a}=this,o=Math.cos(e),u=Math.sin(e),l=t-t*o+n*u,c=n-t*u-n*o;return[o*i-u*r+l,u*i+o*r+c,o*i-u*a+l,u*i+o*a+c,o*s-u*r+l,u*s+o*r+c,o*s-u*a+l,u*s+o*a+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 Of(e){this.mark=e,this.bounds=this.bounds||new We}function Rf(e){Of.call(this,e),this.items=this.items||[]}z(Rf,Of);class Kw{constructor(t){this._pending=0,this._loader=t||hf()}pending(){return this._pending}sanitizeURL(t){const n=this;return _x(n),n._loader.sanitize(t,{context:"href"}).then(i=>(xo(n),i)).catch(()=>(xo(n),null))}loadImage(t){const n=this,i=t6();return _x(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const a=new i,o=H(r,"crossOrigin")?r.crossOrigin:"anonymous";return o!=null&&(a.crossOrigin=o),a.onload=()=>xo(n),a.onerror=()=>xo(n),a.src=s,a}).catch(r=>(xo(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 _x(e){e._pending+=1}function xo(e){e._pending-=1}function Vi(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?EM(t,i):0))}return e}function EM(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const AM=si-1e-8;let _f,Jl,Ql,us,Mp,Zl,Lp,Bp;const fr=(e,t)=>_f.add(e,t),ec=(e,t)=>fr(Jl=e,Ql=t),Tx=e=>fr(e,_f.y1),Nx=e=>fr(_f.x1,e),as=(e,t)=>Mp*e+Lp*t,os=(e,t)=>Zl*e+Bp*t,fh=(e,t)=>fr(as(e,t),os(e,t)),dh=(e,t)=>ec(as(e,t),os(e,t));function qu(e,t){return _f=e,t?(us=t*Fr,Mp=Bp=Math.cos(us),Zl=Math.sin(us),Lp=-Zl):(Mp=Bp=1,us=Zl=Lp=0),CM}const CM={beginPath(){},closePath(){},moveTo:dh,lineTo:dh,rect(e,t,n,i){us?(fh(e+n,t),fh(e+n,t+i),fh(e,t+i),dh(e,t)):(fr(e+n,t+i),ec(e,t))},quadraticCurveTo(e,t,n,i){const r=as(e,t),s=os(e,t),a=as(n,i),o=os(n,i);Mx(Jl,r,a,Tx),Mx(Ql,s,o,Nx),ec(a,o)},bezierCurveTo(e,t,n,i,r,s){const a=as(e,t),o=os(e,t),u=as(n,i),l=os(n,i),c=as(r,s),f=os(r,s);Lx(Jl,a,u,c,Tx),Lx(Ql,o,l,f,Nx),ec(c,f)},arc(e,t,n,i,r,s){if(i+=us,r+=us,Jl=n*Math.cos(r)+e,Ql=n*Math.sin(r)+t,Math.abs(r-i)>AM)fr(e-n,t-n),fr(e+n,t+n);else{const a=l=>fr(n*Math.cos(l)+e,n*Math.sin(l)+t);let o,u;if(a(i),a(r),r!==i)if(i=i%si,i<0&&(i+=si),r=r%si,r<0&&(r+=si),r<i&&(s=!s,o=i,i=r,r=o),s)for(r-=si,o=i-i%ss,u=0;u<4&&o>r;++u,o-=ss)a(o);else for(o=i-i%ss+ss,u=0;u<4&&o<r;++u,o=o+ss)a(o)}}};function Mx(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function Lx(e,t,n,i,r){const s=i-e+3*t-3*n,a=e+n-2*t,o=e-t;let u=0,l=0,c;Math.abs(s)>L6?(c=a*a+o*s,c>=0&&(c=Math.sqrt(c),u=(-a+c)/s,l=(-a-c)/s)):u=.5*o/a,0<u&&u<1&&r(Bx(u,e,t,n,i)),0<l&&l<1&&r(Bx(l,e,t,n,i))}function Bx(e,t,n,i,r){const s=1-e,a=s*s,o=e*e;return a*s*t+3*a*e*n+3*s*o*i+o*e*r}var Ar=(Ar=Er(1,1))?Ar.getContext("2d"):null;const Pp=new We;function k0(e){return function(t,n){if(!Ar)return!0;e(Ar,t),Pp.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:a}=Pp;for(let o=r;o<=a;++o)for(let u=i;u<=s;++u)if(Ar.isPointInPath(u,o))return!0;return!1}}function D0(e,t){return t.contains(e.x||0,e.y||0)}function Jw(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(Pp.set(n,i,n+r,i+s))}function Qw(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return ca(t,n,i,r,s)}function ca(e,t,n,i,r){const{x1:s,y1:a,x2:o,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,p,h,g,m;for(m=0;m<4;++m){if(m===0&&(p=-l,h=-(s-t)),m===1&&(p=l,h=o-t),m===2&&(p=-c,h=-(a-n)),m===3&&(p=c,h=u-n),Math.abs(p)<1e-10&&h<0)return!1;if(g=h/p,p<0){if(g>d)return!1;g>f&&(f=g)}else if(p>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function $a(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Fn(e,t){return e??t}function Px(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function wM(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+Fn(t.x1,.5)*i,n.y1+Fn(t.y1,.5)*r,Math.max(i,r)*Fn(t.r1,0),n.x1+Fn(t.x2,.5)*i,n.y1+Fn(t.y2,.5)*r,Math.max(i,r)*Fn(t.r2,.5));else{const a=Fn(t.x1,0),o=Fn(t.y1,0),u=Fn(t.x2,1),l=Fn(t.y2,0);if(a===u||o===l||i===r)s=e.createLinearGradient(n.x1+a*i,n.y1+o*r,n.x1+u*i,n.y1+l*r);else{const c=Er(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=Px(f.createLinearGradient(a,o,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return Px(s,t.stops)}function Zw(e,t,n){return w0(n)?wM(e,n,t.bounds):n}function wc(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=Zw(e,t,t.fill),!0):!1}var FM=[];function ka(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=Zw(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||FM),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function SM(e,t){return e.zindex-t.zindex||e.index-t.index}function O0(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(SM)}function Pn(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=O0(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function Fc(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=O0(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function R0(e){return function(t,n,i){Pn(n,r=>{(!i||i.intersects(r.bounds))&&eF(e,t,r,r)})}}function $M(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&eF(e,t,n.items[0],n.items)}}function eF(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||($a(t,n),n.fill&&wc(t,n,r)&&t.fill(),n.stroke&&ka(t,n,r)&&t.stroke()))}function Tf(e){return e=e||mn,function(t,n,i,r,s,a){return i*=t.pixelRatio,r*=t.pixelRatio,Fc(n,o=>{const u=o.bounds;if(!(u&&!u.contains(s,a)||!u)&&e(t,o,i,r,s,a))return o})}}function Wu(e,t){return function(n,i,r,s){var a=Array.isArray(i)?i[0]:i,o=t??a.fill,u=a.stroke&&n.isPointInStroke,l,c;return u&&(l=a.strokeWidth,c=a.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:o&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function _0(e){return Tf(Wu(e))}function ls(e,t){return"translate("+e+","+t+")"}function T0(e){return"rotate("+e+")"}function kM(e,t){return"scale("+e+","+t+")"}function tF(e){return ls(e.x||0,e.y||0)}function DM(e){return ls(e.x||0,e.y||0)+(e.angle?" "+T0(e.angle):"")}function OM(e){return ls(e.x||0,e.y||0)+(e.angle?" "+T0(e.angle):"")+(e.scaleX||e.scaleY?" "+kM(e.scaleX||1,e.scaleY||1):"")}function N0(e,t,n){function i(a,o){a("transform",DM(o)),a("d",t(null,o))}function r(a,o){return t(qu(a,o.angle),o),Vi(a,o).translate(o.x||0,o.y||0)}function s(a,o){var u=o.x||0,l=o.y||0,c=o.angle||0;a.translate(u,l),c&&a.rotate(c*=Fr),a.beginPath(),t(a,o),c&&a.rotate(-c),a.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:R0(s),pick:_0(s),isect:n||k0(s)}}var RM=N0("arc",gM);function _M(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,a,o;--r>=0;)e[r].defined!==!1&&(o=Math.abs(e[r][i]-n),o<s&&(s=o,a=e[r]));return a}function TM(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,a;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],a=r*r+s*s,a<n))return e[i];return null}function NM(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function M0(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(qu(u),c),Vi(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const a=Wu(s);function o(u,l,c,f,d,p){var h=l.items,g=l.bounds;return!h||!h.length||g&&!g.contains(d,p)?null:(c*=u.pixelRatio,f*=u.pixelRatio,a(u,h,c,f)?h[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:$M(s),pick:o,isect:D0,tip:n}}var MM=M0("area",mM,_M);function LM(e,t){var n=t.clip;e.save(),ae(n)?(e.beginPath(),n(e),e.clip()):nF(e,t.group)}function nF(e,t){e.beginPath(),S0(t)?to(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function iF(e){const t=Fn(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function BM(e,t){e("transform",tF(t))}function rF(e,t){const n=iF(t);e("d",to(null,t,n,n))}function PM(e,t){e("class","background"),e("aria-hidden",!0),rF(e,t)}function IM(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?rF(e,t):e("d","")}function zM(e,t,n){const i=t.clip?$0(n,t,t):null;e("clip-path",i)}function UM(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),Vi(e,t),e.translate(t.x||0,t.y||0)}function fu(e,t,n,i){const r=iF(t);e.beginPath(),to(e,t,(n||0)+r,(i||0)+r)}const jM=Wu(fu),qM=Wu(fu,!1),WM=Wu(fu,!0);function GM(e,t,n,i){Pn(t,r=>{const s=r.x||0,a=r.y||0,o=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(fu(e,r,s,a),$a(e,r),r.fill&&wc(e,r,u)&&e.fill(),r.stroke&&!o&&ka(e,r,u)&&e.stroke()),e.save(),e.translate(s,a),r.clip&&nF(e,r),n&&n.translate(-s,-a),Pn(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,a),e.restore(),o&&r.stroke&&u&&(fu(e,r,s,a),$a(e,r),ka(e,r,u)&&e.stroke())})}function HM(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const a=n*e.pixelRatio,o=i*e.pixelRatio;return Fc(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const p=c+(u.width||0),h=f+(u.height||0),g=u.clip;if(g&&(r<c||r>p||s<f||s>h))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&S0(u)&&!WM(e,u,a,o))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&qM(e,u,a,o)?(e.restore(),u):(l=Fc(u,b=>VM(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&jM(e,u,a,o)&&(l=u),e.restore(),l||null)})}function VM(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var XM={type:"group",tag:"g",nested:!1,attr:BM,bound:UM,draw:GM,pick:HM,isect:Jw,content:zM,background:PM,foreground:IM},du={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function L0(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 B0(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 P0(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 Nf(e,t){return e==="center"?t/2:e==="right"?t:0}function Mf(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function YM(e,t,n){const i=L0(t,n),r=B0(t,i),s=P0(t,i),a=(t.x||0)-Nf(t.align,r),o=(t.y||0)-Mf(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,du["xmlns:xlink"],"xlink:href"),e("transform",ls(a,o)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function KM(e,t){const n=t.image,i=B0(t,n),r=P0(t,n),s=(t.x||0)-Nf(t.align,i),a=(t.y||0)-Mf(t.baseline,r);return e.set(s,a,s+i,a+r)}function JM(e,t,n){Pn(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=L0(i,this);let s=B0(i,r),a=P0(i,r);if(s===0||a===0)return;let o=(i.x||0)-Nf(i.align,s),u=(i.y||0)-Mf(i.baseline,a),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=s/c,u+=(a-d)/2,a=d):(d=a*c,o+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&($a(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,o,u,s,a))})}var QM={type:"image",tag:"image",nested:!1,attr:YM,bound:KM,draw:JM,pick:Tf(),isect:mn,get:L0,xOffset:Nf,yOffset:Mf},ZM=M0("line",yM,TM);function e8(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",OM(t)),e("d",t.path)}function tc(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,a=t.scaleY||1,o=(t.angle||0)*Fr,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=Sa(n)).path=n),o&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(o),cu(e,u,0,0,s,a),e.rotate(-o),e.translate(-i,-r)):cu(e,u,i,r,s,a)}function t8(e,t){return tc(qu(e,t.angle),t)?e.set(0,0,0,0):Vi(e,t,!0)}var n8={type:"path",tag:"path",nested:!1,attr:e8,bound:t8,draw:R0(tc),pick:_0(tc),isect:k0(tc)};function i8(e,t){e("d",to(null,t))}function r8(e,t){var n,i;return Vi(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function Ix(e,t){e.beginPath(),to(e,t)}var s8={type:"rect",tag:"path",nested:!1,attr:i8,bound:r8,draw:R0(Ix),pick:_0(Ix),isect:Jw};function a8(e,t){e("transform",tF(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function o8(e,t){var n,i;return Vi(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function sF(e,t,n){var i,r,s,a;return t.stroke&&ka(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,a=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,a),!0):!1}function u8(e,t,n){Pn(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&sF(e,i,r)&&($a(e,i),e.stroke())}})}function l8(e,t,n,i){return e.isPointInStroke?sF(e,t,1)&&e.isPointInStroke(n,i):!1}var c8={type:"rule",tag:"line",nested:!1,attr:a8,bound:o8,draw:u8,pick:Tf(l8),isect:Qw},f8=N0("shape",bM),d8=N0("symbol",xM,D0);const zx=W2();var Zt={height:xi,measureWidth:I0,estimateWidth:Sc,width:Sc,canvas:aF};aF(!0);function aF(e){Zt.width=e&&Ar?I0:Sc}function Sc(e,t){return oF($r(e,t),xi(e))}function oF(e,t){return~~(.8*e.length*t)}function I0(e,t){return xi(e)<=0||!(t=$r(e,t))?0:uF(t,Lf(e))}function uF(e,t){const n=`(${t}) ${e}`;let i=zx.get(n);return i===void 0&&(Ar.font=t,i=Ar.measureText(e).width,zx.set(n,i)),i}function xi(e){return e.fontSize!=null?+e.fontSize||0:11}function Sr(e){return e.lineHeight!=null?e.lineHeight:xi(e)+2}function h8(e){return D(e)?e.length>1?e:e[0]:e}function Gu(e){return h8(e.lineBreak&&e.text&&!D(e.text)?e.text.split(e.lineBreak):e.text)}function z0(e){const t=Gu(e);return(D(t)?t.length-1:0)*Sr(e)}function $r(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?g8(e,n):n}function p8(e){if(Zt.width===I0){const t=Lf(e);return n=>uF(n,t)}else if(Zt.width===Sc){const t=xi(e);return n=>oF(n,t)}else return t=>Zt.width(e,t)}function g8(e,t){var n=+e.limit,i=p8(e);if(i(t)<n)return t;var r=e.ellipsis||"â¦",s=e.dir==="rtl",a=0,o=t.length,u;if(n-=i(r),s){for(;a<o;)u=a+o>>>1,i(t.slice(u))>n?a=u+1:o=u;return r+t.slice(a)}else{for(;a<o;)u=1+(a+o>>>1),i(t.slice(0,u))<n?a=u:o=u-1;return t.slice(0,a)+r}}function Hu(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Lf(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+xi(e)+"px "+Hu(e,t)}function U0(e){var t=e.baseline,n=xi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Sr(e):t==="line-bottom"?.29*n-.5*Sr(e):0)}const m8={left:"start",center:"middle",right:"end"},Ko=new We;function Bf(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-ss,t+=i*Math.cos(r),n+=i*Math.sin(r)),Ko.x1=t,Ko.y1=n,Ko}function y8(e,t){var n=t.dx||0,i=(t.dy||0)+U0(t),r=Bf(t),s=r.x1,a=r.y1,o=t.angle||0,u;e("text-anchor",m8[t.align]||"start"),o?(u=ls(s,a)+" "+T0(o),(n||i)&&(u+=" "+ls(n,i))):u=ls(s+n,a+i),e("transform",u)}function j0(e,t,n){var i=Zt.height(t),r=t.align,s=Bf(t),a=s.x1,o=s.y1,u=t.dx||0,l=(t.dy||0)+U0(t)-Math.round(.8*i),c=Gu(t),f;if(D(c)?(i+=Sr(t)*(c.length-1),f=c.reduce((d,p)=>Math.max(d,Zt.width(t,p)),0)):f=Zt.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=a,l+=o,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Fr,a,o);else if(n===2)return e.rotatedPoints(t.angle*Fr,a,o);return e}function b8(e,t,n){Pn(t,i=>{var r=i.opacity==null?1:i.opacity,s,a,o,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=Lf(i),e.textAlign=i.align||"left",s=Bf(i),a=s.x1,o=s.y1,i.angle&&(e.save(),e.translate(a,o),e.rotate(i.angle*Fr),a=o=0),a+=i.dx||0,o+=(i.dy||0)+U0(i),c=Gu(i),$a(e,i),D(c))for(l=Sr(i),u=0;u<c.length;++u)f=$r(i,c[u]),i.fill&&wc(e,i,r)&&e.fillText(f,a,o),i.stroke&&ka(e,i,r)&&e.strokeText(f,a,o),o+=l;else f=$r(i,c),i.fill&&wc(e,i,r)&&e.fillText(f,a,o),i.stroke&&ka(e,i,r)&&e.strokeText(f,a,o);i.angle&&e.restore()}})}function x8(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=Bf(t),o=a.x1,u=a.y1,l=j0(Ko,t,1),c=-t.angle*Fr,f=Math.cos(c),d=Math.sin(c),p=f*r-d*s+(o-f*o+d*u),h=d*r+f*s+(u-d*o-f*u);return l.contains(p,h)}function v8(e,t){const n=j0(Ko,e,2);return ca(t,n[0],n[1],n[2],n[3])||ca(t,n[0],n[1],n[4],n[5])||ca(t,n[4],n[5],n[6],n[7])||ca(t,n[2],n[3],n[6],n[7])}var E8={type:"text",tag:"text",nested:!1,attr:y8,bound:j0,draw:b8,pick:Tf(x8),isect:v8},A8=M0("trail",vM,NM),sn={arc:RM,area:MM,group:XM,image:QM,line:ZM,path:n8,rect:s8,rule:c8,shape:f8,symbol:d8,text:E8,trail:A8};function Ip(e,t,n){var i=sn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new We),e,n)}var Ux={mark:null};function lF(e,t,n){var i=sn[e.marktype],r=i.bound,s=e.items,a=s&&s.length,o,u,l,c;if(i.nested)return a?l=s[0]:(Ux.mark=e,l=Ux),c=Ip(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new We,a)for(o=0,u=s.length;o<u;++o)t.union(Ip(s[o],r,n));return e.bounds=t}const C8=["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 cF(e,t){return JSON.stringify(e,C8,t)}function fF(e){const t=typeof e=="string"?JSON.parse(e):e;return dF(t)}function dF(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&dF(n[r]);return t&&lF(e),e}class hF{constructor(t){arguments.length?this.root=fF(t):(this.root=jx({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Rf(this.root)])}toJSON(t){return cF(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=jx(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function jx(e,t){const n={bounds:new We,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 dr(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}
2function q0(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 He(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=dr(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function cn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function pF(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Pf(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function w8(e,t,n,i){var r=e&&e.mark,s,a;if(r&&(s=sn[r.marktype]).tip){for(a=Pf(t,n),a[0]-=i[0],a[1]-=i[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=s.tip(r.items,a)}return e}let W0=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||hf(),this._tooltip=n||F8}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 s=new MouseEvent(t.type,t),a=dr(null,"a");for(const o in r)a.setAttribute(o,r[o]);a.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=w8(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,s=t.bounds,a=s.width(),o=s.height();let u=s.x1+r[0]+i.left,l=s.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:a,height:o,left:u,top:l,right:u+a,bottom:l+o}}};function F8(e,t,n,i){e.element().setAttribute("title",i||"")}class Vu{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Kw(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}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 s=i._call;i._ready=i._loader.ready().then(a=>{a&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const S8="keydown",$8="keypress",k8="keyup",gF="dragenter",nc="dragleave",mF="dragover",zp="pointerdown",D8="pointerup",$c="pointermove",ic="pointerout",yF="pointerover",Up="mousedown",O8="mouseup",bF="mousemove",kc="mouseout",xF="mouseover",Dc="click",R8="dblclick",_8="wheel",vF="mousewheel",Oc="touchstart",Rc="touchmove",_c="touchend",T8=[S8,$8,k8,gF,nc,mF,zp,D8,$c,ic,yF,Up,O8,bF,kc,xF,Dc,R8,_8,vF,Oc,Rc,_c],jp=$c,Jo=kc,qp=Dc;class Xu extends W0{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=T8,this.pointermove=Wx([$c,bF],[yF,xF],[ic,kc]),this.dragover=Wx([mF],[gF],[nc]),this.pointerout=Gx([ic,kc]),this.dragleave=Gx([nc])}initialize(t,n,i){return this._canvas=t&&q0(t,"canvas"),[Dc,Up,zp,$c,ic,nc].forEach(r=>qx(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(vF,t)}pointerdown(t){this._down=this._active,this.fire(zp,t)}mousedown(t){this._down=this._active,this.fire(Up,t)}click(t){this._down===this._active&&(this.fire(Dc,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Oc,t,!0)}touchmove(t){this.fire(Rc,t,!0)}touchend(t){this.fire(_c,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===qp&&r&&r.href?this.handleHref(n,r,r.href):(t===jp||t===Jo)&&this.handleTooltip(n,r,t!==Jo),s)for(let a=0,o=s.length;a<o;++a)s[a].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&&(qx(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=Pf(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,s){const a=this.context();return sn[t.marktype].pick.call(this,a,t,n,i,r,s)}}const N8=e=>e===Oc||e===Rc||e===_c?[Oc,Rc,_c]:[e];function qx(e,t){N8(t).forEach(n=>M8(e,n))}function M8(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 Uo(e,t,n){t.forEach(i=>
2e.fire(i,n))}function Wx(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Uo(this,e,i):((!r||!r.exit)&&Uo(this,n,i),this._active=s,Uo(this,t,i),Uo(this,e,i))}}function Gx(e){return function(t){Uo(this,e,t),this._active=null}}function L8(){return typeof window<"u"&&window.devicePixelRatio||1}function B8(e,t,n,i,r,s){const a=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,o=e.getContext("2d"),u=a?L8():r;e.width=t*u,e.height=n*u;for(const l in s)o[l]=s[l];return a&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),o.pixelRatio=u,o.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Tc extends Vu{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new We,this._tempb=new We}initialize(t,n,i,r,s,a){return this._options=a||{},this._canvas=this._options.externalContext?null:Er(1,1,this._options.type),t&&this._canvas&&(cn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)B8(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||S("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.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,s=this._width,a=this._height,o=this._dirty,u=P8(r,s,a);i.save();const l=this._redraw||o.empty()?(this._redraw=!1,u.expand(1)):I8(i,u.intersect(o),r);return this.clear(-r[0],-r[1],s,a),this.draw(i,t,l,n),i.restore(),o.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=sn[n.marktype];n.clip&&LM(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,a=this.context();s.type!=="pdf"&&!s.externalContext&&a.clearRect(t,n,i,r),this._bgcolor!=null&&(a.fillStyle=this._bgcolor,a.fillRect(t,n,i,r))}}const P8=(e,t,n)=>new We().set(0,0,t,n).translate(-e[0],-e[1]);
2function I8(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 EF extends W0{constructor(t,n){super(t,n);const i=this;i._hrefHandler=hh(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=hh(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Jo)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(qp,this._hrefHandler),r.removeEventListener(jp,this._tooltipHandler),r.removeEventListener(Jo,this._tooltipHandler)),this._svg=r=t&&q0(t,"svg"),r&&(r.addEventListener(qp,this._hrefHandler),r.addEventListener(jp,this._tooltipHandler),r.addEventListener(Jo,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 a={type:t,handler:n,listener:hh(this,n)};(r[i]||(r[i]=[])).push(a),this._svg&&this._svg.addEventListener(i,a.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const hh=(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)},AF="aria-hidden",G0="aria-label",H0="role",V0="aria-roledescription",CF="graphics-object",X0="graphics-symbol",wF=(e,t,n)=>({[H0]:e,[V0]:t,[G0]:n||void 0}),z8=Ln(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Hx={axis:{desc:"axis",caption:q8},legend:{desc:"legend",caption:W8},"title-text":{desc:"title",caption:e=>`Title text '${Xx(e)}'`}
vendor: 9,095 bytes, lines 2-3
2,"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${Xx(e)}'`}},Vx={ariaRole:H0,ariaRoleDescription:V0,description:G0};function FF(e,t){const n=t.aria===!1;if(e(AF,n||void 0),n||t.description==null)for(const i in Vx)e(Vx[i],void 0);else{const i=t.mark.marktype;e(G0,t.description),e(H0,t.ariaRole||(i==="group"?CF:X0)),e(V0,t.ariaRoleDescription||`${i} mark`)}}function SF(e){return e.aria===!1?{[AF]:!0}:z8[e.role]?null:Hx[e.role]?j8(e,Hx[e.role]):U8(e)}function U8(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return wF(n?CF:X0,`${t} mark container`,e.description)}function j8(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return wF(t.role||X0,t.desc,n.description||i(n))}catch{return null}}function Xx(e){return W(e.text).join(" ")}function q8(e){const t=e.datum,n=e.orient,i=t.title?$F(e):null,r=e.context,s=r.scales[t.scale].value,a=r.dataflow.locale(),o=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Fa(o)?"discrete":o} scale with ${zw(a,s,e)}`}function W8(e){const t=e.datum,n=t.title?$F(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),a=e.context,o=a.scales[r[s[0]]].value,u=a.dataflow.locale();return H8(i)+(n?` titled '${n}'`:"")+` for ${G8(s)} with ${zw(u,o,e)}`}function $F(e){try{return W(ce(e.items).items[0].text).join(" ")}catch{return null}}function G8(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ce(e)}function H8(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const kF=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),V8=e=>kF(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function Y0(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},a=(u,l)=>(l!=null&&(t+=` ${u}="${V8(l)}"`),o),o={open(u){s(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 p in d)a(p,d[p]);return o},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),o},attr:a,text:u=>(n+=kF(u),o),toString:()=>e};return o}const DF=e=>OF(Y0(),e)+"";function OF(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):OF(e,i)}return e.close()}const Nc={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"},Mc={blend:"mix-blend-mode"},RF={fill:"none","stroke-miterlimit":10},vo=0,Yx="http://www.w3.org/2000/xmlns/",Ge=du.xmlns;class K0 extends Vu{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=He(t,0,"svg",Ge),this._svg.setAttributeNS(Yx,"xmlns",Ge),this._svg.setAttributeNS(Yx,"xmlns:xlink",du["xmlns:xlink"]),this._svg.setAttribute("version",du.version),this._svg.setAttribute("class","marks"),cn(t,1),this._root=He(this._svg,vo,"g",Ge),hr(this._root,RF),cn(this._svg,vo+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}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&&(hr(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=He(t,vo,"rect",Ge),hr(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),cn(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,s,a,o,u,l;for(o=0,u=t.length;o<u;++o)if(i=t[o],r=i.mark,r.marktype!==s&&(s=r.marktype,a=sn[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,Kx(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){a.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(a,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=a.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,Kx(i,n)):this._update(a,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,a=n.marktype,o=sn[a],u=n.interactive===!1?"none":null,l=o.tag==="g",c=Jx(n,t,i,"g",s);if(a!=="group"&&r!=null&&!r.includes(a))return cn(c,0),n._svg;c.setAttribute("class",pF(n));const f=SF(n);for(const g in f)Ot(c,g,f[g]);l||Ot(c,"pointer-events",u),Ot(c,"clip-path",n.clip?$0(this,n,n.group):null);let d=null,p=0;const h=g=>{const m=this.isDirty(g),y=Jx(g,c,d,o.tag,s);m&&(this._update(o,y,g),l&&K8(this,y,g,r)),d=y,++p};return o.nested?n.items.length&&h(n.items[0]):Pn(n,h),cn(c,p),c}_update(t,n,i){Li=n,yt=n.__values__,FF(Qo,i),t.attr(Qo,i,this);const r=Q8[t.type];r&&r.call(this,t,n,i),Li&&this.style(Li,i)}style(t,n){if(n!=null){for(const i in Nc){let r=i==="font"?Hu(n):n[i];if(r===yt[i])continue;const s=Nc[i];r==null?t.removeAttribute(s):(w0(r)&&(r=jw(r,this._defs.gradient,_F())),t.setAttribute(s,r+"")),yt[i]=r}for(const i in Mc)rc(t,Mc[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=He(t,vo+1,"defs",Ge)),r=X8(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=He(t,vo+1,"defs",Ge)),r=Y8(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):cn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function Kx(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 X8(e,t,n){let i,r,s;if(t.gradient==="radial"){let a=He(e,n++,"pattern",Ge);hr(a,{id:Cc+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a=He(a,0,"rect",Ge),hr(a,{width:1,height:1,fill:`url(${_F()}#${t.id})`}),e=He(e,n++,"radialGradient",Ge),hr(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=He(e,n++,"linearGradient",Ge),hr(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)s=He(e,i,"stop",Ge),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return cn(e,i),n}function Y8(e,t,n){let i;return e=He(e,n,"clipPath",Ge),e.setAttribute("id",t.id),t.path?(i=He(e,0,"path",Ge),i.setAttribute("d",t.path)):(i=He(e,0,"rect",Ge),hr(i,{x:0,y:0,width:t.width,height:t.height})),cn(e,1),n+1}function K8(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;Pn(n,a=>{r=e.mark(t,a,r,i),++s}),cn(t,1+s)}function Jx(e,t,n,i,r){let s=e._svg,a;if(!s&&(a=t.ownerDocument,s=dr(a,i,Ge),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const o=dr(a,"path",Ge);s.appendChild(o),o.__data__=e;const u=dr(a,"g",Ge);s.appendChild(u),u.__data__=e;const l=dr(a,"path",Ge);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||J8(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function J8(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Li=null,yt=null;const Q8={group(e,t,n){const i=Li=t.childNodes[2];yt=i.__values__,e.foreground(Qo,n,this),yt=t.__values__,Li=t.childNodes[1],e.content(Qo,n,this);const r=Li=t.childNodes[0];e.background(Qo,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==yt.events&&(Ot(i,"pointer-events",s),Ot(r,"pointer-events",s),yt.events=s),n.strokeForeground&&n.stroke){const a=n.fill;Ot(i,"display",null),this.style(r,n),Ot(r,"stroke",null),a&&(n.fill=null),yt=i.__values__,this.style(i,n),a&&(n.fill=a),Li=null}else Ot(i,"display","none")},image(e,t,n){n.smooth===!1?(rc(t,"image-rendering","optimizeSpeed"),rc(t,"image-rendering","pixelated")):rc(t,"image-rendering",null)},text(e,t,n){const i=Gu(n);let r,s,a,o;D(i)?(s=i.map(u=>$r(n,u)),r=s.join(` 3`),r!==yt.text&&(cn(t,0),a=t.ownerDocument,o=Sr(n),s.forEach((u,l)=>{const c=dr(a,"tspan",Ge);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",o)),t.appendChild(c)}),yt.text=r)):(s=$r(n,i),s!==yt.text&&(t.textContent=s,yt.text=s)),Ot(t,"font-family",Hu(n)),Ot(t,"font-size",xi(n)+"px"),Ot(t,"font-style",n.fontStyle),Ot(t,"font-variant",n.fontVariant),Ot(t,"font-weight",n.fontWeight)}};
3function Qo(e,t,n){t!==yt[e]&&(n?Z8(Li,e,t,n):Ot(Li,e,t),yt[e]=t)}function rc(e,t,n){n!==yt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),yt[t]=n)}function hr(e,t){for(const n in t)Ot(e,n,t[n])}function Ot(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Z8(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function _F(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class TF extends Vu{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=Y0();n.open("svg",se({},du,{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",RF,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=sn[n.marktype],r=i.tag,s=[FF,i.attr];t.open("g",{class:pF(n),"clip-path":n.clip?$0(this,n,n.group):null},SF(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const a=o=>{const u=this.href(o);if(u&&t.open("a",u),t.open(r,this.attr(n,o,s,r!=="g"?r:null)),r==="text"){const l=Gu(o);if(D(l)){const c={x:0,dy:Sr(o)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text($r(o,l[f])).close()}else t.text($r(o,l))}else if(r==="g"){const l=o.strokeForeground,c=o.fill,f=o.stroke;l&&f&&(o.stroke=null),t.open("path",this.attr(n,o,i.background,"bgrect")).close(),t.open("g",this.attr(n,o,i.content)),Pn(o,d=>this.mark(t,d)),t.close(),l&&f?(c&&(o.fill=null),o.stroke=f,t.open("path",this.attr(n,o,i.foreground,"bgrect")).close(),c&&(o.fill=c)):t.open("path",this.attr(n,o,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&a(n.items[0]):Pn(n,a),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 s={},a=(o,u,l,c)=>{s[c||o]=u};return Array.isArray(i)?i.forEach(o=>o(a,n,this)):i(a,n,this),r&&e9(s,n,t,r,this._defs),s}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 s in n){const a=n[s],o=a.stops;a.gradient==="radial"?(t.open("pattern",{id:Cc+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:a.x1,fy:a.y1,fr:a.r1,cx:a.x2,cy:a.y2,r:a.r2})):t.open("linearGradient",{id:s,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2});for(let u=0;u<o.length;++u)t.open("stop",{offset:o[u].offset,"stop-color":o[u].color}).close();t.close()}for(const s in i){const a=i[s];t.open("clipPath",{id:s}),a.path?t.open("path",{d:a.path}).close():t.open("rect",{x:0,y:0,width:a.width,height:a.height}).close(),t.close()}t.close()}}}function e9(e,t,n,i,r){let s;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&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Hu(t),e["font-size"]=xi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in Nc){let o=t[a];const u=Nc[a];o==="transparent"&&(u==="fill"||u==="stroke")||o!=null&&(w0(o)&&(o=jw(o,r.gradient,"")),e[u]=o)}for(const a in Mc){const o=t[a];o!=null&&(s=s||[],s.push(`${Mc[a]}: ${o};`))}return s&&(e.style=s.join(" ")),e}const $n={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function t9(e){$n.svgMarkTypes=e.svgMarkTypes??["text"],$n.svgOnTop=e.svgOnTop??!0,$n.debug=e.debug??!1}class Wp extends Vu{constructor(t){super(t),this._svgRenderer=new K0(t),this._canvasRenderer=new Tc(t)}initialize(t,n,i,r,s){this._root_el=He(t,0,"div");const a=He(this._root_el,0,"div"),o=He(this._root_el,1,"div");return this._root_el.style.position="relative",$n.debug||(a.style.height="100%",o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.height="100%",o.style.width="100%"),this._svgEl=$n.svgOnTop?o:a,this._canvasEl=$n.svgOnTop?a:o,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return $n.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(s=>!$n.svgMarkTypes.includes(s));this._svgRenderer.render(t,$n.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 $n.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class NF extends Xu{constructor(t,n){super(t,n)}initialize(t,n,i){const r=He(He(t,0,"div"),$n.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const MF="canvas",LF="hybrid",BF="png",PF="svg",IF="none",pr={Canvas:MF,PNG:BF,SVG:PF,Hybrid:LF,None:IF},bs={};bs[MF]=bs[BF]={renderer:Tc,headless:Tc,handler:Xu};bs[PF]={renderer:K0,headless:TF,handler:EF};bs[LF]={renderer:Wp,headless:Wp,handler:NF};bs[IF]={};function If(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(bs[e]=t,this):bs[e]}function zF(e,t,n){const i=[],r=new We().union(t),s=e.marktype;return s?UF(e,r,n,i):s==="group"?jF(e,r,n,i):S("Intersect scene must be mark node or group item.")}function UF(e,t,n,i){if(n9(e,t,n)){const r=e.items,s=e.marktype,a=r.length;let o=0;if(s==="group")for(;o<a;++o)jF(r[o],t,n,i);else for(const u=sn[s].isect;o<a;
vendor: 28,214 bytes, line 3
3++o){const l=r[o];qF(l,t,u)&&i.push(l)}}return i}function n9(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function jF(e,t,n,i){n&&n(e.mark)&&qF(e,t,sn.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const a=e.x||0,o=e.y||0;t.translate(-a,-o);for(let u=0;u<s;++u)UF(r[u],t,n,i);t.translate(a,o)}return i}function qF(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const ph=new We;function WF(e){const t=e.clip;if(ae(t))t(qu(ph.clear()));else if(t)ph.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(ph)}const i9=1e-9;function J0(e,t,n){return e===t?!0:n==="path"?GF(e,t):e instanceof Date&&t instanceof Date?+e==+t:ge(e)&&ge(t)?Math.abs(e-t)<=i9:!e||!t||!j(e)&&!j(t)?e==t:r9(e,t)}function GF(e,t){return J0(Sa(e),Sa(t))}function r9(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!J0(e[r],t[r],r))return!1;return typeof e==typeof t}function s9(){Yw(),D6()}const Da="top",On="left",Rn="right",kr="bottom",a9="top-left",o9="top-right",u9="bottom-left",l9="bottom-right",Q0="start",Gp="middle",Rt="end",c9="x",f9="y",zf="group",Z0="axis",e1="title",d9="frame",h9="scope",t1="legend",HF="row-header",VF="row-footer",XF="row-title",YF="column-header",KF="column-footer",JF="column-title",p9="padding",g9="symbol",QF="fit",ZF="fit-x",eS="fit-y",m9="pad",n1="none",Fl="all",Hp="each",i1="flush",gr="column",mr="row";function tS(e){F.call(this,null,e)}z(tS,F,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=sn[r],a=s.bound;let o=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),o=Sl(i,a),i.items.forEach(l=>{l.bounds.clear().union(o)});else if(r===zf||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),o.clear(),i.items.forEach(l=>o.union(Sl(l,a))),i.role){case Z0:case t1:case e1:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{o.union(Sl(l,a))}),t.visit(t.MOD,l=>{u=u||o.alignsWith(l.bounds),n.dirty(l),o.union(Sl(l,a))}),u&&(o.clear(),i.items.forEach(l=>o.union(l.bounds)));return WF(i),t.modifies("bounds")}});function Sl(e,t,n){return t(e.bounds.clear(),e,n)}const Qx=":vega_identifier:";function r1(e){F.call(this,0,e)}r1.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};z(r1,F,{transform(e,t){const n=y9(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function y9(e){return e._signals[Qx]||(e._signals[Qx]=e.add(0))}function nS(e){F.call(this,null,e)}z(nS,F,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,b9(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===zf?Rf:Of;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 b9(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 iS(e){F.call(this,null,e)}const Zx={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!rS(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},rS=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),ev=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(rS(r,s=e[n].bounds,t))return!0},x9=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},v9=(e,t,n)=>{var i=e.range(),r=new We;return t===Da||t===kr?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},tv=e=>(e.forEach(t=>t.opacity=1),e),nv=(e,t)=>e.reflow(t.modified()).modifies("opacity");z(iS,F,{transform(e,t){const n=Zx[e.method]||Zx.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,a;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(tv(r),t=nv(t,e)),t;if(r=r.filter(x9),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=tv(r),t=nv(t,e),s.length>=3&&ev(s,i)){do s=n(s,i);while(s.length>=3&&ev(s,i));s.length<3&&!ce(r).opacity&&(s.length>1&&(ce(s).opacity=0),ce(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(a=v9(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{a(u)||(u.opacity=0)}));const o=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&o.union(u.bounds)}),t}});function sS(e){F.call(this,null,e)}z(sS,F,{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 mt=new We;function fa(e,t,n){return e[t]===n?0:(e[t]=n,1)}function E9(e){var t=e.items[0].orient;return t===On||t===Rn}function A9(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function C9(e,t,n,i){var r=t.items[0],s=r.datum,a=r.translate!=null?r.translate:.5,o=r.orient,u=A9(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,p=r.maxExtent,h=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=h&&z0(h),b=0,v=0,A,E;switch(mt.clear().union(m),m.clear(),(A=u[0])>-1&&m.union(r.items[A].bounds),(A=u[1])>-1&&m.union(r.items[A].bounds),o){case Da:b=f||0,v=-c,E=Math.max(d,Math.min(p,-m.y1)),m.add(0,-E).add(l,0),h&&$l(e,h,E,g,y,0,-1,m);break;case On:b=-c,v=f||0,E=Math.max(d,Math.min(p,-m.x1)),m.add(-E,0).add(0,l),h&&$l(e,h,E,g,y,1,-1,m);break;case Rn:b=n+c,v=f||0,E=Math.max(d,Math.min(p,m.x2)),m.add(0,0).add(E,l),h&&$l(e,h,E,g,y,1,1,m);break;case kr:b=f||0,v=i+c,E=Math.max(d,Math.min(p,m.y2)),m.add(0,0).add(l,E),h&&$l(e,h,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return Vi(m.translate(b,v),r),fa(r,"x",b+a)|fa(r,"y",v+a)&&(r.bounds=mt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function $l(e,t,n,i,r,s,a,o){const u=t.bounds;if(t.auto){const l=a*(n+r+i);let c=0,f=0;e.dirty(t),s?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)}o.union(u)}const iv=(e,t)=>Math.floor(Math.min(e,t)),rv=(e,t)=>Math.ceil(Math.max(e,t));function w9(e){var t=e.items,n=t.length,i=0,r,s;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===zf)switch(r.role){case Z0:case t1:case e1:break;case HF:a.rowheaders.push(...s);break;case VF:a.rowfooters.push(...s);break;case YF:a.colheaders.push(...s);break;case KF:a.colfooters.push(...s);break;case XF:a.rowtitle=s[0];break;case JF:a.coltitle=s[0];break;default:a.marks.push(...s)}return a}function F9(e){return new We().set(0,0,e.width||0,e.height||0)}function S9(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Te(e,t,n){const i=j(e)?e[t]:e;return i??(n!==void 0?n:0)}function sv(e){return e<0?Math.ceil(-e):0}function aS(e,t,n){var i=!n.nodirty,r=n.bounds===i1?F9:S9,s=mt.set(0,0,0,0),a=Te(n.align,gr),o=Te(n.align,mr),u=Te(n.padding,gr),l=Te(n.padding,mr),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,p=Array(d),h=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),A=Array(d),E=Array(d),C,x,w,R,L,J,ne,de,N,O,I;for(x=0;x<c;++x)h[x]=0;for(x=0;x<f;++x)y[x]=0;for(x=0;x<d;++x)J=t[x],L=E[x]=r(J),J.x=J.x||0,v[x]=0,J.y=J.y||0,A[x]=0,w=x%c,R=~~(x/c),g=Math.max(g,ne=Math.ceil(L.x2)),b=Math.max(b,de=Math.ceil(L.y2)),h[w]=Math.max(h[w],ne),y[R]=Math.max(y[R],de),p[x]=u+sv(L.x1),m[x]=l+sv(L.y1),i&&e.dirty(t[x]);for(x=0;x<d;++x)x%c===0&&(p[x]=0),x<c&&(m[x]=0);if(a===Hp)for(w=1;w<c;++w){for(I=0,x=w;x<d;x+=c)I<p[x]&&(I=p[x]);for(x=w;x<d;x+=c)p[x]=I+h[w-1]}else if(a===Fl){for(I=0,x=0;x<d;++x)x%c&&I<p[x]&&(I=p[x]);for(x=0;x<d;++x)x%c&&(p[x]=I+g)}else for(a=!1,w=1;w<c;++w)for(x=w;x<d;x+=c)p[x]+=h[w-1];if(o===Hp)for(R=1;R<f;++R){for(I=0,x=R*c,C=x+c;x<C;++x)I<m[x]&&(I=m[x]);for(x=R*c;x<C;++x)m[x]=I+y[R-1]}else if(o===Fl){for(I=0,x=c;x<d;++x)I<m[x]&&(I=m[x]);for(x=c;x<d;++x)m[x]=I+b}else for(o=!1,R=1;R<f;++R)for(x=R*c,C=x+c;x<C;++x)m[x]+=y[R-1];for(N=0,x=0;x<d;++x)N=p[x]+(x%c?N:0),v[x]+=N-t[x].x;for(w=0;w<c;++w)for(O=0,x=w;x<d;x+=c)O+=m[x],A[x]+=O-t[x].y;if(a&&Te(n.center,gr)&&f>1)for(x=0;x<d;++x)L=a===Fl?g:h[x%c],N=L-E[x].x2-t[x].x-v[x],N>0&&(v[x]+=N/2);if(o&&Te(n.center,mr)&&c!==1)for(x=0;x<d;++x)L=o===Fl?b:y[~~(x/c)],O=L-E[x].y2-t[x].y-A[x],O>0&&(A[x]+=O/2);for(x=0;x<d;++x)s.union(E[x].translate(v[x],A[x]));switch(N=Te(n.anchor,c9),O=Te(n.anchor,f9),Te(n.anchor,gr)){case Rt:N-=s.width();break;case Gp:N-=s.width()/2}switch(Te(n.anchor,mr)){case Rt:O-=s.height();break;case Gp:O-=s.height()/2}for(N=Math.round(N),O=Math.round(O),s.clear(),x=0;x<d;++x)t[x].mark.bounds.clear();for(x=0;x<d;++x)J=t[x],J.x+=v[x]+=N,J.y+=A[x]+=O,s.union(J.mark.bounds.union(J.bounds.translate(v[x],A[x]))),i&&e.dirty(J);return s}function $9(e,t,n){var i=w9(t),r=i.marks,s=n.bounds===i1?k9:D9,a=n.offset,o=n.columns||r.length,u=o<=0?1:Math.ceil(r.length/o),l=u*o,c,f,d,p,h,g,m;const y=aS(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=Te(n.headerBand,mr,null),c=kl(e,i.rowheaders,r,o,u,-Te(a,"rowHeader"),iv,0,s,"x1",0,o,1,g)),i.colheaders&&(g=Te(n.headerBand,gr,null),f=kl(e,i.colheaders,r,o,o,-Te(a,"columnHeader"),iv,1,s,"y1",0,1,o,g)),i.rowfooters&&(g=Te(n.footerBand,mr,null),d=kl(e,i.rowfooters,r,o,u,Te(a,"rowFooter"),rv,0,s,"x2",o-1,o,1,g)),i.colfooters&&(g=Te(n.footerBand,gr,null),p=kl(e,i.colfooters,r,o,o,Te(a,"columnFooter"),rv,1,s,"y2",l-o,1,o,g)),i.rowtitle&&(h=Te(n.titleAnchor,mr),m=Te(a,"rowTitle"),m=h===Rt?d+m:c-m,g=Te(n.titleBand,mr,.5),av(e,i.rowtitle,m,0,y,g)),i.coltitle&&(h=Te(n.titleAnchor,gr),m=Te(a,"columnTitle"),m=h===Rt?p+m:f-m,g=Te(n.titleBand,gr,.5),av(e,i.coltitle,m,1,y,g))}function k9(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 D9(e,t){return e.bounds[t]}function kl(e,t,n,i,r,s,a,o,u,l,c,f,d,p){var h=n.length,g=0,m=0,y,b,v,A,E,C,x,w,R;if(!h)return g;for(y=c;y<h;y+=f)n[y]&&(g=a(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+=s,b=0,A=t.length;b<A;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,A=t.length;b<A;++b,y+=f){for(C=t[b],E=C.mark.bounds,v=y;v>=0&&(x=n[v])==null;v-=d);o?(w=p==null?x.x:Math.round(x.bounds.x1+p*x.bounds.width()),R=g):(w=g,R=p==null?x.y:Math.round(x.bounds.y1+p*x.bounds.height())),E.union(C.bounds.translate(w-(C.x||0),R-(C.y||0))),C.x=w,C.y=R,e.dirty(C),m=a(m,E[l])}return m}function av(e,t,n,i,r,s){if(t){e.dirty(t);var a=n,o=n;i?a=Math.round(r.x1+s*r.width()):o=Math.round(r.y1+s*r.height()),t.bounds.translate(a-(t.x||0),o-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=o,e.dirty(t)}}function O9(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function R9(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 _9(e,t,n,i,r,s,a){const o=O9(n,t),u=R9(e,o("offset",0)),l=o("anchor",Q0),c=l===Rt?1:l===Gp?.5:0,f={align:Hp,bounds:o("bounds",i1),columns:o("direction")==="vertical"?1:e.length,padding:o("margin",8),center:o("center"),nodirty:!0};switch(t){case On:f.anchor={x:Math.floor(i.x1)-u,column:Rt,y:c*(a||i.height()+2*i.y1),row:l};break;case Rn:f.anchor={x:Math.ceil(i.x2)+u,y:c*(a||i.height()+2*i.y1),row:l};break;case Da:f.anchor={y:Math.floor(r.y1)-u,row:Rt,x:c*(s||r.width()+2*r.x1),column:l};break;case kr:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case a9:f.anchor={x:u,y:u};break;case o9:f.anchor={x:s-u,y:u,column:Rt};break;case u9:f.anchor={x:u,y:a-u,row:Rt};break;case l9:f.anchor={x:s-u,y:a-u,column:Rt,row:Rt};break}return f}function T9(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,a=n.x,o=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),M9(e,n,n.items[0].items[0]),s=N9(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===g9&&L9(n.items[0].items[0].items[0].items),r!==n1&&(n.x=a=0,n.y=o=0),n.width=u,n.height=l,Vi(s.set(a,o,a+u,o+l),n),n.mark.bounds.clear().union(s),n}function N9(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function M9(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Eo(e,n,r,s);else{var a=t.items[1].items[0],o=a.anchor,u=t.titlePadding||0,l=i-a.x,c=i-a.y;switch(a.orient){case On:r+=Math.ceil(a.bounds.width())+u;break;case Rn:case kr:break;default:s+=a.bounds.height()+u}switch((r||s)&&Eo(e,n,r,s),a.orient){case On:c+=ea(t,n,a,o,1,1);break;case Rn:l+=ea(t,n,a,Rt,0,0)+u,c+=ea(t,n,a,o,1,1);break;case kr:l+=ea(t,n,a,o,0,0),c+=ea(t,n,a,Rt,-1,0,1)+u;break;default:l+=ea(t,n,a,o,0,0)}(l||c)&&Eo(e,a,l,c),(l=Math.round(a.bounds.x1-i))<0&&(Eo(e,n,-l,0),Eo(e,a,-l,0))}}function ea(e,t,n,i,r,s,a){const o=e.datum.type!=="symbol",u=n.datum.vgrad,l=o&&(s||!u)&&!a?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,p=r<=0?0:z0(n);return Math.round(i===Q0?f:i===Rt?d-p:.5*(c-p))}function Eo(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 L9(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 B9(e,t,n,i,r){var s=t.items[0],a=s.frame,o=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],p=o===On||o===Rn?i:n,h=0,g=0,m=0,y=0,b=0,v;if(a!==zf?o===On?(h=r.y2,p=r.y1):o===Rn?(h=r.y1,p=r.y2):(h=r.x1,p=r.x2):o===On&&(h=i,p=0),v=u===Q0?h:u===Rt?p:(h+p)/2,d&&d.text){switch(o){case Da:case kr:b=f.bounds.height()+c;break;case On:y=f.bounds.width()+c;break;case Rn:y=-f.bounds.width()-c;break}mt.clear().union(d.bounds),mt.translate(y-(d.x||0),b-(d.y||0)),fa(d,"x",y)|fa(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(mt),d.mark.bounds.clear().union(mt),e.dirty(d)),mt.clear().union(d.bounds)}else mt.clear();switch(mt.union(f.bounds),o){case Da:g=v,m=r.y1-mt.height()-l;break;case On:g=r.x1-mt.width()-l,m=v;break;case Rn:g=r.x2+mt.width()+l,m=v;break;case kr:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return fa(s,"x",g)|fa(s,"y",m)&&(mt.translate(g,m),e.dirty(s),s.bounds.clear().union(mt),t.bounds.clear().union(mt),e.dirty(s)),s.bounds}function oS(e){F.call(this,null,e)}z(oS,F,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&$9(n,i,e.layout),I9(n,i,e)}),P9(e.mark.group)?t.reflow():t}});function P9(e){return e&&e.mark.role!=="legend-entry"}function I9(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),a=new We().set(0,0,r,s),o=a.clone(),u=a.clone(),l=[],c,f,d,p,h,g;for(h=0,g=i.length;h<g;++h)switch(f=i[h],f.role){case Z0:p=E9(f)?o:u,p.union(C9(e,f,r,s));break;case e1:c=f;break;case t1:l.push(T9(e,f));break;case d9:case h9:case HF:case VF:case XF:case YF:case KF:case JF:o.union(f.bounds),u.union(f.bounds);break;default:a.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||Rn,d!==n1&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];aS(e,b,_9(b,y,n.legends,o,u,r,s))}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===QF||n.autosize.type===ZF||n.autosize.type===eS))switch(y.orient){case On:case Rn:a.add(b.x1,0).add(b.x2,0);break;case Da:case kr:a.add(0,b.y1).add(0,b.y2)}else a.union(b)})}a.union(o).union(u),c&&a.union(B9(e,c,r,s,a)),t.clip&&a.set(0,0,t.width||0,t.height||0),z9(e,t,a,n)}function z9(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let a=e._width,o=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)),p=Math.max(0,Math.ceil(n.y2-c));if(r.contains===p9){const h=e.padding();a-=h.left+h.right,o-=h.top+h.bottom}s===n1?(l=0,f=0,u=a,c=o):s===QF?(u=Math.max(0,a-l-d),c=Math.max(0,o-f-p)):s===ZF?(u=Math.max(0,a-l-d),o=c+f+p):s===eS?(a=u+l+d,c=Math.max(0,o-f-p)):s===m9&&(a=u+l+d,o=c+f+p),e._resizeView(a,o,u,c,[l,f],r.resize)}const U9=Object.freeze(Object.defineProperty({__proto__:null,bound:tS,identifier:r1,mark:nS,overlap:iS,render:sS,viewlayout:oS},Symbol.toStringTag,{value:"Module"}));function uS(e){F.call(this,null,e)}z(uS,F,{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,s=e.scale,a=e.count==null?e.values?e.values.length:10:e.count,o=A0(s,a,e.minstep),u=e.format||Mw(n,s,o,e.formatSpecifier,e.formatType,!!e.values),l=e.values?Nw(s,e.values,o):C0(s,o);return r&&(i.rem=r),r=l.map((c,f)=>be({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(be({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function lS(e){F.call(this,null,e)}function j9(){return be({})}function q9(e){const t=Ka().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}z(lS,F,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||j9,s=e.key||ee,a=this.value;return D(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(s))&&S("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=q9(s)),t.visit(t.ADD,o=>{const u=s(o);let l=a.get(u);l?l.exit?(a.empty--,i.add.push(l)):i.mod.push(l):(l=r(o),a.set(u,l),i.add.push(l)),l.datum=o,l.exit=!1}),t.visit(t.MOD,o=>{const u=s(o),l=a.get(u);l&&(l.datum=o,i.mod.push(l))}),t.visit(t.REM,o=>{const u=s(o),l=a.get(u);o===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}});function cS(e){F.call(this,null,e)}z(cS,F,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(D(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var a=s==="enter",o=r.update||ir,u=r.enter||ir,l=r.exit||ir,c=(s&&!a?r[s]:o)||ir;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),o(f,e)}),n.modifies(u.output),n.modifies(o.output),c!==ir&&c!==o&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ir&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),a||c!==ir){const f=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(f,d=>{const p=u(d,e)||i;(c(d,e)||p)&&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 fS(e){F.call(this,[],e)}z(fS,F,{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,s=e.type||Kl,a=e.scale,o=+e.limit,u=A0(a,e.count==null?5:e.count,e.minstep),l=!!e.values||s===Kl,c=e.format||Iw(n,a,u,s,e.formatSpecifier,e.formatType,l),f=e.values||Pw(a,u),d,p,h,g,m;return r&&(i.rem=r),s===Kl?(o&&f.length>o?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,o-1),m=!0):r=f,ae(h=e.size)?(!e.values&&a(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,h(b,e)),0)):h=kt(g=h||8),r=r.map((y,b)=>be({index:b,label:c(y,b,r),value:y,offset:g,size:h(y,e)})),m&&(m=f[r.length],r.push(be({index:r.length,label:`â¦${f.length-r.length} entries`,value:m,offset:g,size:h(m,e)})))):s===m6?(d=a.domain(),p=Rw(a,d[0],ce(d)),f.length<3&&!e.values&&d[0]!==ce(d)&&(f=[d[0],ce(d)]),r=f.map((y,b)=>be({index:b,label:c(y,b,f),value:y,perc:p(y)}))):(h=f.length-1,p=$6(a),r=f.map((y,b)=>be({index:b,label:c(y,b,f),value:y,perc:b?p(y):0,perc2:b===h?1:p(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const W9=e=>e.source.x,G9=e=>e.source.y,H9=e=>e.target.x,V9=e=>e.target.y;function s1(e){F.call(this,{},e)}s1.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"}]};z(s1,F,{transform(e,t){var n=e.sourceX||W9,i=e.sourceY||G9,r=e.targetX||H9,s=e.targetY||V9,a=e.as||"path",o=e.orient||"vertical",u=e.shape||"line",l=ov.get(u+"-"+o)||ov.get(u);return l||S("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[a]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(a)}});const dS=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,X9=(e,t,n,i)=>dS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),hS=(e,t,n,i)=>{var r=n-e,s=i-t,a=Math.hypot(r,s)/2,o=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+a+","+a+" "+o+" 0 1 "+n+","+i},Y9=(e,t,n,i)=>hS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),pS=(e,t,n,i)=>{const r=n-e,s=i-t,a=.2*(r+s),o=.2*(s-r);return"M"+e+","+t+"C"+(e+a)+","+(t+o)+" "+(n+o)+","+(i-a)+" "+n+","+i},K9=(e,t,n,i)=>pS(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),J9=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Q9=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Z9=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),a=Math.cos(n),o=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*a+","+t*o+"L"+i*a+","+i*o},eL=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},tL=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},nL=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),a=Math.cos(n),o=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*a+","+u*o+" "+i*a+","+i*o},ov=Ka({line:dS,"line-radial":X9,arc:hS,"arc-radial":Y9,curve:pS,"curve-radial":K9,"orthogonal-horizontal":J9,"orthogonal-vertical":Q9,"orthogonal-radial":Z9,"diagonal-horizontal":eL,"diagonal-vertical":tL,"diagonal-radial":nL});function a1(e){F.call(this,null,e)}a1.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"]}]};z(a1,F,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Ha,a=e.startAngle||0,o=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=a,d=(o-a)/y2(l),p=Ms(c),h,g,m;for(e.sort&&p.sort((y,b)=>l[y]-l[b]),h=0;h<c;++h)m=l[p[h]],g=u[p[h]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const iL=5;function rL(e){const t=e.type;return!e.bins&&(t===Ca||t===Lu||t===Bu)}function gS(e){return x0(e)&&e!==ui}const sL=Ln(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function mS(e){F.call(this,null,e),this.modified(!0)}z(mS,F,{transform(e,t){var n=t.dataflow,i=this.value,r=aL(e);(!i||r!==i.type)&&(this.value=i=me(r)());for(r in e)if(!sL[r]){if(r==="padding"&&gS(i.type))continue;ae(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return dL(i,e,fL(i,e,uL(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function aL(e){var t=e.type,n="",i;return t===ui?ui+"-"+Ca:(oL(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?ui+"-":i===3?eo+"-":""),(n+t||Ca).toLowerCase())}function oL(e){const t=e.type;return x0(t)&&t!==ms&&t!==ys&&(e.scheme||e.range&&e.range.length&&e.range.every(q))}function uL(e,t,n){const i=lL(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,a=t.zero||t.zero===void 0&&rL(e),o,u;if(!r)return 0;if((a||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(o=(r=r.slice()).length-1||1,a&&(r[0]>0&&(r[0]=0),r[o]<0&&(r[o]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[o]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[o]?o+1:u<r[0]?0:o;l!==o&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return gS(s)&&t.padding&&r[0]!==ce(r)&&(r=cL(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(yS(s,r,n)),s===g0&&e.unknown(t.domainImplicit?t_:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&A0(e,t.nice)||null),r.length}function lL(e,t,n){return t?(e.domain(yS(e.type,t,n)),t.length):-1}function cL(e,t,n,i,r,s){var a=Math.abs(ce(n)-n[0]),o=a/(a-2*i),u=e===qi?om(t,null,o):e===Bu?xc(t,null,o,.5):e===Lu?xc(t,null,o,r||1):e===Ff?um(t,null,o,s||1):am(t,null,o);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function yS(e,t,n){if(Sw(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+P(t))}return t}function fL(e,t,n){let i=t.bins;if(i&&!D(i)){const r=e.domain(),s=r[0],a=ce(r),o=i.step;let u=i.start==null?s:i.start,l=i.stop==null?a:i.stop;o||S("Scale bins parameter missing step property."),u<s&&(u=o*Math.ceil(s/o)),l>a&&(l=o*Math.floor(a/o)),i=Ms(u,l+o/2,o)}return i?e.bins=i:e.bins&&delete e.bins,e.type===m0&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function dL(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=hL(i,t,n);else if(t.scheme&&(s=pL(i,t,n),ae(s))){if(e.interpolator)return e.interpolator(s);S(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&$w(i))return e.interpolator(kf(Vp(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(v0(t.interpolate,t.interpolateGamma)):ae(e.round)?e.round(r):ae(e.rangeRound)&&e.interpolate(r?X5:Y5),s&&e.range(Vp(s,t.reverse))}function hL(e,t,n){e!==vw&&e!==_p&&S("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===_p?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*p0(n,r,i)]}function pL(e,t,n){var i=t.schemeExtent,r,s;return D(t.scheme)?s=kf(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=E0(r),s||S(`Unrecognized scheme name: ${t.scheme}`)),n=e===$f?n+1:e===m0?n-1:e===wa||e===Sf?+t.schemeCount||iL:n,$w(e)?uv(s,i,t.reverse):ae(s)?Ow(uv(s,i),n):e===g0?s:s.slice(0,n)}function uv(e,t,n){return ae(e)&&(t||n)?Dw(e,Vp(t||[0,1],n)):e}function Vp(e,t){return t?e.slice().reverse():e}function bS(e){F.call(this,null,e)}z(bS,F,{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(Ls(e.sort)),this.modified(n),t}});const lv="zero",xS="center",vS="normalize",ES=["y0","y1"];function o1(e){F.call(this,null,e)}o1.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:lv,values:[lv,xS,vS]},{name:"as",type:"string",array:!0,length:2,default:ES}]};z(o1,F,{transform(e,t){var n=e.as||ES,i=n[0],r=n[1],s=Ls(e.sort),a=e.field||Ha,o=e.offset===xS?gL:e.offset===vS?mL:yL,u,l,c,f;for(u=bL(t.source,e.groupby,s,a),l=0,c=u.length,f=u.max;l<c;++l)o(u[l],f,a,i,r);return t.reflow(e.modified()).modifies(n)}});function gL(e,t,n,i,r){for(var s=(t-e.sum)/2,a=e.length,o=0,u;o<a;++o)u=e[o],u[i]=s,u[r]=s+=Math.abs(n(u))}function mL(e,t,n,i,r){for(var s=1/e.sum,a=0,o=e.length,u=0,l=0,c;u<o;++u)c=e[u],c[i]=a,c[r]=a=s*(l+=Math.abs(n(c)))}function yL(e,t,n,i,r){for(var s=0,a=0,o=e.length,u=0,l,c;u<o;++u)c=e[u],l=+n(c),l<0?(c[i]=a,c[r]=a+=l):(c[i]=s,c[r]=s+=l)}function bL(e,t,n,i){var r=[],s=g=>g(c),a,o,u,l,c,f,d,p,h;if(t==null)r.push(e.slice());else for(a={},o=0,u=e.length;o<u;++o)c=e[o],f=t.map(s),d=a[f],d||(a[f]=d=[],r.push(d)),d.push(c);for(f=0,h=0,l=r.length;f<l;++f){for(d=r[f],o=0,p=0,u=d.length;o<u;++o)p+=Math.abs(i(d[o]));d.sum=p,p>h&&(h=p),n&&d.sort(n)}return r.max=h,r}const xL=Object.freeze(Object.defineProperty({__proto__:null,axisticks:uS,datajoin:lS,encode:cS,legendentries:fS,linkpath:s1,pie:a1,scale:mS,sortitems:bS,stack:o1},Symbol.toStringTag,{value:"Module"})),vL=b2(),Xp=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","t
3ilt"];function EL(e,t){return function n(){const i=t();return i.type=e,i.path=b2().projection(i),i.copy=i.copy||function(){const r=n();return Xp.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},ww(i)}}function u1(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Lc[e]=EL(e,t),this):Lc[e]||null}function AS(e){return e&&e.path||vL}const Lc={albers:r5,albersusa:i5,azimuthalequalarea:n5,azimuthalequidistant:t5,conicconformal:e5,conicequalarea:ZR,conicequidistant:QR,equalEarth:JR,equirectangular:KR,gnomonic:YR,identity:XR,mercator:VR,mollweide:HR,naturalEarth1:GR,orthographic:WR,stereographic:qR,transversemercator:jR};for(const e in Lc)u1(e,Lc[e]);function AL(){}const Oi=[[],[[[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 CS(){var e=1,t=1,n=o;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),CL(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var p=0,h=c.length,g;p<h;++p)if(wL((g=c[p])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],p,h,g,m,y,b;for(p=h=-1,m=u[0]>=l,Oi[m<<1].forEach(v);++p<e-1;)g=m,m=u[p+1]>=l,Oi[g|m<<1].forEach(v);for(Oi[m<<0].forEach(v);++h<t-1;){for(p=-1,m=u[h*e+e]>=l,y=u[h*e]>=l,Oi[m<<1|y<<2].forEach(v);++p<e-1;)g=m,m=u[h*e+e+p+1]>=l,b=y,y=u[h*e+p+1]>=l,Oi[g|m<<1|y<<2|b<<3].forEach(v);Oi[m|y<<3].forEach(v)}for(p=-1,y=u[h*e]>=l,Oi[y<<2].forEach(v);++p<e-1;)b=y,y=u[h*e+p+1]>=l,Oi[y<<2|b<<3].forEach(v);Oi[y<<3].forEach(v);function v(A){var E=[A[0][0]+p,A[0][1]+h],C=[A[1][0]+p,A[1][1]+h],x=a(E),w=a(C),R,L;(R=d[x])?(L=f[w])?(delete d[R.end],delete f[L.start],R===L?(R.ring.push(C),c(R.ring)):f[R.start]=d[L.end]={start:R.start,end:L.end,ring:R.ring.concat(L.ring)}
vendor: 47,791 bytes, line 3
3):(delete d[R.end],R.ring.push(C),d[R.end=w]=R):(R=f[w])?(L=d[x])?(delete f[R.start],delete d[L.end],R===L?(R.ring.push(C),c(R.ring)):f[L.start]=d[R.end]={start:L.start,end:R.end,ring:L.ring.concat(R.ring)}):(delete f[R.start],R.ring.unshift(E),f[R.start=x]=R):f[x]=d[w]={start:x,end:w,ring:[E,C]}}}function a(u){return u[0]*2+u[1]*(e+1)*4}function o(u,l,c){u.forEach(f=>{var d=f[0],p=f[1],h=d|0,g=p|0,m,y=l[g*e+h];d>0&&d<e&&h===d&&(m=l[g*e+h-1],f[0]=d+(c-m)/(y-m)-.5),p>0&&p<t&&g===p&&(m=l[(g-1)*e+h],f[1]=p+(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||S("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?o:AL,i):n===o},i}function CL(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 wL(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=FL(e,t[n]))return r;return 0}function FL(e,t){for(var n=t[0],i=t[1],r=-1,s=0,a=e.length,o=a-1;s<a;o=s++){var u=e[s],l=u[0],c=u[1],f=e[o],d=f[0],p=f[1];if(SL(u,f,t))return 0;c>i!=p>i&&n<(d-l)*(i-c)/(p-c)+l&&(r=-r)}return r}function SL(e,t,n){var i;return $L(e,t,n)&&kL(e[i=+(e[0]===t[0])],n[i],t[i])}function $L(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function kL(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function wS(e,t,n){return function(i){var r=di(i),s=n?Math.min(r[0],0):r[0],a=r[1],o=a-s,u=t?au(s,a,e):o/(e+1);return Ms(s+u,a,u)}}function l1(e){F.call(this,null,e)}l1.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"}]};z(l1,F,{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||$t,s=CS().smooth(e.smooth!==!1),a=e.thresholds||DL(i,r,e),o=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,D(a)?a:a(c.values));OL(f,c,l,e),f.forEach(d=>{u.push(mf(l,be(o!=null?{[o]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function DL(e,t,n){const i=wS(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Yo(t(r).values)))}function OL(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(ae(r)&&(r=r(n,i)),ae(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const a=(ge(r)?r:r[0])||1,o=(ge(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(FS(t,a,o,u,l))}function FS(e,t,n,i,r){const s=e.x1||0,a=e.y1||0,o=t*n<0;function u(f){f.forEach(l)}function l(f){o&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-a)*n+r}return function(f){return f.coordinates.forEach(u),f}}function cv(e,t,n){const i=e>=0?e:km(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function gh(e){return ae(e)?e:kt(+e)}function SS(){var e=u=>u[0],t=u=>u[1],n=Ha,i=[-1,-1],r=960,s=500,a=2;function o(u,l){const c=cv(i[0],u,e)>>a,f=cv(i[1],u,t)>>a,d=c?c+2:0,p=f?f+2:0,h=2*d+(r>>a),g=2*p+(s>>a),m=new Float32Array(h*g),y=new Float32Array(h*g);let b=m;u.forEach(A=>{const E=d+(+e(A)>>a),C=p+(+t(A)>>a);E>=0&&E<h&&C>=0&&C<g&&(m[E+C*h]+=+n(A))}),c>0&&f>0?(ta(h,g,m,y,c),na(h,g,y,m,f),ta(h,g,m,y,c),na(h,g,y,m,f),ta(h,g,m,y,c),na(h,g,y,m,f)):c>0?(ta(h,g,m,y,c),ta(h,g,y,m,c),ta(h,g,m,y,c),b=y):f>0&&(na(h,g,m,y,f),na(h,g,y,m,f),na(h,g,m,y,f),b=y);const v=l?Math.pow(2,-2*a):1/y2(b);for(let A=0,E=h*g;A<E;++A)b[A]*=v;return{values:b,scale:1<<a,width:h,height:g,x1:d,y1:p,x2:d+(r>>a),y2:p+(s>>a)}}return o.x=function(u){return arguments.length?(e=gh(u),o):e},o.y=function(u){return arguments.length?(t=gh(u),o):t},o.weight=function(u){return arguments.length?(n=gh(u),o):n},o.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||S("invalid size"),r=l,s=c,o},o.cellSize=function(u){return arguments.length?((u=+u)>=1||S("invalid cell size"),a=Math.floor(Math.log(u)/Math.LN2),o):1<<a},o.bandwidth=function(u){return arguments.length?(u=W(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&S("invalid bandwidth"),i=u,o):i},o}function ta(e,t,n,i,r){const s=(r<<1)+1;for(let a=0;a<t;++a)for(let o=0,u=0;o<e+r;++o)o<e&&(u+=n[o+a*e]),o>=r&&(o>=s&&(u-=n[o-s+a*e]),i[o-r+a*e]=u/Math.min(o+1,e-1+s-o,s))}function na(e,t,n,i,r){const s=(r<<1)+1;for(let a=0;a<e;++a)for(let o=0,u=0;o<t+r;++o)o<t&&(u+=n[a+o*e]),o>=r&&(o>=s&&(u-=n[a+(o-s)*e]),i[a+(o-r)*e]=u/Math.min(o+1,t-1+s-o,s))}function c1(e){F.call(this,null,e)}c1.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 RL=["x","y","weight","size","cellSize","bandwidth"];function $S(e,t){return RL.forEach(n=>t[n]!=null?e[n](t[n]):0),e}z(c1,F,{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=_L(i,e.groupby),s=(e.groupby||[]).map(ze),a=$S(SS(),e),o=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>be(l({[o]:a(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function _L(e,t){var n=[],i=c=>c(o),r,s,a,o,u,l;if(t==null)n.push(e);else for(r={},s=0,a=e.length;s<a;++s)o=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(o);return n}function f1(e){F.call(this,null,e)}f1.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}]};z(f1,F,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=CS().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||wS(e.count||10,e.nice,!!r),a=e.size,o,u;return r||(r=t.materialize(t.SOURCE).source,o=$S(SS(),e)(r,!0),u=FS(o,o.scale||1,o.scale||1,0,0),a=[o.width,o.height],r=o.values),s=D(s)?s:s(r),r=i.size(a)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(be),n}});const Yp="Feature",d1="FeatureCollection",TL="MultiPoint";function h1(e){F.call(this,null,e)}h1.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};z(h1,F,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],a=r&&r[1],o=e.geojson||!r&&$t,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Et(o))||s&&t.modified(Et(s))||a&&t.modified(Et(a)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),o&&t.visit(u,c=>n.push(o(c))),s&&a&&(t.visit(u,c=>{var f=s(c),d=a(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Yp,geometry:{type:TL,coordinates:i}})),this.value={type:d1,features:n}}});function p1(e){F.call(this,null,e)}p1.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"}]};z(p1,F,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||$t,s=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=AS(e.projection),n.materialize().reflow()):a=r===$t||t.modified(r.fields)?n.ADD_MOD:n.ADD;const o=NL(i,e.pointRadius);return n.visit(a,u=>u[s]=i(r(u))),i.pointRadius(o),n.modifies(s)}});function NL(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function g1(e){F.call(this,null,e)}g1.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"]}]};z(g1,F,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],a=s[0],o=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[a]=f[0],c[o]=f[1]):(c[a]=void 0,c[o]=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(s)}});function m1(e){F.call(this,null,e)}m1.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"}]};z(m1,F,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=ML(AS(e.projection),e.field||gn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,a=>a[r]=i),n.modifies(r)}});function ML(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),a=e.pointRadius(n)(t(r));return e.pointRadius(s),a};return i.context=r=>(e.context(r),i),i}function y1(e){F.call(this,[],e),this.generator=s5()}y1.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}]};z(y1,F,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)ae(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(kC(n[0],r)):t.add.push(be(r)),n[0]=r,t}});function b1(e){F.call(this,null,e)}b1.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"}]};z(b1,F,{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||$t,s=BL(e.opacity,e),a=LL(e.color,e),o=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Yo(n.map(l=>Yo(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=se({},l,u);i||(f.$max=Yo(c.values||[])),l[o]=PL(c,f,a.dep?a:kt(a(f)),s.dep?s:kt(s(f)))}),t.reflow(!0).modifies(o)}});function LL(e,t){let n;return ae(e)?(n=i=>yc(e(i,t)),n.dep=kS(e)):n=kt(yc(e||"#888")),n}function BL(e,t){let n;return ae(e)?(n=i=>e(i,t),n.dep=kS(e)):e?n=kt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function kS(e){if(!ae(e))return!1;const t=Ln(Et(e));return t.$x||t.$y||t.$value||t.$max}function PL(e,t,n,i){const r=e.width,s=e.height,a=e.x1||0,o=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:cr,d=Er(u-a,l-o),p=d.getContext("2d"),h=p.getImageData(0,0,u-a,l-o),g=h.data;for(let m=o,y=0;m<l;++m){t.$y=m-o;for(let b=a,v=m*r;b<u;++b,y+=4){t.$x=b-a,t.$value=f(b+v);const A=n(t);g[y+0]=A.r,g[y+1]=A.g,g[y+2]=A.b,g[y+3]=~~(255*i(t))}}return p.putImageData(h,0,0),d}function DS(e){F.call(this,null,e),this.modified(!0)}z(DS,F,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=zL(e.type),Xp.forEach(i=>{e[i]!=null&&fv(n,i,e[i])})):Xp.forEach(i=>{e.modified(i)&&fv(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&IL(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function IL(e,t){const n=UL(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function zL(e){const t=u1((e||"mercator").toLowerCase());return t||S("Unrecognized projection type: "+e),t()}function fv(e,t,n){ae(e[t])&&e[t](n)}function UL(e){return e=W(e),e.length===1?e[0]:{type:d1,features:e.reduce((t,n)=>t.concat(jL(n)),[])}}function jL(e){return e.type===d1?e.features:W(e).filter(t=>t!=null).map(t=>t.type===Yp?t:{type:Yp,geometry:t})}const qL=Object.freeze(Object.defineProperty({__proto__:null,contour:f1,geojson:h1,geopath:p1,geopoint:g1,geoshape:m1,graticule:y1,heatmap:b1,isocontour:l1,kde2d:c1,projection:DS},Symbol.toStringTag,{value:"Module"})),dv={center:d5,collide:f5,nbody:c5,link:l5,x:u5,y:o5},jo="forces",Kp=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],WL=["static","iterations"],OS=["x","y","vx","vy"];function x1(e){F.call(this,null,e)}x1.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:OS}]};z(x1,F,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Kp),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&RS(n,e,0,t)):(this.value=n=HL(t.source,e),n.on("tick",GL(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(WL)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=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 o=this._argops,u=0,l=o.length,c;u<l;++u)if(c=o[u],!(c.name!==jo||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,a;r<s;++r)if(i[r].name==="links"&&(a=i[r].op.source)){n.pulse(a,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(OS)}});function GL(e,t){return()=>e.touch(t).run()}function HL(e,t){const n=a5(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),RS(n,t,!0).on("end",()=>s=!0)}function RS(e,t,n,i){var r=W(t.forces),s,a,o,u;for(s=0,a=Kp.length;s<a;++s)o=Kp[s],o!==jo&&t.modified(o)&&e[o](t[o]);for(s=0,a=r.length;s<a;++s)u=jo+s,o=n||t.modified(jo,s)?XL(r[s]):i&&VL(r[s],i)?e.force(u):null,o&&e.force(u,o);for(a=e.numForces||0;s<a;++s)e.force(jo+s,null);return e.numForces=r.length,e}function VL(e,t){var n,i;for(n in e)if(ae(i=e[n])&&t.modified(Et(i)))return 1;return 0}function XL(e){var t,n;H(dv,e.force)||S("Unrecognized force: "+e.force),t=dv[e.force]();for(n in e)ae(t[n])&&YL(t[n],e[n],e);return t}function YL(e,t,n){e(ae(t)?i=>t(i,n):t)}const KL=Object.freeze(Object.defineProperty({__proto__:null,force:x1},Symbol.toStringTag,{value:"Module"}));function Jp(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function v1(e){F.call(this,null,e)}v1.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const JL=e=>e.values;z(v1,F,{transform(e,t){t.source||S("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(a=>{a.children&&gf(a.data)&&r.rem.push(a.data)}),this.value=s=C_({values:W(e.keys).reduce((a,o)=>(a.key(o),a),QL()).entries(r.source)},JL),n&&s.each(a=>{a.children&&(a=be(a.data),r.add.push(a),r.source.push(a))}),Jp(s,ee,ee)),r.source.root=s,r}});function QL(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const a=r.length,o=e[s++],u={},l={};let c=-1,f,d,p;for(;++c<a;)f=o(d=r[c])+"",(p=u[f])?p.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const a=[];for(const o in r)a.push({key:o,values:i(r[o],s)});return a}return t}function Xi(e){F.call(this,null,e)}const ZL=(e,t)=>e.parent===t.parent?1:2;z(Xi,F,{transform(e,t){(!t.source||!t.source.root)&&S(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Ls(e.sort,a=>a.data)),eB(n,this.params,e),n.separation&&n.separation(e.separation!==!1?ZL:Ha);try{this.value=n(r)}catch(a){S(a)}return r.each(a=>tB(a,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function eB(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function tB(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const Qp=["x","y","r","depth","children"];function E1(e){Xi.call(this,e)}E1.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:Qp.length,default:Qp}]};z(E1,Xi,{layout:h5,params:["radius","size","padding"],fields:Qp});const Zp=["x0","y0","x1","y1","depth","children"];function A1(e){Xi.call(this,e)}A1.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:Zp.length,default:Zp}]};z(A1,Xi,{layout:p5,params:["size","round","padding"],fields:Zp});function C1(e){F.call(this,null,e)}C1.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};z(C1,F,{transform(e,t){t.source||S("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?Jp(rx().id(e.key).parentId(e.parentKey)(r.source),e.key,mn):Jp(rx()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const hv={tidy:m5,cluster:g5},eg=["x","y","depth","children"];function w1(e){Xi.call(this,e)}w1.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:eg.length,default:eg}]};z(w1,Xi,{layout(e){const t=e||"tidy";if(H(hv,t))return hv[t]();S("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:eg});function F1(e){F.call(this,[],e)}F1.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};z(F1,F,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||S("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,a=>s[ee(a)]=1),i.each(a=>{const o=a.data,u=a.parent&&a.parent.data;u&&s[ee(o)]&&s[ee(u)]&&r.add.push(be({source:u,target:o}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,a=>s[ee(a)]=1),n.forEach(a=>{(s[ee(a.source)]||s[ee(a.target)])&&r.mod.push(a)})),r}});const pv={binary:x5,dice:$_,slice:S_,slicedice:b5,squarify:F_,resquarify:y5},tg=["x0","y0","x1","y1","depth","children"];function S1(e){Xi.call(this,e)}S1.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:tg.length,default:tg}]};z(S1,Xi,{layout(){const e=w_();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{H(pv,t)?e.tile(pv[t]):S("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:tg});const nB=Object.freeze(Object.defineProperty({__proto__:null,nest:v1,pack:E1,partition:A1,stratify:C1,tree:w1,treelinks:F1,treemap:S1},Symbol.toStringTag,{value:"Module"})),mh=4278190080;function iB(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function rB(e,t,n,i,r){const s=e.width,a=e.height,o=i||r,u=Er(s,a).getContext("2d"),l=Er(s,a).getContext("2d"),c=o&&Er(s,a).getContext("2d");n.forEach(w=>sc(u,w,!1)),sc(l,t,!1),o&&sc(c,t,!0);const f=yh(u,s,a),d=yh(l,s,a),p=o&&yh(c,s,a),h=e.bitmap(),g=o&&e.bitmap();let m,y,b,v,A,E,C,x;for(y=0;y<a;++y)for(m=0;m<s;++m)A=y*s+m,E=f[A]&mh,x=d[A]&mh,C=o&&p[A]&mh,(E||C||x)&&(b=e(m),v=e(y),!r&&(E||x)&&h.set(b,v),o&&(E||C)&&g.set(b,v));return[h,g]}function yh(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function sc(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>sc(e,s.items,n))}):sn[i].draw(e,{items:n?t.map(sB):t})}function sB(e){const t=mf(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ri=5,Dt=31,hu=32,ur=new Uint32Array(hu+1),Dn=new Uint32Array(hu+1);Dn[0]=0;ur[0]=~Dn[0];for(let e=1;e<=hu;++e)Dn[e]=Dn[e-1]<<1|1,ur[e]=~Dn[e];function aB(e,t){const n=new Uint32Array(~~((e*t+hu)/hu));function i(s,a){n[s]|=a}function r(s,a){n[s]&=a}return{array:n,get:(s,a)=>{const o=a*e+s;return n[o>>>Ri]&1<<(o&Dt)},set:(s,a)=>{const o=a*e+s;i(o>>>Ri,1<<(o&Dt))},clear:(s,a)=>{const o=a*e+s;r(o>>>Ri,~(1<<(o&Dt)))},getRange:(s,a,o,u)=>{let l=u,c,f,d,p;for(;l>=a;--l)if(c=l*e+s,f=l*e+o,d=c>>>Ri,p=f>>>Ri,d===p){if(n[d]&ur[c&Dt]&Dn[(f&Dt)+1])return!0}else{if(n[d]&ur[c&Dt]||n[p]&Dn[(f&Dt)+1])return!0;for(let h=d+1;h<p;++h)if(n[h])return!0}return!1},setRange:(s,a,o,u)=>{let l,c,f,d,p;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Ri,d=c>>>Ri,f===d)i(f,ur[l&Dt]&Dn[(c&Dt)+1]);else for(i(f,ur[l&Dt]),i(d,Dn[(c&Dt)+1]),p=f+1;p<d;++p)i(p,4294967295)},clearRange:(s,a,o,u)=>{let l,c,f,d,p;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Ri,d=c>>>Ri,f===d)r(f,Dn[l&Dt]|ur[(c&Dt)+1]);else for(r(f,Dn[l&Dt]),r(d,ur[(c&Dt)+1]),p=f+1;p<d;++p)r(p,0)},outOfBounds:(s,a,o,u)=>s<0||a<0||u>=t||o>=e}}function oB(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),a=o=>~~((o+n)/i);return a.invert=o=>o*i-n,a.bitmap=()=>aB(r,s),a.ratio=i,a.padding=n,a.width=e,a.height=t,a}function uB(e,t,n,i){const r=e.width,s=e.height;return function(a){const o=a.datum.datum.items[i].items,u=o.length,l=a.datum.fontSize,c=Zt.width(a.datum,a.datum.text);let f=0,d,p,h,g,m,y,b;for(let v=0;v<u;++v)d=o[v].x,h=o[v].y,p=o[v].x2===void 0?d:o[v].x2,g=o[v].y2===void 0?h:o[v].y2,m=(d+p)/2,y=(h+g)/2,b=Math.abs(p-d+g-h),b>=f&&(f=b,a.x=m,a.y=y);return m=c/2,y=l/2,d=a.x-m,p=a.x+m,h=a.y-y,g=a.y+y,a.align="center",d<0&&p<=r?a.align="left":0<=d&&r<p&&(a.align="right"),a.baseline="middle",h<0&&g<=s?a.baseline="top":0<=h&&s<g&&(a.baseline="bottom"),!0}}function Bc(e,t,n,i,r,s){let a=n/2;return e-a<0||e+a>r||t-(a=i/2)<0||t+a>s}function yr(e,t,n,i,r,s,a,o){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||o&&o.getRange(l,f,c,d)}function lB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1];function u(l,c,f,d,p){const h=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Bc(h,g,d,p,r,s)&&!yr(e,h,g,p,d,m,a,o)&&!yr(e,h,g,p,d,p,a,null)){for(;y-m>=1;)b=(m+y)/2,yr(e,h,g,p,d,b,a,o)?y=b:m=b;if(m>f)return[h,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=Zt.width(l.datum,l.datum.text);let h=n?d:0,g=!1,m=!1,y=0,b,v,A,E,C,x,w,R,L,J,ne,de,N,O,I,G,X;for(let V=0;V<f;++V){for(b=c[V].x,A=c[V].y,v=c[V].x2===void 0?b:c[V].x2,E=c[V].y2===void 0?A:c[V].y2,b>v&&(X=b,b=v,v=X),A>E&&(X=A,A=E,E=X),L=e(b),ne=e(v),J=~~((L+ne)/2),de=e(A),O=e(E),N=~~((de+O)/2),w=J;w>=L;--w)for(R=N;R>=de;--R)G=u(w,R,h,p,d),G&&([l.x,l.y,h,g]=G);for(w=J;w<=ne;++w)for(R=N;R<=O;++R)G=u(w,R,h,p,d),G&&([l.x,l.y,h,g]=G);!g&&!n&&(I=Math.abs(v-b+E-A),C=(b+v)/2,x=(A+E)/2,I>=y&&!Bc(C,x,p,d,r,s)&&!yr(e,C,x,d,p,d,a,null)&&(y=I,l.x=C,l.y=x,m=!0))}return g||m?(C=p/2,x=d/2,a.setRange(e(l.x-C),e(l.y-x),e(l.x+C),e(l.y+x)),l.align="center",l.baseline="middle",!0):!1}}const cB=[-1,-1,1,1],fB=[-1,1,-1,1];function dB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=Zt.width(l.datum,l.datum.text),h=[];let g=n?d:0,m=!1,y=!1,b=0,v,A,E,C,x,w,R,L,J,ne,de,N;for(let O=0;O<f;++O){for(v=c[O].x,E=c[O].y,A=c[O].x2===void 0?v:c[O].x2,C=c[O].y2===void 0?E:c[O].y2,h.push([e((v+A)/2),e((E+C)/2)]);h.length;)if([R,L]=h.pop(),!(a.get(R,L)||o.get(R,L)||u.get(R,L))){u.set(R,L);for(let I=0;I<4;++I)x=R+cB[I],w=L+fB[I],u.outOfBounds(x,w,x,w)||h.push([x,w]);if(x=e.invert(R),w=e.invert(L),J=g,ne=s,!Bc(x,w,p,d,r,s)&&!yr(e,x,w,d,p,J,a,o)&&!yr(e,x,w,d,p,d,a,null)){for(;ne-J>=1;)de=(J+ne)/2,yr(e,x,w,d,p,de,a,o)?ne=de:J=de;J>g&&(l.x=x,l.y=w,g=J,m=!0)}}!m&&!n&&(N=Math.abs(A-v+C-E),x=(v+A)/2,w=(E+C)/2,N>=b&&!Bc(x,w,p,d,r,s)&&!yr(e,x,w,d,p,d,a,null)&&(b=N,l.x=x,l.y=w,y=!0))}return m||y?(x=p/2,w=d/2,a.setRange(e(l.x-x),e(l.y-w),e(l.x+x),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const hB=["right","center","left"],pB=["bottom","middle","top"];function gB(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=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]>s)return!1;let d=l.textWidth??0,p,h,g,m,y,b,v,A,E,C,x,w,R,L,J;for(let ne=0;ne<u;++ne){if(p=(n[ne]&3)-1,h=(n[ne]>>>2&3)-1,g=p===0&&h===0||i[ne]<0,m=p&&h?Math.SQRT1_2:1,y=i[ne]<0?-1:1,b=c[1+p]+i[ne]*p*m,x=c[4+h]+y*f*h/2+i[ne]*h*m,A=x-f/2,E=x+f/2,w=e(b),L=e(A),J=e(E),!d)if(gv(w,w,L,J,a,o,b,b,A,E,c,g))d=Zt.width(l.datum,l.datum.text);else continue;if(C=b+y*d*p/2,b=C-d/2,v=C+d/2,w=e(b),R=e(v),gv(w,R,L,J,a,o,b,v,A,E,c,g))return l.x=p?p*y<0?v:b:C,l.y=h?h*y<0?E:A:x,l.align=hB[p*y+1],l.baseline=pB[h*y+1],a.setRange(w,L,R,J),!0}return!1}}function gv(e,t,n,i,r,s,a,o,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const bh=0,xh=4,vh=8,Eh=0,Ah=1,Ch=2,mB={"top-left":bh+Eh,top:bh+Ah,"top-right":bh+Ch,left:xh+Eh,middle:xh+Ah,right:xh+Ch,"bottom-left":vh+Eh,bottom:vh+Ah,"bottom-right":vh+Ch},yB={naive:uB,"reduced-search":lB,floodfill:dB};function bB(e,t,n,i,r,s,a,o,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=xB(i,f),p=vB(r,f),h=EB(e[0].datum),g=h==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=AB(h,g,o,u),b=l===null||l===1/0,v=m&&c==="naive";let A=-1,E=-1;const C=e.map(L=>{const J=b?Zt.width(L,L.text):void 0;return A=Math.max(A,J),E=Math.max(E,L.fontSize),{datum:L,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(L),textWidth:J}});l=l===null||l===1/0?Math.max(A,E)+Math.max(...i):l;const x=oB(t[0],t[1],l);let w;if(!v){n&&C.sort((ne,de)=>n(ne.datum,de.datum));let L=!1;for(let ne=0;ne<p.length&&!L;++ne)L=p[ne]===5||d[ne]<0;const J=(h&&a||m)&&e.map(ne=>ne.datum);w=s.length||J?rB(x,J||[],s,L,m):iB(x,a&&C)}const R=m?yB[c](x,w,a,u):gB(x,w,p,d);return C.forEach(L=>L.opacity=+R(L)),C}function xB(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 vB(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=mB[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function EB(e){return e&&e.mark&&e.mark.marktype}function AB(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const a=s.datum.items[i].items;return r(a.length?a[n==="start"?0:a.length-1]:{x:NaN,y:NaN})}:s=>{const a=s.datum.bounds;return[a.x1,(a.x1+a.x2)/2,a.x2,a.y1,(a.y1+a.y2)/2,a.y2]}:r}const ng=["x","y","opacity","align","baseline"],_S=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $1(e){F.call(this,null,e)}$1.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:_S},{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:ng.length,default:ng}]};z($1,F,{transform(e,t){function n(s){const a=e[s];return ae(a)&&t.modified(a.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&S("Size parameter should be specified as a [width, height] array.");const r=e.as||ng;return bB(t.materialize(t.SOURCE).source||[],e.size,e.sort,W(e.offset==null?1:e.offset),W(e.anchor||_S),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const a=s.datum;a[r[0]]=s.x,a[r[1]]=s.y,a[r[2]]=s.opacity,a[r[3]]=s.align,a[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const CB=Object.freeze(Object.defineProperty({__proto__:null,label:$1},Symbol.toStringTag,{value:"Module"}));function TS(e,t){var n=[],i=function(c){return c(o)},r,s,a,o,u,l;if(t==null)n.push(e);else for(r={},s=0,a=e.length;s<a;++s)o=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(o);return n}function k1(e){F.call(this,null,e)}k1.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}]};z(k1,F,{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=TS(i,e.groupby),s=(e.groupby||[]).map(ze),a=s.length,o=e.as||[ze(e.x),ze(e.y)],u=[];r.forEach(l=>{HC(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<a;++d)f[s[d]]=l.dims[d];f[o[0]]=c[0],f[o[1]]=c[1],u.push(be(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const ig={constant:zm,linear:Um,log:jC,exp:qC,pow:WC,quad:jm,poly:GC},wB=(e,t)=>e==="poly"?t:e==="quad"?2:1;function D1(e){F.call(this,null,e)}D1.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(ig)},{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}]};z(D1,F,{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=TS(i,e.groupby),s=(e.groupby||[]).map(ze),a=e.method||"linear",o=e.order==null?3:e.order,u=wB(a,o),l=e.as||[ze(e.x),ze(e.y)],c=ig[a],f=[];let d=e.extent;H(ig,a)||S("Invalid regression method: "+a),d!=null&&a==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(p=>{if(p.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(p,e.x,e.y,o);if(e.params){f.push(be({keys:p.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||di(p,e.x),y=b=>{const v={};for(let A=0;A<s.length;++A)v[s[A]]=p.dims[A];v[l[0]]=b[0],v[l[1]]=b[1],f.push(be(v))};a==="linear"||a==="constant"?m.forEach(b=>y([b,g.predict(b)])):Cf(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const FB=Object.freeze(Object.defineProperty({__proto__:null,loess:k1,regression:D1},Symbol.toStringTag,{value:"Module"}));function O1(e){F.call(this,null,e)}O1.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 SB=[-1e5,-1e5,1e5,1e5];z(O1,F,{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]]:SB;const s=this.value=v5.from(i,e.x,e.y).voronoi(r);for(let a=0,o=i.length;a<o;++a){const u=s.cellPolygon(a);i[a][n]=u&&!kB(u)?$B(u):null}return t.reflow(e.modified()).modifies(n)}});function $B(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 kB(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const DB=Object.freeze(Object.defineProperty({__proto__:null,voronoi:O1},Symbol.toStringTag,{value:"Module"}));var wh=Math.PI/180,qo=64,ac=2048;function OB(){var e=[256,256],t,n,i,r,s,a,o,u=NS,l=[],c=Math.random,f={};f.layout=function(){for(var h=d(Er()),g=LB((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],A=l.map(C=>({text:t(C),font:n(C),style:r(C),weight:s(C),rotate:a(C),size:~~(i(C)+1e-14),padding:o(C),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:C})).sort((C,x)=>x.size-C.size);++b<y;){var E=A[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,RB(h,E,A,b),E.hasText&&p(g,E,m)&&(v.push(E),m?TB(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(h){h.width=h.height=1;var g=Math.sqrt(h.getContext("2d").getImageData(0,0,1,1).data.length>>2);h.width=(qo<<5)/g,h.height=ac/g;var m=h.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function p(h,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),A=u(e),E=c()<.5?1:-1,C=-E,x,w,R;(x=A(C+=E))&&(w=~~x[0],R=~~x[1],!(Math.min(Math.abs(w),Math.abs(R))>=v));)if(g.x=y+w,g.y=b+R,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!_B(g,h,e[0]))&&(!m||NB(g,m))){for(var L=g.sprite,J=g.width>>5,ne=e[0]>>5,de=g.x-(J<<4),N=de&127,O=32-N,I=g.y1-g.y0,G=(g.y+g.y0)*ne+(de>>5),X,V=0;V<I;V++){X=0;for(var te=0;te<=J;te++)h[G+te]|=X<<O|(te<J?(X=L[V*J+te])>>>N:0);G+=ne}return g.sprite=null,!0}return!1}return f.words=function(h){return arguments.length?(l=h,f):l},f.size=function(h){return arguments.length?(e=[+h[0],+h[1]],f):e},f.font=function(h){return arguments.length?(n=Vr(h),f):n},f.fontStyle=function(h){return arguments.length?(r=Vr(h),f):r},f.fontWeight=function(h){return arguments.length?(s=Vr(h),f):s},f.rotate=function(h){return arguments.length?(a=Vr(h),f):a},f.text=function(h){return arguments.length?(t=Vr(h),f):t},f.spiral=function(h){return arguments.length?(u=BB[h]||h,f):u},f.fontSize=function(h){return arguments.length?(i=Vr(h),f):i},f.padding=function(h){return arguments.length?(o=Vr(h),f):o},f.random=function(h){return arguments.length?(c=h,f):c},f}function RB(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(qo<<5)/s,ac/s);var a=0,o=0,u=0,l=n.length,c,f,d,p,h;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*wh),m=Math.cos(t.rotate*wh),y=c*m,b=c*g,v=d*m,A=d*g;c=Math.max(Math.abs(y+A),Math.abs(y-A))+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),a+c>=qo<<5&&(a=0,o+=u,u=0),o+d>=ac)break;r.translate((a+(c>>1))/s,(o+(d>>1))/s),t.rotate&&r.rotate(t.rotate*wh),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=a,t.yoff=o,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=c}for(var E=r.getImageData(0,0,(qo<<5)/s,ac/s).data,C=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,p=0;p<d*f;p++)C[p]=0;if(a=t.xoff,a==null)return;o=t.yoff;var x=0,w=-1;for(h=0;h<d;h++){for(p=0;p<c;p++){var R=f*h+(p>>5),L=E[(o+h)*(qo<<5)+(a+p)<<2]?1<<31-p%32:0;C[R]|=L,x|=L}x?w=h:(t.y0++,d--,h--,o++)}t.y1=t.y0+w,t.sprite=C.slice(0,(t.y1-t.y0)*f)}}}function _B(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),a=s&127,o=32-a,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<o|(d<r?(c=i[f*r+d])>>>a:0))&t[l+d])return!0;l+=n}return!1}function TB(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 NB(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 NS(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function MB(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function LB(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Vr(e){return typeof e=="function"?e:function(){return e}}var BB={archimedean:NS,rectangular:MB};const MS=["x","y","font","fontSize","fontStyle","fontWeight","angle"],PB=["text","font","rotate","fontSize","fontStyle","fontWeight"];function R1(e){F.call(this,OB(),e)}R1.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:MS}]};z(R1,F,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&S("Wordcloud size dimensions must be non-zero.");function n(h){const g=e[h];return ae(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||PB.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,a=e.as||MS;let o=e.fontSize||14,u;if(ae(o)?u=e.fontSizeRange:o=kt(o),u){const h=o,g=me("sqrt")().domain(di(r,h)).range(u);o=m=>g(h(m))}r.forEach(h=>{h[a[0]]=NaN,h[a[1]]=NaN,h[a[3]]=0});const l=s.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(o).random(bn).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,p=l.length;for(let h=0,g,m;h<p;++h)g=l[h],m=g.datum,m[a[0]]=g.x+f,m[a[1]]=g.y+d,m[a[2]]=g.font,m[a[3]]=g.size,m[a[4]]=g.style,m[a[5]]=g.weight,m[a[6]]=g.rotate;return t.reflow(i).modifies(a)}});const IB=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:R1},Symbol.toStringTag,{value:"Module"})),zB=e=>new Uint8Array(e),UB=e=>new Uint16Array(e),Zo=e=>new Uint32Array(e);function jB(){let e=8,t=[],n=Zo(0),i=Dl(0,e),r=Dl(0,e);return{data:()=>t,seen:()=>n=qB(n,t.length),add(s){for(let a=0,o=t.length,u=s.length,l;a<u;++a)l=s[a],l._index=o++,t.push(l)},remove(s,a){const o=t.length,u=Array(o-s),l=t;let c,f,d;for(f=0;!a[f]&&f<o;++f)u[f]=t[f],l[f]=f;for(d=f;f<o;++f)c=t[f],a[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:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,a){i[s]|=a},clear(s,a){i[s]&=~a},resize(s,a){const o=i.length;(s>o||a>e)&&(e=Math.max(a,e),i=Dl(s,e,i),r=Dl(s,e))}}}function qB(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Dl(e,t,n){const i=(t<257?zB:t<65537?UB:Zo)(e);return n&&i.set(n),i}function mv(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,s){const a=this,o=a.bisect(a.range,r.value),u=r.index,l=o[0],c=o[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return a}}}function yv(){let e=Zo(0),t=[],n=0;function i(o,u,l){if(!u.length)return[];const c=n,f=u.length,d=Zo(f);let p=Array(f),h,g,m;for(m=0;m<f;++m)p[m]=o(u[m]),d[m]=m;if(p=WB(p,d),c)h=t,g=e,t=Array(c+f),e=Zo(c+f),GB(l,h,g,c,p,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=p,e=d}return n=c+f,{index:d,value:p}}function r(o,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-o}function s(o){for(let u=0,l=n;u<l;++u)e[u]=o[e[u]]}function a(o,u){let l;return u?l=u.length:(u=t,l=n),[K5(u,o[0],0,l),mc(u,o[1],0,l)]}return{insert:i,remove:r,bisect:a,reindex:s,index:()=>e,size:()=>n}}function WB(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),E5(e,t)}function GB(e,t,n,i,r,s,a,o,u){let l=0,c=0,f;for(f=0;l<i&&c<a;++f)t[l]<r[c]?(o[f]=t[l],u[f]=n[l++]):(o[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)o[f]=t[l],u[f]=n[l];for(;c<a;++c,++f)o[f]=r[c],u[f]=s[c]+e}function _1(e){F.call(this,jB(),e),this._indices=null,this._dims=null}_1.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}}]};z(_1,F,{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={},s=this._dims=[],a=i.length;let o=0,u,l;for(;o<a;++o)u=n[o].fname,l=r[u]||(r[u]=yv()),s.push(mv(l,o,i[o]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,a=this._dims,o=this.value,u=o.curr(),l=o.prev(),c=o.all(),f=n.rem=n.add,d=n.mod,p=r.length,h={};let g,m,y,b,v,A,E,C,x;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&o.add(t.add),t.mod.length)for(A={},b=t.mod,E=0,C=b.length;E<C;++E)A[b[E]._index]=1;for(E=0;E<p;++E)x=i[E],(!a[E]||e.modified("fields",E)||t.modified(x.fields))&&(y=x.fname,(g=h[y])||(s[y]=m=yv(),h[y]=g=m.insert(x,t.source,0)),a[E]=mv(m,E,r[E]).onAdd(g,u));for(E=0,C=o.data().length;E<C;++E)v[E]||(l[E]!==u[E]?f.push(E):A[E]&&u[E]!==c&&d.push(E));return o.mask=(1<<p)-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,s=this._dims,a=this._indices,o=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),p,h,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(p=0;p<f;++p)h=o[p].fname,g=u[h]||(u[h]=a[h].insert(o[p],i,d)),s[p].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(),s=i.all(),a=e.mod;let o,u,l;for(o=0,u=a.length;o<u;++o)l=a[o]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),a=r.prev(),o=r.all(),u={},l=n.rem,c=t.rem;let f,d,p,h;for(f=0,d=c.length;f<d;++f)p=c[f]._index,u[p]=1,a[p]=h=s[p],s[p]=o,h!==o&&l.push(p);for(p in i)i[p].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const a in i)i[a].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,a=i.length;let o=0,u,l;for(n.filters=0,l=0;l<a;++l)e.modified("query",l)&&(u=l,++o);if(o===1)o=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,o=0;l<a;++l)e.modified("query",l)&&(o|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return o},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),a=r.curr(),o=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],p=l[0],h=l[1],g=e.one;let m,y,b;if(f<p)for(m=f,y=Math.min(p,d);m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=g;else if(f>p)for(m=p,y=Math.min(f,h);m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=g;if(d>h)for(m=Math.max(f,h),y=d;m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=g;else if(d<h)for(m=Math.max(p,d),y=h;m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),a=e.index(),o=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=o[0],d=o[1],p=e.one;let h,g,m;if(l<f)for(h=l,g=Math.min(f,c);h<g;++h)m=a[h],s[m]^=p,n.push(m);else if(l>f)for(h=f,g=Math.min(l,d);h<g;++h)m=a[h],s[m]^=p,i.push(m);if(c>d)for(h=Math.max(l,d),g=c;h<g;++h)m=a[h],s[m]^=p,n.push(m);else if(c<d)for(h=Math.max(f,c),g=d;h<g;++h)m=a[h],s[m]^=p,i.push(m);e.range=t.slice()}});function T1(e){F.call(this,null,e)}T1.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."}]};z(T1,F,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if((r&n)===0)return t.StopPropagation;const s=t.fork(t.ALL),a=i.data(),o=i.curr(),u=i.prev(),l=c=>o[c]&n?null:a[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=o[c]&n;return!f&&f^u[c]&n?a[c]:null}),s.filter(s.REM,c=>{const f=o[c]&n;return f&&!(f^(f^u[c]&n))?a[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(o[c]&n)===r?a[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const HB=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:_1,resolvefilter:T1},Symbol.toStringTag,{value:"Module"})),VB="RawCode",xs="Literal",XB="Property",YB="Identifier",KB="ArrayExpression",JB="BinaryExpression",LS="CallExpression",QB="ConditionalExpression",ZB="LogicalExpression",e7="MemberExpression",t7="Ob
3jectExpression",n7="UnaryExpression";function qn(e){this.type=e}qn.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=i7(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function i7(e){switch(e.type){case KB:return e.elements;case JB:case ZB:return[e.left,e.right];case LS:return[e.callee].concat(e.arguments);case QB:return[e.test,e.consequent,e.alternate];case e7:return[e.object,e.property];case t7:return e.properties;case XB:return[e.key,e.value];case n7:return[e.argument];case YB:case xs:case VB:default:return[]}}var vi,Y,$,Ct,ve,Uf=1,Yu=2,vs=3,Lr=4,jf=5,Is=6,Lt=7,Ku=8,r7=9;vi={};vi[Uf]="Boolean";vi[Yu]="<end>";vi[vs]="Identifier";vi[Lr]="Keyword";vi[jf]="Null";vi[Is]="Numeric";vi[Lt]="Punctuator";vi[Ku]="String";vi[r7]="RegularExpression";var s7="ArrayExpression",a7="BinaryExpression",o7="CallExpression",u7="ConditionalExpression",BS="Identifier",l7="Literal",c7="LogicalExpression",f7="MemberExpression",d7="ObjectExpression",h7="Property",p7="UnaryExpression",Qe="Unexpected token %0",g7="Unexpected number",m7="Unexpected string",y7="Unexpected identifier",b7="Unexpected reserved word",x7="Unexpected end of input",rg="Invalid regular expression",Fh="Invalid regular expression: missing /",PS="Octal literals are not allowed in strict mode.",v7="Duplicate data property in object literal not allowed in strict mode",lt="ILLEGAL",pu="Disabled.",E7=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\\u
30AE1\\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]"),A7
vendor: 5,882 bytes, line 3
3=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
vendor: 12,629 bytes, lines 3-5
3qf(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ni(e){return e>=48&&e<=57}function N1(e){return"0123456789abcdefABCDEF".includes(e)}function eu(e){return"01234567".includes(e)}function C7(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 gu(e){return e===10||e===13||e===8232||e===8233}function Ju(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&E7.test(String.fromCharCode(e))}function Pc(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&A7.test(String.fromCharCode(e))}const w7={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 IS(){for(;$<Ct;){const e=Y.charCodeAt($);if(C7(e)||gu(e))++$;else break}}function sg(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)$<Ct&&N1(Y[$])?(i=Y[$++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):he({},Qe,lt);return String.fromCharCode(r)}function F7(){var e,t,n,i;for(e=Y[$],t=0,e==="}"&&he({},Qe,lt);$<Ct&&(e=Y[$++],!!N1(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&he({},Qe,lt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function zS(){var e,t;for(e=Y.charCodeAt($++),t=String.fromCharCode(e),e===92&&(Y.charCodeAt($)!==117&&he({},Qe,lt),++$,e=sg("u"),(!e||e==="\\"||!Ju(e.charCodeAt(0)))&&he({},Qe,lt),t=e);$<Ct&&(e=Y.charCodeAt($),!!Pc(e));)++$,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Y.charCodeAt($)!==117&&he({},Qe,lt),++$,e=sg("u"),(!e||e==="\\"||!Pc(e.charCodeAt(0)))&&he({},Qe,lt),t+=e);return t}function S7(){var e,t;for(e=$++;$<Ct;){if(t=Y.charCodeAt($),t===92)return $=e,zS();if(Pc(t))++$;else break}return Y.slice(e,$)}function $7(){var e,t,n;return e=$,t=Y.charCodeAt($)===92?zS():S7(),t.length===1?n=vs:w7.hasOwnProperty(t)?n=Lr:t==="null"?n=jf:t==="true"||t==="false"?n=Uf:n=vs,{type:n,value:t,start:e,end:$}}function Sh(){var e=$,t=Y.charCodeAt($),n,i=Y[$],r,s,a;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++$,{type:Lt,value:String.fromCharCode(t),start:e,end:$};default:if(n=Y.charCodeAt($+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 $+=2,{type:Lt,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:$};case 33:case 61:return $+=2,Y.charCodeAt($)===61&&++$,{type:Lt,value:Y.slice(e,$),start:e,end:$}}}if(a=Y.substr($,4),a===">>>=")return $+=4,{type:Lt,value:a,start:e,end:$};if(s=a.substr(0,3),s===">>>"||s==="<<="||s===">>=")return $+=3,{type:Lt,value:s,start:e,end:$};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return $+=2,{type:Lt,value:r,start:e,end:$};if(r==="//"&&he({},Qe,lt),"<>=!+-*%&|^/".includes(i))return++$,{type:Lt,value:i,start:e,end:$};he({},Qe,lt)}function k7(e){let t="";for(;$<Ct&&N1(Y[$]);)t+=Y[$++];return t.length===0&&he({},Qe,lt),Ju(Y.charCodeAt($))&&he({},Qe,lt),{type:Is,value:parseInt("0x"+t,16),start:e,end:$}}function D7(e){let t="0"+Y[$++];for(;$<Ct&&eu(Y[$]);)t+=Y[$++];return(Ju(Y.charCodeAt($))||Ni(Y.charCodeAt($)))&&he({},Qe,lt),{type:Is,value:parseInt(t,8),octal:!0,start:e,end:$}}function bv(){var e,t,n;if(n=Y[$],qf(Ni(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=$,e="",n!=="."){if(e=Y[$++],n=Y[$],e==="0"){if(n==="x"||n==="X")return++$,k7(t);if(eu(n))return D7(t);n&&Ni(n.charCodeAt(0))&&he({},Qe,lt)}for(;Ni(Y.charCodeAt($));)e+=Y[$++];n=Y[$]}if(n==="."){for(e+=Y[$++];Ni(Y.charCodeAt($));)e+=Y[$++];n=Y[$]}if(n==="e"||n==="E")if(e+=Y[$++],n=Y[$],(n==="+"||n==="-")&&(e+=Y[$++]),Ni(Y.charCodeAt($)))for(;Ni(Y.charCodeAt($));)e+=Y[$++];else he({},Qe,lt);return Ju(Y.charCodeAt($))&&he({},Qe,lt),{type:Is,value:parseFloat(e),start:t,end:$}}function O7(){var e="",t,n,i,r,s=!1;for(t=Y[$],qf(t==="'"||t==='"',"String literal must starts with a quote"),n=$,++$;$<Ct;)if(i=Y[$++],i===t){t="";break}else if(i==="\\")if(i=Y[$++],!i||!gu(i.charCodeAt(0)))switch(i){case"u":case"x":Y[$]==="{"?(++$,e+=F7()):e+=sg(i);break;case"n":e+=` 4`;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:eu(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),$<Ct&&eu(Y[$])&&(s=!0,r=r*8+"01234567".indexOf(Y[$++]),"0123".includes(i)&&$<Ct&&eu(Y[$])&&(r=r*8+"01234567".indexOf(Y[$++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Y[$]===` 5`&&++$;else{if(gu(i.charCodeAt(0)))break;e+=i}return t!==""&&he({},Qe,lt),{type:Ku,value:e,octal:s,start:n,end:$}}function R7(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";he({},rg)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{he({},rg)}try{return new RegExp(e,t)}catch{return null}}function _7(){var e,t,n,i,r;for(e=Y[$],qf(e==="/","Regular expression literal must start with a slash"),t=Y[$++],n=!1,i=!1;$<Ct;)if(e=Y[$++],t+=e,e==="\\")e=Y[$++],gu(e.charCodeAt(0))&&he({},Fh),t+=e;else if(gu(e.charCodeAt(0)))he({},Fh);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||he({},Fh),r=t.substr(1,t.length-2),{value:r,literal:t}}function T7(){var e,t,n;for(t="",n="";$<Ct&&(e=Y[$],!!Pc(e.charCodeAt(0)));)++$,e==="\\"&&$<Ct?he({},Qe,lt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&he({},rg,n),{value:n,literal:t}}function N7(){var e,t,n,i;return ve=null,IS(),e=$,t=_7(),n=T7(),i=R7(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:$}}function M7(e){return e.type===vs||e.type===Lr||e.type===Uf||e.type===jf}function US(){if(IS(),$>=Ct)return{type:Yu,start:$,end:$};const e=Y.charCodeAt($);return Ju(e)?$7():e===40||e===41||e===59?Sh():e===39||e===34?O7():e===46?Ni(Y.charCodeAt($+1))?bv():Sh():Ni(e)?bv():Sh()}function Pt(){const e=ve;return $=e.end,ve=US(),$=e.end,e}function jS(){const e=$;ve=US(),$=e}function L7(e){const t=new qn(s7);return t.elements=e,t}function xv(e,t,n){const i=new qn(e==="||"||e==="&&"?c7:a7);return i.operator=e,i.left=t,i.right=n,i}function B7(e,t){const n=new qn(o7);return n.callee=e,n.arguments=t,n}function P7(e,t,n){const i=new qn(u7);return i.test=e,i.consequent=t,i.alternate=n,i}function M1(e){const t=new qn(BS);return t.name=e,t}function Wo(e){const t=new qn(l7);return t.value=e.value,t.raw=Y.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function vv(e,t,n){const i=new qn(f7);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function I7(e){const t=new qn(d7);return t.properties=e,t}function Ev(e,t,n){const i=new qn(h7);return i.key=t,i.value=n,i.kind=e,i}function z7(e,t){const n=new qn(p7);return n.operator=e,n.argument=t,n.prefix=!0,n}function he(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,a)=>(qf(a<i.length,"Message reference must be in range"),i[a]));throw n=new Error(r),n.index=$,n.description=r,n}function Wf(e){e.type===Yu&&he(e,x7),e.type===Is&&he(e,g7),e.type===Ku&&he(e,m7),e.type===vs&&he(e,y7),e.type===Lr&&he(e,b7),he(e,Qe,e.value)}function wt(e){const t=Pt();(t.type!==Lt||t.value!==e)&&Wf(t)}function Oe(e){return ve.type===Lt&&ve.value===e}function $h(e){return ve.type===Lr&&ve.value===e}function U7(){const e=[];for($=ve.start,wt("[");!Oe("]");)Oe(",")?(Pt(),e.push(null)):(e.push(Es()),Oe("]")||wt(","));return Pt(),L7(e)}function Av(){$=ve.start;const e=Pt();return e.type===Ku||e.type===Is?(e.octal&&he(e,PS),Wo(e)):M1(e.value)}function j7(){var e,t,n,i;if($=ve.start,e=ve,e.type===vs)return n=Av(),wt(":"),i=Es(),Ev("init",n,i);if(e.type===Yu||e.type===Lt)Wf(e);else return t=Av(),wt(":"),i=Es(),Ev("init",t,i)}function q7(){var e=[],t,n,i,r={},s=String;for($=ve.start,wt("{");!Oe("}");)t=j7(),t.key.type===BS?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?he({},v7):r[i]=!0,e.push(t),Oe("}")||wt(",");return wt("}"),I7(e)}function W7(){wt("(");const e=L1();return wt(")"),e}const G7={if:1};function H7(){var e,t,n;if(Oe("("))return W7();if(Oe("["))return U7();if(Oe("{"))return q7();if(e=ve.type,$=ve.start,e===vs||G7[ve.value])n=M1(Pt().value);else if(e===Ku||e===Is)ve.octal&&he(ve,PS),n=Wo(Pt());else{if(e===Lr)throw new Error(pu);e===Uf?(t=Pt(),t.value=t.value==="true",n=Wo(t)):e===jf?(t=Pt(),t.value=null,n=Wo(t)):Oe("/")||Oe("/=")?(n=Wo(N7()),jS()):Wf(Pt())}return n}function V7(){const e=[];if(wt("("),!Oe(")"))for(;$<Ct&&(e.push(Es()),!Oe(")"));)wt(",");return wt(")"),e}function X7(){$=ve.start;const e=Pt();return M7(e)||Wf(e),M1(e.value)}function Y7(){return wt("."),X7()}function K7(){wt("[");const e=L1();return wt("]"),e}function J7(){var e,t,n;for(e=H7();;)if(Oe("."))n=Y7(),e=vv(".",e,n);else if(Oe("("))t=V7(),e=B7(e,t);else if(Oe("["))n=K7(),e=vv("[",e,n);else break;return e}function Cv(){const e=J7();if(ve.type===Lt&&(Oe("++")||Oe("--")))throw new Error(pu);return e}function oc(){var e,t;if(ve.type!==Lt&&ve.type!==Lr)t=Cv();else{if(Oe("++")||Oe("--"))throw new Error(pu);if(Oe("+")||Oe("-")||Oe("~")||Oe("!"))e=Pt(),t=oc(),t=z7(e.value,t);else{if($h("delete")||$h("void")||$h("typeof"))throw new Error(pu);t=Cv()}}return t}function wv(e){let t=0;if(e.type!==Lt&&e.type!==Lr)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 Q7(){var e,t,n,i,r,s,a,o,u,l;if(e=ve,u=oc(),i=ve,r=wv(i),r===0)return u;for(i.prec=r,Pt(),t=[e,ve],a=oc(),s=[u,i,a];(r=wv(ve))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)a=s.pop(),o=s.pop().value,u=s.pop(),t.pop(),n=xv(o,u,a),s.push(n);i=Pt(),i.prec=r,s.push(i),t.push(ve),n=oc(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=xv(s[l-1].value,s[l-2],n),l-=2;return n}function Es(){var e,t,n;return e=Q7(),Oe("?")&&(Pt(),t=Es(),wt(":"),n=Es(),e=P7(e,t,n)),e}function L1(){const e=Es();if(Oe(","))throw new Error(pu);return e}function qS(e){Y=e,$=0,Ct=Y.length,ve=null,jS();const t=L1();if(ve.type!==Yu)throw new Error("Unexpect token after expression.");return t}var WS={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 GS(e){function t(a,o,u,l){let c=e(o[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+a+(l<0?"":l===0?"()":"("+o.slice(1).map(e).join(",")+")")}function n(a,o,u){return l=>t(a,l,o,u)}const i="new Date",r="String",s="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(a){a.length<3&&S("Missing arguments to clamp function."),a.length>3&&S("Too many arguments to clamp function.");const o=a.map(e);return"Math.max("+o[1]+", Math.min("+o[2]+","+o[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),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(a){a.length<3&&S("Missing arguments to if function."),a.length>3&&S("Too many arguments to if function.");const o=a.map(e);
5return"("+o[0]+"?"+o[1]+":"+o[2]+")"}}}function Z7(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function HS(e){e=e||{};const t=e.allowed?Ln(e.allowed):{},n=e.forbidden?Ln(e.forbidden):{},i=e.constants||WS,r=(e.functions||GS)(f),s=e.globalvar,a=e.fieldvar,o=ae(s)?s:h=>`${s}["${h}"]`;let u={},l={},c=0;function f(h){if(q(h))return h;const g=d[h.type];return g==null&&S("Unsupported type: "+h.type),g(h)}const d={Literal:h=>h.raw,Identifier:h=>{const g=h.name;return c>0?g:H(n,g)?S("Illegal identifier: "+g):H(i,g)?i[g]:H(t,g)?g:(u[g]=1,o(g))},MemberExpression:h=>{const g=!h.computed,m=f(h.object);g&&(c+=1);const y=f(h.property);return m===a&&(l[Z7(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:h=>{h.callee.type!=="Identifier"&&S("Illegal callee type: "+h.callee.type);const g=h.callee.name,m=h.arguments,y=H(r,g)&&r[g];return y||S("Unrecognized function: "+g),ae(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:h=>"["+h.elements.map(f).join(",")+"]",BinaryExpression:h=>"("+f(h.left)+" "+h.operator+" "+f(h.right)+")",UnaryExpression:h=>"("+h.operator+f(h.argument)+")",ConditionalExpression:h=>"("+f(h.test)+"?"+f(h.consequent)+":"+f(h.alternate)+")",LogicalExpression:h=>"("+f(h.left)+h.operator+f(h.right)+")",ObjectExpression:h=>{for(const g of h.properties){const m=g.key.name;nm.has(m)&&S("Illegal property: "+m)}return"{"+h.properties.map(f).join(",")+"}"},Property:h=>{c+=1;const g=f(h.key);return c-=1,g+":"+f(h.value)}};function p(h){const g={code:f(h),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return p.functions=r,p.constants=i,p}const Fv=Symbol("vega_selection_getter");function VS(e){return(!e.getter||!e.getter[Fv])&&(e.getter=gn(e.field),e.getter[Fv]=!0),e.getter}const B1="intersect",Sv="union",eP="vlMulti",tP="vlPoint",$v="or",nP="and",ri="_vgsid_",mu=gn(ri),iP="E",rP="R",sP="R-E",aP="R-LE",oP="R-RE",uP="E-LT",lP="E-LTE",cP="E-GT",fP="E-GTE",dP="E-VALID",hP="E-ONE",Ic="index:unit";function kv(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,a,o;s<r;++s)if(o=n[s],a=VS(o)(e),xr(a)&&(a=xt(a)),xr(i[s])&&(i[s]=xt(i[s])),D(i[s])&&xr(i[s][0])&&(i[s]=i[s].map(xt)),o.type===iP){if(D(i[s])?!i[s].includes(a):a!==i[s])return!1}else if(o.type===rP){if(!la(a,i[s]))return!1}else if(o.type===oP){if(!la(a,i[s],!0,!1))return!1}else if(o.type===sP){if(!la(a,i[s],!1,!1))return!1}else if(o.type===aP){if(!la(a,i[s],!1,!0))return!1}else if(o.type===uP){if(a>=i[s])return!1}else if(o.type===lP){if(a>i[s])return!1}else if(o.type===cP){if(a<=i[s])return!1}else if(o.type===fP){if(a<i[s])return!1}else if(o.type===dP){if(a===null||isNaN(a))return!1}else if(o.type===hP&&i[s].indexOf(a)===-1)return!1;return!0}function pP(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[Ic]&&i[Ic].value:void 0,a=n===B1,o=r.length,u=0,l,c,f,d,p;u<o;++u)if(l=r[u],s&&a){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(p=kv(t,l),c[d]=p?-1:++f,p&&s.size===1)return!0;if(!p&&f===s.get(d).count)return!1}else if(p=kv(t,l),a^p)return p;return o&&a}const XS=em(mu),gP=XS.left,mP=XS.right;function yP(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[Ic]&&i[Ic].value:void 0,a=n===B1,o=mu(t),u=gP(r,o);if(u===r.length||mu(r[u])!==o)return!1;if(s&&a){if(s.size===1)return!0;if(mP(r,o)-u<s.size)return!1}return!0}function bP(e,t){return D(e)||S("First argument to selectionTuples must be an array."),j(t)||S("Second argument to selectionTuples must be an object."),e.map(n=>se(t.fields?{values:t.fields.map(i=>VS(i)(n.datum))}:{[ri]:mu(n.datum)},t))}function xP(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],a={},o={},u={},l,c,f,d,p,h,g,m,y,b,v=s.length,A=0,E,C;A<v;++A)if(l=s[A],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,C=c.length;E<C;++E)p=c[E],g=a[p.field]||(a[p.field]={}),m=g[d]||(g[d]=[]),u[p.field]=y=p.type.charAt(0),b=kh[`${y}_union`],g[d]=b(m,W(f[E]));n&&(m=o[d]||(o[d]=[]),m.push(W(f).reduce((x,w,R)=>(x[c[R].field]=w,x),{})))}else p=ri,h=mu(l),g=a[p]||(a[p]={}),m=g[d]||(g[d]=[]),m.push(h),n&&(m=o[d]||(o[d]=[]),m.push({[ri]:h}));if(t=t||Sv,a[ri]?a[ri]=kh[`${ri}_${t}
5`](...Object.values(a[ri])):Object.keys(a).forEach(x=>{a[x]=Object.keys(a[x]).map(w=>a[x][w]).reduce((w,R)=>w===void 0?R:kh[`${u[x]}_${t}`](w,R))}),s=Object.keys(o),n&&s.length){const x=i?tP:eP;a[x]=t===Sv?{[$v]:s.reduce((w,R)=>(w.push(...o[R]),w),[])}:{[nP]:s.map(w=>({[$v]:o[w]}))}}return a}var kh={[`${ri}_union`]:C5,[`${ri}_intersect`]:A5,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.includes(n)):t},R_union:function(e,t){var n=xt(t[0]),i=xt(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=xt(t[0]),i=xt(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 vP=":",EP="@";function P1(e,t,n,i){t[0].type!==xs&&S("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&ce(t).value,a="unit",o=EP+a,u=vP+r;s===B1&&!H(i,o)&&(i[o]=n.getData(r).indataRef(n,a)),H(i,u)||(i[u]=n.getData(r).tuplesRef())}function YS(e){const t=this.context.data[e];return t?t.values.value:[]}function AP(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function CP(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(mn).insert(t)),1}function wP(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 Qu=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},FP=Qu("format"),KS=Qu("timeFormat"),SP=Qu("utcFormat"),$P=Qu("timeParse"),kP=Qu("utcParse"),Ol=new Date(2e3,0,1);function Gf(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Ol.setYear(2e3),Ol.setMonth(e),Ol.setDate(t),KS.call(this,Ol,n))}function DP(e){return Gf.call(this,e,1,"%B")}function OP(e){return Gf.call(this,e,1,"%b")}function RP(e){return Gf.call(this,0,2+e,"%A")}function _P(e){return Gf.call(this,0,2+e,"%a")}const TP=":",NP="@",ag="%",JS="$";function I1(e,t,n,i){t[0].type!==xs&&S("First argument to data functions must be a string literal.");const r=t[0].value,s=TP+r;if(!H(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function MP(e,t,n,i){t[0].type!==xs&&S("First argument to indata must be a string literal."),t[1].type!==xs&&S("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,a=NP+s;H(a,i)||(i[a]=n.getData(r).indataRef(n,s))}function Tt(e,t,n,i){if(t[0].type===xs)Dv(n,i,t[0].value);else for(e in n.scales)Dv(n,i,e)}function Dv(e,t,n){const i=ag+n;if(!H(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Ei(e,t){if(q(e)){const n=t.scales[e];return n&&wx(n.value)?n.value:void 0}else if(ae(e))return wx(e)?e:void 0}function LP(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Tt,n._range=Tt,n._scale=Tt;const i=r=>"_["+(r.type===xs?P(ag+r.value):P(ag)+"+"+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 z1(e,t){return function(n,i,r){if(n){const s=Ei(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const BP=z1("area",w5),PP=z1("bounds",F5),IP=z1("centroid",S5);function zP(e,t){const n=Ei(e,(t||this).context);return n&&n.scale()}function UP(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 U1(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function jP(){return U1(this.context.dataflow,"warn",arguments)}function qP(){return U1(this.context.dataflow,"info",arguments)}function WP(){return U1(this.context.dataflow,"debug",arguments)}function Dh(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function og(e){const t=yc(e),n=Dh(t.r),i=Dh(t.g),r=Dh(t.b);return .2126*n+.7152*i+.0722*r}function GP(e,t){const n=og(e),i=og(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function HP(){const e=[].slice.call(arguments);return e.unshift({}),se(...e)}function QS(e,t){return e===t||e!==e&&t!==t?!0:D(e)?D(t)&&e.length===t.length?VP(e,t):!1:j(e)&&j(t)?ZS(e,t):!1}function VP(e,t){for(let n=0,i=e.length;n<i;++n)if(!QS(e[n],t[n]))return!1;return!0}function ZS(e,t){for(const n in e)if(!QS(e[n],t[n]))return!1;return!0}function Ov(e){return t=>ZS(e,t)}function XP(e,t,n,i,r,s){const a=this.context.dataflow,o=this.context.data[e],u=o.input,l=a.stamp();let c=o.changes,f,d;
vendor: 49,875 bytes, lines 5-9
5if(a._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(o.changes=c=a.changeset(),c.stamp=l,a.runAfter(()=>{o.modified=!0,a.pulse(u,c).run()},!0,1)),n&&(f=n===!0?mn:D(n)||gf(n)?n:Ov(n),c.remove(f)),t&&c.insert(t),i&&(f=Ov(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function YP(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 KP(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const Rv={};function JP(e,t){const n=Rv[t]||(Rv[t]=gn(t));return D(e)?e.map(n):n(e)}function Hf(e){return D(e)||ArrayBuffer.isView(e)?e:null}function j1(e){return Hf(e)||(q(e)?e:null)}function QP(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 Hf(e).join(...n)}function ZP(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 j1(e).indexOf(...n)}function eI(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 j1(e).lastIndexOf(...n)}function tI(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 j1(e).slice(...n)}function nI(e,t,n){return ae(n)&&S("Function argument passed to replace."),!q(t)&&!fm(t)&&S("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function iI(e){return Hf(e).slice().reverse()}function rI(e){return Hf(e).slice().sort(Ya)}function sI(e,t,n){return p0(e||0,t||0,n||0)}function aI(e,t){const n=Ei(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function oI(e,t){const n=Ei(e,(t||this).context);return n?n.copy():void 0}function uI(e,t){const n=Ei(e,(t||this).context);return n?n.domain():[]}function lI(e,t,n){const i=Ei(e,(n||this).context);return i?D(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function cI(e,t){const n=Ei(e,(t||this).context);return n&&n.range?n.range():[]}function fI(e,t,n){const i=Ei(e,(n||this).context);return i?i(t):void 0}function dI(e,t,n,i,r){e=Ei(e,(r||this).context);const s=qw(t,n);let a=e.domain(),o=a[0],u=ce(a),l=$t;return u-o?l=Rw(e,o,u):e=(e.interpolator?me("sequential")().interpolator(e.interpolator()):me("linear")().interpolate(e.interpolate()).range(e.range())).domain([o=0,u=1]),e.ticks&&(a=e.ticks(+i||15),o!==a[0]&&a.unshift(o),u!==ce(a)&&a.push(u)),a.forEach(c=>s.stop(l(c),e(c))),s}function hI(e,t,n){const i=Ei(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function pI(e){let t=null;return function(n){return n?cu(n,t=t||Sa(e)):e}}const e$=e=>e.data;function t$(e,t){const n=YS.call(t,e);return n.root&&n.root.lookup||{}}function gI(e,t,n){const i=t$(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(e$):void 0}function mI(e,t){const n=t$(e,this)[t];return n?n.ancestors().map(e$):void 0}const n$=()=>typeof window<"u"&&window||null;function yI(){const e=n$();return e?e.screen:{}}function bI(){const e=n$();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function xI(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function i$(e,t,n){if(!e)return[];const[i,r]=e,s=new We().set(i[0],i[1],r[0],r[1]),a=n||this.context.dataflow.scenegraph().root;return zF(a,s,vI(t))}function vI(e){let t=null;if(e){const n=W(e.marktype),i=W(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function EI(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=W(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 AI(e){return W(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function CI(e,t,n){const{x:i,y:r,mark:s}=n,a=new We().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<a.x1&&(a.x1=u),u>a.x2&&(a.x2=u),l<a.y1&&(a.y1=l),l>a.y2&&(a.y2=l);return a.translate(i,r),i$([[a.x1,a.y1],[a.x2,a.y2]],e,s).filter(u=>wI(u.x,u.y,t))}function wI(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[a,o]=n[s],[u,l]=n[r];l>t!=o>t&&e<(a-u)*(t-l)/(o-l)+u&&i++}return i&1}const yu={random(){return bn()},cumulativeNormal:vf,cumulativeLogNormal:Nm,cumulativeUniform:Pm,densityNormal:Dm,densityLogNormal:Tm,densityUniform:Bm,quantileNormal:Ef,quantileLogNormal:Mm,quantileUniform:Im,sampleNormal:xf,sampleLogNormal:_m,sampleUniform:Lm,isArray:D,isBoolean:Mr,isDate:xr,isDefined(e){return e!==void 0},isNumber:ge,isObject:j,isRegExp:fm,isString:q,isTuple:gf,isValid(e){return e!=null&&e===e},toBoolean:hm,toDate(e){return pm(e)},toNumber:xt,toString:gm,indexof:ZP,join:QP,lastindexof:eI,replace:nI,reverse:iI,sort:rI,slice:tI,flush:U2,lerp:q2,merge:HP,pad:H2,peek:ce,pluck:JP,span:_u,inrange:la,truncate:V2,rgb:yc,lab:j5,hcl:U5,hsl:A_,luminance:og,contrast:GP,sequence:Ms,format:FP,utcFormat:SP,utcParse:kP,utcOffset:aC,utcSequence:lC,timeFormat:KS,timeParse:$P,timeOffset:sC,timeSequence:uC,timeUnitSpecifier:X2,monthFormat:DP,monthAbbrevFormat:OP,dayFormat:RP,dayAbbrevFormat:_P,quarter:B2,utcquarter:P2,week:K2,utcweek:Z2,dayofyear:Y2,utcdayofyear:Q2,warn:jP,info:qP,debug:WP,extent(e){return di(e)},inScope:UP,intersect:i$,clampRange:I2,pinchDistance:YP,pinchAngle:KP,screen:yI,containerSize:xI,windowSize:bI,bandspace:sI,setdata:CP,pathShape:pI,panLinear:T2,panLog:N2,panPow:M2,panSymlog:L2,zoomLinear:am,zoomLog:om,zoomPow:xc,zoomSymlog:um,encode:wP,modify:XP,lassoAppend:EI,lassoPath:AI,intersectLasso:CI},FI=["view","item","group","xy","x","y"],SI="event.vega.",r$="this.",q1={},s$={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${P(JS+e)}]`,functions:$I,constants:WS,visitors:q1},ug=HS(s$);function $I(e){const t=GS(e);FI.forEach(n=>t[n]=SI+n);for(const n in yu)t[n]=r$+n;return se(t,LP(e,yu,q1)),t}function qe(e,t,n){return arguments.length===1?yu[e]:(yu[e]=t,n&&(q1[e]=n),ug&&(ug.functions[e]=r$+e),this)}qe("bandwidth",aI,Tt);qe("copy",oI,Tt);qe("domain",uI,Tt);qe("range",cI,Tt);qe("invert",lI,Tt);qe("scale",fI,Tt);qe("gradient",dI,Tt);qe("geoArea",BP,Tt);qe("geoBounds",PP,Tt);qe("geoCentroid",IP,Tt);qe("geoShape",hI,Tt);qe("geoScale",zP,Tt);qe("indata",AP,MP);qe("data",YS,I1);qe("treePath",gI,I1);qe("treeAncestors",mI,I1);qe("vlSelectionTest",pP,P1);qe("vlSelectionIdTest",yP,P1);qe("vlSelectionResolve",xP,P1);qe("vlSelectionTuples",bP);function pi(e,t){const n={};let i;try{e=q(e)?e:P(e)+"",i=qS(e)}catch{S("Expression parse error: "+e)}i.visit(s=>{if(s.type!==LS)return;const a=s.callee.name,o=s$.visitors[a];o&&o(a,s.arguments,t,n)});const r=ug(i);return r.globals.forEach(s=>{const a=JS+s;!H(n,a)&&t.getSignal(s)&&(n[a]=t.signalRef(s))}),{$expr:se({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function kI(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 DI=Ln(["rule"]),_v=Ln(["group","image","rect"]);function OI(e,t){let n="";return DI[t]||(e.x2&&(e.x?(_v[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?(_v[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 W1(e){return(e+"").toLowerCase()}function RI(e){return W1(e)==="operator"}function _I(e){return W1(e)==="collect"}function Ao(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function TI(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} 6 : (u > v || v == null) && u != null ? ${i} 7 : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} 8 : v !== v && u === u ? ${i} : `}var NI={operator:(e,t)=>Ao(e,["_"],t.code),parameter:(e,t)=>Ao(e,["datum","_"],t.code),event:(e,t)=>Ao(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Ao(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const a="o["+P(s)+"]";r+=`$=${i[s].code};if(${a}!==$)${a}=$,m=1;`}return r+=OI(i,n),r+="return m;",Ao(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(P).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,a)=>{const o=t[a];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+a]=s,u=`this.f${a}(a)`,l=`this.f${a}(b)`),TI(u,l,-o,o)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function MI(e){const t=this;RI(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function LI(e){const t=this;if(e.params){const n=t.get(e.id);n||S("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function BI(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=D(r)?r.map(s=>Tv(s,n,t)):Tv(r,n,t)}return t}function Tv(e,t,n){if(!e||!j(e))return e;for(let i=0,r=Nv.length,s;i<r;++i)if(s=Nv[i],H(e,s.key))return s.parse(e,t,n);return e}var Nv=[{key:"$ref",parse:PI},{key:"$key",parse:zI},{key:"$expr",parse:II},{key:"$field",parse:UI},{key:"$encode",parse:qI},{key:"$compare",parse:jI},{key:"$context",parse:WI},{key:"$subflow",parse:GI},{key:"$tupleid",parse:HI}];function PI(e,t){return t.get(e.$ref)||S("Operator not defined: "+e.$ref)}function II(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=Vt(t.parameterExpression(e.$expr),e.$fields))}function zI(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=dm(e.$key,e.$flat,t.expr.codegen))}function UI(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=gn(e.$field,e.$name,t.expr.codegen))}function jI(e,t){const n="c:"+e.$compare+"_"+e.$order,i=W(e.$compare).map(r=>r&&r.$tupleid?ee:r);return t.fn[n]||(t.fn[n]=lm(i,e.$order,t.expr.codegen))}function qI(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Vt(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function WI(e,t){return t}function GI(e,t){const n=e.$subflow;return function(i,r,s){const a=t.fork().parse(n),o=a.get(n.operators[0].id),u=a.signals.parent;return u&&u.set(s),o.detachSubflow=()=>t.detach(a),o}}function HI(){return ee}function VI(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(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),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&&S("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function XI(e){var t=this,n=j(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,a=void 0;i||S("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(a=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,a)}const YI={skip:!0};function KI(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const a=t.signals[s];e.signals(s,a)&&(i[s]=a.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const a=t.data[s];e.data(s,a)&&(r[s]=a.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function JI(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],YI)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(mn).insert(i[s]))}),(e.subcontext||[]).forEach((s,a)=>{const o=t.subcontext[a];o&&o.setState(s)})}function a$(e,t,n,i){return new o$(e,t,n,i)}function o$(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||NI,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Mv(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)}o$.prototype=Mv.prototype={fork(){const e=new Mv(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),_I(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 s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const a=n.data[s]||(n.data[s]={});e.data[s].forEach(o=>a[o]=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[W1(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:kI,parseOperator:MI,parseOperatorParameters:LI,parseParameters:BI,parseStream:VI,parseUpdate:XI,getState:KI,setState:JI};function QI(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),u$(t,e.description()))}function u$(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function ZI(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const Oh="default";function e4(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Oh,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?q(r)?r:r.user:Oh,a=i.item&&i.item.cursor||null;return r&&s===r.user&&a==r.item?r:{user:s,item:a}}),e.add(null,function(n){let i=n.cursor,r=this.value;return q(i)||(r=i.item,i=i.user),lg(e,i&&i!==Oh?i:r||i),r},{cursor:t})}function lg(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 zc(e,t){var n=e._runtime.data;return H(n,t)||S("Unrecognized data set: "+t),n[t]}function t4(e,t){return arguments.length<2?zc(this,e).values.value:Vf.call(this,e,Bs().remove(mn).insert(t))}function Vf(e,t){DC(t)||S("Second argument to changes must be a changeset.");const n=zc(this,e);return n.modified=!0,this.pulse(n.input,t)}function n4(e,t){return Vf.call(this,e,Bs().insert(t))}function i4(e,t){return Vf.call(this,e,Bs().remove(t))}function l$(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function c$(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Xf(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function r4(e){var t=Xf(e),n=l$(e),i=c$(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(s){e.error(s)}})}function s4(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,a,o;return r&&(o=Xf(e),a=t.changedTouches?t.changedTouches[0]:t,s=Pf(a,r),s[0]-=o[0],s[1]-=o[1]),t.dataflow=e,t.item=n,t.vega=a4(e,n,s),t}function a4(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(a){var o=i,u;if(a){for(u=t;u;u=u.mark.group)if(u.mark.name===a){o=u;break}}return o&&o.mark&&o.mark.interactive?o:{}}function s(a){if(!a)return n;q(a)&&(a=r(a));const o=n.slice();for(;a;)o[0]-=a.x||0,o[1]-=a.y||0,a=a.mark&&a.mark.group;return o}return{view:kt(e),item:kt(t||{}),group:r,xy:s,x:a=>s(a)[0],y:a=>s(a)[1]}}const Lv="view",o4="timer",u4="window",l4={trap:!1};function c4(e){const t=se({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{D(i[s])&&(i[s]=Ln(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function f$(e,t,n,i){e._eventListeners.push({type:n,sources:W(t),handler:i})}function f4(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 Rl(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||j(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function d4(e,t,n){var i=this,r=new bf(n),s=function(l,c){i.runAsync(null,()=>{e===Lv&&f4(i,t)&&l.preventDefault(),r.receive(s4(i,l,c))})},a;if(e===o4)Rl(i,"timer",t)&&i.timer(s,t);else if(e===Lv)Rl(i,"view",t)&&i.addEventListener(t,s,l4);else if(e===u4?Rl(i,"window",t)&&typeof window<"u"&&(a=[window]):typeof document<"u"&&Rl(i,"selector",t)&&(a=Array.from(document.querySelectorAll(e))),!a)i.warn("Can not resolve event source: "+e);else{for(var o=0,u=a.length;o<u;++o)a[o].addEventListener(t,s);f$(i,a,t,s)}return r}function Bv(e){return e.item}function Pv(e){return e.item.mark.source}function Iv(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function h4(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",Bv),Pv,Iv(e)),this.on(this.events("view","pointerout",Bv),Pv,Iv(t)),this}function p4(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,s,a,o,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(a=i[r],s=a.sources.length;--s>=0;)a.sources[s].removeEventListener(a.type,a.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,o=n[r].handler,this._handler.off(u,o);return this}function en(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 g4="vega-bind",m4="vega-bind-name",y4="vega-bind-radio";function b4(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:a=>{a!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,a)})}},i.debounce&&(r.update=cm(i.debounce,r.update))),(i.input==null&&i.element?x4:E4)(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 x4(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),f$(i,t,r,s),e.set=a=>{t.value=a,t.dispatchEvent(v4(r))}}function v4(e){return typeof Event<"u"?new Event(e):{type:e}}function E4(e,t,n,i){const r=i.signal(n.signal),s=en("div",{class:g4}),a=n.input==="radio"?s:s.appendChild(en("label"));a.appendChild(en("span",{class:m4},n.name||n.signal)),t.appendChild(s);let o=A4;switch(n.input){case"checkbox":o=C4;break;case"select":o=w4;break;case"radio":o=F4;break;case"range":o=S4;break}o(e,a,n,r)}function A4(e,t,n,i){const r=en("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function C4(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=en("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=a=>s.checked=!!a||null}function w4(e,t,n,i){const r=en("select",{name:n.signal}),s=n.labels||[];n.options.forEach((a,o)=>{const u={value:a};Uc(a,i)&&(u.selected=!0),r.appendChild(en("option",u,(s[o]||a)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=a=>{for(let o=0,u=n.options.length;o<u;++o)if(Uc(n.options[o],a)){r.selectedIndex=o;return}}}function F4(e,t,n,i){const r=en("span",{class:y4}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((a,o)=>{const u={type:"radio",name:n.signal,value:a};Uc(a,i)&&(u.checked=!0);const l=en("input",u);l.addEventListener("change",()=>e.update(a));const c=en("label",{},(s[o]||a)+"");return c.prepend(l),r.appendChild(c),l}),e.set=a=>{const o=e.elements,u=o.length;for(let l=0;l<u;++l)Uc(o[l].value,a)&&(o[l].checked=!0)}}function S4(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,s=n.min||Math.min(0,r,+i)||0,a=n.step||au(s,r,100),o=en("input",{type:"range",name:n.signal,min:s,max:r,step:a});o.value=i;const u=en("span",{},+i);t.appendChild(o),t.appendChild(u);const l=()=>{u.textContent=o.value,e.update(+o.value)};o.addEventListener("input",l),o.addEventListener("change",l),e.elements=[o],e.set=c=>{o.value=c,u.textContent=c}}function Uc(e,t){return e===t||e+""==t+""}function d$(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,l$(e),c$(e),Xf(e),r,s).background(e.background())}function G1(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function $4(e,t,n,i){const r=new i(e.loader(),G1(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Xf(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function k4(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=If(i);e=n._el=e?Rh(n,e,!0):null,QI(n),s||n.error("Unrecognized renderer type: "+i);const a=s.handler||Xu,o=e?s.renderer:s.headless;return n._renderer=o?d$(n,n._renderer,e,o):null,n._handler=$4(n,n._handler,e,a),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=Rh(n,t,!0):e.appendChild(en("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=Rh(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{b4(n,u.element||t,u)})),n}function Rh(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 Co=e=>+e||0,D4=e=>({top:e,bottom:e,left:e,right:e});function zv(e){return j(e)?{top:Co(e.top),bottom:Co(e.bottom),left:Co(e.left),right:Co(e.right)}:D4(Co(e))}async function H1(e,t,n,i){const r=If(t),s=r&&r.headless;return s||S("Unrecognized renderer type: "+t),await e.runAsync(),d$(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function O4(e,t){e!==pr.Canvas&&e!==pr.SVG&&e!==pr.PNG&&S("Unrecognized image type: "+e);const n=await H1(this,e,t);return e===pr.SVG?R4(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function R4(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function _4(e,t){return(await H1(this,pr.Canvas,e,t)).canvas()}async function T4(e){return(await H1(this,pr.SVG,e)).svg()}function N4(e,t,n){return a$(e,Aa,yu,n).parse(t)}function M4(e){var t=this._runtime.scales;return H(t,e)||S("Unrecognized scale or projection: "+e),t[e].value}var h$="width",p$="height",V1="padding",Uv={skip:!0};function g$(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===V1?i.left+i.right:0)}function m$(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===V1?i.top+i.bottom:0)}function L4(e){var t=e._signals,n=t[h$],i=t[p$],r=t[V1];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,o=>{e._width=o.size,e._viewWidth=g$(e,o.size),s()},{size:n}),e._resizeHeight=e.add(null,o=>{e._height=o.size,e._viewHeight=m$(e,o.size),s()},{size:i});const a=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,a.rank=r.rank+1}function B4(e,t,n,i,r,s){this.runAfter(a=>{let o=0;a._autosize=0,a.width()!==n&&(o=1,a.signal(h$,n,Uv),a._resizeWidth.skip(!0)),a.height()!==i&&(o=1,a.signal(p$,i,Uv),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),(a._origin[0]!==r[0]||a._origin[1]!==r[1])&&(a._resize=1,a._origin=r),o&&a.run("enter"),s&&a.runAfter(u=>u.resize())},!1,1)}function P4(e){return this._runtime.getState(e||{data:I4,signals:z4,recurse:!0})}function I4(e,t){return t.modified&&D(t.input.value)&&!e.startsWith("_:vega:_")}function z4(e,t){return!(e==="parent"||t instanceof Aa.proxy)}function U4(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function j4(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push($5(n,t))}function q4(e,t,n,i){const r=e.element();r&&r.setAttribute("title",W4(i))}function W4(e){return e==null?"":D(e)?y$(e):j(e)&&!xr(e)?G4(e):e+""}function G4(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(D(n)?y$(n):b$(n))}).join(` 9`)}function y$(e){return"["+e.map(b$).join(", ")+"]"}function b$(e){return D(e)?"[â¦]":j(e)&&!xr(e)?"{â¦}":e}function H4(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{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 x$(e,t){const n=this;if(t=t||{},pa.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 s=se({},e.locale,t.locale);n.locale(xC(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||pr.Canvas,n._scenegraph=new hF;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||q4,n._redraw=!0,n._handler=new Xu().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=c4(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=N4(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:se({},s)})),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=g$(n,n._width),n._viewHeight=m$(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,L4(n),ZI(n),e4(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function _l(e,t){return H(e._signals,t)?e._signals[t]:S("Unrecognized signal name: "+P(t))}function v$(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function jv(e,t,n,i){let r=v$(n,i);return r||(r=G1(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function qv(e,t,n){const i=v$(t,n);return i&&t._targets.remove(i),e}z(x$,pa,{async evaluate(e,t,n){if(await pa.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,r4(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Xl(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&&u$(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=_l(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",zv(e)):zv(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?(If(e)||S("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&&(pa.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(_l(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:B4,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=G1(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,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,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 jv(this,e,_l(this,e),t)},removeSignalListener(e,t){return qv(this,_l(this,e),t)},addDataListener(e,t){return jv(this,e,zc(this,e).values,t)},removeDataListener(e,t){return qv(this,zc(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=lg(this,null);this._globalCursor=!!e,t&&lg(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:j4,events:d4,finalize:p4,hover:h4,data:t4,change:Vf,insert:n4,remove:i4,scale:M4,initialize:k4,toImageURL:O4,toCanvas:_4,toSVG:T4,getState:P4,setState:U4,_watchPixelRatio:H4});const V4="view",jc="[",qc="]",E$="{",A$="}",X4=":",C$=",",Y4="@",K4=">",J4=/[[\]{}]/,Q4={"*":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 w$,F$;function Br(e,t,n){return w$=t||V4,F$=n||Q4,S$(e.trim()).map(cg)}function Z4(e){return F$[e]}function tu(e,t,n,i,r){const s=e.length;let a=0,o;for(;t<s;++t){if(o=e[t],!a&&o===n)return t;r&&r.indexOf(o)>=0?--a:i&&i.indexOf(o)>=0&&++a}return t}function S$(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=tu(e,r,C$,jc+E$,qc+A$),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function cg(e){return e[0]==="["?ez(e):tz(e)}function ez(e){const t=e.length;let n=1,i;if(n=tu(e,n,qc,jc,qc),n===t)throw"Empty between selector: "+e;if(i=S$(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==K4)throw"Expected '>' after between selector: "+e;i=i.map(cg);const r=cg(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function tz(e){const t={source:w$},n=[];let i=[0,0],r=0,s=0,a=e.length,o=0,u,l;if(e[a-1]===A$){if(o=e.lastIndexOf(E$),o>=0){try{i=nz(e.substring(o+1,a-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,o).trim(),a=e.length}else throw"Unmatched right brace: "+e;o=0}if(!a)throw e;if(e[0]===Y4&&(r=++o),u=tu(e,o,X4),u<a&&(n.push(e.substring(s,u).trim()),s=o=++u),o=tu(e,o,jc),o===a)n.push(e.substring(s,a).trim());else if(n.push(e.substring(s,o).trim()),l=[],s=++o,s===a)throw"Unmatched left bracket: "+e;for(;o<a;){if(o=tu(e,o,qc),o===a)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,o).trim()),o<a-1&&e[++o]!==jc)throw"Expected left bracket: "+e;s=++o}if(!(a=n.length)||J4.test(n[a-1]))throw"Invalid event selector: "+e;return a>1?(t.type=n[1],r?t.markname=n[0].slice(1):Z4(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 nz(e){const t=e.split(C$);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function iz(e){return j(e)?e:{type:e||"pad"}}const wo=e=>+e||0,rz=e=>({top:e,bottom:e,left:e,right:e});function sz(e){return j(e)?e.signal?e:{top:wo(e.top),bottom:wo(e.bottom),left:wo(e.left),right:wo(e.right)}:rz(wo(e))}const Ze=e=>j(e)&&!D(e)?se({},e):{value:e};function Wv(e,t,n,i){return n!=null?(j(n)&&!D(n)||D(n)&&n.length&&j(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function ht(e,t,n){for(const i in t)Wv(e,i,t[i]);for(const i in n)Wv(e,i,n[i],"update")}function no(e,t,n){for(const i in t)n&&H(n,i)||(e[i]=se(e[i]||{},t[i]));return e}function oa(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const X1="mark",Y1="frame",K1="scope",az="axis",oz="axis-domain",uz="axis-grid",lz="axis-label",cz="axis-tick",fz="axis-title",dz="legend",hz="legend-band",pz="legend-entry",gz="legend-gradient",$$="legend-label",mz="legend-symbol",yz="legend-title",bz="title",xz="title-text",vz="title-subtitle";function Ez(e,t,n,i,r){const s={},a={};let o,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!oa(u,e)&&_h(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===Y1?r.group:n===X1?se({},r.mark,r[t]):null;for(u in c)l=oa(u,e)||(u==="fill"||u==="stroke")&&(oa("fill",e)||oa("stroke",e)),l||_h(s,u,c[u]);W(i).forEach(f=>{const d=r.style&&r.style[f];for(const p in d)oa(p,e)||_h(s,p,d[p])}),e=se({},e);for(u in s)c=s[u],c.signal?(o=o||{})[u]=c:a[u]=c;return e.enter=se(a,e.enter),o&&(e.update=se(o,e.update)),e}function _h(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const k$=e=>q(e)?P(e):e.signal?`(${e.signal})`:D$(e);function Yf(e){if(e.gradient!=null)return Cz(e);let t=e.signal?`(${e.signal})`:e.color?Az(e.color):e.field!=null?D$(e.field):e.value!==void 0?P(e.value):void 0;return e.scale!=null&&(t=wz(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${uc(e.exponent)})`),e.mult!=null&&(t+=`*${uc(e.mult)}`),e.offset!=null&&(t+=`+${uc(e.offset)}`),e.round&&(t=`round(${t})`),t}const Tl=(e,t,n,i)=>`(${e}(${[t,n,i].map(Yf).join(",")})+'')`;function Az(e){return e.c?Tl("hcl",e.h,e.c,e.l):e.h||e.s?Tl("hsl",e.h,e.s,e.l):e.l||e.a?Tl("lab",e.l,e.a,e.b):e.r||e.g||e.b?Tl("rgb",e.r,e.g,e.b):null}function Cz(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:P(n));for(;t.length&&ce(t)==null;)t.pop();return t.unshift(k$(e.gradient)),`gradient(${t.join(",")})`}function uc(e){return j(e)?"("+Yf(e)+")":e}function D$(e){return O$(j(e)?e:{datum:e})}function O$(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):S("Invalid field reference: "+P(e));return e.signal||(i=q(i)?bi(i).map(P).join("]["):O$(i)),t+"["+i+"]"}function wz(e,t){const n=k$(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?"":"*"+uc(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Fz(e){let t="";return e.forEach(n=>{const i=Yf(n);t+=n.test?`(${n.test})?${i}:`:i}),ce(t)===":"&&(t+="null"),t}function R$(e,t,n,i,r,s){const a={};s=s||{},s.encoders={$encode:a},e=Ez(e,t,n,i,r.config);for(const o in e)a[o]=Sz(e[o],t,s,r);return s}function Sz(e,t,n,i){const r={},s={};for(const a in e)e[a]!=null&&(r[a]=kz($z(e[a]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function $z(e){return D(e)?Fz(e):Yf(e)}function kz(e,t,n,i){const r=pi(e,t);return r.$fields.forEach(s=>i[s]=1),se(n,r.$params),r.$expr}const Dz="outer",Oz=["value","update","init","react","bind"];function Gv(e,t){S(e+' for "outer" push: '+P(t))}function _$(e,t){const n=e.name;if(e.push===Dz)t.signals[n]||Gv("No prior signal definition",n),Oz.forEach(i=>{e[i]!==void 0&&Gv("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 fg(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Kf(e,t,n,i){return new fg(e,t,n,i)}function Wc(e,t){return Kf("operator",e,t)}function Z(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function bu(e,t){return t?{$field:e,$name:t}:{$field:e}}const dg=bu("key");function Hv(e,t){return{$compare:e,$order:t}}function Rz(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const _z="ascending",Tz="descending";function Nz(e){return j(e)?(e.order===Tz?"-":"+")+Jf(e.op,e.field):""}function Jf(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const J1="scope",hg="view";function Ye(e){return e&&e.signal}function Mz(e){return e&&e.expr}function lc(e){if(Ye(e))return!0;if(j(e)){for(const t in e)if(lc(e[t]))return!0}return!1}function kn(e,t){return e??t}function cs(e){return e&&e.signal||e}const Vv="timer";function xu(e,t){return(e.merge?Bz:e.stream?Pz:e.type?Iz:S("Invalid stream specification: "+P(e)))(e,t)}function Lz(e){return e===J1?hg:e||hg}function Bz(e,t){const n=e.merge.map(r=>xu(r,t)),i=Q1({merge:n},e,t);return t.addStream(i).id}function Pz(e,t){const n=xu(e.stream,t),i=Q1({stream:n},e,t);return t.addStream(i).id}function Iz(e,t){let n;e.type===Vv?(n=t.event(Vv,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Lz(e.source),e.type);const i=Q1({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function Q1(e,t,n){let i=t.between;return i&&(i.length!==2&&S('Stream "between" parameter must have 2 entries: '+P(t)),e.between=[xu(i[0],n),xu(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(zz(t.marktype,t.markname,t.markrole)),t.source===J1&&i.push("inScope(event.item)"),i.length&&(e.filter=pi("("+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 zz(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 Uz={code:"_.$value",ast:{type:"Identifier",value:"value"}};function jz(e,t,n){const i=e.encode,r={target:n};let s=e.events,a=e.update,o=[];s||S("Signal update missing events specification."),q(s)&&(s=Br(s,t.isSubscope()?J1:hg)),s=W(s).filter(u=>u.signal||u.scale?(o.push(u),0):1),o.length>1&&(o=[Wz(o)]),s.length&&o.push(s.length>1?{merge:s}:s[0]),i!=null&&(a&&S("Signal encode and update are mutually exclusive."),a="encode(item(),"+P(i)+")"),r.update=q(a)?pi(a,t):a.expr!=null?pi(a.expr,t):a.value!=null?a.value:a.signal!=null?{$expr:Uz,$params:{$value:t.signalRef(a.signal)}}:S("Invalid signal update specification."),e.force&&(r.options={force:!0}),o.forEach(u=>t.addUpdate(se(qz(u,t),r)))}function qz(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):xu(e,t)}}function Wz(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function Gz(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?S("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=pi(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>jz(r,t,n.id))}const Se=e=>(t,n,i)=>Kf(e,n,t||void 0,i),T$=Se("aggregate"),Hz=Se("axisticks"),N$=Se("bound"),Wn=Se("collect"),Xv=Se("compare"),Vz=Se("datajoin"),M$=Se("encode"),Xz=Se("expression"),Yz=Se("facet"),Kz=Se("field"),Jz=Se("key"),Qz=Se("legendentries"),Zz=Se("load"),eU=Se("mark"),tU=Se("multiextent"),nU=Se("multivalues"),iU=Se("overlap"),rU=Se("params"),L$=Se("prefacet"),sU=Se("projection"),aU=Se("proxy"),oU=Se("relay"),B$=Se("render"),uU=Se("scale"),zs=Se("sieve"),lU=Se("sortitems"),P$=Se("viewlayout"),cU=Se("values");let fU=0;const I$={min:"min",max:"max",count:"sum"};function dU(e,t){const n=e.type||"linear";Fw(n)||S("Unrecognized scale type: "+P(n)),t.addScale(e.name,{type:n,domain:void 0})}function hU(e,t){const n=t.getScale(e.name).params;let i;n.domain=z$(e.domain,e,t),e.range!=null&&(n.range=j$(e,t,n)),e.interpolate!=null&&CU(e.interpolate,n),e.nice!=null&&(n.nice=AU(e.nice,t)),e.bins!=null&&(n.bins=EU(e.bins,t));for(i in e)H(n,i)||i==="name"||(n[i]=fn(e[i],t))}function fn(e,t){return j(e)?e.signal?t.signalRef(e.signal):S("Unsupported object: "+P(e)):e}function cc(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>fn(n,t))}function Qf(e){S("Can not find data set: "+P(e))}function z$(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&S("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(D(e)?pU:e.fields?mU:gU)(e,t,n)}function pU(e,t,n){return e.map(i=>fn(i,n))}function gU(e,t,n){const i=n.getData(e.data);return i||Qf(e.data),Fa(t.type)?i.valuesRef(n,e.field,U$(e.sort,!1)):kw(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function mU(e,t,n){const i=e.data,r=e.fields.reduce((s,a)=>(a=q(a)?{data:i,field:a}:D(a)||a.signal?yU(a,n):a,s.push(a),s),[]);return(Fa(t.type)?bU:kw(t.type)?xU:vU)(e,n,r)}function yU(e,t){const n="_:vega:_"+fU++,i=Wn({});if(D(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+P(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,zs({})]),{data:n,field:"data"}}function bU(e,t,n){const i=U$(e.sort,!0);let r,s;const a=n.map(l=>{const c=t.getData(l.data);return c||Qf(l.data),c.countsRef(t,l.field,i)}),o={groupby:dg,pulse:a};i&&(r=i.op||"count",s=i.field?Jf(r,i.field):"count",o.ops=[I$[r]],o.fields=[t.fieldRef(s)],o.as=[s]),r=t.add(T$(o));const u=t.add(Wn({pulse:Z(r)}));return s=t.add(cU({field:dg,sort:t.sortRef(i),pulse:Z(u)})),Z(s)}function U$(e,t){return e&&(!e.field&&!e.op?j(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?S("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!I$[e.op]&&S("Multiple domain scales can not be sorted using "+e.op)),e}function xU(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Qf(r.data),s.domainRef(t,r.field)});return Z(t.add(nU({values:i})))}function vU(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Qf(r.data),s.extentRef(t,r.field)});return Z(t.add(tU({extents:i})))}function EU(e,t){return e.signal||D(e)?cc(e,t):t.objectProperty(e)}function AU(e,t){return e.signal?t.signalRef(e.signal):j(e)?{interval:fn(e.interval),step:fn(e.step)}:fn(e)}function CU(e,t){t.interpolate=fn(e.type||e),e.gamma!=null&&(t.interpolateGamma=fn(e.gamma))}function j$(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(q(r)){if(i&&H(i,r))return e=se({},e,{range:i[r]}),j$(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Fa(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:S("Unrecognized scale range value: "+P(r))}else if(r.scheme){n.scheme=D(r.scheme)?cc(r.scheme,t):fn(r.scheme,t),r.extent&&(n.schemeExtent=cc(r.extent,t)),r.count&&(n.schemeCount=fn(r.count,t));return}else if(r.step){n.rangeStep=fn(r.step,t);return}else{if(Fa(e.type)&&!D(r))return z$(r,e,t);D(r)||S("Unsupported range type: "+P(r))}return r.map(s=>(D(s)?cc:fn)(s,t))}function wU(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=pg(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=pg(n[r],r,t));t.addProjection(e.name,i)}function pg(e,t,n){return D(e)?e.map(i=>pg(i,t,n)):j(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:S("Unsupported parameter object: "+P(e)):e}const Gn="top",io="left",ro="right",Dr="bottom",q$="center",FU="vertical",SU="start",$U="middle",kU="end",gg="index",Z1="label",DU="offset",Oa="perc",OU="perc2",hn="value",Zu="guide-label",ey="guide-title",RU="group-title",_U="group-subtitle",Yv="symbol",fc="gradient",mg="discrete",yg="size",TU="shape",NU="fill",MU="stroke",LU="strokeWidth",BU="strokeDash",PU="opacity",ty=[yg,TU,NU,MU,LU,BU,PU],el={name:1,style:1,interactive:1},fe={value:0},pn={value:1},Zf="group",W$="rect",ny="rule",IU="symbol",Us="text";function vu(e){return e.type=Zf,e.interactive=e.interactive||!1,e}function Xt(e,t){const n=(i,r)=>kn(e[i],kn(t[i],r));return n.isVertical=i=>FU===kn(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>kn(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>kn(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>kn(e.columns,kn(t.columns,+n.isVertical(!0))),n}function G$(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 zU(e,t,n){const i=t.config.style[n];return i&&i[e]}function ed(e,t,n){return`item.anchor === '${SU}' ? ${e} : item.anchor === '${kU}' ? ${t} : ${n}`}const iy=ed(P(io),P(ro),P(q$));function UU(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'`},j(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 H$(e,t){return t?e?j(e)?Object.assign({},e,{offset:H$(e.offset,t)}):{value:e,offset:t}:t:e}function an(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=no(e.encode,t,el)):e.interactive=!1,e}function jU(e,t,n,i){const r=Xt(e,n),s=r.isVertical(),a=r.gradientThickness(),o=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=a,d=o):(l=[0,0],c=[1,0],f=o,d=a);const p={enter:u={opacity:fe,x:fe,y:fe,width:Ze(f),height:Ze(d)},update:se({},u,{opacity:pn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:fe}};return ht(p,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),an({type:W$,role:gz,encode:p},i)}function qU(e,t,n,i,r){const s=Xt(e,n),a=s.isVertical(),o=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,p="";a?(l="y",f="y2",c="x",d="width",p="1-"):(l="x",f="x2",c="y",d="height");const h={opacity:fe,fill:{scale:t,field:hn}};h[l]={signal:p+"datum."+Oa,mult:u},h[c]=fe,h[f]={signal:p+"datum."+OU,mult:u},h[d]=Ze(o);const g={enter:h,update:se({},h,{opacity:pn}),exit:{opacity:fe}};return ht(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),an({type:W$,role:hz,key:hn,from:r,encode:g},i)}const WU=`datum.${Oa}<=0?"${io}":datum.${Oa}>=1?"${ro}":"${q$}"`,GU=`datum.${Oa}<=0?"${Dr}":datum.${Oa}>=1?"${Gn}":"${$U}"`;function Kv(e,t,n,i){const r=Xt(e,t),s=r.isVertical(),a=Ze(r.gradientThickness()),o=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,p="";const h={enter:l={opacity:fe},update:c={opacity:pn,text:{field:Z1}},exit:{opacity:fe}};return ht(h,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:kn(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:GU},f="y",d="x",p="1-"):(l.align=c.align={signal:WU},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:p+"datum."+Oa,mult:o},l[d]=c[d]=a,a.offset=kn(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+gg}:void 0,an({type:Us,role:$$,style:Zu,key:hn,from:i,encode:h,overlap:u},n)}function HU(e,t,n,i,r){const s=Xt(e,t),a=n.entries,o=!!(a&&a.interactive),u=a?a.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${DU} : datum.${yg}`,p=l?Ze(l):{field:yg},h=`datum.${gg}`,g=`max(1, ${r})`;let m,y,b,v,A;p.mult=.5,m={enter:y={opacity:fe,x:{signal:d,mult:.5,offset:c},y:p},update:b={opacity:pn,x:y.x,y:y.y},exit:{opacity:fe}};let E=null,C=null;e.fill||(E=t.symbolBaseFillColor,C=t.symbolBaseStrokeColor),ht(m,{fill:s("symbolFillColor",E),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",C),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),ty.forEach(L=>{e[L]&&(b[L]=y[L]={scale:e[L],field:hn})});const x=an({type:IU,role:mz,key:hn,from:f,clip:l?!0:void 0,encode:m},n.symbols),w=Ze(c);w.offset=s("labelOffset"),m={enter:y={opacity:fe,x:{signal:d,offset:w},y:p},update:b={opacity:pn,text:{field:Z1},x:y.x,y:y.y},exit:{opacity:fe}},ht(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const R=an({type:Us,role:$$,style:Zu,key:hn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:fe,height:l?Ze(l):fe,opacity:fe},exit:{opacity:fe},update:b={opacity:pn,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${h}%${v}`,b.column.signal=`floor(${h} / ${v})`,A={field:["row",h]}):(b.row.signal=`floor(${h} / ${g})`,b.column.signal=`${h} % ${g}`,A={field:h}),b.column.signal=`(${r})?${b.column.signal}:${h}`,i={facet:{data:i,name:"value",groupby:gg}},vu({role:K1,from:i,encode:no(m,a,el),marks:[x,R],name:u,interactive:o,sort:A})}function VU(e,t){const n=Xt(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ry='item.orient === "left"',sy='item.orient === "right"',td=`(${ry} || ${sy})`,XU=`datum.vgrad && ${td}`,YU=ed('"top"','"bottom"','"middle"'),KU=ed('"right"','"left"','"center"'),JU=`datum.vgrad && ${sy} ? (${KU}) : (${td} && !(datum.vgrad && ${ry})) ? "left" : ${iy}
9`,QU=`item._anchor || (${td} ? "middle" : "start")`,ZU=`${XU} ? (${ry} ? -90 : 90) : 0`,ej=`${td} ? (datum.vgrad ? (${sy} ? "bottom" : "top") : ${YU}) : "top"`;function tj(e,t,n,i){const r=Xt(e,t),s={enter:{opacity:fe},update:{opacity:pn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:fe}};return ht(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:QU},angle:{signal:ZU},align:{signal:JU},baseline:{signal:ej},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")}),an({type:Us,role:yz,style:ey,from:i,encode:s},n)}function nj(e,t){let n;return j(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Jv(e.path)+")":e.sphere&&(n="geoShape("+Jv(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Jv(e){return j(e)&&e.signal?e.signal:P(e)}function V$(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===Zf?K1:t||X1}function ij(e){return{marktype:e.type,name:e.name||void 0,role:e.role||V$(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function rj(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function ay(e,t){const n=_C(e.type);n||S("Unrecognized transform type: "+P(e.type));const i=Kf(n.type.toLowerCase(),null,X$(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function X$(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const a=e.params[s];i[a.name]=sj(a,t,n)}return i}function sj(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return aj(e,t,n);if(r===void 0){e.required&&S("Missing required "+P(t.type)+" parameter: "+P(e.name));return}else{if(i==="param")return oj(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!Ye(r)?r.map(s=>Qv(e,s,n)):Qv(e,r,n)}function Qv(e,t,n){const i=e.type;if(Ye(t))return eE(i)?S("Expression references can not be signals."):Th(i)?n.fieldRef(t):tE(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||Th(i);return r&&uj(t)?n.exprRef(t.expr,t.as):r&&lj(t)?bu(t.field,t.as):eE(i)?pi(t,n):cj(i)?Z(n.getData(t).values):Th(i)?bu(t):tE(i)?n.compareRef(t):t}}function aj(e,t,n){return q(t.from)||S('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function oj(e,t,n){const i=t[e.name];return e.array?(D(i)||S("Expected an array of sub-parameters. Instead: "+P(i)),i.map(r=>Zv(e,r,n))):Zv(e,i,n)}function Zv(e,t,n){const i=e.params.length;let r;for(let a=0;a<i;++a){r=e.params[a];for(const o in r.key)if(r.key[o]!==t[o]){r=null;break}if(r)break}r||S("Unsupported parameter: "+P(t));const s=se(X$(r,t,n),r.key);return Z(n.add(rU(s)))}const uj=e=>e&&e.expr,lj=e=>e&&e.field,cj=e=>e==="data",eE=e=>e==="expr",Th=e=>e==="field",tE=e=>e==="compare";function fj(e,t,n){let i,r,s,a,o;return e?(i=e.facet)&&(t||S("Only group marks can be faceted."),i.field!=null?a=o=dc(i,n):(e.data?o=Z(n.getData(e.data).aggregate):(s=ay(se({type:"aggregate",groupby:W(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=dc(i,n),a=o=Z(n.add(s))),r=n.keyRef(i.groupby,!0))):a=Z(n.add(Wn(null,[{}]))),a||(a=dc(e,n)),{key:r,pulse:a,parent:o}}function dc(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Z(t.getData(e.data).output)}function As(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}As.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],a=null,o=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);o<n;++o)t[o].params.pulse=Z(t[o-1]),e.add(t[o]),t[o].type==="aggregate"&&(a=t[o]);return new As(e,s,r,i,a)};function Y$(e){return q(e)?e:null}function nE(e,t,n){const i=Jf(n.op,n.field);let r;if(t.ops){for(let s=0,a=t.as.length;s<a;++s)if(t.as[s]===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 Fo(e,t,n,i,r,s,a){const o=t[n]||(t[n]={}),u=Nz(s);let l=Y$(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=o[l]),!c){const d=s?{field:dg,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:Z(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(Kf(i,void 0,d)),a&&(t.index[r]=f),c=Z(f),l!=null&&(o[l]=c)}return c}As.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=Y$(t);let a,o,u;return s!=null&&(e=i.scope,a=r[s]),a?n&&n.field&&nE(e,a.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:Z(i.output)},n&&n.field&&nE(e,u,n),o=e.add(T$(u)),a=e.add(Wn({pulse:Z(o)})),a={agg:o,ref:Z(a)},s!=null&&(r[s]=a)),a.ref},tuplesRef(){return Z(this.values)},extentRef(e,t){return Fo(e,this,"extent","extent",t,!1)},domainRef(e,t){return Fo(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Fo(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Fo(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Fo(e,this,"indata","tupleindex",t,!0,!0)}};function dj(e,t,n){const i=e.from.facet,r=i.name,s=dc(i,t);let a;i.name||S("Facet must have a name: "+P(i)),i.data||S("Facet must reference a data set: "+P(i)),i.field?a=t.add(L$({field:t.fieldRef(i.field),pulse:s})):i.groupby?a=t.add(Yz({key:t.keyRef(i.groupby),group:Z(t.proxy(n.parent)),pulse:s})):S("Facet must specify groupby or field: "+P(i));const o=t.fork(),u=o.add(Wn()),l=o.add(zs({pulse:Z(u)}));o.addData(r,new As(o,u,u,l)),o.addSignal("parent",null),a.params.subflow={$subflow:o.parse(e).toRuntime()}}function hj(e,t,n){const i=t.add(L$({pulse:n.pulse}
vendor: 27,710 bytes, line 9
9)),r=t.fork();r.add(zs()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function K$(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,a=e.modify,o=e.values,u=t.add(Wc()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,a,o].map(f=>f??"null").join(",")+"),0)",c=pi(l,t);u.update=c.$expr,u.params=c.$params}function nd(e,t){const n=V$(e),i=e.type===Zf,r=e.from&&e.from.facet,s=e.overlap;let a=e.layout||n===K1||n===Y1,o,u,l,c,f,d,p;const h=n===X1||a||r,g=fj(e.from,i,t);u=t.add(Vz({key:g.key||(e.key?bu(e.key):void 0),pulse:g.pulse,clean:!i}));const m=Z(u);u=l=t.add(Wn({pulse:m})),u=t.add(eU({markdef:ij(e),interactive:rj(e.interactive,t),clip:nj(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Z(u)}));const y=Z(u);u=c=t.add(M$(R$(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(C=>{const x=ay(C,t),w=x.metadata;(w.generates||w.changes)&&S("Mark transforms should not generate new data."),w.nomod||(c.params.mod=!0),x.params.pulse=Z(u),t.add(u=x)}),e.sort&&(u=t.add(lU({sort:t.compareRef(e.sort),pulse:Z(u)})));const b=Z(u);(r||a)&&(a=t.add(P$({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Z(a));const v=t.add(N$({mark:y,pulse:d||b}));p=Z(v),i&&(h&&(o=t.operators,o.pop(),a&&o.pop()),t.pushState(b,d||p,m),r?dj(e,t,g):h?hj(e,t,g):t.parse(e),t.popState(),h&&(a&&o.push(a),o.push(v))),s&&(p=pj(s,p,t));const A=t.add(B$({pulse:p})),E=t.add(zs({pulse:Z(A)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new As(t,l,A,E)),e.on&&e.on.forEach(C=>{(C.insert||C.remove||C.toggle)&&S("Marks only support modify triggers."),K$(C,t,f)}))}function pj(e,t,n){const i=e.method,r=e.bound,s=e.separation,a={separation:Ye(s)?n.signalRef(s.signal):s,method:Ye(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),r){const o=r.tolerance;a.boundTolerance=Ye(o)?n.signalRef(o.signal):+o,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return Z(n.add(iU(a)))}function gj(e,t){const n=t.config.legend,i=e.encode||{},r=Xt(e,n),s=i.legend||{},a=s.name||void 0,o=s.interactive,u=s.style,l={};let c=0,f,d,p;ty.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||S("Missing valid scale for legend.");const h=mj(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:h,vgrad:h!=="symbol"&&r.isVertical()},m=Z(t.add(Wn(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=Z(t.add(Qz(d={type:h,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 h===fc?(p=[jU(e,c,n,i.gradient),Kv(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${cs(r.gradientLength())})/100))`)):h===mg?p=[qU(e,c,n,i.gradient,b),Kv(e,n,i.labels,b)]:(f=VU(e,n),p=[HU(e,n,i,b,cs(f.columns))],d.size=xj(e,t,p[0].marks)),p=[vu({role:pz,from:m,encode:y,marks:p,layout:f,interactive:o})],g.title&&p.push(tj(e,n,i.title,m)),nd(vu({role:dz,from:m,encode:no(bj(r,e,n),s,el),marks:p,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:o,style:u}),t)}function mj(e,t){let n=e.type||Yv;return!e.type&&yj(e)===1&&(e.fill||e.stroke)&&(n=x0(t)?fc:Tp(t)?mg:Yv),n!==fc?n:Tp(t)?mg:fc}function yj(e){return ty.reduce((t,n)=>t+(e[n]?1:0),0)}function bj(e,t,n){const i={enter:{},update:{}};return ht(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 xj(e,t,n){const i=cs(iE("size",e,n)),r=cs(iE("strokeWidth",e,n)),s=cs(vj(n[1].encode,t,Zu));return pi(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function iE(e,t,n){return t[e]?`scale("${t[e]}",datum)`:G$(e,n[0].encode)}function vj(e,t,n){return G$("fontSize",e)||zU("fontSize",t,n)}const Ej=`item.orient==="${io}"?-90:item.orient==="${ro}"?90:0`;function Aj(e,t){e=q(e)?{text:e}:e;const n=Xt(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,a=r.interactive,o=r.style,u=[],l={},c=Z(t.add(Wn(null,[l])));return u.push(Fj(e,n,Cj(e),c)),e.subtitle&&u.push(Sj(e,n,i.subtitle,c)),nd(vu({role:bz,from:c,encode:wj(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:a,style:o}),t)}function Cj(e){const t=e.encode;return t&&t.title||se({name:e.name,interactive:e.interactive,style:e.style},t)}function wj(e,t){const n={enter:{},update:{}};return ht(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:iy},angle:{signal:Ej},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),no(n,t,el)}function Fj(e,t,n,i){const r={value:0},s=e.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return ht(a,{text:s,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")}),an({type:Us,role:xz,style:RU,from:i,encode:a},n)}function Sj(e,t,n,i){const r={value:0},s=e.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return ht(a,{text:s,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")}),an({type:Us,role:vz,style:_U,from:i,encode:a},n)}function $j(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(ay(i,t))}),e.on&&e.on.forEach(i=>{K$(i,t,e.name)}),t.addDataPipeline(e.name,kj(e,t,n))}function kj(e,t,n){const i=[];let r=null,s=!1,a=!1,o,u,l,c,f;for(e.values?Ye(e.values)||lc(e.format)?(i.push(rE(t,e)),i.push(r=Xr())):i.push(r=Xr({$ingest:e.values,$format:e.format})):e.url?lc(e.url)||lc(e.format)?(i.push(rE(t,e)),i.push(r=Xr())):i.push(r=Xr({$request:e.url,$format:e.format})):e.source&&(r=o=W(e.source).map(d=>Z(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=Xr()),i.push(c),f.generates&&(a=!0),f.modifies&&!a&&(s=!0),f.source?r=c:f.changes&&(r=null);return o&&(l=o.length-1,i[0]=oU({derive:s,pulse:l?o:o[0]}),(s||l)&&i.splice(1,0,Xr())),r||i.push(Xr()),i.push(zs({})),i}function Xr(e){const t=Wn({},e);return t.metadata={source:!0},t}function rE(e,t){return Zz({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 J$=e=>e===Dr||e===Gn,id=(e,t,n)=>Ye(e)?_j(e.signal,t,n):e===io||e===Gn?t:n,et=(e,t,n)=>Ye(e)?Oj(e.signal,t,n):J$(e)?t:n,Nn=(e,t,n)=>Ye(e)?Rj(e.signal,t,n):J$(e)?n:t,Q$=(e,t,n)=>Ye(e)?Tj(e.signal,t,n):e===Gn?{value:t}:{value:n},Dj=(e,t,n)=>Ye(e)?Nj(e.signal,t,n):e===ro?{value:t}:{value:n},Oj=(e,t,n)=>Z$(`${e} === '${Gn}' || ${e} === '${Dr}'`,t,n),Rj=(e,t,n)=>Z$(`${e} !== '${Gn}' && ${e} !== '${Dr}'`,t,n),_j=(e,t,n)=>oy(`${e} === '${io}' || ${e} === '${Gn}'`,t,n),Tj=(e,t,n)=>oy(`${e} === '${Gn}'`,t,n),Nj=(e,t,n)=>oy(`${e} === '${ro}'`,t,n),Z$=(e,t,n)=>(t=t!=null?Ze(t):t,n=n!=null?Ze(n):n,sE(t)&&sE(n)?(t=t?t.signal||P(t.value):null,n=n?n.signal||P(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[se({test:e},t)].concat(n||[])),sE=e=>e==null||Object.keys(e).length===1,oy=(e,t,n)=>({signal:`${e} ? (${da(t)}) : (${da(n)})`}),Mj=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${io}' ? (${da(i)}) : `:"")+(n!=null?`${e} === '${Dr}' ? (${da(n)}) : `:"")+(r!=null?`${e} === '${ro}' ? (${da(r)}) : `:"")+(t!=null?`${e} === '${Gn}' ? (${da(t)}) : `:"")+"(null)"}),da=e=>Ye(e)?e.signal:e==null?null:P(e),Lj=(e,t)=>t===0?0:Ye(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},ga=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function ia(e,t,n,i){let r;if(t&&H(t,e))return t[e];if(H(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[ey][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[Zu][r]}return null}function aE(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Bj(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,a=e.orient,o,u,l;if(Ye(a)){const f=aE([n.axisX,n.axisY]),d=aE([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);o={};for(l of f)o[l]=et(a,ia(l,n.axisX,r,i),ia(l,n.axisY,r,i));u={};for(l of d)u[l]=Mj(a.signal,ia(l,n.axisTop,r,i),ia(l,n.axisBottom,r,i),ia(l,n.axisLeft,r,i),ia(l,n.axisRight,r,i))}else o=a===Gn||a===Dr?n.axisX:n.axisY,u=n["axis"+a[0].toUpperCase()+a.slice(1)];return o||u||s?se({},r,o,u,s):r}function Pj(e,t,n,i){const r=Xt(e,t),s=e.orient;let a,o;const u={enter:a={opacity:fe},update:o={opacity:pn},exit:{opacity:fe}};ht(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=oE(e,0),c=oE(e,1);return a.x=o.x=et(s,l,fe),a.x2=o.x2=et(s,c),a.y=o.y=Nn(s,l,fe),a.y2=o.y2=Nn(s,c),an({type:ny,role:oz,from:i,encode:u},n)}function oE(e,t){return{scale:e.scale,range:t}}function Ij(e,t,n,i,r){const s=Xt(e,t),a=e.orient,o=e.gridScale,u=id(a,1,-1),l=zj(e.offset,u);let c,f,d;const p={enter:c={opacity:fe},update:d={opacity:pn},exit:f={opacity:fe}};ht(p,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const h={scale:e.scale,field:hn,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=et(a,{signal:"height"},{signal:"width"}),m=o?{scale:o,range:0,mult:u,offset:l}:{value:0,offset:l},y=o?{scale:o,range:1,mult:u,offset:l}:se(g,{mult:u,offset:l});return c.x=d.x=et(a,h,m),c.y=d.y=Nn(a,h,m),c.x2=d.x2=Nn(a,y),c.y2=d.y2=et(a,y),f.x=et(a,h),f.y=Nn(a,h),an({type:ny,role:uz,key:hn,from:i,encode:p},n)}function zj(e,t){if(t!==1)if(!j(e))e=Ye(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=se({},e);for(;n.mult!=null;)if(j(n.mult))n=n.mult=se({},n.mult);else return n.mult=Ye(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Uj(e,t,n,i,r,s){const a=Xt(e,t),o=e.orient,u=id(o,-1,1);let l,c,f;const d={enter:l={opacity:fe},update:f={opacity:pn},exit:c={opacity:fe}};ht(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const p=Ze(r);p.mult=u;const h={scale:e.scale,field:hn,band:s.band,extra:s.extra,offset:s.offset,round:a("tickRound")};return f.y=l.y=et(o,fe,h),f.y2=l.y2=et(o,p),c.x=et(o,h),f.x=l.x=Nn(o,fe,h),f.x2=l.x2=Nn(o,p),c.y=Nn(o,h),an({type:ny,role:cz,key:hn,from:i,encode:d},n)}function Nh(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function jj(e,t,n,i,r,s){const a=Xt(e,t),o=e.orient,u=e.scale,l=id(o,-1,1),c=cs(a("labelFlush")),f=cs(a("labelFlushOffset")),d=a("labelAlign"),p=a("labelBaseline");let h=c===0||!!c,g;const m=Ze(r);m.mult=l,m.offset=Ze(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:hn,band:.5,offset:H$(s.offset,a("labelOffset"))},b=et(o,h?Nh(u,c,'"left"','"right"','"center"'):{value:"center"},Dj(o,"left","right")),v=et(o,Q$(o,"bottom","top"),h?Nh(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),A=Nh(u,c,`-(${f})`,f,0);h=h&&f;const E={opacity:fe,x:et(o,y,m),y:Nn(o,y,m)},C={enter:E,update:g={opacity:pn,text:{field:Z1},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:fe,x:E.x,y:E.y}};ht(C,{dx:!d&&h?et(o,A):null,dy:!p&&h?Nn(o,A):null}),ht(C,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:p});const x=a("labelBound");let w=a("labelOverlap");return w=w||x?{separation:a("labelSeparation"),method:w,order:"datum.index",bound:x?{scale:u,orient:o,tolerance:x}:null}:void 0,g.align!==b&&(g.align=ga(g.align,b)),g.baseline!==v&&(g.baseline=ga(g.baseline,v)),an({type:Us,role:lz,style:Zu,key:hn,from:i,encode:C,overlap:w},n)}function qj(e,t,n,i){const r=Xt(e,t),s=e.orient,a=id(s,-1,1);let o,u;const l={enter:o={opacity:fe,anchor:Ze(r("titleAnchor",null)),align:{signal:iy}},update:u=se({},o,{opacity:pn,text:Ze(e.title)}),exit:{opacity:fe}},c={signal:`lerp(range("${e.scale}"), ${ed(0,1,.5)})`};return u.x=et(s,c),u.y=Nn(s,c),o.angle=et(s,fe,Lj(a,90)),o.baseline=et(s,Q$(s,Dr,Gn),{value:Dr}),u.angle=o.angle,u.baseline=o.baseline,ht(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")}),Wj(r,s,l,n),l.update.align=ga(l.update.align,o.align),l.update.angle=ga(l.update.angle,o.angle),l.update.baseline=ga(l.update.baseline,o.baseline),an({type:Us,role:fz,style:ey,from:i,encode:l},n)}function Wj(e,t,n,i){const r=(o,u)=>o!=null?(n.update[u]=ga(Ze(o),n.update[u]),!1):!oa(u,i),s=r(e("titleX"),"x"),a=r(e("titleY"),"y");n.enter.auto=a===s?Ze(a):et(t,Ze(a),Ze(s))}function Gj(e,t){const n=Bj(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,a=r.interactive,o=r.style,u=Xt(e,n),l=UU(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=Z(t.add(Wn({},[c]))),d=Z(t.add(Hz({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)}))),p=[];let h;return c.grid&&p.push(Ij(e,n,i.grid,d,l)),c.ticks&&(h=u("tickSize"),p.push(Uj(e,n,i.ticks,d,h,l))),c.labels&&(h=c.ticks?h:0,p.push(jj(e,n,i.labels,d,h,l))),c.domain&&p.push(Pj(e,n,i.domain,f)),c.title&&p.push(qj(e,n,i.title,f)),nd(vu({role:az,from:f,encode:no(Hj(u,e),r,el),marks:p,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:a,style:o}),t)}function Hj(e,t){const n={enter:{},update:{}};return ht(n,{orient:e("orient"),offset:e("offset")||0,position:kn(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 ek(e,t,n){const i=W(e.signals),r=W(e.scales);return n||i.forEach(s=>_$(s,t)),W(e.projections).forEach(s=>wU(s,t)),r.forEach(s=>dU(s,t)),W(e.data).forEach(s=>$j(s,t)),r.forEach(s=>hU(s,t)),(n||i).forEach(s=>Gz(s,t)),W(e.axes).forEach(s=>Gj(s,t)),W(e.marks).forEach(s=>nd(s,t)),W(e.legends).forEach(s=>gj(s,t)),e.title&&Aj(e.title,t),t.parseLambdas(),t}const Vj=e=>no({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Xj(e,t){const n=t.config,i=Z(t.root=t.add(Wc())),r=Yj(e,n);r.forEach(l=>_$(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 s=t.add(Wn()),a=t.add(M$(R$(Vj(e.encode),Zf,Y1,e.style,t,{pulse:Z(s)}))),o=t.add(P$({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Z(a)}));t.operators.pop(),t.pushState(Z(a),Z(o),null),ek(e,t,r),t.operators.push(o);let u=t.add(N$({mark:i,pulse:Z(o)}));return u=t.add(B$({pulse:Z(u)})),u=t.add(zs({pulse:Z(u)})),t.addData("root",new As(t,s,s,u)),t}function So(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Yj(e,t){const n=a=>kn(e[a],t[a]),i=[So("background",n("background")),So("autosize",iz(n("autosize"))),So("padding",sz(n("padding"))),So("width",n("width")||0),So("height",n("height")||0)],r=i.reduce((a,o)=>(a[o.name]=o,a),{}),s={};return W(e.signals).forEach(a=>{H(r,a.name)?a=se(r[a.name],a):i.push(a),s[a.name]=a}),W(t.signals).forEach(a=>{!H(s,a.name)&&!H(r,a.name)&&i.push(a)}),i}function tk(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 uE(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}tk.prototype=uE.prototype={parse(e){return ek(e,this)},fork(){return new uE(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 fg?Z(e):e;return this.add(aU({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;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,s){let a,o;i&&(a=i.data||(i.data={}),o=a[r]||(a[r]=[]),o.push(s))}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(Z(this.add(zs({pulse:e})))),this._parent.push(t),this._lookup.push(n?Z(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ce(this._parent)},encode(){return ce(this._encode)},lookup(){return ce(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(q(e))return bu(e,t);e.signal||S("Unsupported field reference: "+P(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=Z(this.add(Kz(r)))}return i},compareRef(e){let t=!1;const n=s=>Ye(s)?(t=!0,this.signalRef(s.signal)):Mz(s)?(t=!0,this.exprRef(s.expr)):s,i=W(e.field).map(n),r=W(e.order).map(n);return t?Z(this.add(Xv({fields:i,orders:r}))):Hv(i,r)},keyRef(e,t){let n=!1;const i=s=>Ye(s)?(n=!0,Z(r[s.signal])):s,r=this.signals;return e=W(e).map(i),n?Z(this.add(Jz({fields:e,flat:t}))):Rz(e,t)},sortRef(e){if(!e)return e;const t=Jf(e.op,e.field),n=e.order||_z;return n.signal?Z(this.add(Xv({fields:t,orders:this.signalRef(n.signal)}))):Hv(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 H(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&S("Duplicate signal name: "+P(e));const n=t instanceof fg?t:this.add(Wc(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||S("Unrecognized signal name: "+P(e)),this.signals[e]},signalRef(e){return this.signals[e]?Z(this.signals[e]):(H(this.lambdas,e)||(this.lambdas[e]=this.add(Wc(null))),Z(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=pi(i,this),s=this.lambdas[i];s.params=r.$params,s.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!j(e)?e:this.signalRef(e.signal||uy(e))},exprRef(e,t){const n={expr:pi(e,this)};return t&&(n.expr.$name=t),Z(this.add(Xz(n)))},addBinding(e,t){this.bindings||S("Nested signals do not support binding: "+P(e)),this.bindings.push(se({signal:e},t))},addScaleProj(e,t){H(this.scales,e)&&S("Duplicate scale or projection name: "+P(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,uU(t))},addProjection(e,t){this.addScaleProj(e,sU(t))},getScale(e){return this.scales[e]||S("Unrecognized scale name: "+P(e)),this.scales[e]},scaleRef(e){return Z(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 H(this.data,e)&&S("Duplicate data set name: "+P(e)),this.data[e]=t},getData(e){return this.data[e]||S("Undefined data set name: "+P(e)),this.data[e]},addDataPipeline(e,t){return H(this.data,e)&&S("Duplicate data set name: "+P(e)),this.addData(e,As.fromEntries(this,t))}};function uy(e){return(D(e)?Kj:Jj)(e)}function Kj(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(j(r)?r.signal||uy(r):P(r))}return n+"]"}function Jj(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+P(i)+":"+(j(r)?r.signal||uy(r):P(r));return t+"}"}function Qj(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",a="#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:a},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:a,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,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:a,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:s,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 Zj(e,t,n){return j(e)||S("Input Vega specification must be an object."),t=Va(Qj(),t,e.config),Xj(e,new tk(t,n)).toRuntime()}var eq="5.33.1";se(Aa,e6,U9,xL,qL,KL,CB,nB,FB,DB,IB,HB);const tq=Object.freeze(Object.defineProperty({__proto__:null,Bounds:We,CanvasHandler:Xu,CanvasRenderer:Tc,DATE:qt,DAY:bt,DAYOFYEAR:hi,Dataflow:pa,Debug:k2,DisallowedObjectProperties:nm,Error:im,EventStream:bf,Gradient:qw,GroupItem:Rf,HOURS:nn,Handler:W0,HybridHandler:NF,HybridRenderer:Wp,Info:$2,Item:Of,MILLISECONDS:Bn,MINUTES:rn,MONTH:At,Marks:sn,MultiPulse:wm,None:S2,Operator:$e,Parameters:yf,Pulse:vr,QUARTER:jt,RenderType:pr,Renderer:Vu,ResourceLoader:Kw,SECONDS:yn,SVGHandler:EF,SVGRenderer:K0,SVGStringRenderer:TF,Scenegraph:hF,TIME_UNITS:mm,Transform:F,View:x$,WEEK:Ve,Warn:rm,YEAR:ft,accessor:Vt,accessorFields:Et,accessorName:ze,array:W,ascending:Ya,bandwidthNRD:km,bin:MC,bootstrapCI:LC,boundClip:WF,boundContext:qu,boundItem:Ip,boundMark:lF,boundStroke:Vi,changeset:Bs,clampRange:I2,codegenExpression:HS,compare:lm,constant:kt,cumulativeLogNormal:Nm,cumulativeNormal:vf,cumulativeUniform:Pm,dayofyear:Y2,debounce:cm,defaultLocale:xm,definition:_C,densityLogNormal:Tm,densityNormal:Dm,densityUniform:Bm,domChild:He,domClear:cn,domCreate:dr,domFind:q0,dotbin:BC,error:S,expressionFunction:qe,extend:se,extent:di,extentIndex:z2,falsy:ir,fastmap:Ka,field:gn,flush:U2,font:Lf,fontFamily:Hu,fontSize:xi,format:Vl,formatLocale:vc,formats:Am,hasOwnProperty:H,id:Ru,identity:$t,inferType:EC,inferTypes:AC,ingest:be,inherits:z,inrange:la,interpolate:v0,interpolateColors:kf,interpolateRange:Dw,intersect:zF,intersectBoxLine:ca,intersectPath:k0,intersectPoint:D0,intersectRule:Qw,isArray:D,isBoolean:Mr,isDate:xr,isFunction:ae,isIterable:j2,isNumber:ge,isObject:j,isRegExp:fm,isString:q,isTuple:gf,key:dm,lerp:q2,lineHeight:Sr,loader:hf,locale:xC,logger:sm,lruCache:W2,markup:Y0,merge:G2,mergeConfig:Va,multiLineOffset:z0,one:Ha,pad:H2,panLinear:T2,panLog:N2,panPow:M2,panSymlog:L2,parse:Zj,parseExpression:qS,parseSelector:Br,path:tm,pathCurves:F0,pathEqual:GF,pathParse:Sa,pathRectangle:Hw,pathRender:cu,pathSymbols:Gw,pathTrail:Vw,peek:ce,point:Pf,projection:u1,quantileLogNormal:Mm,quantileNormal:Ef,quantileUniform:Im,quantiles:Sm,quantizeInterpolator:Ow,quarter:B2,quartiles:$m,get random(){return bn},randomInteger:rN,randomKDE:Rm,randomLCG:iN,randomLogNormal:IC,randomMixture:zC,randomNormal:Om,randomUniform:UC,read:FC,regressionConstant:zm,regressionExp:qC,regressionLinear:Um,regressionLoess:HC,regressionLog:jC,regressionPoly:GC,regressionPow:WC,regressionQuad:jm,renderModule:If,repeat:To,resetDefaultLocale:eT,resetSVGClipId:Yw,resetSVGDefIds:s9,responseType:wC,runtimeContext:a$,sampleCurve:Cf,sampleLogNormal:_m,sampleNormal:xf,sampleUniform:Lm,scale:me,sceneEqual:J0,sceneFromJSON:fF,scenePickVisit:Fc,sceneToJSON:cF,sceneVisit:Pn,sceneZOrder:O0,scheme:E0,serializeXML:DF,setHybridRendererOptions:t9,setRandom:tN,span:_u,splitAccessPath:bi,stringValue:P,textMetrics:Zt,timeBin:dC,timeFloor:nC,timeFormatLocale:ou,timeInterval:Ja,timeOffset:sC,timeSequence:uC,timeUnitSpecifier:X2,timeUnits:ym,toBoolean:hm,toDate:pm,toNumber:xt,toSet:Ln,toString:gm,transform:TC,transforms:Aa,truncate:V2,truthy:mn,tupleid:ee,typeParsers:Op,utcFloor:iC,utcInterval:Qa,utcOffset:aC,utcSequence:lC,utcdayofyear:Q2,utcquarter:P2,utcweek:Z2,version:eq,visitArray:ar,week:K2,writeConfig:Xa,zero:cr,zoomLinear:am,zoomLog:om,zoomPow:xc,zoomSymlog:um},Symbol.toStringTag,{value:"Module"}));function nq(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.he
9ight||0)/2)}var iq={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},rq={"*":(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},sq={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const aq=Array.prototype.slice,Yr=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,aq.call(t,1))},oq=(e,t,n,i,r,s,a)=>new Date(e,t||0,n??1,i||0,r||0,s||0,a||0);var uq={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:oq,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 Yr("join",arguments)},indexof:function(){return Yr("indexOf",arguments)},lastindexof:function(){return Yr("lastIndexOf",arguments)},slice:function(){return Yr("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(Ya),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Yr("substring",arguments,String)},split:function(){return Yr("split",arguments,String)},replace:function(){return Yr("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const lq=["view","item","group","xy","x","y"],bg=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&bg.add(setImmediate);const cq={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:iq[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),bg.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]||uq[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>rq[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>sq[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);e.memberDepth-=1;const s=e(i.value);return nm.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):bg.has(s)?console.error(`Prevented interpretation of method "${s}" which could lead to insecure code execution`):n[r]=s,n},{})};function $o(e,t,n,i,r,s){const a=o=>cq[o.type](a,o);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=i,a.event=r,a.item=s,lq.forEach(o=>a.fn[o]=function(){return r.vega[o](...arguments)}),a(e)}var fq={operator(e,t){const n=t.ast,i=e.functions;return r=>$o(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>$o(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>$o(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const a=s.item&&s.item.datum;return $o(n,i,r,a,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(a,o)=>{const u=a.datum;let l=0,c;for(const f in i)c=$o(i[f].ast,r,o,u,void 0,a),a[f]!==c&&(a[f]=c,l=1);return n!=="rule"&&nq(a,i,s),l}}};const dq="5.23.0",hq={version:dq};function ly(e){return T(e,"or")}function cy(e){return T(e,"and")}function fy(e){return T(e,"not")}function hc(e,t){if(fy(e))hc(e.not,t);else if(cy(e))for(const n of e.and)hc(n,t);else if(ly(e))for(const n of e.or)hc(n,t);else t(e)}function ma(e,t){return fy(e)?{not:ma(e.not,t)}:cy(e)?{and:e.and.map(n=>ma(n,t))}:ly(e)?{or:e.or.map(n=>ma(n,t))}:t(e)}const ie=structuredClone;function nk(e){throw new Error(e)}function Ra(e,t){const n={};for(const i of t)H(e,i)&&(n[i]=e[i]);return n}function zt(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Fe(e)).join(",")})`};function le(e){if(ge(e))return e;const t=q(e)?e:Fe(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 xg(e){return e===!1||e===null}function ue(e,t){return e.includes(t)}function _a(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function dy(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function ik(e,...t){for(const n of t)pq(e,n??{});return e}
vendor: 4,822 bytes, line 9
9function pq(e,t){for(const n of _(t))Xa(e,n,t[n],!0)}function ai(e,t){const n=[],i={};let r;for(const s of e)r=t(s),!(r in i)&&(i[r]=1,n.push(s));return n}function gq(e,t){const n=_(e),i=_(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function rk(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hy(e,t){for(const n of e)if(t.has(n))return!0;return!1}function vg(e){const t=new Set;for(const n of e){const r=bi(n).map((a,o)=>o===0?a:`[${a}]`),s=r.map((a,o)=>r.slice(0,o+1).join(""));for(const a of s)t.add(a)}return t}function py(e,t){return e===void 0||t===void 0?!0:hy(vg(e),vg(t))}function we(e){return _(e).length===0}const _=Object.keys,dt=Object.values,Or=Object.entries;function Eu(e){return e===!0||e===!1}function Ne(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function nu(e,t){return fy(e)?`!(${nu(e.not,t)})`:cy(e)?`(${e.and.map(n=>nu(n,t)).join(") && (")})`:ly(e)?`(${e.or.map(n=>nu(n,t)).join(") || (")})`:t(e)}function Gc(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Gc(e[n],t)&&delete e[n],we(e)}function tl(e){return e.charAt(0).toUpperCase()+e.substr(1)}function gy(e,t="datum"){const n=bi(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(P).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function sk(e,t="datum"){return`${t}[${P(bi(e).join("."))}]`}function xe(e){return`datum['${e.replaceAll("'","\\'")}']`}function mq(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function xn(e){return`${bi(e).map(mq).join("\\.")}`}function Cs(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function so(e){return`${bi(e).join(".")}`}function Ta(e){return e?bi(e).length:0}function Ue(...e){return e.find(t=>t!==void 0)}let ak=42;function ok(e){const t=++ak;return e?String(e)+t:t}function yq(){ak=42}function uk(e){return lk(e)?e:`__${e}`}function lk(e){return e.startsWith("__")}function Au(e){if(e!==void 0)return(e%360+360)%360}function rd(e){return ge(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const lE=Object.getPrototypeOf(structuredClone({}));function Jt(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(!Jt(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Jt(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[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!==lE.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==lE.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 s=r[i];if(!Jt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Fe(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,s;if(Array.isArray(i)){for(s="[",r=0;r<i.length;r++)r&&(s+=","),s+=n(i[r])||"null";return s+"]"}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const a=t.push(i)-1,o=Object.keys(i).sort();for(s="",r=0;r<o.length;r++){const u=o[r],l=n(i[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return t.splice(a,1),`{${s}}`})(e)}function T(e,t){return j(e)&&H(e,t)&&e[t]!==void 0}const Pi="row",Ii="column",sd="facet",Me="x",rt="y",Hn="x2",Ai="y2",Pr="xOffset",ao="yOffset",Vn="radius",Yi="radius2",An="theta",Ki="theta2",Xn="latitude",Yn="longitude",Kn="latitude2",vn="longitude2",Ir="time",Wt="color",Ci="fill",wi="stroke",Gt="shape",Ji="size",js="angle",Qi="opacity",zr="fillOpacity",Ur="strokeOpacity",jr="strokeWidth",qr="strokeDash",nl="text",Na="order",il="detail",ad="key",ws="tooltip",od="href",ud="url",ld="description",bq={x:1,y:1,x2:1,y2:1},ck={theta:1,theta2:1,radius:1,radius2:1};function fk(e){return H(ck,e)}const my={longitude:1,longitude2:1,latitude:1,latitude2:1};function dk(e){switch(e){case Xn:return"y";case Kn:return"y2";case Yn:return"x";case vn:return"x2"}}function hk(e){return H(my,e)}const xq=_(my),yy={...bq,...ck,...my,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time:1,op
9acity: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 ya(e){return e===Wt||e===Ci||e===wi}const pk={row:1,column:1,facet:1},dn=_(pk),by={...yy,...pk},vq=_(by),{order:rte,detail:ste,tooltip:ate,...Eq}=by,{row:ote,column:ute,facet:lte,...Aq}=Eq;function Cq(e){return H(Aq,e)}function gk(e){return H(by,e)}const wq=[Hn,Ai,Kn,vn,Ki,Yi];function mk(e){return qs(e)!==e}function qs(e){switch(e){case Hn:return Me;case Ai:return rt;case Kn:return Xn;case vn:return Yn;case Ki:return An;case Yi:return Vn}return e}function Rr(e){if(fk(e))switch(e){case An:return"startAngle";case Ki:return"endAngle";case Vn:return"outerRadius";case Yi:return"innerRadius"}return e}function Fi(e){switch(e){case Me:return Hn;case rt:return Ai;case Xn:return Kn;case Yn:return vn;case An:return Ki;case Vn:return Yi}}function Ht(e){switch(e){case Me:case Hn:return"width";case rt:case Ai:return"height"}}function yk(e){switch(e){case Me:return"xOffset";case rt:return"yOffset";case Hn:return"x2Offset";case Ai:return"y2Offset";case An:return"thetaOffset";case Vn:return"radiusOffset";case Ki:return"theta2Offset";case Yi:return"radius2Offset"}}function xy(e){switch(e){case Me:return"xOffset";case rt:return"yOffset"}}function Fq(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Sq=_(yy),{x:cte,y:fte,x2:dte,y2:hte,xOffset:pte,yOffset:gte,latitude:mte,longitude:yte,latitude2:bte,longitude2:xte,theta:vte,theta2:Ete,radius:Ate,radius2:Cte,...vy}=yy,$q=_(vy),Ey={x:1,y:1},Zi=_(Ey);function je(e){return H(Ey,e)}const Ay={theta:1,radius:1},kq=_(Ay);function cd(e){return e==="width"?Me:rt}const bk={xOffset:1,yOffset:1};function rl(e){return H(bk,e)}const Dq={time:1};function Mh(e){return e in Dq}const{text:wte,tooltip:Fte,href:Ste,url:$te,description:kte,detail:Dte,key:Ote,order:Rte,...xk}=vy,Oq=_(xk);function Rq(e){return H(vy,e)}function _q(e){switch(e){case Wt:case Ci:case wi:case Ji:case Gt:case Qi:case jr:case qr:return!0;case zr:case Ur:case js:case Ir:return!1}}const vk={...Ey,...Ay,...bk,...xk},Cy=_(vk);function Si(e){return H(vk,e)}function Tq(e,t){return Mq(e)[t]}const Ek={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:_te,...Nq}=Ek;function Mq(e){switch(e){case Wt:case Ci:case wi:case ld:case il:case ad:case ws:case od:case Na:case Qi:case zr:case Ur:case jr:case sd:case Pi:case Ii:return Ek;case Me:case rt:case Pr:case ao:case Xn:case Yn:case Ir:return Nq;case Hn:case Ai:case Kn:case vn:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Ji:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case qr:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Gt:return{point:"always",geoshape:"always"};case nl:return{text:"always"};case js:return{point:"always",square:"always",text:"always"};case ud:return{image:"always"};case An:return{text:"always",arc:"always"};case Vn:return{text:"always",arc:"always"};case Ki:case Yi:return{arc:"always"}}}function Lh(e){switch(e){case Me:case rt:case An:case Vn:case Pr:case ao:case Ji:case js:case jr:case Qi:case zr:case Ur:case Ir:case Hn:case Ai:case Ki:case Yi:return;case sd:case Pi:case Ii:case Gt:case qr:case nl:case ws:case od:case ud:case ld:return"discrete";case Wt:case Ci:case wi:return"flexible";case Xn:case Yn:case Kn:case vn:case il:case ad:case Na:return}}const Lq={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},Bq={count:1,min:1,max:1};function Wi(e){return T(e,"argmin")}function Wr(e){return T(e,"argmax")}function wy(e){return q(e)&&H(Lq,e)}const Pq=new Set(["count","valid","missing","distinct"]);function fd(e){return q(e)&&Pq.has(e)}function Iq(e){return q(e)&&ue(["min","max"],e)}const zq=new Set(["count","sum","distinct","valid","missing"]),Uq=new Set(["mean","average","median","q1","q3","min","max"]);function Ak(e){return Mr(e)&&(e=Cd(e,void 0)),"bin"+_(e).map(t=>dd(e[t])?Ne(`_${t}_${Or(e[t])}`):Ne(`_${t}_${e[t]}`)).join("")}function De(e){return e===!0||Ws(e)&&!e.binned}function st(e){return e==="binned"||Ws(e)&&e.binned===!0}function Ws(e){return j(e)}function dd(e){return T(e,"param")}function cE(e){switch(e){case Pi:case Ii:case Ji:case Wt:case Ci:case wi:case jr:case Qi:case zr:case Ur:case Gt:return 6;case qr:return 4;default:return 10}}function sl(e){return T(e,"expr")}function at(e,{level:t}={level:0}){const n=_(e||{}),i={};for(const r of n)i[r]=t===0?Kt(e[r]):at(e[r],{level:t-1});return i}function Ck(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:a,color:o,subtitleColor:u,subtitleFont:l,subt
9itleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:h,...g}=e,m={...g,...o?{fill:o}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...a!==void 0?{limit:a}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...h?{subtitlePadding:h}:{}},v=Ra(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function lr(e){return q(e)||D(e)&&q(e[0])}function Q(e){return T(e,"signal")}function Gs(e){return T(e,"step")}function jq(e){return D(e)?!1:T(e,"fields")&&!T(e,"data")}function qq(e){return D(e)?!1:T(e,"fields")&&T(e,"data")}function Bi(e){return D(e)?!1:T(e,"field")&&T(e,"data")}const Wq={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},Gq=_(Wq),Hq={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Eg=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function wk(e){const t=D(e.condition)?e.condition.map(fE):fE(e.condition);return{...Kt(e),condition:t}}function Kt(e){if(sl(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function fE(e){if(sl(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Re(e){if(sl(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Q(e)?e:e!==void 0?{value:e}:void 0}function Vq(e){return Q(e)?e.signal:P(e)}function dE(e){return Q(e)?e.signal:P(e.value)}function _n(e){return Q(e)?e.signal:e==null?null:P(e)}function Xq(e,t,n){for(const i of n){const r=gi(i,t.markDef,t.config);r!==void 0&&(e[i]=Re(r))}return e}function Fk(e){return[].concat(e.type,e.style??[])}function Ce(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&T(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:gi(e,t,n,i)}function gi(e,t,n,{vgChannel:i}={}){const r=Ag(e,t,n.style);return Ue(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Ag(e,t,n){return Sk(e,Fk(t),n)}function Sk(e,t,n){t=W(t);let i;for(const r of t){const s=n[r];T(s,e)&&(i=s[e])}return i}function $k(e,t){return W(e).reduce((n,i)=>(n.field.push(U(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function kk(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Jt(r,i))return;n.push(i)}),n}function Dk(e,t){return Jt(e,t)||!t?e:e?[...W(e),...W(t)].join(", "):t}function Ok(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((lr(n)||Q(n))&&(lr(i)||Q(i)))return{explicit:e.explicit,value:Dk(n,i)};if(lr(n)||Q(n))return{explicit:e.explicit,value:n};if(lr(i)||Q(i))return{explicit:e.explicit,value:i};if(!lr(n)&&!Q(n)&&!lr(i)&&!Q(i))return{explicit:e.explicit,value:kk(n,i)};throw new Error("It should never reach here")}function Fy(e){return`Invalid specification ${Fe(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Yq='Autosize "fit" only works for single views and layered views.';function hE(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function pE(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 gE(e){return e?`Dropping "fit-${e}" because spec has discrete ${Ht(e)}.`:'Dropping "fit" because spec has discrete size.'}function Sy(e){return`Unknown field for ${e}. Cannot calculate view size.`}function mE(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Kq(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Jq(e){return`The "nearest" transform is not supported for ${e} marks.`}function Rk(e){return`Selection not supported for ${e} yet.`}function Qq(e){return`Cannot find a selection named "${e}".`}const Zq="Scale bindings are currently only supported for scales with unbinned, continuous domains.",eW="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",tW="Legend bindings are only supported for selections over an individual field or encoding channel.";function nW(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function iW(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const rW="The same selection must be used to override scale domains in a layered view.",sW='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function aW(e){return`Unknown repeated value "${e}".`}function yE(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const oW="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",$y="Animation involving facet, layer, or concat is currently unsupported.";function uW(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${P(e)}.`}function lW(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${P(t)} encoding found for selection ${P(n.param)}. Using "field": ${P(i)}.`}const cW="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function fW(e){return`Unrecognized parse "${e}".`}function bE(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const dW="Attempt to add the same child twice.";
vendor: 15,746 bytes, line 9
9function hW(e){return`Ignoring an invalid transform: ${Fe(e)}.`}const pW='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 xE(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function gW(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Fe(t)} is overridden by a child projection ${Fe(n)}.`}const mW="Arc marks uses theta channel rather than angle, replacing angle with theta.";function yW(e){return`${e}Offset dropped because ${e} is continuous`}function bW(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Fe(n)}}.`}function _k(e){return`Invalid field type "${e}".`}function xW(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function vW(e){return`Invalid aggregation operator "${e}".`}function Tk(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 EW(e){return`Position range does not support relative band size for ${e}.`}function Cg(e,t){return`Dropping ${Fe(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const AW="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function hd(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function CW(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function wW(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function FW(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function SW(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Bh(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function $W(e){return`The ${e} for range marks cannot be an expression`}function kW(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 DW(e,t){return`Specified orient "${e}" overridden with "${t}".`}function OW(e){return`Cannot use the scale property "${e}" with non-color channel.`}function RW(e){return`Cannot use the relative band size with ${e} scale.`}function _W(e){return`Using unaggregated domain with raw field has no effect (${Fe(e)}).`}function TW(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function NW(e){return`Unaggregated domain is currently unsupported for log scale (${Fe(e)}).`}function MW(e){return`Cannot apply size to non-oriented mark "${e}".`}function LW(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function BW(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function Nk(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Mk(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function PW(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Fe(n)} and ${Fe(i)}). Using ${Fe(n)}.`}function IW(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Fe(n)} and ${Fe(i)}). Using the union of the two domains.`}function zW(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 UW(e){return`Dropping sort property ${Fe(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const vE="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",jW="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.",qW="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.",WW="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 GW(e){return`Cannot stack "${e}" if there is already "${e}2".`}function HW(e){return`Stack is applied to a non-linear scale (${e}).`}function VW(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Hc(e,t){return`Invalid ${e}: ${Fe(t)}.`}function XW(e){return`Dropping day from datetime ${Fe(e)} as day cannot be combined with other units.`}function YW(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function KW(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function JW(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function EE(e){return`1D error band does not support ${e}.`}function Lk(e){return`Channel ${e} is required for "binned" bin.`}function QW(e){return`Channel ${e} should not be used with "binned" bin.`}function ZW(e){return`Domain for ${e} is required for threshold scale.`}const Bk=sm(rm);let Fs=Bk;function eG(e){return Fs=e,Fs}function tG(){return Fs=Bk,Fs}function ky(...e){Fs.error(...e)}function M(...e){Fs.warn(...e)}function nG(...e){Fs.debug(...e)}function Hs(e){if(e&&j(e)){for(const t of Oy)if(T(e,t))return!0}return!1}const Pk=["january","february","march","april","may","june","july","august","september","october","november","december"],iG=Pk.map(e=>e.substr(0,3)),Ik=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],rG=Ik.map(e=>e.substr(0,3));function sG(e){if(rd(e)&&(e=+e),ge(e))return e>4&&M(Hc("quarter",e)),e-1;throw new Error(Hc("quarter",e))}function aG(e){if(rd(e)&&(e=+e),ge(e))return e-1;{const t=e.toLowerCase(),n=Pk.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=iG.indexOf(i);if(r!==-1)return r;throw new Error(Hc("month",e))}}function oG(e){if(rd(e)&&(e=+e),ge(e))return e%7;{const t=e.toLowerCase(),n=Ik.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=rG.indexOf(i);if(r!==-1)return r;throw new Error(Hc("day",e))}}function Dy(e,t){const n=[];if(t&&e.day!==void 0&&_(e).length>1&&(M(XW(e)),e=ie(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?aG(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?sG(e.quarter):e.quarter;n.push(ge(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?oG(e.day):e.day;n.push(ge(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 Ss(e){const n=Dy(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function uG(e){const n=Dy(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function lG(e){const t=Dy(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const zk={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Oy=_(zk);function cG(e){return H(zk,e)}function Vs(e){return j(e)?e.binned:Uk(e)}function Uk(e){return e&&e.startsWith("binned")}function Ry(e){return e.startsWith("utc")}function fG(e){return e.substring(3)}const dG={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function pd(e){return Oy.filter(t=>qk(e,t))}function jk(e){const t=pd(e);return t[t.length-1]}function qk(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 hG(e,t,{end:n}={end:!1}){const i=gy(t),r=Ry(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let a;const o={};for(const u of Oy)qk(e,u)&&(o[u]=s(u),a=u);return n&&(o[a]+="+1"),uG(o)}function Wk(e){if(!e)return;const t=pd(e);return`timeUnitSpecifier(${Fe(t)}, ${Fe(dG)})`}function pG(e,t,n){if(!e)return;const i=Wk(e);return`${n||Ry(e)?"utc":"time"}Format(${t}, ${i})`}function nt(e){if(!e)return;let t;return q(e)?Uk(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:j(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Ry(t.unit)&&(t.utc=!0,t.unit=fG(t.unit)),t}function gG(e){const{utc:t,...n}=nt(e);return n.unit?(t?"utc":"")+_(n).map(i=>Ne(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+_(n).map(i=>Ne(`_${i}_${n[i]}`)).join("")}function Gk(e,t=n=>n){const n=nt(e),i=jk(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:a}=Hk(i,n.step),o={...r,[a]:+r[a]+s};return`${t(Ss(o))} - ${t(Ss(r))}`}}const mG={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function yG(e){return H(mG,e)}function Hk(e,t=1){if(yG(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 bG(e){return T(e,"param")}function _y(e){return!!e?.field&&e.equal!==void 0}function Ty(e){return!!e?.field&&e.lt!==void 0}function Ny(e){return!!e?.field&&e.lte!==void 0}function My(e){return!!e?.field&&e.gt!==void 0}function Ly(e){return!!e?.field&&e.gte!==void 0}function By(e){if(e?.field){if(D(e.range)&&e.range.length===2)return!0;if(Q(e.range))return!0}return!1}function Py(e){return!!e?.field&&(D(e.oneOf)||D(e.in))}function xG(e){return!!e?.field&&e.valid!==void 0}function Vk(e){return Py(e)||_y(e)||By(e)||Ty(e)||My(e)||Ny(e)||Ly(e)}function ei(e,t){return wd(e,{timeUnit:t,wrapTime:!0})}function vG(e,t){return e.map(n=>ei(n,t))}function Xk(e,t=!0){const{field:n}=e,i=nt(e.timeUnit),{unit:r,binned:s}=i||{},a=U(e,{expr:"datum"}),o=r?`time(${s?a:hG(r,n)})`:a;if(_y(e))return`${o}===${ei(e.equal,r)}`;if(Ty(e)){const u=e.lt;return`${o}<${ei(u,r)}`}else if(My(e)){const u=e.gt;return`${o}>${ei(u,r)}`}else if(Ny(e)){const u=e.lte;return`${o}<=${ei(u,r)}`}else if(Ly(e)){const u=e.gte;return`${o}>=${ei(u,r)}`}else{if(Py(e))return`indexof([${vG(e.oneOf,r).join(",")}], ${o}) !== -1`;if(xG(e))return gd(o,e.valid);if(By(e)){const{range:u}=at(e),l=Q(u)?{signal:`${u.signal}[0]`}:u[0],c=Q(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+o+", ["+ei(l,r)+", "+ei(c,r)+"])";const f=[];return l!==null&&f.push(`${o} >= ${ei(l,r)}`),c!==null&&f.push(`${o} <= ${ei(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Fe(e)}`)}function gd(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function EG(e){return Vk(e)&&e.timeUnit?{...e,timeUnit:nt(e.timeUnit)}:e}const al={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function AG(e){return e==="quantitative"||e==="temporal"}function Yk(e){return e==="ordinal"||e==="nominal"}const $s=al.quantitative,Iy=al.ordinal,Ma=al.temporal,zy=al.nominal,oo=al.geojson;function CG(e){if(e)switch(e=e.toLowerCase(),e){case"q":case $s:return"quantitative";case"t":case Ma:return"temporal";case"o":case Iy:return"ordinal";case"n":case zy:return"nominal";case oo:return"geojson"}}const ot={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},wg={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 wG(e,t){const n=wg[e],i=wg[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const FG={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 AE(e){return FG[e]}const Kk=new Set(["linear","log","pow","sqrt","symlog"]),Jk=new Set([...Kk,"time","utc"]);function Qk(e){return Kk.has(e)}const Zk=new Set(["quantile","quantize","threshold"]),SG=new Set([...Jk,...Zk,"sequential","identity"]),$G=new Set(["ordinal","bin-ordinal","point","band"]);function it(e){return $G.has(e)}function In(e){return SG.has(e)}function oi(e){return Jk.has(e)}function La(e){return Zk.has(e)}const kG={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,framesPerSecond:2,animationDuration:5};function DG(e){return!q(e)&&T(e,"name")}function eD(e){return T(e,"param")}function OG(e){return T(e,"unionWith")}function RG(e){return j(e)&&"field"in e}const _G={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:Tte,domain:Nte,range:Mte,rangeMax:Lte,rangeMin:Bte,scheme:Pte,...TG}=_G,NG=_(TG);function Fg(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 oi(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return oi(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 oi(e);case"nice":return oi(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return In(e)&&!ue(["log","time","utc","threshold","quantile"],e)}}function tD(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return ya(e)?void 0:OW(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 MG(e,t){return ue([Iy,zy],t)?e===void 0||it(e):t===Ma?ue([ot.TIME,ot.UTC,void 0],e):t===$s?Qk(e)||La(e)||e===void 0:!0}function LG(e,t,n=!1){if(!Si(e))return!1;switch(e){case Me:case rt:case Pr:case ao:case An:case Vn:return oi(t)||t==="band"?!0:t==="point"?!n:!1;case Ir:return ue(["linear","band"],t);case Ji:case jr:case Qi:case zr:case Ur:case js:return oi(t)||La(t)||ue(["band","point","ordinal"],t);case Wt:case Ci:case wi:return t!=="band";case qr:case Gt:return t==="ordinal"||La(t)}}function BG(e){return j(e)&&"value"in e}const Mt={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"},nD=Mt.arc,md=Mt.area,yd=Mt.bar,PG=Mt.image,bd=Mt.line,xd=Mt.point,IG=Mt.rect,Vc=Mt.rule,iD=Mt.text,Uy=Mt.tick,zG=Mt.trail,jy=Mt.circle,qy=Mt.square,rD=Mt.geoshape;function Gr(e){return["line","area","trail"].includes(e)}function Cu(e){return["rect","bar","image","arc","tick"].includes(e)}
9const UG=new Set(_(Mt));function mi(e){return T(e,"type")}const jG=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],qG=["fill","fillOpacity"],WG=[...jG,...qG],GG={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},CE=_(GG),Ph=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],HG={area:["line","point"],bar:Ph,rect:Ph,line:["point"],tick:["bandSize","thickness",...Ph]},VG={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},XG={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},sD=_(XG);function ks(e){return T(e,"band")}const YG={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},KG=5,Wy={binSpacing:0,continuousBandSize:KG,minBandSize:.25,timeUnitBandPosition:.5},JG={...Wy,binSpacing:1},QG={...Wy,thickness:1};function ZG(e){return mi(e)?e.type:e}function aD(e,{isPath:t}
9){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Gy({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){if(!i||!In(i)||r)return"always-valid";const s=aD(Ce("invalid",e,t),{isPath:Gr(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":s}function eH(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function oD({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,a=t.domainHasZero();return a==="definitely"?{scale:e,value:0}:a==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function uD({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){const a=n?.get("type"),o=Un(t),u=fd(o?.aggregate),l=Gy({scaleChannel:e,markDef:r,config:s,scaleType:a,isCountAggregate:u});if(o&&l==="show"){const c=s.scale.invalid?.[e]??"zero-or-min";return{test:gd(U(o,{expr:"datum"}),!1),...tH(c,n,i)}}}function tH(e,t,n){if(BG(e)){const{value:i}=e;return Q(i)?{signal:i.signal}:{value:i}}return oD({scale:t,scaleName:n,mode:"zeroOrMin"})}function Hy(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:a}=e,o=qs(t),u=Vy(e),l=uD({scaleChannel:o,channelDef:n,scale:r,scaleName:s,markDef:i,config:a});return l!==void 0?[l,u]:u}function nH(e){const{datum:t}=e;return Hs(t)?Ss(t):`${Fe(t)}`}function fs(e,t,n,i){const r={};if(t&&(r.scale=t),$i(e)){const{datum:s}=e;Hs(s)?r.signal=Ss(s):Q(s)?r.signal=s.signal:sl(s)?r.signal=s.expr:r.value=s}else r.field=U(e,n);if(i){const{offset:s,band:a}=i;s&&(r.offset=s),a&&(r.band=a)}return r}function Xc({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:a=.5}){const o=!Q(a)&&0<a&&a<1?"datum":void 0,u=U(t,{expr:o,suffix:r}),l=n!==void 0?U(n,{expr:o}):U(t,{suffix:s,expr:o}),c={};if(a===0||a===1){c.scale=e;const f=a===0?u:l;c.field=f}else{const f=Q(a)?`(1-${a.signal}) * ${u} + ${a.signal} * ${l}`:`${1-a} * ${u} + ${a} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function iH({scaleName:e,fieldDef:t}){const n=U(t,{expr:"datum"}),i=U(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function Vy({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:a,stack:o,offset:u,defaultRef:l,bandPosition:c}){if(t){if(re(t)){const f=a?.get("type");if(Nt(t)){c??(c=_r({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:p,type:h}=t;if(De(d)||c&&p&&h===Ma)return o?.impute?fs(t,s,{binSuffix:"mid"},{offset:u}):c&&!it(f)?Xc({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):fs(t,s,fl(t,e)?{binSuffix:"range"}:{},{offset:u});if(st(d)){if(B(n))return Xc({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});M(Lk(e===Me?Hn:Ai))}}
vendor: 7,680 bytes, line 9
9return fs(t,s,it(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(zn(t)){const f=t.value,d=u?{offset:u}:{};return{...iu(e,f),...d}}}return ae(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function iu(e,t){return ue(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ue(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Re(t)}function Ds(e){return e&&e!=="number"&&e!=="time"}function lD(e,t,n){return`${e}(${t}${n?`, ${Fe(n)}`:""})`}const rH=" â ";function Xy({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){if(Ds(n))return Tn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const a=cD(e,i,r),o=Ba(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(o==="quantitative"){if(r&&s.normalizedNumberFormatType)return Tn({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return Tn({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(o==="temporal"&&s.timeFormatType&&B(e)&&e.timeUnit===void 0)return Tn({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}if(Ia(e)){const u=aH({field:a,timeUnit:B(e)?nt(e.timeUnit)?.unit:void 0,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:Xs(e)&&e.scale?.type===ot.UTC});return u?{signal:u}:void 0}if(t=Sg({type:o,specifiedFormat:t,config:s,normalizeStack:r}),B(e)&&De(e.bin)){const u=U(e,{expr:i,binSuffix:"end"});return{signal:ol(a,u,t,n,s)}}else return t||Ba(e)==="quantitative"?{signal:`${hD(a,t)}`}:{signal:`isValid(${a}) ? ${a} : ""+${a}`}}function cD(e,t,n){return B(e)?n?`${U(e,{expr:t,suffix:"end"})}-${U(e,{expr:t,suffix:"start"})}`:U(e,{expr:t}):nH(e)}function Tn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:a}){if(a??(a=cD(e,i,r)),a!=="datum.value"&&B(e)&&De(e.bin)){const o=U(e,{expr:i,binSuffix:"end"});return{signal:ol(a,o,t,n,s)}}return{signal:lD(n,a,t)}}function fD(e,t,n,i,r,s){if(!(q(i)&&Ds(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&Ba(e)==="quantitative"&&(r.normalizedNumberFormatType&&Pa(e)&&e.stack==="normalize"||r.numberFormatType))){if(Pa(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return Sg({type:"quantitative",config:r,normalizeStack:!0});if(Ia(e)){const a=B(e)?nt(e.timeUnit)?.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:sH({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:s})}return Sg({type:t,specifiedFormat:n,config:r})}}function dD(e,t,n){if(e&&(Q(e)||e==="number"||e==="time"))return e;if(Ia(t)&&n!=="time"&&n!=="utc")return B(t)&&nt(t?.timeUnit)?.utc?"utc":"time"}function Sg({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(q(t))return t;if(e===$s)return i?n.normalizedNumberFormat:n.numberFormat}function sH({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:Wk(t)}:i?void 0:n.timeFormat)}function hD(e,t){return`format(${e}, "${t||""}")`}function wE(e,t,n,i){return Ds(n)?lD(n,e,t):hD(e,(q(t)?t:void 0)??i.numberFormat)}function ol(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return ol(e,t,r.numberFormat,r.numberFormatType,r);const s=wE(e,n,i,r),a=wE(t,n,i,r);return`${gd(e,!1)} ? "null" : ${s} + "${rH}" + ${a}`}function aH({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=q(n)?n:r,`${s?"utc":"time"}Format(${e}, '${n}')`):pG(t,e,s)}const vd="min",oH={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 FE(e){return H(oH,e)}function uH(e){return T(e,"encoding")}function zi(e){return e&&(e.op==="count"||T(e,"field"))}function pD(e){return e&&D(e)}function ul(e){return T(e,"row")||T(e,"column")}function Yy(e){return T(e,"header")}function Ed(e){return T(e,"facet")}function lH(e){return T(e,"param")}function cH(e){return!q(e)&&T(e,"repeat")}function SE(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Ky(e){return T(e,"sort")}function _r({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(re(e)&&e.bandPosition!==void 0)return e.bandPosition;if(B(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return gi("timeUnitBandPosition",n,i);if(De(s))return .5}}function gD({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:a}){const o=Ht(e),u=Ce(a?"size":o,i,r,{vgChannel:o});if(u!==void 0)return u;if(B(t)){const{timeUnit:l,bin:c}=t;if(l&&!n)return{band:gi("timeUnitBandSize",i,r)};if(De(c)&&!it(s))return{band:1}}if(Cu(i.type))return s?it(s)?r[i.type]?.discreteBandSize||{band:1}:r[i.type]?.continuousBandSize:r[i.type]?.discreteBandSize}function mD(e,t,n,i){return De(e.bin)||e.timeUnit&&Nt(e)&&e.type==="temporal"?_r({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function yD(e){return T(e,"sort")&&!T(e,"field")}function ll(e){return T(e,"condition")}function Ad(e){const t=e?.condition;return!!t&&!D(t)&&B(t)}function cl(e){const t=e?.condition;return!!t&&!D(t)&&re(t)}function fH(e){const t=e?.condition;return!!t&&(D(t)||zn(t))}function B(e){return T(e,"field")||e?.aggregate==="count"}function Ba(e){return e?.type}function $i(e){return T(e,"datum")}function br(e){return Nt(e)&&!Kc(e)||Yc(e)}function $E(e){return Nt(e)&&e.type==="quantitative"&&!e.bin||Yc(e)}function Yc(e){return $i(e)&&ge(e.datum)}function re(e){return B(e)||$i(e)}function Nt(e){return e&&(T(e,"field")||e.aggregate==="count")&&T(e,"type")}function zn(e){return T(e,"value")}function Xs(e){return T(e,"scale")||T(e,"sort")}function Pa(e){return T(e,"axis")||T(e,"stack")||T(e,"impute")}function bD(e){return T(e,"legend")}function xD(e){return T(e,"format")||T(e,"formatType")}function dH(e){return zt(e,["legend","axis","header","scale"])}function hH(e){return T(e,"op")}function U(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(gH(e))n=uk("count");else{let a;if(!t.nofn)if(hH(e))a=e.op;else{const{bin:o,aggregate:u,timeUnit:l}=e;De(o)?(a=Ak(o),r=(t.binSuffix??"")+(t.suffix??"")):u?Wr(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):Wi(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):a=String(u):l&&!Vs(l)&&(a=gG(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}a&&(n=n?`${a}_${n}`:a)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?so(n):t.expr?sk(n,t.expr)+s:xn(n)+s}function Kc(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return B(e)&&!!e.bin;case"temporal":return!1}throw new Error(_k(e.type))}function pH(e){return Xs(e)&&La(e.scale?.type)}function gH(e){return e.aggregate==="count"}function mH(e,t){const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(De(i))return`${n} (binned)`;if(r&&!Vs(r)){const a=nt(r)?.unit;if(a)return`${n} (${pd(a).join("-")})`}else if(s)return Wr(s)?`${n} for max ${s.argmax}`:Wi(s)?`${n} for min ${s.argmin}`:`${tl(s)} of ${n}`;return n}function yH(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Wr(t))return`${r} for argmax(${t.argmax})`;if(Wi(t))return`${r} for argmin(${t.argmin})`;const s=i&&!Vs(i)?nt(i):void 0,a=t||s?.unit||s?.maxbins&&"timeunit"||De(n)&&"bin";return a?`${a.toUpperCase()}(${r})`:r}const vD=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return yH(e);default:return mH(e,t)}};let ED=vD;function AD(e){ED=e}function bH(){AD(vD)}function ba(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=Jy(e)?.title;if(!B(e))return r??e.title;const s=e,a=i?Qy(s,t):void 0;return n?Ue(r,s.title,a):r??s.title??a}function Jy(e){if(Pa(e)&&e.axis)return e.axis;
vendor: 9,555 bytes, line 9
9if(bD(e)&&e.legend)return e.legend;if(Yy(e)&&e.header)return e.header}function Qy(e,t){return ED(e,t)}function Jc(e){if(xD(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Jy(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function xH(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ky(e)&&D(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Wr(n)&&!Wi(n))return"quantitative";if(Xs(e)&&e.scale?.type)switch(wg[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Un(e){if(B(e))return e;if(Ad(e))return e.condition}function Xe(e){if(re(e))return e;if(cl(e))return e.condition}function CD(e,t,n,i={}){if(q(e)||ge(e)||Mr(e)){const r=q(e)?"string":ge(e)?"number":"boolean";return M(bW(t,r,e)),{value:e}}return re(e)?Qc(e,t,n,i):cl(e)?{...e,condition:Qc(e.condition,t,n,i)}:e}function Qc(e,t,n,i){if(xD(e)){const{format:r,formatType:s,...a}=e;if(Ds(s)&&!n.customFormatTypes)return M(xE(t)),Qc(a,t,n,i)}else{const r=Pa(e)?"axis":bD(e)?"legend":Yy(e)?"header":null;if(r&&e[r]){const{format:s,formatType:a,...o}=e[r];if(Ds(a)&&!n.customFormatTypes)return M(xE(t)),Qc({...e,[r]:o},t,n,i)}}return B(e)?Zy(e,t,i):vH(e)}function vH(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=ge(n)?"quantitative":q(n)?"nominal":Hs(n)?"temporal":void 0,{...e,type:t}}function Zy(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:a}=e,o={...e};if(!n&&i&&!wy(i)&&!Wr(i)&&!Wi(i)&&(M(vW(i)),delete o.aggregate),r&&(o.timeUnit=nt(r)),a&&(o.field=`${a}`),De(s)&&(o.bin=Cd(s,t)),st(s)&&!je(t)&&M(QW(t)),Nt(o)){const{type:u}=o,l=CG(u);u!==l&&(o.type=l),u!=="quantitative"&&fd(i)&&(M(xW(u,i)),o.type="quantitative")}else if(!mk(t)){const u=xH(o,t);o.type=u}if(Nt(o)){const{compatible:u,warning:l}=EH(o,t)||{};u===!1&&M(l)}if(Ky(o)&&q(o.sort)){const{sort:u}=o;if(FE(u))return{...o,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&FE(l))return{...o,sort:{encoding:l,order:"descending"}}}if(Yy(o)){const{header:u}=o;if(u){const{orient:l,...c}=u;if(l)return{...o,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return o}function Cd(e,t){return Mr(e)?{maxbins:cE(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:cE(t)}:e}const ra={compatible:!0};function EH(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 Pi:case Ii:case sd:return Kc(e)?ra:{compatible:!1,warning:wW(t)};case Me:case rt:case Pr:case ao:case Wt:case Ci:case wi:case nl:case il:case ad:case ws:case od:case ud:case js:case An:case Vn:case ld:return ra;case Yn:case vn:case Xn:case Kn:return n!==$s?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ra;case Qi:case zr:case Ur:case jr:case Ji:case Ki:case Yi:case Hn:case Ai:case Ir:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:ra;case Gt:case qr:return!Kc(e)&&!pH(e)?{compatible:!1,warning:FW(t)}:ra;case Na:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:ra}}function Ia(e){const{formatType:t}=Jc(e);return t==="time"||!t&&AH(e)}function AH(e){return e&&(e.type==="temporal"||B(e)&&!!e.timeUnit)}function wd(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const s=t&&nt(t)?.unit;let a=s||n==="temporal",o;return sl(e)?o=e.expr:Q(e)?o=e.signal:Hs(e)?(a=!0,o=Ss(e)):(q(e)||ge(e))&&a&&(o=`datetime(${Fe(e)})`,cG(s)&&(ge(e)&&e<1e4||q(e)&&isNaN(Date.parse(e)))&&(o=Ss({[s]:e}))),o?i&&a?`time(${o})`:o:r?void 0:Fe(e)}function wD(e,t){const{type:n}=e;return t.map(i=>{const r=B(e)&&!Vs(e.timeUnit)?e.timeUnit:void 0,s=wd(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function fl(e,t){return De(e.bin)?Si(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const kE={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 dl(e){return e?.condition}const FD=["domain","grid","labels","ticks","title"],CH={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"},SD={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},wH={...SD,style:1,labelExpr:1,encoding:1};function DE(e){return H(wH,e)}const FH={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},$D=_(FH);function er(e){return T(e,"mark")}class Fd{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return er(t)?ZG(t.mark)===this.name:!1}}function ds(e,t){const n=e&&e[t];return n?D(n)?_a(n,i=>!!i.field):B(n)||Ad(n):!1}function kD(e,t){const n=e&&e[t];return n?D(n)?_a(n,i=>!!i.field):B(n)||$i(n)||cl(n):!1}function DD(e,t){if(je(t)){const n=e[t];if((B(n)||$i(n))&&(Yk(n.type)||B(n)&&n.timeUnit)){const i=xy(t);return kD(e,i)}}return!1}function OD(e){return _a(vq,t=>{if(ds(e,t)){const n=e[t];if(D(n))return _a(n,i=>!!i.aggregate);{const i=Un(n);return i&&!!i.aggregate}}return!1})}function RD(e,t){const n=[],i=[],r=[],s=[],a={};return eb(e,(o,u)=>{if(B(o)){const{field:l,aggregate:c,bin:f,timeUnit:d,...p}=o;if(c||d||f){const g=Jy(o)?.title;let m=U(o,{forAs:!0});const y={...g?[]:{title:ba(o,t,{allowDisabling:!0})},...p,field:m};if(c){let b;if(Wr(c)?(b="argmax",m=U({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):Wi(c)?(b="argmin",m=U({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),s.push(v)}}else if(n.push(m),Nt(o)&&De(f)){if(i.push({bin:f,field:l,as:m}),n.push(U(o,{binSuffix:"end"})),fl(o,u)&&n.push(U(o,{binSuffix:"range"})),je(u)){const b={field:`${m}_end`};a[`${u}2`]=b}y.bin="binned",mk(u)||(y.type=$s)}else if(d&&!Vs(d)){r.push({timeUnit:d,field:l,as:m});const b=Nt(o)&&o.type!==Ma&&"time";b&&(u===nl||u===ws?y.formatType=b:Rq(u)?y.legend={formatType:b,...y.legend}:je(u)&&(y.axis={formatType:b,...y.axis}
vendor: 6,121 bytes, line 9
9))}a[u]=y}else n.push(l),a[u]=e[u]}else a[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:a}}function SH(e,t,n){const i=Tq(t,n);if(i){if(i==="binned"){const r=e[t===Hn?Me:rt];return!!(B(r)&&B(e[t])&&st(r.bin))}}else return!1;return!0}function $H(e,t,n,i){const r={};for(const s of _(e))gk(s)||M(CW(s));for(let s of Sq){if(!e[s])continue;const a=e[s];if(rl(s)){const o=Fq(s),u=r[o];if(B(u)&&AG(u.type)&&B(a)&&!u.timeUnit){M(yW(o));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(M(mW),s=An),!SH(e,s,t)){M(hd(s,t));continue}if(s===Ji&&t==="line"&&Un(e[s])?.aggregate){M(AW);continue}if(s===Wt&&(n?"fill"in e:"stroke"in e)){M(Tk("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===il||s===Na&&!D(a)&&!zn(a)||s===ws&&D(a)){if(a){if(s===Na){const o=e[s];if(yD(o)){r[s]=o;continue}}r[s]=W(a).reduce((o,u)=>(B(u)?o.push(Zy(u,s)):M(Cg(u,s)),o),[])}}else{if(s===ws&&a===null)r[s]=null;else if(!B(a)&&!$i(a)&&!zn(a)&&!ll(a)&&!Q(a)){M(Cg(a,s));continue}r[s]=CD(a,s,i)}}return r}function Sd(e,t){const n={};for(const i of _(e)){const r=CD(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function kH(e){const t=[];for(const n of _(e))if(ds(e,n)){const i=e[n],r=W(i);for(const s of r)B(s)?t.push(s):Ad(s)&&t.push(s.condition)}return t}function eb(e,t,n){if(e)for(const i of _(e)){const r=e[i];if(D(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function DH(e,t,n,i){return e?_(e).reduce((r,s)=>{const a=e[s];return D(a)?a.reduce((o,u)=>t.call(i,o,u,s),r):t.call(i,r,a,s)},n):n}function _D(e,t){return _(t).reduce((n,i)=>{switch(i){case Me:case rt:case od:case ld:case ud:case Hn:case Ai:case Pr:case ao:case An:case Ki:case Vn:case Yi:case Ir:case Xn:case Yn:case Kn:case vn:case nl:case Gt:case js:case ws:return n;case Na:if(e==="line"||e==="trail")return n;case il:case ad:{const r=t[i];if(D(r)||B(r))for(const s of W(r))s.aggregate||n.push(U(s,{}));return n}case Ji:if(e==="trail")return n;case Wt:case Ci:case wi:case Qi:case zr:case Ur:case qr:case jr:{const r=Un(t[i]);return r&&!r.aggregate&&n.push(U(r,{})),n}}},[])}function OH(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(D(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return D(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function $g(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:a,titlePrefix:o})=>{const u=i?` of ${tb(t)}`:"";return{field:a+t.field,type:t.type,title:Q(o)?{signal:`${o}"${escape(u)}"`}:o+u}}),s=kH(n).map(dH);return{tooltip:[...r,...ai(s,le)]}}function tb(e){const{title:t,field:n}=e;return Ue(t,n)}function nb(e,t,n,i,r){const{scale:s,axis:a}=n;return({partName:o,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=tb(n);return TD(e,o,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...a!==void 0?{axis:a}:{}},...q(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function TD(e,t,n,i){const{clip:r,color:s,opacity:a}=e,o=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...a?{opacity:a}:{},...mi(i.mark)?i.mark:{type:i.mark},style:`${o}-${String(t)}`,...Mr(e[t])?{}:e[t]}}]:[]}function ND(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],a=i[`${r}2`],o=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Nl(s,n),continuousAxisChannelDef2:Nl(a,n),continuousAxisChannelDefError:Nl(o,n),continuousAxisChannelDefError2:Nl(u,n),continuousAxis:r}}function Nl(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&M(JW(n,t)),i}else return e}function MD(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(mi(n)&&n.orient)return n.orient;if(br(r)){if(br(s)){const a=B(r)&&r.aggregate,o=B(s)&&s.aggregate;if(!a&&o===t)return"vertical";if(!o&&a===t)return"horizontal";if(a===t&&o===t)throw new Error("Both x and y cannot have aggregate");return Ia(s)&&!Ia(r)?"horizontal":"vertical"}return"horizontal"}else{if(br(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Zc="boxplot",RH=["box","median","outliers","rule","ticks"],_H=new Fd(Zc,BD);function LD(e){return ge(e)?"tukey":e}function BD(e,{config:t}){e={...e,encoding:Sd(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...a}=e,o=mi(n)?n:{type:n};r&&M(Rk("boxplot"));const u=o.extent??t.boxplot.extent,l=Ce("size",o,t),c=o.invalid,f=LD(u),{bins:d,timeUnits:p,transform:h,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:A,boxOrient:E,customTooltipWithoutAggregatedField:C}=TH(e,u,t),x=so(g.field),{color:w,size:R,...L}=v,J=X3=>nb(o,m,g,X3,t.boxplot),ne=J(L),de=J(v),N=(j(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",O=J({...L,...R?{size:R}:{},color:{condition:{test:`${xe(`lower_box_${g.field}`)} >= ${xe(`upper_box_${g.field}`)}`,...w||{value:N}}}}),I=$g([{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),G={type:"tick",color:"black",opacity:1,orient:A,invalid:c,aria:!1},X=f==="min-max"?I:$g([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),V=[...ne({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:X}),...ne({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:X}),...ne({partName:"ticks",mark:G,positionPrefix:"lower_whisker",extraEncoding:X}),...ne({partName:"ticks",mark:G,positionPrefix:"upper_whisker",extraEncoding:X})],te=[...f!=="tukey"?V:[],...de({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}
vendor: 18,048 bytes, line 9
9),...O({partName:"median",mark:{type:"tick",invalid:c,...j(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:A,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...a,transform:(a.transform??[]).concat(h),layer:te};const ye=xe(`lower_box_${g.field}`),oe=xe(`upper_box_${g.field}`),ke=`(${oe} - ${ye})`,gt=`${ye} - ${u} * ${ke}`,Le=`${oe} + ${u} * ${ke}`,Qn=xe(g.field),G3={joinaggregate:PD(g.field),groupby:y},Gb={transform:[{filter:`(${gt} <= ${Qn}) && (${Qn} <= ${Le})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${x}`},{op:"max",field:g.field,as:`upper_whisker_${x}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${x}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${x}`},...b],groupby:y}],layer:V},{tooltip:zee,...H3}=L,{scale:Hb,axis:V3}=g,Vb=tb(g),Xb=zt(V3,["title"]),Yb=TD(o,"outliers",t.boxplot,{transform:[{filter:`(${Qn} < ${gt}) || (${Qn} > ${Le})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Vb!==void 0?{title:Vb}:{},...Hb!==void 0?{scale:Hb}:{},...we(Xb)?{}:{axis:Xb}},...H3,...w?{color:w}:{},...C?{tooltip:C}:{}}})[0];let xl;const Kb=[...d,...p,G3];return Yb?xl={transform:Kb,layer:[Yb,Gb]}:(xl=Gb,xl.transform.unshift(...Kb)),{...a,layer:[xl,{transform:h,layer:te}]}}function PD(e){const t=so(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function TH(e,t,n){const i=MD(e,Zc),{continuousAxisChannelDef:r,continuousAxis:s}=ND(e,i,Zc),a=r.field,o=so(a),u=LD(t),l=[...PD(a),{op:"median",field:a,as:`mid_box_${o}`},{op:"min",field:a,as:(u==="min-max"?"lower_whisker_":"min_")+o},{op:"max",field:a,as:(u==="min-max"?"upper_whisker_":"max_")+o}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${xe(`upper_box_${o}`)} - ${xe(`lower_box_${o}`)}`,as:`iqr_${o}`},{calculate:`min(${xe(`upper_box_${o}`)} + ${xe(`iqr_${o}`)} * ${t}, ${xe(`max_${o}`)})`,as:`upper_whisker_${o}`},{calculate:`max(${xe(`lower_box_${o}`)} - ${xe(`iqr_${o}`)} * ${t}, ${xe(`min_${o}`)})`,as:`lower_whisker_${o}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:h}=OH(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=RD(h,n),A=i==="vertical"?"horizontal":"vertical",E=i,C=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:C,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:A,boxOrient:E,customTooltipWithoutAggregatedField:p}}const ib="errorbar",NH=["ticks","rule"],MH=new Fd(ib,ID);function ID(e,{config:t}){e={...e,encoding:Sd(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:a,markDef:o,outerSpec:u,tooltipEncoding:l}=zD(e,ib,t);delete s.size;const c=nb(o,r,i,s,t.errorbar),f=o.thickness,d=o.size,p={type:"tick",orient:a,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},h=[...c({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:p,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,...h.length>1?{layer:h}:{...h[0]}}}function LH(e,t){const{encoding:n}=e;if(BH(n))return{orient:MD(e,t),inputType:"raw"};const i=PH(n),r=IH(n),s=n.x,a=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const o=n.x2,u=n.y2;if(re(o)&&re(u))throw new Error(`${t} cannot have both x2 and y2`);if(re(o)){if(br(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(re(u)){if(br(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const o=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(re(u)&&!re(o))throw new Error(`${t} cannot have xError2 without xError`);if(re(c)&&!re(l))throw new Error(`${t} cannot have yError2 without yError`);if(re(o)&&re(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(re(o)){if(br(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(re(l)){if(br(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function BH(e){return(re(e.x)||re(e.y))&&!re(e.x2)&&!re(e.y2)&&!re(e.xError)&&!re(e.xError2)&&!re(e.yError)&&!re(e.yError2)}function PH(e){return re(e.x2)||re(e.y2)}function IH(e){return re(e.xError)||re(e.xError2)||re(e.yError)||re(e.yError2)}function zD(e,t,n){const{mark:i,encoding:r,params:s,projection:a,...o}=e,u=mi(i)?i:{type:i};s&&M(Rk(t));const{orient:l,inputType:c}=LH(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:h,continuousAxis:g}=ND(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=zH(u,f,d,p,h,c,t,n),{[g]:A,[g==="x"?"x2":"y2"]:E,[g==="x"?"xError":"yError"]:C,[g==="x"?"xError2":"yError2"]:x,...w}=r,{bins:R,timeUnits:L,aggregate:J,groupby:ne,encoding:de}=RD(w,n),N=[...J,...m],O=c!=="raw"?[]:ne,I=$g(b,f,de,v);return{transform:[...o.transform??[],...R,...L,...N.length===0?[]:[{aggregate:N,groupby:O}],...y],groupby:O,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:de,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:o,tooltipEncoding:I}}function zH(e,t,n,i,r,s,a,o){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":o.errorbar.center,h=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!=(h==="iqr")&&M(KW(p,h,a)),h==="stderr"||h==="stdev")u=[{op:h,field:c,as:`extent_${c}`},{op:p,field:c,as:`center_${c}`}],l=[{calculate:`${xe(`center_${c}`)} + ${xe(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${xe(`center_${c}`)} - ${xe(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:tl(p)},{fieldPrefix:"upper_",titlePrefix:OE(p,h,"+")},{fieldPrefix:"lower_",titlePrefix:OE(p,h,"-")}],d=!0;else{let g,m,y;h==="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:ba({field:c,aggregate:y,type:"quantitative"},o,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ba({field:c,aggregate:m,type:"quantitative"},o,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ba({field:c,aggregate:g,type:"quantitative"},o,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&M(YW(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:xe(n.field),as:`upper_${c}`},{calculate:xe(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${xe(c)} + ${xe(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${xe(c)} + ${xe(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${xe(c)} - ${xe(i.field)}`,as:`lower_${c}`}));for(const p of l)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:Cs(Cs(p.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function OE(e,t,n){return`${tl(e)} ${n} ${t}`}const rb="errorband",UH=["band","borders"],jH=new Fd(rb,UD);function UD(e,{config:t}){e={...e,encoding:Sd(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:a,outerSpec:o,tooltipEncoding:u}=zD(e,rb,t),l=a,c=nb(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const h={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...h,ariaRoleDescription:"errorband"},p={...p,...h,aria:!1}):l.interpolate?M(EE("interpolate")):l.tension&&M(EE("tension")),{...o,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:u})]}}const jD={};function sb(e,t,n){const i=new Fd(e,t);jD[e]={normalizer:i,parts:n}}function qH(){return _(jD)}sb(Zc,BD,RH);sb(ib,ID,NH);sb(rb,UD,UH);const WH=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],qD={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"},WD={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"},GH=_(qD),HH=_(WD),VH={header:1,headerRow:1,headerColumn:1,headerFacet:1},GD=_(VH),HD=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],XH={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},YH={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},jn="_vgsid_",KH={point:{on:"click",fields:[jn],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 ab(e){return e==="legend"||!!e?.legend}function Ih(e){return ab(e)&&j(e)}function ob(e){return!!e?.select}function VD(e){const t=[];for(const n of e||[]){if(ob(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const a={...s,bind:r,init:i};t.push(a)}else{const a={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(a)}}return t}function JH(e){return $d(e)||lb(e)||ub(e)}function ub(e){return T(e,"concat")}function $d(e){return T(e,"vconcat")}function lb(e){return T(e,"hconcat")}function XD({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function yi(e){return T(e,"step")}function RE(e){return T(e,"view")||T(e,"width")||T(e,"height")}const _E=20,QH={align:1,bounds:1,center:1,columns:1,spacing:1},ZH=_(QH);function eV(e,t,n){const i=n[t],r={},{spacing:s,columns:a}=i;s!==void 0&&(r.spacing=s),a!==void 0&&(Ed(e)&&!ul(e.facet)||ub(e))&&(r.columns=a),$d(e)&&(r.columns=1);for(const o of ZH)if(e[o]!==void 0)if(o==="spacing"){const u=e[o];r[o]=ge(u)?u:{row:u.row??s,column:u.column??s}}else r[o]=e[o];return r}function kg(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Dg(e,t){const n=ef(e,t);return yi(n)?n.step:YD}function ef(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Ue(n,{step:e.step})}const YD=20,tV={continuousWidth:200,continuousHeight:200,step:YD},nV={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:tV,mark:VG,arc:{},area:{},bar:JG,circle:{},geoshape:{},image:{},line:{},point:{},rect:Wy,rule:{color:"black"},square:{},text:{color:"black"},tick:QG,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:kG,projection:{},legend:XH,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:KH,style:{},title:{},facet:{spacing:_E},concat:{spacing:_E},normalizedNumberFormat:".0%"},_i=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],TE={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},NE={blue:_i[0],orange:_i[1],red:_i[2],teal:_i[3],green:_i[4],yellow:_i[5],purple:_i[6],pink:_i[7],brown:_i[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 iV(e={}){return{signals:[{name:"color",value:j(e)?{...NE,...e}:NE}],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 rV(e){return{signals:[{name:"fontSize",value:j(e)?{...TE,...e}:TE}],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 sV(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function KD(e){const t=_(e||{}),n={};for(const i of t){const r=e[i];n[i]=dl(r)?wk(r):Kt(r)}return n}function aV(e){const t=_(e),n={};for(const i of t)n[i]=KD(e[i]);return n}const oV=[...sD,...$D,...GD,"background","padding","legend","lineBreak","scale","style","title","view"];function JD(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,a=Va({},ie(nV),n?sV(n):{},t?iV(t):{},i?rV(i):{},s||{});r&&Xa(a,"selection",r,!0);const o=zt(a,oV);for(const u of["background","lineBreak","padding"])a[u]&&(o[u]=Kt(a[u]));for(const u of sD)a[u]&&(o[u]=at(a[u]));for(const u of $D)a[u]&&(o[u]=KD(a[u]));for(const u of GD)a[u]&&(o[u]=at(a[u]));if(a.legend&&(o.legend=at(a.legend)),a.scale){const{invalid:u,...l}=a.scale,c=at(u,{level:1});o.scale={...at(l),..._(c).length>0?{invalid:c}:{}}}return a.style&&(o.style=aV(a.style)),a.title&&(o.title=at(a.title)),a.view&&(o.view=at(a.view)),o}const uV=new Set(["view",...UG]),lV=["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"],cV={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...HG};function fV(e){e=ie(e);for(const t of lV)delete e[t];if(e.axis)for(const t in e.axis)dl(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of WH)delete e.legend[t];if(e.mark){for(const t of CE)delete e.mark[t];e.mark.tooltip&&j(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(VD(e.params)),delete e.params);for(const t of uV){for(const i of CE)delete e[t][i];const n=cV[t];if(n)for(const i of n)delete e[t][i];hV(e,t)}for(const t of qH())delete e[t];dV(e);for(const t in e)j(e[t])&&we(e[t])&&delete e[t];return we(e)?void 0:e}function dV(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=Ck(e.title);we(t)||(e.style["group-title"]={...e.style["group-title"],...t}),we(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),we(i)?delete e.title:e.title=i}function hV(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};we(s)||(e.style[n??t]=s),delete e[t]}function kd(e){return T(e,"layer")}function pV(e){return T(e,"repeat")}function gV(e){return!D(e.repeat)&&T(e.repeat,"layer")}class cb{map(t,n){return Ed(t)?this.mapFacet(t,n):pV(t)?this.mapRepeat(t,n):lb(t)?this.mapHConcat(t,n):$d(t)?this.mapVConcat(t,n):ub(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(kd(t))return this.mapLayer(t,n);if(er(t))return this.mapUnit(t,n);throw new Error(Fy(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(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const mV={zero:1,center:1,normalize:1};function yV(e){return H(mV,e)}const bV=new Set([nD,yd,md,Vc,xd,jy,qy,bd,iD,Uy]),xV=new Set([yd,md,n
vendor: 18,255 bytes, line 9
9D]);function sa(e){return B(e)&&Ba(e)==="quantitative"&&!e.bin}function ME(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),a=e[t],o=e[r];if(B(a)&&B(o))if(sa(a)&&sa(o)){if(a.stack)return t;if(o.stack)return r;const u=B(a)&&!!a.aggregate,l=B(o)&&!!o.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(sa(a))return t;if(sa(o))return r}else{if(sa(a))return s&&n==="vertical"?void 0:t;if(sa(o))return s&&n==="horizontal"?void 0:r}}function vV(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function QD(e,t){const n=mi(e)?e:{type:e},i=n.type;if(!bV.has(i))return null;const r=ME(t,"x",n)||ME(t,"theta",n);if(!r)return null;const s=t[r],a=B(s)?U(s,{}):void 0,o=vV(r),u=[],l=new Set;if(t[o]){const g=t[o],m=B(g)?U(g,{}):void 0;m&&m!==a&&(u.push(o),l.add(m))}const c=o==="x"?"xOffset":"yOffset",f=t[c],d=B(f)?U(f,{}):void 0;d&&d!==a&&(u.push(c),l.add(d));const p=$q.reduce((g,m)=>{if(m!=="tooltip"&&ds(t,m)){const y=t[m];for(const b of W(y)){const v=Un(b);if(v.aggregate)continue;const A=U(v,{});(!A||!l.has(A))&&g.push({channel:m,fieldDef:v})}}return g},[]);let h;return s.stack!==void 0?Mr(s.stack)?h=s.stack?"zero":null:h=s.stack:xV.has(i)&&(h="zero"),!h||!yV(h)||OD(t)&&p.length===0?null:(s?.scale?.type&&s?.scale?.type!==ot.LINEAR&&s?.stack&&M(HW(s.scale.type)),re(t[Fi(r)])?(s.stack!==void 0&&M(GW(r)),null):(B(s)&&s.aggregate&&!zq.has(s.aggregate)&&M(VW(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:Gr(i),stackBy:p,offset:h}))}function ZD(e,t,n){const i=at(e),r=Ce("orient",i,n);if(i.orient=wV(i.type,t,r),r!==void 0&&r!==i.orient&&M(DW(i.orient,r)),i.type==="bar"&&i.orient){const u=Ce("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:YG[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=Ce("opacity",i,n),a=Ce("fillOpacity",i,n);return s===void 0&&a===void 0&&(i.opacity=AV(i.type,t)),Ce("cursor",i,n)===void 0&&(i.cursor=EV(i,t,n)),i}function EV(e,t,n){return t.href||e.href||Ce("href",e,n)?"pointer":e.cursor}function AV(e,t){if(ue([xd,Uy,jy,qy],e)&&!OD(t))return .7}function CV(e,t,{graticule:n}){if(n)return!1;const i=gi("filled",e,t),r=e.type;return Ue(i,r!==xd&&r!==bd&&r!==Vc)}function wV(e,t,n){switch(e){case xd:case jy:case qy:case iD:case IG:case PG:return}const{x:i,y:r,x2:s,y2:a}=t;switch(e){case yd:if(B(i)&&(st(i.bin)||B(r)&&r.aggregate&&!i.aggregate))return"vertical";if(B(r)&&(st(r.bin)||B(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||s){if(n)return n;if(!s)return(B(i)&&i.type===$s&&!De(i.bin)||Yc(i))&&B(r)&&st(r.bin)?"horizontal":"vertical";if(!a)return(B(r)&&r.type===$s&&!De(r.bin)||Yc(r))&&B(i)&&st(i.bin)?"vertical":"horizontal"}case Vc:if(s&&!(B(i)&&st(i.bin))&&a&&!(B(r)&&st(r.bin)))return;case md:if(a)return B(r)&&st(r.bin)?"horizontal":"vertical";if(s)return B(i)&&st(i.bin)?"vertical":"horizontal";if(e===Vc){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case bd:case Uy:{const o=$E(i),u=$E(r);if(n)return n;if(o&&!u)return e!=="tick"?"horizontal":"vertical";if(!o&&u)return e!=="tick"?"vertical":"horizontal";if(o&&u)return"vertical";{const l=Nt(i)&&i.type===Ma,c=Nt(r)&&r.type===Ma;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function FV(e){const{point:t,line:n,...i}=e;return _(i).length>1?i:i.type}function SV(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:zt(e[t],["point","line"])});return e}function zh(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?j(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?j(t.point)?t.point:{}:void 0}function LE(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 $V{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(er(t)){const{mark:i,encoding:r}=t,s=mi(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!zh(s,n[s.type],r);case"area":return!!zh(s,n[s.type],r)||!!LE(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:a,mark:o,name:u,encoding:l,...c}=t,f=Sd(l,r),d=mi(o)?o:{type:o},p=zh(d,r[d.type],f),h=d.type==="area"&&LE(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:FV({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:zt(f,["shape"])}],m=QD(ZD(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=zt(y,["y2","x2"]),h&&g.push({...a?{projection:a}:{},mark:{type:"line",...Ra(d,["clip","interpolate","tension","tooltip"]),...h},encoding:y}),p&&g.push({...a?{projection:a}:{},mark:{type:"point",opacity:1,filled:!0,...Ra(d,["clip","tooltip"]),...p},encoding:y}),i({...c,layer:g},{...n,config:SV(r)})}}function kV(e,t){return t?ul(e)?tO(e,t):eO(e,t):e}function Uh(e,t){return t?tO(e,t):e}function Og(e,t,n){const i=t[e];if(cH(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};M(aW(i.repeat));return}return t}function eO(e,t){if(e=Og("field",e,t),e!==void 0){if(e===null)return null;if(Ky(e)&&zi(e.sort)){const n=Og("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function BE(e,t){if(B(e))return eO(e,t);{const n=Og("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function PE(e,t){if(re(e)){const n=BE(e,t);if(n)return n;if(ll(e))return{condition:e.condition}}else{if(cl(e)){const n=BE(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function tO(e,t){const n={};for(const i in e)if(T(e,i)){const r=e[i];if(D(r))n[i]=r.map(s=>PE(s,t)).filter(s=>s);else{const s=PE(r,t);s!==void 0&&(n[i]=s)}}return n}class DV{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(er(t)){const{encoding:n,mark:i}=t;if(i==="line"||mi(i)&&i.type==="line")for(const r of wq){const s=qs(r),a=n[s];if(n[r]&&(B(a)&&!st(a.bin)||$i(a)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return M(kW(!!r.x2,!!r.y2)),i({...t,mark:j(s)?{...s,type:"rule"}:"rule"},n)}}class OV extends cb{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[_H,MH,jH,new $V,new DV]}map(t,n){if(er(t)){const i=ds(t.encoding,Pi),r=ds(t.encoding,Ii),s=ds(t.encoding,sd);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Uh(t.encoding,n.repeater),a={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(a,n);const o=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(a,n.config))return u.run(a,n,o);return a}mapRepeat(t,n){return gV(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:a,column:o,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return a||o?this.mapRepeat({...t,repeat:{...a?{row:a}:{},...o?{column:o}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},p=`${(r.name?`${r.name}_`:"")+c}child__layer_${Ne(f)}`,h=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:p});return h.name=p,h})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...a}=t;!D(i)&&t.columns&&(t=zt(t,["columns"]),M(yE("repeat")));const o=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!D(i)&&i.row||[u?u.row:null],f=!D(i)&&i.column||[u?u.column:null],d=D(i)&&i||[u?u.repeat:null];for(const h of d)for(const g of c)for(const m of f){const y={repeat:h,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(D(i)?`${Ne(h)}`:(i.row?`row_${Ne(g)}`:"")+(i.column?`column_${Ne(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,o.push(zt(v,["data"]))}const p=D(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...a,columns:p,concat:o}}mapFacet(t,n){const{facet:i}=t;return ul(i)&&t.columns&&(t=zt(t,["columns"]),M(yE("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:a,config:o}=n,u=zE({parentProjection:a,projection:r}),l=IE({parentEncoding:s,encoding:Uh(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:o})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...a}=t.encoding,{mark:o,width:u,projection:l,height:c,view:f,params:d,encoding:p,...h}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Uh(a,n.repeater);return this.mapFacet({...h,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:o,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&M(SW([...i?[Pi]:[],...r?[Ii]:[]]));const a={},o={};for(const u of[Pi,Ii]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:p,...h}=l;a[u]=h;for(const g of["align","center","spacing"])l[g]!==void 0&&(o[g]??(o[g]={}),o[g][u]=l[g])}}return{facetMapping:a,layout:o}}else{const{align:a,center:o,spacing:u,columns:l,...c}=s;return{facetMapping:kV(c,n.repeater),layout:{...a?{align:a}:{},...o?{center:o}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:a,...o}=t,u={...r,parentEncoding:IE({parentEncoding:n,encoding:s,layer:!0}),parentProjection:zE({parentProjection:i,projection:a})};return super.mapLayer({...o,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function IE({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([..._(e),..._(t)]);for(const s of r){const a=t[s],o=e[s];if(re(a)){const u={...o,...a};i[s]=u}else cl(a)?i[s]={...a,condition:{...o,...a.condition}}:a||a===null?i[s]=a:(n||zn(o)||Q(o)||re(o)||D(o))&&(i[s]=o)}}else i=t;return!i||we(i)?void 0:i}function zE(e){const{parentProjection:t,projection:n}=e;return t&&n&&M(gW({parentProjection:t,projection:n})),n??t}function fb(e){return T(e,"filter")}function RV(e){return T(e,"stop")}function nO(e){return T(e,"lookup")}function _V(e){return T(e,"data")}function TV(e){return T(e,"param")}function NV(e){return T(e,"pivot")}function MV(e){return T(e,"density")}function LV(e){return T(e,"quantile")}function BV(e){return T(e,"regression")}function PV(e){return T(e,"loess")}function IV(e){return T(e,"sample")}function zV(e){return T(e,"window")}function UV(e){return T(e,"joinaggregate")}function jV(e){return T(e,"flatten")}function qV(e){return T(e,"calculate")}function iO(e){return T(e,"bin")}function WV(e){return T(e,"impute")}function GV(e){return T(e,"timeUnit")}function HV(e){return T(e,"aggregate")}function VV(e){return T(e,"stack")}function XV(e){return T(e,"fold")}function YV(e){return T(e,"extent")&&!T(e,"density")&&!T(e,"regression")}function KV(e){return e.map(t=>fb(t)?{filter:ma(t.filter,EG)}:t)}class JV extends cb{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=UE(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=UE(t,n),t.encoding){const i={};for(const[r,s]of Or(t.encoding))i[r]=rO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Or(i).map(([s,a])=>{const{init:o,bind:u,empty:l,...c}=a;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of dt(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:o,select:c,bind:u}})}:t}}function UE(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(fb(s))return{filter:Rg(s,t)};if(iO(s)&&Ws(s.bin))return{...s,bin:sO(s.bin)};if(nO(s)){const{selection:a,...o}=s.from;return a?{...s,from:{param:a,...o}}:s}return s});return{...i,transform:r}}return e}function rO(e,t){const n=ie(e);if(B(n)&&Ws(n.bin)&&(n.bin=sO(n.bin)),Xs(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(ll(n))if(D(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:s,test:a,...o}=i;return s?i:{...o,test:Rg(i,t)}});else{const{selection:i,param:r,test:s,...a}=rO(n.condition,t);n.condition=r?n.condition:{...a,test:Rg(n.condition,t)}}return n}function sO(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Rg(e,t){const n=i=>ma(i,r=>{var s;const a=t.emptySelections[r]??!0,o={param:r,empty:a};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(o),o});return e.selection?n(e.selection):ma(e.test||e.filter,i=>i.selection?n(i.selection):i)}class _g extends cb{map(t,n){const i=n.selections??[];if(t.params&&!er(t)){const r=[];for(const s of t.params)ob(s)?i.push(s):r.push(s);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),s=[];for(const a of i)if(!a.views||!a.views.length)s.push(a);else for(const o of a.views)(q(o)&&(o===t.name||r.includes(o))||D(o)&&o.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(a);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=_g.prototype[e];_g.prototype[e]=function(n,i){return t.call(this,n,QV(n,i))}}function QV(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function aO(e,t){t===void 0&&(t=JD(e.config));const n=nX(e,t),{width:i,height:r}=e,s=iX(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const ZV=new OV,eX=new JV,tX=new _g;function nX(e,t={}){const n={config:t};return tX.map(ZV.map(eX.map(e,n),n),n)}function jE(e){return q(e)?{type:e}:e??{}}function iX(e,t,n){let{width:i,height:r}=t;const s=er(e)||kd(e),a={};s?i=="container"&&r=="container"?(a.type="fit",a.contains="padding"):i=="container"?(a.type="fit-x",a.contains="padding"):r=="container"&&(a.type="fit-y",a.contains="padding"):(i=="container"&&(M(hE("width")),i=void 0),r=="container"&&(M(hE("height")),r=void 0));const o={type:"pad",...a,...n?jE(n.autosize):{},...jE(e.autosize)};if(o.type==="fit"&&!s&&(M(Yq),o.type="pad"),i=="container"&&!(o.type=="fit"||o.type=="fit-x")&&M(pE("width")),r=="container"&&!(o.type=="fit"||o.type=="fit-y")&&M(pE("height")),!Jt(o,{type:"pad"}))return o}function rX(e){return["fit","fit-x","fit-y"].includes(e)}function sX(e){return e?`fit-${cd(e)}`:"fit"}const aX=["background","padding"];function qE(e,t){const n={};for(const i of aX)e&&e[i]!==void 0&&(n[i]=Kt(e[i]));return t&&(n.params=e.params),n}class tr{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new tr(ie(this.explicit),ie(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Ue(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 _(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function ii(e){return{explicit:!0,value:e}}function Yt(e){return{explicit:!1,value:e}}function oO(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:Dd(t,n,i,r)}}function Dd(e,t,n,i){return e.explicit&&t.explicit&&M(PW(n,i,e.value,t.value)),e}function Tr(e,t,n,i,r=Dd){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Jt(e.value,t.value)?e:r(e,t,n,i)}class oX extends tr{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 za(e){return T(e,"url")}function wu(e){return T(e,"values")}function uO(e){return T(e,"name")&&!za(e)&&!wu(e)&&!Cr(e)}function Cr(e){return e&&(lO(e)||cO(e)||db(e))}function lO(e){return T(e,"sequence")}function cO(e){return T(e,"sphere")}function db(e){return T(e,"graticule")}var Pe;(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"})(Pe||(Pe={}));function fO({invalid:e,isPath:t}){switch(aD(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 uX(e){const{marks:t,scales:n}=fO(e);return t===n?Pe.Main:n==="include-invalid-values"?Pe.PreFilterInvalid:Pe.PostFilterInvalid}class Ae{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)){M(dW);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 Ut extends Ae{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}
9`,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 ${ok()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function jh(e){return e.as!==void 0}function WE(e){return`${e}_end`}class li extends Ae{clone(){return new li(null,ie(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,a)=>{const{field:o,timeUnit:u}=s;if(u){let l;if(Vs(u)){if(Be(n)){const{mark:c,markDef:f,config:d}=n,p=_r({fieldDef:s,markDef:f,config:d});(Cu(c)||p)&&(l={timeUnit:nt(u),field:o})}}else l={as:U(s,{forAs:!0}),field:o,timeUnit:u};if(Be(n)){const{mark:c,markDef:f,config:d}=n,p=_r({fieldDef:s,markDef:f,config:d});Cu(c)&&je(a)&&p!==.5&&(l.rectBandPosition=p)}l&&(r[le(l)]=l)}return r},{});return we(i)?null:new li(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=nt(i),a={...r,timeUnit:s};return new li(t,{[le(a)]:a})}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 Or(this.timeUnits)){const s=jh(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(dt(this.timeUnits).map(t=>jh(t)?t.as:WE(t.field)))}dependentFields(){return new Set(dt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${le(this.timeUnits)}`}assemble(){const t=[];for(const n of dt(this.timeUnits)){const{rectBandPosition:i}=n,r=nt(n.timeUnit);if(jh(n)){const{field:s,as:a}=n,{unit:o,utc:u,...l}=r,c=[a,`${a}_end`];t.push({field:xn(s),type:"timeunit",...o?{units:pd(o)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...GE(c,i,r))}else if(n){const{field:s}=n,a=s.replaceAll("\\.","."),o=dO({timeUnit:r,field:a}),u=WE(a);t.push({type:"formula",expr:o,as:u}),t.push(...GE([a,u],i,r))}}return t}}const Od="offsetted_rect_start",Rd="offsetted_rect_end";function dO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=jk(i),{part:a,step:o}=Hk(s,e.step);return`${r?"utcOffset":"timeOffset"}('${a}', ${xe(t)}, ${n?-o:o})`}function GE([e,t],n,i){if(n!==void 0&&n!==.5){const r=xe(e),s=xe(t);return[{type:"formula",expr:HE([dO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Od}`},{type:"formula",expr:HE([r,s],n+.5),as:`${e}_${Rd}`}]}return[]}function HE([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const hl="_tuple_fields";class lX{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const cX={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new lX),s={},a={},o=new Set,u=(h,g)=>{const m=g==="visual"?h.channel:h.field;let y=Ne(`${i}_${m}`);for(let b=1;o.has(y);b++)y=Ne(`${i}_${m}_${b}`);return o.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?W(n.value):null;let{fields:d,encodings:p}=j(n.select)?n.select:{};if(!d&&!p&&f){for(const h of f)if(j(h))for(const g of _(h))Cq(g)?(p||(p=[])).push(g):l==="interval"?(M(sW),p=c.encodings):(d??(d=[])).push(g)}!d&&!p&&(p=c.encodings,"fields"in c&&(d=c.fields));for(const h of p??[]){const g=e.fieldDef(h);if(g){let m=g.field;if(g.aggregate){M(Kq(h,g.aggregate));continue}else if(!m){M(mE(h));continue}if(g.timeUnit&&!Vs(g.timeUnit)){m=e.vgField(h);const y={timeUnit:g.timeUnit,as:m,field:g.field};a[le(y)]=y}if(!s[m]){const y=l==="interval"&&Si(h)&&In(e.getScaleComponent(h).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:h,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===jn,hk(h)?(b.geoChannel=h,b.channel=dk(h),r.hasChannel[b.channel]=s[m]):r.hasChannel[h]=s[m]}}else M(mE(h))}for(const h of d??[]){if(r.hasField[h])continue;const g={type:"E",field:h,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[h]=g,r.hasSelectionId=r.hasSelectionId||h===jn}f&&(t.init=f.map(h=>r.items.map(g=>j(h)?h[g.geoChannel||g.channel]!==void 0?h[g.geoChannel||g.channel]:h[g.field]:h))),we(a)||(r.timeUnit=new li(null,a))},signals:(e,t,n)=>{const i=t.name+hl;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(mO)}
9)}},hO="_curr",pc="anim_value",ua="anim_clock",Tg="eased_anim_clock",pO="min_extent",gO="max_range_extent",qh="last_tick_at",Wh="is_playing",fX=1/60*1e3,dX=(e,t)=>[{name:Tg,update:ua},{name:`${e}_domain`,init:`domain('${t}')`},{name:pO,init:`extent(${e}_domain)[0]`},{name:gO,init:`extent(range('${t}'))[1]`},{name:pc,update:`invert('${t}', ${Tg})`}],hX={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(ci(t)&&(n=n.concat([{name:ua,init:"0",on:[{events:{type:"timer",throttle:fX},update:`${Wh} ? (${ua} + (now() - ${qh}) > ${gO} ? 0 : ${ua} + (now() - ${qh})) : ${ua}`}]},{name:qh,init:"now()",on:[{events:[{signal:ua},{signal:Wh}],update:"now()"}]},{name:Wh,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+hl,s=t.project,a="(item().isVoronoi ? datum.datum : datum)",o=dt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+xa):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${o?` && ${o}`:""}`;let l=`unit: ${hs(e)}, `;if(t.project.hasSelectionId)l+=`${jn}: ${a}[${P(jn)}]`;else if(ci(t))l+=`fields: ${r}, values: [${pc} ? ${pc} : ${pO}]`;else{const c=s.items.map(f=>e.fieldDef(f.channel)?.bin?`[${a}[${P(e.vgField(f.channel,{}))}], ${a}[${P(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${a}[${P(f.field)}]`).join(", ");l+=`fields: ${r}, values: [${c}]`}if(ci(t))return n.concat(dX(t.name,e.scaleName(Ir)),[{name:i+Hi,on:[{events:[{signal:Tg},{signal:pc}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+Hi,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function mO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=xn(r.field),r}function Os(e,t=!0,n=$t){if(D(e)){const i=e.map(r=>Os(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Hs(e))return n(t?Ss(e):lG(e));return t?n(Fe(e)):e}function pX(e,t){for(const n of dt(e.component.selection??{})){const i=n.name;let r=`${i}${Hi}, ${n.resolve==="global"?"true":`{unit: ${hs(e)}}`}`;for(const s of Td)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+UX,on:[{events:{signal:n.name+Hi},update:`modify(${P(n.name+Rs)}, ${r})`}]})}return hb(t)}function gX(e,t){if(e.component.selection&&_(e.component.selection).length){const n=P(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Br("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return hb(t)}function mX(e,t){let n=!1;for(const i of dt(e.component.selection??{})){const r=i.name,s=P(r+Rs);if(t.filter(o=>o.name===r).length===0){const o=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${TO}(${s}, ${P(o)}${u}`})}n=!0;for(const o of Td)o.defined(i)&&o.topLevelSignals&&(t=o.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"}]}),hb(t)}function yX(e,t){const n=[],i=[],r=hs(e,{escape:!1});for(const s of dt(e.component.selection??{})){const a={name:s.name+Rs};if(s.project.hasSelectionId&&(a.transform=[{type:"collect",sort:{field:jn}}]),s.init){const u=s.project.items.map(mO);a.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[jn]:Os(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:Os(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+Rs).length||n.push(a),ci(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Pe.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+hO,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function yO(e,t){for(const n of dt(e.component.selection??{}))for(const i of Td)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function bX(e,t){for(const n of e.children)Be(n)&&(t=yO(n,t));return t}function xX(e,t,n,i){const r=WO(e,t.param,t);return{signal:In(n.get("type"))&&D(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function hb(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Ui={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(!Si(r))continue;const s=e.getScaleComponent(r),a=s?s.get("type"):void 0;if(a=="sequential"&&M(eW),!s||!In(a)){M(Zq);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(a=>n.filter(o=>o.name===a.signals.data).length===0);if(!e.parent||Mg(e)||i.length===0)return n;const r=n.find(a=>a.name===t.name);let s=r.update;if(s.includes(TO))r.update=`{${i.map(a=>`${P(xn(a.field))}: ${a.signals.data}`).join(", ")}}`;else{for(const a of i){const o=`${P(xn(a.field))}: ${a.signals.data}`;s.includes(o)||(s=`${s.substring(0,s.length-1)}, ${o}}`)}r.update=s}return n.concat(i.map(a=>({name:a.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Mg(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);
vendor: 4,166 bytes, line 9
9r.push="outer",delete r.value,delete r.update}return n}};function Ng(e,t){return`domain(${P(e.scaleName(t))})`}function Mg(e){return e.parent&&ho(e.parent)&&(!e.parent.parent||Mg(e.parent.parent))}const xa="_brush",bO="_scale_trigger",ko="geo_interval_init_tick",xO="_init",vX="_center",EX={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...j(n.select)?n.select:{}};r.fields=[jn],r.encodings||(r.encodings=n.value?_(n.value):[Yn,Xn]),n.select={type:"interval",...r}}if(t.translate&&!Ui.defined(t)){const r=`!event.item || event.item.mark.name !== ${P(t.name+xa)}`;for(const s of t.events){if(!s.between){M(`${s} is not an ordered event stream for interval selections.`);continue}const a=W((i=s.between[0]).filter??(i.filter=[]));a.includes(r)||a.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Hi,s=dt(t.project.hasChannel).filter(o=>o.channel===Me||o.channel===rt),a=t.init?t.init[0]:null;if(n.push(...s.reduce((o,u)=>o.concat(AX(e,t,u,a&&a[u.index])),[])),e.hasProjection){const o=P(e.projectionName()),u=e.projectionName()+vX,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,p=l?a&&a[l.index]:`${u}[0]`,h=c?a&&a[c.index]:`${u}[1]`,g=E=>e.getSizeSignalRef(E).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;a&&(n.unshift({name:i+xO,init:`[scale(${o}, [${l?p[0]:p}, ${c?h[0]:h}]), scale(${o}, [${l?p[1]:p}, ${c?h[1]:h}])]`}),(!l||!c)&&(n.find(C=>C.name===u)||n.unshift({name:u,update:`invert(${o}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${P(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${hs(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,A=s.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...A.length?[{signal:A.join(" || ")}]:[],...a?[{signal:ko}]:[]],update:v}]})}else{if(!Ui.defined(t)){const l=i+bO,c=s.map(f=>{const d=f.channel,{data:p,visual:h}=f.signals,g=P(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=In(m)?"+":"";return`(!isArray(${p}) || (${y}invert(${g}, ${h})[0] === ${y}${p}[0] && ${y}invert(${g}, ${h})[1] === ${y}${p}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const o=s.map(l=>l.signals.data),u=`unit: ${hs(e)}, fields: ${i+hl}, values`;return n.concat({name:r,...a?{init:`{${u}: ${Os(a)}}`}:{},...o.length?{on:[{events:[{signal:o.join(" || ")}],update:`${o.join(" && ")} ? {${u}: [${o}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Be(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===ko).length||n.unshift({name:ko,value:null,on:[{events:"timer{1}",update:`${ko} === null ? {} : ${ko}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,a=r?.signals.visual,o=s?.signals.visual,u=`data(${P(t.name+Rs)})`;if(Ui.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${a}[0]`}:{value:0},y:s!==void 0?{signal:`${o}[0]`}:{value:0},x2:r!==void 0?{signal:`${a}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${o}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of _(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${hs(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...p}=t.mark,h=_(p).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${a}[0] !== ${a}[1]`,s!==void 0&&`${o}[0] !== ${o}[1]`].filter(b=>b).join(" && "),value:p[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+xa}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+xa,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...h}}}]}};function AX(e,t,n,i){const r=!e.hasProjection,s=n.channel,a=n.signals.visual,o=P(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${o}, ${d})`,l=e.getSizeSignalRef(s===Me?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${c}, ${c}]`},{events:p,update:`[${a}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,p=Ui.defined(t),h=e.getScaleComponent(s),g=h?h.get("type"):void 0,m=i?{init:Os(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+bO}
9,update:In(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:a,...m,on:f},{name:d,...i?{init:Os(i)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${o}, ${a})`}]}]}else{const d=s===Me?0:1,p=t.name+xO,h=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:a,...h,on:f}]}}function uo({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=ll(t)&&t.condition;let a=[];s&&(a=W(s).map(l=>{const c=r(l);if(lH(l)){const{param:f,empty:d}=l;return{test:qO(e,{param:f,empty:d}),...c}}else return{test:sf(e,l.test),...c}})),i!==void 0&&a.push(i);const o=r(t);return o!==void 0&&a.push(o),a.length>1||a.length===1&&a[0].test?{[n]:a}:a.length===1?{[n]:a[0]}:{}}function pb(e,t="text"){const n=e.encoding[t];return uo({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>_d(i,e.config),invalidValueRef:void 0})}function _d(e,t,n="datum"){if(e){if(zn(e))return Re(e.value);if(re(e)){const{format:i,formatType:r}=Jc(e);return Xy({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function vO(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,a=n.tooltip;if(D(a))return{tooltip:VE({tooltip:a},s,r,t)};{const o=t.reactiveGeom?"datum.datum":"datum";return uo({model:e,channelDef:a,vgChannel:"tooltip",mainRefFn:l=>{const c=_d(l,r,o);if(c)return c;if(l===null)return;let f=Ce("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),q(f))return{value:f};if(j(f))return Q(f)?f:f.content==="encoding"?VE(n,s,r,t):{signal:o}},invalidValueRef:void 0})}}function EO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,a=i?"datum.datum":"datum",o=[];function u(c,f){const d=qs(f),p=Nt(c)?c:{...c,type:e[d].type},h=p.title||Qy(p,r),g=W(h).join(", ").replaceAll(/"/g,'\\"');let m;if(je(f)){const y=f==="x"?"x2":"y2",b=Un(e[y]);if(st(p.bin)&&b){const v=U(p,{expr:a}),A=U(b,{expr:a}),{format:E,formatType:C}=Jc(p);m=ol(v,A,E,C,r),s.add(y)}}if((je(f)||f===An||f===Vn)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=Jc(p);m=Xy({fieldOrDatumDef:p,format:y,formatType:b,expr:a,config:r,normalizeStack:!0}).signal}m??(m=_d(p,r,a).signal),o.push({channel:f,key:g,value:m})}eb(e,(c,f)=>{B(c)?u(c,f):Ad(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of o)!s.has(c)&&!l[f]&&(l[f]=d);return l}function VE(e,t,n,{reactiveGeom:i}={}){const r=EO(e,t,n,{reactiveGeom:i}),s=Or(r).map(([a,o])=>`"${a}": ${o}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function CX(e){const{markDef:t,config:n}=e,i=Ce("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...wX(e),...FX(e)}}function wX(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Ce("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:H(Hq,t)?{}:{ariaRoleDescription:{value:t}}}function FX(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return uo({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>_d(u,e.config),invalidValueRef:void 0});const a=Ce("description",n,i);if(a!=null)return{description:Re(a)};if(i.aria===!1)return{};const o=EO(t,r,i);if(!we(o))return{description:{signal:Or(o).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function ut(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:a}=n;let{defaultRef:o,defaultValue:u}=n;const l=r[e];o===void 0&&(u??(u=Ce(e,i,s,{vgChannel:a,ignoreVgConfig:!ll(l)})),u!==void 0&&(o=Re(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=uD({...c,scaleChannel:e,channelDef:l});return uo({model:t,channelDef:l,vgChannel:a??e,invalidValueRef:f,mainRefFn:p=>Vy({...c,channel:e,channelDef:p,stack:null,defaultRef:o})})}function AO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,a=t.filled??Ce("filled",n,r),o=ue(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=Ce(a===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[a===!0&&"color"]??o,l=Ce(a===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[a===!1&&"color"],c=a?"fill":"stroke",f={...u?{fill:Re(u)}:{},...l?{stroke:Re(l)}:{}};return n.color&&(a?n.fill:n.stroke)&&M(Tk("property",{fill:"fill"in n,stroke:"stroke"in n}
vendor: 7,948 bytes, line 9
9)),{...f,...ut("color",e,{vgChannel:c,defaultValue:a?u:l}),...ut("fill",e,{defaultValue:i.fill?u:void 0}),...ut("stroke",e,{defaultValue:i.stroke?l:void 0})}}function SX(e){const{encoding:t,mark:n}=e,i=t.order;return!Gr(n)&&zn(i)?uo({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Re(r.value),invalidValueRef:void 0}):{}}function Ua({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,a=t[s],o=n[s];if((s==="xOffset"||s==="yOffset")&&o)return{offsetType:"encoding",offset:Vy({channel:s,channelDef:o,markDef:t,config:i?.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Re(a),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function _t(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:a,stack:o}=t,u=r[e],l=r[Fi(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=Ua({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),h=gb({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&je(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:$X({channel:e,channelDef:u,channel2Def:l,markDef:s,config:a,scaleName:c,scale:f,stack:o,offset:d,defaultRef:h,bandPosition:p==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function $X(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:a}=e;if(re(n)&&r&&t===r.fieldChannel){if(B(n)){let o=n.bandPosition;if(o===void 0&&a.type==="text"&&(t==="radius"||t==="theta")&&(o=.5),o!==void 0)return Xc({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:o,offset:s})}return fs(n,i,{suffix:"end"},{offset:s})}return Hy(e)}function gb({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:a}=e;return()=>{const o=qs(n),u=Rr(n),l=Ce(n,s,a,{vgChannel:u});if(l!==void 0)return iu(n,l);switch(t){case"zeroOrMin":return XE({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:o,config:a});case"zeroOrMax":return XE({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:o,config:a});case"mid":return{...e[Ht(n)],mult:.5}}}}function XE({mainChannel:e,config:t,...n}){const i=oD(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:a}=r.zeroOrMax;return{signal:`min(${s},${a})/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 kX={left:"x",center:"xc",right:"x2"},DX={top:"y",middle:"yc",bottom:"y2"};function CO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Rr(e);const r=e==="x"?"align":"baseline",s=Ce(r,t,n);let a;return Q(s)?(M($W(r)),a=void 0):a=s,e==="x"?kX[a||(i==="top"?"left":"center")]:DX[a||i]}function tf(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?wO(e,t,{defaultPos:n,defaultPos2:i}):_t(e,t,{defaultPos:n})}function wO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,a=Fi(e),o=Ht(e),u=OX(t,i,a),l=u[o]?CO(e,r,s):Rr(e);return{..._t(e,t,{defaultPos:n,vgChannel:l}),...u}}function OX(e,t,n){const{encoding:i,mark:r,markDef:s,stack:a,config:o}=e,u=qs(n),l=Ht(n),c=Rr(n),f=i[u],d=e.scaleName(u),p=e.getScaleComponent(u),{offset:h}=n in i||n in s?Ua({channel:n,markDef:s,encoding:i,model:e}):Ua({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=Ht(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=RX({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:o,scaleName:d,scale:p,stack:a,offset:h,defaultRef:void 0});return g!==void 0?{[c]:g}:Ml(n,s)||Ml(n,{[n]:Ag(n,s,o.style),[l]:Ag(l,s,o.style)})||Ml(n,o[r])||Ml(n,o.mark)||{[c]:gb({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function RX({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:a,stack:o,offset:u,defaultRef:l}){return re(t)&&o&&e.charAt(0)===o.fieldChannel.charAt(0)?fs(t,s,{suffix:"start"},{offset:u}):Hy({channel:e,channelDef:n,scaleName:s,scale:a,stack:o,markDef:i,config:r,offset:u,defaultRef:l})}function Ml(e,t){const n=Ht(e),i=Rr(e);if(t[i]!==void 0)return{[i]:iu(e,t[i])};if(t[e]!==void 0)return{[i]:iu(e,t[e])};if(t[n]){const r=t[n];if(ks(r))M(EW(n));else return{[n]:iu(e,r)}}}function Gi(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,a=Fi(t),o=Ht(t),u=i[t],l=i[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,p=i[o]??i.size??Ce("size",r,n,{vgChannel:o}),h=yk(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return B(u)&&(De(u.bin)||st(u.bin)||u.timeUnit&&!l)&&!(p&&!ks(p))&&!i[h]&&!it(f)?NX({fieldDef:u,fieldDef2:l,channel:t,model:e}):(re(u)&&it(f)||g)&&!l?TX(u,t,e):wO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function _X(e,t,n,i,r,s,a){if(ks(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=gi("minBandSize",{type:a},i);return{signal:c?`max(${_n(c)}, ${l})`:l}}else r.band!==1&&(M(RW(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(Q(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(Gs(u)&&ge(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=Ue(u,a==="tick"?f:a==="bar"?l:c);if(Q(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(ge(d))return{signal:`${1-d} * ${e}`}}return{value:Dg(i.view,e)-2}}function TX(e,t,n){const{markDef:i,encoding:r,config:s,stack:a}=n,o=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=Ht(t),f=Fi(t),d=yk(t),p=n.scaleName(d),h=n.getScaleComponent(xy(t)),g=i.type==="tick"||o==="horizontal"&&t==="y"||o==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=ut("size",n,{vgChannel:c,defaultRef:Re(i.size)}):M(MW(i.type)));const y=!!m,b=gD({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(l||h)?.get("type"),useVlSizeChannel:g});m=m||{[c]:_X(c,p||u,h||l,s,b,!!e,i.type)};const v=(l||h)?.get("type")==="band"&&ks(b)&&!y?"top":"middle",A=CO(t,i,s,v),E=A==="xc"||A==="yc",{offset:C,offsetType:x}=Ua({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),w=Hy({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:a,offset:C,defaultRef:gb({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?x==="encoding"?0:.5:Q(b)?{signal:`(1-${b})/2`}:ks(b)?(1-b.band)/2:0});if(c)return{[A]:w,...m};{const R=Rr(f),L=m[c],J=C?{...L,offset:C}:L;return{[A]:w,[R]:D(w)?[w[0],{...w[1],offset:J}]:{...w,offset:J}}}}function YE(e,t,n,i,r,s,a){if(fk(e))return 0;const o=e==="x"||e==="y2",u=o?-t/2:t/2;if(Q(n)||Q(r)||Q(i)||s){const l=_n(n),c=_n(r),f=_n(i),d=_n(s),h=s?`(${a} < ${d} ? ${o?"":"-"}0.5 * (${d} - (${a})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${h})`:h;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function NX({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:s,encoding:a}=i,o=i.getScaleComponent(n),u=i.scaleName(n),l=o?o.get("type"):void 0,c=o.get("reverse"),f=gD({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),p=i.component.axes[n]?.[0]?.get("translate")??.5,h=je(n)?Ce("binSpacing",s,r)??0:0,g=Fi(n),m=Rr(n),y=Rr(g),b=gi("minBandSize",s,r),{offset:v}=Ua({channel:n,markDef:s,encoding:a,model:i,bandPosition:0}),{offset:A}=Ua({channel:g,markDef:s,encoding:a,model:i,bandPosition:0}),E=iH({fieldDef:e,scaleName:u}),C=YE(n,h,c,p,v,b,E),x=YE(g,h,c,p,A??v,b,E),w=Q(f)?{signal:`(1-${f.signal})/2`}:ks(f)?(1-f.band)/2:.5,R=_r({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(De(e.bin)||e.timeUnit){const L=e.timeUnit&&R!==.5;return{[y]:KE({fieldDef:e,scaleName:u,bandPosition:w,offset:x,useRectOffsetField:L}),[m]:KE({fieldDef:e,scaleName:u,bandPosition:Q(w)?{signal:`1-${w.signal}`}:1-w,offset:C,useRectOffsetField:L})}}else if(st(e.bin)){const L=fs(e,u,{},{offset:x});if(B(t))return{[y]:L,[m]:fs(t,u,{},{offset:C}
9)};if(Ws(e.bin)&&e.bin.step)return{[y]:L,[m]:{signal:`scale("${u}", ${U(e,{expr:"datum"})} + ${e.bin.step})`,offset:C}}}M(Lk(g))}function KE({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Xc({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Od,endSuffix:Rd}:{}})}const MX=new Set(["aria","width","height"]);function Cn(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?AO(e):{};return{...LX(e.markDef,t),...JE("fill",n),...JE("stroke",i),...ut("opacity",e),...ut("fillOpacity",e),...ut("strokeOpacity",e),...ut("strokeWidth",e),...ut("strokeDash",e),...SX(e),...vO(e),...pb(e,"href"),...CX(e)}}function JE(e,t){return t?{[e]:t}:{}}function LX(e,t){return Gq.reduce((n,i)=>(!MX.has(i)&&T(e,i)&&t[i]!=="ignore"&&(n[i]=Re(e[i])),n),{})}function mb(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{let a;if(!Si(s)||!(a=e.getScaleType(s)))return;const o=fd(r.aggregate),u=Gy({scaleChannel:s,markDef:n,config:t,scaleType:a,isCountAggregate:o});if(eH(u)){const l=e.vgField(s,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});l&&i.add(l)}}),i.size>0)return{defined:{signal:[...i].map(s=>gd(s,!0)).join(" && ")}}}function QE(e,t){if(t!==void 0)return{[e]:Re(t)}}const Gh="voronoi",FO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Gh)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Gr(s))return M(Jq(s)),n;const a={name:e.getName(Gh),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...vO(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 o=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?o=c:f.includes(Gh)&&(u=!0)}),u||n.splice(o+1,0,a),n}},SO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!ab(e.bind),parse:(e,t,n)=>NO(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,a=t.init&&t.init[0],o=FO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=Ne(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...a?{init:Os(a[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${o}[${P(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+Hi),a=i+hl,o=r.items.map(l=>Ne(`${i}_${l.field}`)),u=o.map(l=>`${l} !== null`).join(" && ");return o.length&&(s.update=`${u} ? {fields: ${a}, values: [${o.join(", ")}]} : null`),delete s.value,delete s.on,n}},nf="_toggle",$O={defined:e=>e.type==="point"&&!ci(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+nf,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Hi,i=t.name+nf;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${hs(e)}}, `)+`${i} ? ${n} : null`}},BX={defined:e=>e.clear!==void 0&&e.clear!==!1&&!ci(e),parse:(e,t)=>{t.clear&&(t.clear=q(t.clear)?Br(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(SO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===Ne(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(a=>a.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const a=n.findIndex(o=>o.name===r.signals.data);i(a,"null")}}else{let r=n.findIndex(s=>s.name===t.name+Hi);i(r,"null"),$O.defined(t)&&(r=n.findIndex(s=>s.name===t.name+nf),i(r,"false"))}return n}},kO={defined:e=>{const t=e.resolve==="global"&&e.bind&&ab(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==jn;return t&&!n&&M(tW),t&&n},parse:(e,t,n)=>{const i=ie(n);if(i.select=q(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},NO(t,i),j(n.select)&&(n.select.on||n.select.clear)){const a='event.item && indexof(event.item.mark.role, "legend") < 0';
vendor: 4,876 bytes, line 9
9for(const o of t.events)o.filter=W(o.filter??[]),o.filter.includes(a)||o.filter.push(a)}const r=Ih(t.bind)?t.bind.legend:"click",s=q(r)?Br(r,"view"):W(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Ih(t.bind)&&t.bind.legend,s=a=>o=>{const u=ie(o);return u.markname=a,u};for(const a of t.project.items){if(!a.hasLegend)continue;const o=`${Ne(a.field)}_legend`,u=`${i}_${o}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${o}_symbols`)).concat(r.merge.map(s(`${o}_labels`))).concat(r.merge.map(s(`${o}_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,s=n.find(d=>d.name===i+Hi),a=i+hl,o=r.items.filter(d=>d.hasLegend).map(d=>Ne(`${i}_${Ne(d.field)}_legend`)),l=`${o.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${a}, values: [${o.join(", ")}]} : null`;t.events&&o.length>0?s.on.push({events:o.map(d=>({signal:d})),update:l}):o.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+nf),f=Ih(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function PX(e,t,n){const i=e.fieldDef(t)?.field;for(const r of dt(e.component.selection??{})){const s=r.project.hasField[i]??r.project.hasChannel[t];if(s&&kO.defined(r)){const a=n.get("selections")??[];a.push(r.name),n.set("selections",a,!1),s.hasLegend=!0}}}const DO="_translate_anchor",OO="_translate_delta",IX={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Ui.defined(t),s=i+DO,{x:a,y:o}=t.project.hasChannel;let u=Br(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+xa,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(a!==void 0?`, extent_x: ${r?Ng(e,Me):`slice(${a.signals.visual})`}`:"")+(o!==void 0?`, extent_y: ${r?Ng(e,rt):`slice(${o.signals.visual})`}`:"")+"}"}]},{name:i+OO,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),a!==void 0&&ZE(e,t,a,"width",n),o!==void 0&&ZE(e,t,o,"height",n),n}};function ZE(e,t,n,i,r){const s=t.name,a=s+DO,o=s+OO,u=n.channel,l=Ui.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),p=d&&d.get("type"),h=d&&d.get("reverse"),g=l?u===Me?h?"":"-":h?"-":"":"",m=`${a}.extent_${u}`,y=`${g}${o}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",v=l?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",A=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:o},update:l?A:`clampRange(${A}, 0, ${f})`})}const RO="_zoom_anchor",_O="_zoom_delta",zX={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Ui.defined(t),s=i+_O,{x:a,y:o}=t.project.hasChannel,u=P(e.scaleName(Me)),l=P(e.scaleName(rt));let c=Br(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+xa,f))),n.push({name:i+RO,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:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),a!==void 0&&eA(e,t,a,"width",n),o!==void 0&&eA(e,t,o,"height",n),n}};function eA(e,t,n,i,r){const s=t.name,a=n.channel,o=Ui.defined(t),u=r.find(b=>b.name===n.signals[o?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(a),f=c&&c.get("type"),d=o?Ng(e,a):u.name,p=s+_O,h=`${s}${RO}.${a}`,g=!o||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=o?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${h}, ${p}${m})`;u.on.push({events:{signal:p},update:o?y:`clampRange(${y}, 0, ${l})`})}const Rs="_store",Hi="_tuple",UX="_modify",TO="vlSelectionResolve",Td=[hX,EX,cX,$O,SO,Ui,kO,BX,IX,zX,FO];function jX(e){let t=e.parent;for(;t&&!tn(t);)t=t.parent;return t}function hs(e,{escape:t}={escape:!0}){let n=t?P(e.name):e.name;const i=jX(e);if(i){const{facet:r}=i;for(const s of dn)r[s]&&(n+=` + '__facet_${s}_' + (facet[${P(i.vgField(s))}])`)}return n}function yb(e){return dt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function NO(e,t){(q(t.select)||!t.select.on)&&delete e.events,(q(t.select)||!t.select.clear)&&delete e.clear,(q(t.select)||!t.select.toggle)&&delete e.toggle}function ci(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}const qX="RawCode",WX="Literal",GX="Property",HX="Identifier",VX="ArrayExpression",XX="BinaryExpression",YX="CallExpression",KX="ConditionalExpression",JX="LogicalExpression",QX="MemberExpression",ZX="Ob
9jectExpression",eY="UnaryExpression";function Jn(e){this.type=e}Jn.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=tY(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function tY(e){switch(e.type){case VX:return e.elements;case XX:case JX:return[e.left,e.right];case YX:return[e.callee].concat(e.arguments);case KX:return[e.test,e.consequent,e.alternate];case QX:return[e.object,e.property];case ZX:return e.properties;case GX:return[e.key,e.value];case eY:return[e.argument];case HX:case WX:case qX:default:return[]}}var ki,K,k,Ft,Ee,Nd=1,pl=2,_s=3,Hr=4,Md=5,Ys=6,Bt=7,gl=8,nY=9;ki={};ki[Nd]="Boolean";ki[pl]="<end>";ki[_s]="Identifier";ki[Hr]="Keyword";ki[Md]="Null";ki[Ys]="Numeric";ki[Bt]="Punctuator";ki[gl]="String";ki[nY]="RegularExpression";var iY="ArrayExpression",rY="BinaryExpression",sY="CallExpression",aY="ConditionalExpression",MO="Identifier",oY="Literal",uY="LogicalExpression",lY="MemberExpression",cY="ObjectExpression",fY="Property",dY="UnaryExpression",tt="Unexpected token %0",hY="Unexpected number",pY="Unexpected string",gY="Unexpected identifier",mY="Unexpected reserved word",yY="Unexpected end of input",Lg="Invalid regular expression",Hh="Invalid regular expression: missing /",LO="Octal literals are not allowed in strict mode.",bY="Duplicate data property in object literal not allowed in strict mode",ct="ILLEGAL",Fu="Disabled.",xY=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\\u
90AE1\\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]"),vY
vendor: 5,882 bytes, line 9
9=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
vendor: 5,331 bytes, lines 9-11
9Ld(e,t){if(!e)throw new Error("ASSERT: "+t)}function Mi(e){return e>=48&&e<=57}function bb(e){return"0123456789abcdefABCDEF".includes(e)}function ru(e){return"01234567".includes(e)}function EY(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 Su(e){return e===10||e===13||e===8232||e===8233}function ml(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&xY.test(String.fromCharCode(e))}function rf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&vY.test(String.fromCharCode(e))}const AY={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 BO(){for(;k<Ft;){const e=K.charCodeAt(k);if(EY(e)||Su(e))++k;else break}}function Bg(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)k<Ft&&bb(K[k])?(i=K[k++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):pe({},tt,ct);return String.fromCharCode(r)}function CY(){var e,t,n,i;for(e=K[k],t=0,e==="}"&&pe({},tt,ct);k<Ft&&(e=K[k++],!!bb(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&pe({},tt,ct),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function PO(){var e,t;for(e=K.charCodeAt(k++),t=String.fromCharCode(e),e===92&&(K.charCodeAt(k)!==117&&pe({},tt,ct),++k,e=Bg("u"),(!e||e==="\\"||!ml(e.charCodeAt(0)))&&pe({},tt,ct),t=e);k<Ft&&(e=K.charCodeAt(k),!!rf(e));)++k,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),K.charCodeAt(k)!==117&&pe({},tt,ct),++k,e=Bg("u"),(!e||e==="\\"||!rf(e.charCodeAt(0)))&&pe({},tt,ct),t+=e);return t}function wY(){var e,t;for(e=k++;k<Ft;){if(t=K.charCodeAt(k),t===92)return k=e,PO();if(rf(t))++k;else break}return K.slice(e,k)}function FY(){var e,t,n;return e=k,t=K.charCodeAt(k)===92?PO():wY(),t.length===1?n=_s:AY.hasOwnProperty(t)?n=Hr:t==="null"?n=Md:t==="true"||t==="false"?n=Nd:n=_s,{type:n,value:t,start:e,end:k}}function Vh(){var e=k,t=K.charCodeAt(k),n,i=K[k],r,s,a;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++k,{type:Bt,value:String.fromCharCode(t),start:e,end:k};default:if(n=K.charCodeAt(k+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 k+=2,{type:Bt,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:k};case 33:case 61:return k+=2,K.charCodeAt(k)===61&&++k,{type:Bt,value:K.slice(e,k),start:e,end:k}}}if(a=K.substr(k,4),a===">>>=")return k+=4,{type:Bt,value:a,start:e,end:k};if(s=a.substr(0,3),s===">>>"||s==="<<="||s===">>=")return k+=3,{type:Bt,value:s,start:e,end:k};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return k+=2,{type:Bt,value:r,start:e,end:k};if(r==="//"&&pe({},tt,ct),"<>=!+-*%&|^/".includes(i))return++k,{type:Bt,value:i,start:e,end:k};pe({},tt,ct)}function SY(e){let t="";for(;k<Ft&&bb(K[k]);)t+=K[k++];return t.length===0&&pe({},tt,ct),ml(K.charCodeAt(k))&&pe({},tt,ct),{type:Ys,value:parseInt("0x"+t,16),start:e,end:k}}function $Y(e){let t="0"+K[k++];for(;k<Ft&&ru(K[k]);)t+=K[k++];return(ml(K.charCodeAt(k))||Mi(K.charCodeAt(k)))&&pe({},tt,ct),{type:Ys,value:parseInt(t,8),octal:!0,start:e,end:k}}function tA(){var e,t,n;if(n=K[k],Ld(Mi(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=k,e="",n!=="."){if(e=K[k++],n=K[k],e==="0"){if(n==="x"||n==="X")return++k,SY(t);if(ru(n))return $Y(t);n&&Mi(n.charCodeAt(0))&&pe({},tt,ct)}for(;Mi(K.charCodeAt(k));)e+=K[k++];n=K[k]}if(n==="."){for(e+=K[k++];Mi(K.charCodeAt(k));)e+=K[k++];n=K[k]}if(n==="e"||n==="E")if(e+=K[k++],n=K[k],(n==="+"||n==="-")&&(e+=K[k++]),Mi(K.charCodeAt(k)))for(;Mi(K.charCodeAt(k));)e+=K[k++];else pe({},tt,ct);return ml(K.charCodeAt(k))&&pe({},tt,ct),{type:Ys,value:parseFloat(e),start:t,end:k}}function kY(){var e="",t,n,i,r,s=!1;for(t=K[k],Ld(t==="'"||t==='"',"String literal must starts with a quote"),n=k,++k;k<Ft;)if(i=K[k++],i===t){t="";break}else if(i==="\\")if(i=K[k++],!i||!Su(i.charCodeAt(0)))switch(i){case"u":case"x":K[k]==="{"?(++k,e+=CY()):e+=Bg(i);break;case"n":e+=` 10`;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:ru(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),k<Ft&&ru(K[k])&&(s=!0,r=r*8+"01234567".indexOf(K[k++]),"0123".includes(i)&&k<Ft&&ru(K[k])&&(r=r*8+"01234567".indexOf(K[k++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&K[k]===` 11`&&++k;else{if(Su(i.charCodeAt(0)))break;e+=i}return t!==""&&pe({},tt,ct),{type:gl,value:e,octal:s,start:n,end:k}}function DY(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";pe({},Lg)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{pe({},Lg)}try{return new RegExp(e,t)}catch{return null}}function OY(){var e,t,n,i,r;for(e=K[k],Ld(e==="/","Regular expression literal must start with a slash"),t=K[k++],n=!1,i=!1;k<Ft;
11)if(e=K[k++],t+=e,e==="\\")e=K[k++],Su(e.charCodeAt(0))&&pe({},Hh),t+=e;else if(Su(e.charCodeAt(0)))pe({},Hh);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||pe({},Hh),r=t.substr(1,t.length-2),{value:r,literal:t}}function RY(){var e,t,n;for(t="",n="";k<Ft&&(e=K[k],!!rf(e.charCodeAt(0)));)++k,e==="\\"&&k<Ft?pe({},tt,ct):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&pe({},Lg,n),{value:n,literal:t}}function _Y(){var e,t,n,i;return Ee=null,BO(),e=k,t=OY(),n=RY(),i=DY(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:k}}function TY(e){return e.type===_s||e.type===Hr||e.type===Nd||e.type===Md}function IO(){if(BO(),k>=Ft)return{type:pl,start:k,end:k};const e=K.charCodeAt(k);return ml(e)?FY():e===40||e===41||e===59?Vh():e===39||e===34?kY():e===46?Mi(K.charCodeAt(k+1))?tA():Vh():Mi(e)?tA():Vh()}function It(){const e=Ee;return k=e.end,Ee=IO(),k=e.end,e}function zO(){const e=k;Ee=IO(),k=e}function NY(e){const t=new Jn(iY);return t.elements=e,t}function nA(e,t,n){const i=new Jn(e==="||"||e==="&&"?uY:rY);return i.operator=e,i.left=t,i.right=n,i}function MY(e,t){const n=new Jn(sY);return n.callee=e,n.arguments=t,n}function LY(e,t,n){const i=new Jn(aY);return i.test=e,i.consequent=t,i.alternate=n,i}function xb(e){const t=new Jn(MO);return t.name=e,t}function Go(e){const t=new Jn(oY);return t.value=e.value,t.raw=K.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function iA(e,t,n){const i=new Jn(lY);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function BY(e){const t=new Jn(cY);return t.properties=e,t}function rA(e,t,n){const i=new Jn(fY);return i.key=t,i.value=n,i.kind=e,i}function PY(e,t){const n=new Jn(dY);return n.operator=e,n.argument=t,n.prefix=!0,n}function pe(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,a)=>(Ld(a<i.length,"Message reference must be in range"),i[a]));throw n=new Error(r),n.index=k,n.description=r,n}function Bd(e){e.type===pl&&pe(e,yY),e.type===Ys&&pe(e,hY),e.type===gl&&pe(e,pY),e.type===_s&&pe(e,gY),e.type===Hr&&pe(e,mY),pe(e,tt,e.value)}function St(e){const t=It();(t.type!==Bt||t.value!==e)&&Bd(t)}function _e(e){return Ee.type===Bt&&Ee.value===e}function Xh(e){return Ee.type===Hr&&Ee.value===e}function IY(){const e=[];for(k=Ee.start,St("[");!_e("]");)_e(",")?(It(),e.push(null)):(e.push(Ts()),_e("]")||St(","));return It(),NY(e)}function sA(){k=Ee.start;const e=It();return e.type===gl||e.type===Ys?(e.octal&&pe(e,LO),Go(e)):xb(e.value)}function zY(){var e,t,n,i;if(k=Ee.start,e=Ee,e.type===_s)return n=sA(),St(":"),i=Ts(),rA("init",n,i);if(e.type===pl||e.type===Bt)Bd(e);else return t=sA(),St(":"),i=Ts(),rA("init",t,i)}function UY(){var e=[],t,n,i,r={},s=String;for(k=Ee.start,St("{");!_e("}");)t=zY(),t.key.type===MO?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?pe({},bY):r[i]=!0,e.push(t),_e("}")||St(",");return St("}"),BY(e)}function jY(){St("(");const e=vb();return St(")"),e}const qY={if:1};function WY(){var e,t,n;if(_e("("))return jY();if(_e("["))return IY();if(_e("{"))return UY();if(e=Ee.type,k=Ee.start,e===_s||qY[Ee.value])n=xb(It().value);else if(e===gl||e===Ys)Ee.octal&&pe(Ee,LO),n=Go(It());else{if(e===Hr)throw new Error(Fu);e===Nd?(t=It(),t.value=t.value==="true",n=Go(t)):e===Md?(t=It(),t.value=null,n=Go(t)):_e("/")||_e("/=")?(n=Go(_Y()),zO()):Bd(It())}return n}function GY(){const e=[];if(St("("),!_e(")"))for(;k<Ft&&(e.push(Ts()),!_e(")"));)St(",");return St(")"),e}function HY(){k=Ee.start;const e=It();return TY(e)||Bd(e),xb(e.value)}function VY(){return St("."),HY()}function XY(){St("[");const e=vb();return St("]"),e}function YY(){var e,t,n;for(e=WY();;)if(_e("."))n=VY(),e=iA(".",e,n);else if(_e("("))t=GY(),e=MY(e,t);else if(_e("["))n=XY(),e=iA("[",e,n);else break;return e}function aA(){const e=YY();if(Ee.type===Bt&&(_e("++")||_e("--")))throw new Error(Fu);return e}function gc(){var e,t;if(Ee.type!==Bt&&Ee.type!==Hr)t=aA();else{if(_e("++")||_e("--"))throw new Error(Fu);if(_e("+")||_e("-")||_e("~")||_e("!"))e=It(),t=gc(),t=PY(e.value,t);else{if(Xh("delete")||Xh("void")||Xh("typeof"))throw new Error(Fu);t=aA()}}return t}function oA(e){let t=0;if(e.type!==Bt&&e.type!==Hr)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 KY(){var e,t,n,i,r,s,a,o,u,l;if(e=Ee,u=gc(),i=Ee,r=oA(i),r===0)return u;for(i.prec=r,It(),t=[e,Ee],a=gc(),s=[u,i,a];(r=oA(Ee))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)a=s.pop(),o=s.pop().value,u=s.pop(),t.pop(),n=nA(o,u,a),s.push(n);i=It(),i.prec=r,s.push(i),t.push(Ee),n=gc(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=nA(s[l-1].value,s[l-2],n),l-=2;return n}function Ts(){var e,t,n;return e=KY(),_e("?")&&(It(),t=Ts(),St(":"),n=Ts(),e=LY(e,t,n)),e}function vb(){const e=Ts();if(_e(","))throw new Error(Fu);return e}function JY(e){K=e,k=0,Ft=K.length,Ee=null,zO();const t=vb();if(Ee.type!==pl)throw new Error("Unexpect token after expression.");return t}function Pg(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Pg(e.object)),t.push(...Pg(e.property))),t)}function UO(e){return e.object.type==="MemberExpression"?UO(e.object):e.object.name==="datum"}function jO(e){const t=JY(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&UO(i)&&n.add(Pg(i).slice(1).join("."))}),n}class lo extends Ae{clone(){return new lo(null,this.model,ie(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=sf(this.model,this.filter,this),this._dependentFields=jO(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function QY(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const a=Ne(s.name),o=s.select,u=q(o)?o:o.type,l=j(o)?ie(o):{type:u},c=i[u];for(const p in c)p==="fields"||p==="encodings"||(p==="mark"&&(l.mark={...c.mark,...l.mark}),(l[p]===void 0||l[p]===!0)&&(l[p]=ie(c[p]??l[p])));const f=n[a]={...l,name:a,type:u,init:s.value,bind:s.bind,events:q(l.on)?Br(l.on,"scope"):W(ie(l.on))};if(ci(f)&&(r++,r>1)){delete n[a];continue}const d=ie(s);for(const p of Td)p.defined(f)&&p.parse&&p.parse(e,f,d)}return r>1&&M(oW),n}function qO(e,t,n,i="datum"){const r=q(t)?t:t.param,s=Ne(r),a=P(s+Rs);let o;try{o=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(o.project.timeUnit){const d=n??e.component.data.raw,p=o.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const u=o.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=o.resolve==="global"?")":`, ${P(o.resolve)})`,c=`${u}${a}, ${i}${l}`,f=`length(data(${a}
11))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function WO(e,t,n){const i=Ne(t),r=n.encoding;let s=n.field,a;try{a=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=a.project.items[0].field,a.project.items.length>1&&M(uW(s));else if(r&&!s){const o=a.project.items.filter(u=>u.channel===r);!o.length||o.length>1?(s=a.project.items[0].field,M(lW(o,r,n,s))):s=o[0].field}return`${a.name}[${P(xn(s))}]`}function ZY(e,t){for(const[n,i]of Or(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Ut(new lo(t,e,{param:n}),r,Pe.Lookup,e.component.data.outputNodeRefCounts)}}function sf(e,t,n){return nu(t,i=>q(i)?i:bG(i)?qO(e,i,n):Xk(i))}function eK(e,t){if(e)return D(e)&&!lr(e)?e.map(n=>Qy(n,t)).join(", "):e}function Yh(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Ho(e,t,n,i={header:!1}){const{disable:r,orient:s,scale:a,labelExpr:o,title:u,zindex:l,...c}=e.combine();if(!r){for(const f in c){const d=f,p=CH[d],h=c[d];if(p&&p!==t&&p!=="both")delete c[d];else if(dl(h)){const{condition:g,...m}=h,y=W(g),b=kE[d];if(b){const{vgProp:v,part:A}=b,E=[...y.map(C=>{const{test:x,...w}=C;return{test:sf(null,x),...w}}),m];Yh(c,A,v,E),delete c[d]}else if(b===null){const v={signal:y.map(A=>{const{test:E,...C}=A;return`${sf(null,E)} ? ${dE(C)} : `}).join("")+dE(m)};c[d]=v}}else if(Q(h)){const g=kE[d];if(g){const{vgProp:m,part:y}=g;Yh(c,y,m,h),delete c[d]}}ue(["labelAlign","labelBaseline"],d)&&c[d]===null&&delete c[d]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:f}=c.encode;c.encode={...f?{grid:f}:{}},we(c.encode)&&delete c.encode}return{scale:a,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Ue(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(o!==void 0){let d=o;c.encode?.labels?.update&&Q(c.encode.labels.update.text)&&(d=Cs(o,"datum.label",c.encode.labels.update.text.signal)),Yh(c,"labels","text",{signal:d})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const d of FD)e.hasAxisPart(d)||delete c.encode[d];we(c.encode)&&delete c.encode}const f=eK(u,n);return{scale:a,orient:s,grid:!1,...f?{title:f}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Ue(l,0)}}}}function GO(e){const{axes:t}=e.component,n=[];for(const i of Zi)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",a=e.getSizeSignalRef(s).signal;s!==a&&n.push({name:s,update:a})}}return n}function tK(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Ho(r,"grid",t)),...i.map(r=>Ho(r,"grid",t)),...n.map(r=>Ho(r,"main",t)),...i.map(r=>Ho(r,"main",t))].filter(r=>r)}function uA(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",a=t[n==="x"?"axisBottom":"axisLeft"]||{},o=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([..._(a),..._(o)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${_n(a[c])} : ${_n(o[c])}`};return l}return t[r]})])}function nK(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:Qk(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",a=Q(n)?"axisOrient":`axis${tl(n)}`,o=[...r,...r.map(l=>s+l.substr(4))],u=["axis",a,s];return{vlOnlyAxisConfig:uA(o,i,e,n),vgAxisConfig:uA(u,i,e,n),axisConfigStyle:iK([...u,...o],i)}}function iK(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=W(r);for(const s of r)n.push(t.style[s])}}return Object.assign.apply(null,n)}function Ig(e,t,n,i={}){const r=Sk(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[s]?.[e]!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const lA={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??rK(n,e),gridScale:({model:e,channel:t})=>sK(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||VO(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||HO(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??oK(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??uK(t.type,n,B(t)&&!!t.timeUnit,B(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,a=s?t.getSizeSignalRef(s):void 0;return n.tickCount??cK({fieldOrDatumDef:i,scaleType:r,size:a,values:n.values})},tickMinStep:fK,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=XO(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",a=t.fieldDef(s);return kk(r?[SE(r)]:[],B(a)?[SE(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>dK(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??hK(n,t)};
vendor: 4,607 bytes, line 11
11function rK(e,t){return!it(e)&&B(t)&&!De(t?.bin)&&!st(t?.bin)}function sK(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function aK(e,t,n,i,r){const s=t?.labelAngle;if(s!==void 0)return Q(s)?s:Au(s);{const{configValue:a}=Ig("labelAngle",i,t?.style,r);return a!==void 0?Au(a):n===Me&&ue([zy,Iy],e.type)&&!(B(e)&&e.timeUnit)?270:void 0}}function zg(e){return`(((${e.signal} % 360) + 360) % 360)`}function HO(e,t,n,i){if(e!==void 0)if(n==="x"){if(Q(e)){const r=zg(e),s=Q(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(Q(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(Q(e)){const r=zg(e),s=Q(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${s} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(Q(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 VO(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(Q(e)){const a=zg(e),o=Q(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${a} + 90)`:a} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${a} && ${a} < ${180+r}) === ${o} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(Q(t)){const a=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${a} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function oK(e,t){if(t==="x"&&ue(["quantitative","temporal"],e))return!0}function uK(e,t,n,i){if(n&&!j(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function lK(e){return e==="x"?"bottom":"left"}function cK({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){if(!i&&!it(t)&&t!=="log"){if(B(e)){if(De(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ue(["month","hours","day","quarter"],nt(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function fK({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(B(t)){const{timeUnit:n}=t;if(n){const i=Gk(n);if(i)return{signal:i}}}}function XO(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,a=r?r.title:void 0;if(s&&a)return Dk(s,a);if(s)return s;if(a)return a;if(s!==void 0)return s;if(a!==void 0)return a}function dK(e,t){const n=e.values;if(D(n))return wD(t,n);if(Q(n))return n}function hK(e,t){return e==="rect"&&Kc(t)?1:0}class ja extends Ae{clone(){return new ja(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=jO(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Xs(i)&&pD(i.sort)){const{field:s,timeUnit:a}=i,o=i.sort,u=o.map((l,c)=>`${Xk({field:s,timeUnit:a,equal:l})} ? ${c} : `).join("")+o.length;t=new ja(t,{calculate:u,as:qa(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 ${le(this.transform)}`}}function qa(e,t,n){return U(e,{prefix:t,suffix:"sort_index",...n})}function Pd(e,t){return ue(["top","bottom"],t)?"column":ue(["left","right"],t)||e==="row"?"row":"column"}function Wa(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Ue((t||{})[e],r[e],n.header[e])}function Id(e,t,n,i){const r={};for(const s of e){const a=Wa(s,t||{},n,i);a!==void 0&&(r[s]=a)}return r}const Eb=["row","column"],Ab=["header","footer"];function pK(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:s,titleAngle:a,titleOrient:o}=Id(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Pd(t,o),l=Au(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...KO(l,u),...YO(u,l,s),...JO(i,r,t,GH,qD)}}}function YO(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=VO(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function KO(e,t){const n=HO(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}
vendor: 9,578 bytes, line 11
11:{}}function gK(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Ab)if(n[r])for(const s of n[r]){const a=yK(e,t,r,n,s);a!=null&&i.push(a)}return i}function mK(e,t){const{sort:n}=e;return zi(n)?{field:U(n,{expr:"datum"}),order:n.order??"ascending"}:D(n)?{field:qa(e,t,{expr:"datum"}),order:"ascending"}:{field:U(e,{expr:"datum"}),order:n??"ascending"}}function Ug(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:a,labelOrient:o,labelExpr:u}=Id(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Xy({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Pd(t,o);return{text:{signal:u?Cs(Cs(u,"datum.label",l),"datum.value",U(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...KO(s,c),...YO(c,s,a),...JO(n,e,t,HH,WD)}}function yK(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:a}=i,o=e.config?e.config:void 0;if(a&&r.labels){const{labelOrient:f}=Id(["labelOrient"],a.header,o,t);(t==="row"&&!ue(["top","bottom"],f)||t==="column"&&!ue(["left","right"],f))&&(s=Ug(a,t,o))}const u=tn(e)&&!ul(e.facet),l=r.axes,c=l?.length>0;if(s||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:mK(a,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const bK={column:{start:0,end:1},row:{start:1,end:0}};function xK(e,t){return bK[t][e]}function vK(e,t){const n={};for(const i of dn){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:s,titleOrient:a}=Id(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),o=Pd(i,a),u=xK(s,o);u!==void 0&&(n[o]=u)}}return we(n)?void 0:n}function JO(e,t,n,i,r){const s={};for(const a of i){if(!r[a])continue;const o=Wa(a,t?.header,e,n);o!==void 0&&(s[r[a]]=o)}return s}function Cb(e){return[...Ll(e,"width"),...Ll(e,"height"),...Ll(e,"childWidth"),...Ll(e,"childHeight")]}function Ll(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 s=e.getScaleComponent(n);if(s){const a=s.get("type"),o=s.get("range");if(it(a)&&Gs(o)){const u=e.scaleName(n);return tn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[cA(u,o)]:[cA(u,o),{name:r,update:QO(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),a=s?"containerSize()[0]":"containerSize()[1]",o=kg(e.config.view,s?"width":"height"),u=`isFinite(${a}) ? ${a} : ${o}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function cA(e,t){const n=`${e}_step`;return Q(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function QO(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Ue(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a=i==="band"?a!==void 0?a:r:1,`bandspace(${n}, ${_n(a)}, ${_n(s)}) * ${e}_step`}function ZO(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function e3(e,t){return _(e).reduce((n,i)=>({...n,...uo({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Re(r.value),invalidValueRef:void 0})}),{})}function t3(e,t){if(tn(t))return e==="theta"?"independent":"shared";if(ho(t))return"shared";if(Ob(t))return je(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function wb(e,t){const n=e.scale[t],i=je(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&M(zW(t)),"independent"):e[i][t]||"shared"}const EK={...YH,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},n3=_(EK);class AK extends tr{}const fA={symbols:CK,gradient:wK,labels:FK,entries:SK};function CK(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:a,encoding:o,config:u,mark:l}=n,c=a.filled&&l!=="trail";let f={...Xq({},n,WG),...AO(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,p=r.get("symbolFillColor")??u.legend.symbolFillColor,h=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?i3(o.opacity)??a.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===Wt)delete f.fill;else if(T(f.fill,"field"))p?delete f.fill:(f.fill=Re(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Re(g??1));else if(D(f.fill)){const m=jg(o.fill??o.color)??a.fill??(c&&a.color);m&&(f.fill=Re(m))}}if(f.stroke){if(i==="stroke"||!c&&i===Wt)delete f.stroke;else if(T(f.stroke,"field")||h)delete f.stroke;else if(D(f.stroke)){const m=Ue(jg(o.stroke||o.color),a.stroke,c?a.color:void 0);m&&(f.stroke={value:m})}}if(i!==Qi){const m=B(t)&&s3(n,r,t);m?f.opacity=[{test:m,...Re(g??1)},Re(u.legend.unselectedOpacity)]:g&&(f.opacity=Re(g))}return f={...f,...e},we(f)?void 0:f}function wK(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:a}=t;let o={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?i3(a.opacity)||s.opacity:void 0;return l&&(o.opacity=Re(l)),o={...o,...e},we(o)?void 0:o}function FK(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},a=n.config,o=B(t)?s3(n,r,t):void 0,u=o?[{test:o,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;Ds(c)?f=Tn({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):l===void 0&&c===void 0&&a.customFormatTypes&&(t.type==="quantitative"&&a.numberFormatType?f=Tn({fieldOrDatumDef:t,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):t.type==="temporal"&&a.timeFormatType&&B(t)&&t.timeUnit===void 0&&(f=Tn({fieldOrDatumDef:t,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return we(d)?void 0:d}function SK(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function i3(e){return r3(e,(t,n)=>Math.max(t,n.value))}function jg(e){return r3(e,(t,n)=>Ue(t,n.value))}function r3(e,t){if(fH(e))return W(e.condition).reduce(t,e.value);if(zn(e))return e.value}function s3(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=P(n.field);return i.map(s=>`(!length(data(${P(Ne(s)+Rs)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const dA={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return fD(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return dD(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??TK(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??NK(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??kK(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>ba(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(ya(n)&&oi(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>$K(t,e)};function $K(e,t){const n=e.values;if(D(n))return wD(t,n);if(Q(n))return n}function kK(e,t,n,i){if(t!=="shape"){const r=jg(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 DK(e){const{legend:t}=e;return Ue(t.type,OK(e))}function OK({channel:e,timeUnit:t,scaleType:n}){if(ya(e)){if(ue(["quarter","month","day"],t))return"symbol";if(oi(n))return"gradient"}return"symbol"}function RK({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??_K(n,t)}function _K(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 TK({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:a,gradientVerticalMaxLength:o,gradientVerticalMinLength:u}=e;if(oi(r))return n==="horizontal"?i==="top"||i==="bottom"?hA(t,"width",a,s):a:hA(t,"height",u,o)}function hA(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function NK(e){if(ue(["quantile","threshold","log","symlog"],e))return"greedy"}function a3(e){const t=Be(e)?MK(e):IK(e);return e.component.legends=t,t}function MK(e){const{encoding:t}=e,n={};for(const i of[Wt,...HD]){const r=Xe(t[i]);!r||!e.getScaleComponent(i)||i===Gt&&B(r)&&r.type===oo||(n[i]=PK(e,i))}return n}function LK(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 BK(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function PK(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,a=s.legend,o=new AK({},LK(e,t));PX(e,t,o);const u=n!==void 0?!n:a.disable;if(o.set("disable",u,n!==void 0),u)return o;n=n||{};const l=e.getScaleComponent(t).get("type"),c=Xe(r[t]),f=B(c)?nt(c.timeUnit)?.unit:void 0,d=n.orient||s.legend.orient||"right",p=DK({legend:n,channel:t,timeUnit:f,scaleType:l}
vendor: 12,502 bytes, line 11
11),h=RK({legend:n,legendType:p,orient:d,legendConfig:a}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:a,config:s,scaleType:l,orient:d,legendType:p,direction:h};for(const A of n3){if(p==="gradient"&&A.startsWith("symbol")||p==="symbol"&&A.startsWith("gradient"))continue;const E=A in dA?dA[A](g):n[A];if(E!==void 0){const C=BK(E,A,n,e.fieldDef(t));(C||s.legend[A]===void 0)&&o.set(A,E,C)}}const m=n?.encoding??{},y=o.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:o,legendType:p};for(const A of["labels","legend","title","symbols","gradient","entries"]){const E=e3(m[A]??{},e),C=A in fA?fA[A](E,v):E;C!==void 0&&!we(C)&&(b[A]={...y?.length&&B(c)?{name:`${Ne(c.field)}_legend_${A}`}:{},...y?.length?{interactive:!!y}:{},update:C})}return we(b)||o.set("encode",b,!!n?.encoding),o}function IK(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){a3(i);for(const r of _(i.component.legends))n.legend[r]=wb(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=o3(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of _(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function o3(e,t){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 s of n3){const a=Tr(e.getWithExplicit(s),t.getWithExplicit(s),s,"legend",(o,u)=>{switch(s){case"symbolType":return zK(o,u);case"title":return Ok(o,u);case"type":return r=!0,Yt("symbol")}return Dd(o,u,s,"legend")});e.setWithExplicit(s,a)}return r&&(e.implicit?.encode?.gradient&&Gc(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&Gc(e.explicit,["encode","gradient"])),e}function zK(e,t){return t.value==="circle"?t:e}function UK(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function u3(e){const t=e.component.legends,n={};for(const r of _(t)){const s=e.getScaleComponent(r),a=Fe(s.get("domains"));if(n[a])for(const o of n[a])o3(o,t[r])||n[a].push(t[r]);else n[a]=[t[r].clone()]}return dt(n).flat().map(r=>jK(r,e.config)).filter(r=>r!==void 0)}function jK(e,t){const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),s.encode?.symbols){const a=s.encode.symbols.update;a.fill&&a.fill.value!=="transparent"&&!a.stroke&&!s.stroke&&(a.stroke={value:"transparent"});for(const o of HD)s[o]&&delete a[o]}if(s.title||delete s.title,i!==void 0){let a=i;s.encode?.labels?.update&&Q(s.encode.labels.update.text)&&(a=Cs(i,"datum.label",s.encode.labels.update.text.signal)),UK(s,"labels","text",{signal:a})}return s}}function qK(e){return ho(e)||Ob(e)?WK(e):l3(e)}function WK(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),l3(e))}function l3(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(a=>a.signal).join(", ")}]`},s=t.data.reduce((a,o)=>{const u=Q(o)?o.signal:`data('${e.lookupDataSource(o)}')`;return ue(a,u)||a.push(u),a},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const GK=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class c3 extends tr{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 f3(e){e.component.projection=Be(e)?HK(e):YK(e)}function HK(e){if(e.hasProjection){const t=at(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?VK(e):void 0,s=new c3(e.projectionName(!0),{...at(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function VK(e){const t=[],{encoding:n}=e;for(const i of[[Yn,Xn],[vn,Kn]])(Xe(n[i[0]])||Xe(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Gt)&&e.typedFieldDef(Gt).type===oo&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Pe.Main)),t}function XK(e,t){const n=dy(GK,r=>!!(!H(e.explicit,r)&&!H(t.explicit,r)||H(e.explicit,r)&&H(t.explicit,r)&&Jt(e.get(r),t.get(r))));if(Jt(e.size,t.size)){if(n)return e;if(Jt(e.explicit,{}))return t;if(Jt(t.explicit,{}))return e}return null}function YK(e){if(e.children.length===0)return;let t;for(const i of e.children)f3(i);const n=dy(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=XK(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new c3(i,t.specifiedProjection,t.size,ie(t.data));for(const s of e.children){const a=s.component.projection;a&&(a.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(a.get("name"),i),a.merged=!0)}return r}}function KK(e,t,n,i){if(fl(t,n)){const r=Be(e)?e.axis(n)??e.legend(n)??{}:{},s=U(t,{expr:"datum"}),a=U(t,{expr:"datum",binSuffix:"end"});return{formulaAs:U(t,{binSuffix:"range",forAs:!0}),formula:ol(s,a,r.format,r.formatType,i)}}return{}}function d3(e,t){return`${Ak(e)}_${t}`}function JK(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Fb(e,t,n){const i=Cd(n,void 0)??{},r=d3(i,t);return e.getName(`${r}_bins`)}function QK(e){return"as"in e}function pA(e,t,n){let i,r;QK(e)?i=q(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[U(e,{forAs:!0}),U(e,{binSuffix:"end",forAs:!0})];const s={...Cd(t,void 0)},a=d3(s,e.field),{signal:o,extentSignal:u}=JK(n,a);if(dd(s.extent)){const c=s.extent;r=WO(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...o?{signal:o}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:a,binComponent:l}}class fi extends Ae{clone(){return new fi(null,ie(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,a)=>{if(Nt(s)&&De(s.bin)){const{key:o,binComponent:u}=pA(s,s.bin,n);r[o]={...u,...r[o],...KK(n,s,a,n.config)}}return r},{});return we(i)?null:new fi(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=pA(n,n.bin,i);return new fi(t,{[r]:s})}merge(t,n){for(const i of _(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ai([...this.bins[i].as,...t.bins[i].as],le)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(dt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(dt(this.bins).map(t=>t.field))}hash(){return`Bin ${le(this.bins)}`}assemble(){return dt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...a}=t.bin,o={type:"bin",field:xn(t.field),as:i,signal:t.signal,...dd(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...a};!s&&t.extentSignal&&(n.push({type:"extent",field:xn(t.field),signal:t.extentSignal}),o.extent={signal:t.extentSignal}),n.push(o);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:U({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function ZK(e,t,n,i){const r=Be(i)?i.encoding[Fi(t)]:void 0;if(Nt(n)&&Be(i)&&mD(n,r,i.markDef,i.config)){e.add(U(n,{})),e.add(U(n,{suffix:"end"}));const{mark:s,markDef:a,config:o}=i,u=_r({fieldDef:n,markDef:a,config:o});Cu(s)&&u!==.5&&je(t)&&(e.add(U(n,{suffix:Od})),e.add(U(n,{suffix:Rd}))),n.bin&&fl(n,t)&&e.add(U(n,{binSuffix:"range"}))}else if(hk(t)){const s=dk(t);e.add(i.getName(s))}else e.add(U(n));return Xs(n)&&RG(n.scale?.range)&&e.add(n.scale.range.field),e}function eJ(e,t){for(const n of _(t)){const i=t[n];for(const r of _(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Mn extends Ae{clone(){return new Mn(null,new Set(this.dimensions),ie(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(a=>{a.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((a,o)=>{const{aggregate:u,field:l}=a;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([U(a,{forAs:!0})]);else{if(Wi(u)||Wr(u)){const c=Wi(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([U({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([U(a,{forAs:!0})]);Si(o)&&n.scaleDomain(o)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([U({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([U({field:l,aggregate:"max"},{forAs:!0})]))}else ZK(s,o,a,n)}),s.size+_(r).length===0)?null:new Mn(t,s,r)}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const a of n.aggregate){const{op:o,field:u,as:l}=a;o&&(o==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||U(a,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[o]??(i[o]=new Set),s[u][o].add(l||U(a,{forAs:!0}))))}for(const a of n.groupby??[])r.add(a);return r.size+_(s).length===0?null:new Mn(t,r,s)}merge(t){return rk(this.dimensions,t.dimensions)?(eJ(this.measures,t.measures),!0):(nG("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,..._(this.measures)])}producedFields(){const t=new Set;for(const n of _(this.measures))for(const i of _(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 ${le({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of _(this.measures))for(const a of _(this.measures[s]))for(const o of this.measures[s][a])i.push(o),t.push(a),n.push(s==="*"?null:xn(s));return{type:"aggregate",groupby:[...this.dimensions].map(xn),ops:t,fields:n,as:i}}}class co extends Ae{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of dn){const a=n.facet[s];if(a){const{bin:o,sort:u}=a;this[s]={name:n.getName(`${s}_domain`),fields:[U(a),...De(o)?[U(a,{binSuffix:"end"})]:[]],...zi(u)?{sortField:u}:D(u)?{sortIndexField:qa(a,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of dn)this[n]&&(t+=` ${n.charAt(0)}:${le(this[n])}`);return t}get fields(){const t=[];for(const n of dn)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of dn)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 Zi){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(it(r)&&Gs(s)){const a=zd(this.childModel,n),o=Db(a);o?t[n]=o:M(Sy(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],a=[],o=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),a.push("max")):(s.push(i[r]),a.push("distinct")),o.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=vd,field:f}=u;s.push(f),a.push(c),o.push(U(u,{forAs:!0}))}else l&&(s.push(l),a.push("max"),o.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:a,as:o}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const u of Eb){for(const l of Ab){const c=(i[u]&&i[u][l])??[];for(const f of c)if(f.axes?.length>0){s[u]=!0;break}}if(s[u]){const l=`length(data("${this.facet.name}"))`,c=u==="row"?n?{signal:`ceil(${l} / ${n})`}:1:n?{signal:`min(${l}, ${n})`}:{signal:l};r.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:c}]})}}const{row:a,column:o}=s;return(a||o)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:a}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(i.x??[],i.y??[]),u=o.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:u}]})}
vendor: 11,515 bytes, line 11
11for(const o of[Ii,Pi])this[o]&&t.push(this.assembleRowColumnHeaderData(o,n,i));if(a){const o=this.assembleFacetHeaderData(i);o&&t.push(...o)}return t}}function gA(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function tJ(e,t){const n=gy(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=gA(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=gA(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return M(fW(t)),null}function nJ(e){const t={};return hc(e.filter,n=>{if(Vk(n)){let i=null;_y(n)?i=Kt(n.equal):Ny(n)?i=Kt(n.lte):Ty(n)?i=Kt(n.lt):My(n)?i=Kt(n.gt):Ly(n)?i=Kt(n.gte):By(n)?i=n.range[0]:Py(n)&&(i=(n.oneOf??n.in)[0]),i&&(Hs(i)?t[n.field]="date":ge(i)?t[n.field]="number":q(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function iJ(e){const t={};function n(i){Ia(i)?t[i.field]="date":i.type==="quantitative"&&Iq(i.aggregate)?t[i.field]="number":Ta(i.field)>1?i.field in t||(t[i.field]="flatten"):Xs(i)&&zi(i.sort)&&Ta(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Be(e)||tn(e))&&e.forEachFieldDef((i,r)=>{if(Nt(i))n(i);else{const s=qs(r),a=e.fieldDef(s);n({...i,type:a.type})}}),Be(e)){const{mark:i,markDef:r,encoding:s}=e;if(Gr(i)&&!e.encoding.order){const a=r.orient==="horizontal"?"y":"x",o=s[a];B(o)&&o.type==="quantitative"&&!(o.field in t)&&(t[o.field]="number")}}return t}function rJ(e){const t={};if(Be(e)&&e.component.selection)for(const n of _(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Ta(r.field)>1&&(t[r.field]="flatten")}return t}class vt extends Ae{clone(){return new vt(null,ie(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${le(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!Cr(s)&&s?.format?.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const o of _(i)){const u=r.getWithExplicit(o);u.value!==void 0&&(u.explicit||u.value===i[o]||u.value==="derived"||i[o]==="flatten"?delete i[o]:M(bE(o,i[o],u.value)))}for(const o of _(n)){const u=r.get(o);u!==void 0&&(u===n[o]?delete n[o]:M(bE(o,n[o],u)))}const s=new tr(n,i);r.copyAll(s);const a={};for(const o of _(s.combine())){const u=s.get(o);u!==null&&(a[o]=u)}return _(a).length===0||r.parseNothing?null:new vt(t,a)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of _(this._parse)){const i=this._parse[n];Ta(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(_(this._parse))}dependentFields(){return new Set(_(this._parse))}assembleTransforms(t=!1){return _(this._parse).filter(n=>t?Ta(n)>1:!0).map(n=>{const i=tJ(n,this._parse[n]);return i?{type:"formula",expr:i,as:so(n)}:null}).filter(n=>n!==null)}}class Nr extends Ae{clone(){return new Nr(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([jn])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:jn}}}class yl extends Ae{clone(){return new yl(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${le(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class bl extends Ae{clone(){return new bl(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 ${le(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Ns extends Ae{constructor(t){super(null),t??(t={name:"source"});let n;if(Cr(t)||(n=t.format?{...zt(t.format,["parse"])}:{}),wu(t))this._data={values:t.values};else if(za(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ue(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else cO(t)?this._data={values:[{type:"Sphere"}]}:(uO(t)||Cr(t))&&(this._data={});this._generator=Cr(t),t.name&&(this._name=t.name),n&&!we(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 mA=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},sJ=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)},Vo;function Sb(e){return e instanceof Ns||e instanceof yl||e instanceof bl}class $b{constructor(){Vo.set(this,void 0),mA(this,Vo,!1,"f")}setModified(){mA(this,Vo,!0,"f")}get modifiedFlag(){return sJ(this,Vo,"f")}}Vo=new WeakMap;class Ks extends $b{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,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class kb extends $b{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class aJ extends kb{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 _(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class oJ extends kb{constructor(t){super(),this.requiresSelectionId=t&&yb(t)}run(t){t instanceof Nr&&(this.requiresSelectionId&&(Sb(t.parent)||t.parent instanceof Mn||t.parent instanceof vt)||(this.setModified(),t.remove()))}}class uJ extends $b{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof li&&(i=t.producedFields(),hy(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 lJ extends kb{constructor(){super()}run(t){t instanceof Ut&&!t.isRequired()&&(this.setModified(),t.remove())}}class cJ extends Ks{run(t){if(!Sb(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(py(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class fJ extends Ks{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof vt);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const a of i){const o=a.parse;for(const u of _(o))u in r?r[u]!==o[u]&&s.add(u):r[u]=o[u]}for(const a of s)delete r[a];if(!we(r)){this.setModified();const a=new vt(t,r);for(const o of n){if(o instanceof vt)for(const u of _(r))delete o.parse[u];t.removeChild(o),o.parent=a,o instanceof vt&&_(o.parse).length===0&&o.remove()}}}}}class dJ extends Ks{run(t){t instanceof Ut||t.numChildren()>0||t instanceof co||t instanceof Ns||(this.setModified(),t.remove())}}class hJ extends Ks{run(t){const n=t.children.filter(r=>r instanceof li),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class pJ extends Ks{run(t){const n=t.children.filter(r=>r instanceof Mn),i={};for(const r of n){const s=le(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of _(i)){const s=i[r];if(s.length>1){const a=s.pop();for(const o of s)a.merge(o)&&(t.removeChild(o),o.parent=a,o.remove(),this.setModified())}}}}class gJ extends Ks{constructor(t){super(),this.model=t}run(t){const n=!(Sb(t)||t instanceof lo||t instanceof vt||t instanceof Nr),i=[],r=[];for(const s of t.children)s instanceof fi&&(n&&!py(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const a of i)s.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof fi?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const a of r)s.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}}class mJ extends Ks{run(t){const n=[...t.children];if(!_a(n,a=>a instanceof Ut)||t.numChildren()<=1)return;const r=[];let s;for(const a of n)if(a instanceof Ut){let o=a;for(;o.numChildren()===1;){const[u]=o.children;if(u instanceof Ut)o=u;else break}r.push(...o.children),s?(t.removeChild(a),a.parent=s.parent,s.parent.removeChild(s),s.parent=o,this.setModified()):s=o}else r.push(a);if(r.length){this.setModified();for(const a of r)a.parent.removeChild(a),a.parent=s}}}class Js extends Ae{clone(){return new Js(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ai(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??U(t)}hash(){return`JoinAggregateTransform ${le(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Ga extends Ae{clone(){return new Ga(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:a,scales:o}=i;if(a==="include-invalid-values"&&o==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=Si(f)&&n.getScaleComponent(f);if(d){const p=d.get("type"),{aggregate:h}=c,g=Gy({scaleChannel:f,markDef:s,config:r,scaleType:p,isCountAggregate:fd(h)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return _(u).length?new Ga(t,u):null}dependentFields(){return new Set(_(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${le(this.filter)}`}assemble(){const t=_(this.filter).reduce((n,i)=>{const r=this.filter[i],s=U(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${qg(s)}))`):r.type==="quantitative"&&n.push(qg(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function qg(e){return`isValid(${e}) && isFinite(+${e})`}function yJ(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=U(i);return r&&t.push(r),t},[])}function bJ(e){return D(e)&&e.every(t=>q(t))&&e.length>1}class ji extends Ae{clone(){return new ji(null,ie(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:a="zero"}=n,o=[],u=[];
vendor: 46,391 bytes, line 11
11if(n.sort!==void 0)for(const f of n.sort)o.push(f.field),u.push(Ue(f.order,"ascending"));const l={field:o,order:u};let c;return bJ(s)?c=s:q(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new ji(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:a,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:a,offset:o,impute:u}=i,l=s.map(p=>{const h=r[p];return Un(h)}).filter(p=>!!p),c=yJ(n),f=n.encoding.order;let d;if(D(f)||B(f))d=$k(f);else{const p=yD(f)?f.sort:a==="y"?"descending":"ascending";d=c.reduce((h,g)=>(h.field.includes(g)||(h.field.push(g),h.order.push(p)),h),{field:[],order:[]})}return new ji(t,{dimensionFieldDefs:l,stackField:n.vgField(a),facetby:[],stackby:c,sort:d,offset:o,impute:u,as:[n.vgField(a,{suffix:"start",forAs:!0}),n.vgField(a,{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 ${le(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[U(r,{binSuffix:"mid"})]:[U(r,{}),U(r,{binSuffix:"end"})]:[U(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:a,offset:o,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const p=U(c,{expr:"datum"}),h=U(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${qg(p)} ? ${f}*${p}+${1-f}*${h} : ${p}`,as:U(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:U(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:a,as:l,offset:o}),t}}class fo extends Ae{clone(){return new fo(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ai(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??U(t)}hash(){return`WindowTransform ${le(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 s=this.transform.frame,a=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>wy(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...a!==void 0?{groupby:a}:{}};const o=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)o.push(f.field),u.push(f.order??"ascending");const l={field:o,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...a!==void 0?{groupby:a}:{},...s!==void 0?{frame:s}:{}}}}function xJ(e){function t(n){if(!(n instanceof co)){const i=n.clone();if(i instanceof Ut){const r=Gg+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Mn||i instanceof ji||i instanceof fo||i instanceof Js)&&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 Wg(e){if(e instanceof co)if(e.numChildren()===1&&!(e.children[0]instanceof Ut)){const t=e.children[0];(t instanceof Mn||t instanceof ji||t instanceof fo||t instanceof Js)&&t.addDimensions(e.fields),t.swapWithParent(),Wg(e)}else{const t=e.model.component.data.main;h3(t);const n=xJ(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Wg)}function h3(e){if(e instanceof Ut&&e.type===Pe.Main&&e.numChildren()===1){const t=e.children[0];t instanceof co||(t.swapWithParent(),h3(e))}}const Gg="scale_",Bl=5;function Hg(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Hg(t.children))return!1}return!0}function wn(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function yA(e,t,n){let i=e.sources,r=!1;return r=wn(new lJ,i)||r,r=wn(new oJ(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=wn(new dJ,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=wn(new cJ,i)||r,r=wn(new gJ(t),i)||r,r=wn(new uJ,i)||r,r=wn(new fJ,i)||r,r=wn(new pJ,i)||r,r=wn(new hJ,i)||r,r=wn(new aJ,i)||r,r=wn(new mJ,i)||r),e.sources=i,r}function vJ(e,t){Hg(e.sources);let n=0,i=0;for(let r=0;r<Bl&&yA(e,t,!0);r++)n++;e.sources.map(Wg);for(let r=0;r<Bl&&yA(e,t,!1);r++)i++;Hg(e.sources),Math.max(n,i)===Bl&&M(`Maximum optimization runs(${Bl}) reached.`)}class Je{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new Je(()=>t(n))}}function p3(e){Be(e)?EJ(e):AJ(e)}function EJ(e){const t=e.component.scales;for(const n of _(t)){const i=wJ(e,n);if(t[n].setWithExplicit("domains",i),SJ(e,n),e.component.data.isFaceted){let s=e;for(;!tn(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const o of i.value)Bi(o)&&(o.data=Gg+o.data.replace(Gg,""))}}}function AJ(e){for(const n of e.children)p3(n);const t=e.component.scales;for(const n of _(t)){let i,r=null;for(const s of e.children){const a=s.component.scales[n];if(a){i===void 0?i=a.getWithExplicit("domains"):i=Tr(i,a.getWithExplicit("domains"),"domains","scale",Vg);const o=a.get("selectionExtent");r&&o&&r.param!==o.param&&M(rW),r=o}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function CJ(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=bA(t,n);if(!r){M(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=bA(t,n);if(r)return"unaggregated"}return e}function wJ(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=CJ(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"&&Xe(i.x2)?Xe(i.x)?Tr(sr(n,r,e,"x"),sr(n,r,e,"x2"),"domain","scale",Vg):sr(n,r,e,"x2"):t==="y"&&Xe(i.y2)?Xe(i.y)?Tr(sr(n,r,e,"y"),sr(n,r,e,"y2"),"domain","scale",Vg):sr(n,r,e,"y2"):sr(n,r,e,t)}function FJ(e,t,n){return e.map(i=>({signal:`{data: ${wd(i,{timeUnit:n,type:t})}}`}))}function Kh(e,t,n){const i=nt(n)?.unit;return t==="temporal"||i?FJ(e,t,i):[e]}function sr(e,t,n,i){const{encoding:r,markDef:s,mark:a,config:o,stack:u}=n,l=Xe(r[i]),{type:c}=l,f=l.timeUnit,d=uX({invalid:gi("invalid",s,o),isPath:Gr(a)});if(OG(t)){const g=sr(e,void 0,n,i),m=Kh(t.unionWith,c,f);return ii([...m,...g.value])}else{if(Q(t))return ii([t]);if(t&&t!=="unaggregated"&&!eD(t))return ii(Kh(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Yt([[0,1]]);const g=n.requestDataName(d);return Yt([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const p=Si(i)&&B(l)?$J(n,i,e):void 0;if($i(l)){const g=Kh([l.datum],c,f);return Yt(g)}const h=l;if(t==="unaggregated"){const{field:g}=l;return Yt([{data:n.requestDataName(d),field:U({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:U({field:g,aggregate:"max"})}])}else if(De(h.bin)){if(it(e))return Yt(e==="bin-ordinal"?[]:[{data:Eu(p)?n.requestDataName(d):n.requestDataName(Pe.Raw),field:n.vgField(i,fl(h,i)?{binSuffix:"range"}:{}),sort:p===!0||!j(p)?{field:n.vgField(i,{}),op:"min"}:p}]);{const{bin:g}=h;if(De(g)){const m=Fb(n,h.field,g);return Yt([new Je(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Yt([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(h.timeUnit&&ue(["time","utc"],e)){const g=r[Fi(i)];if(mD(h,g,s,o)){const m=n.requestDataName(d),y=_r({fieldDef:h,fieldDef2:g,markDef:s,config:o}),b=Cu(a)&&y!==.5&&je(i);return Yt([{data:m,field:n.vgField(i,b?{suffix:Od}:{})},{data:m,field:n.vgField(i,{suffix:b?Rd:"end"})}])}}return Yt(p?[{data:Eu(p)?n.requestDataName(d):n.requestDataName(Pe.Raw),field:n.vgField(i),sort:p}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function Jh(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":vd),...i?{field:xn(i)}:{},...r?{order:r}:{}}}function SJ(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,s=eD(i)?i:void 0,a=Ws(r)&&dd(r.extent)?r.extent:void 0;(s||a)&&n.set("selectionExtent",s??a,!0)}function $J(e,t,n){if(!it(n))return;const i=e.fieldDef(t),r=i.sort;if(pD(r))return{op:"min",field:qa(i,t),order:"ascending"};const{stack:s}=e,a=s?new Set([...s.groupbyFields,...s.stackBy.map(o=>o.fieldDef.field)]):void 0;if(zi(r)){const o=s&&!a.has(r.field);return Jh(r,o)}else if(uH(r)){const{encoding:o,order:u}=r,l=e.fieldDef(o),{aggregate:c,field:f}=l,d=s&&!a.has(f);if(Wi(c)||Wr(c))return Jh({field:U(l),order:u},d);if(wy(c)||!c)return Jh({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ue(["ascending",void 0],r))return!0}}function bA(e,t){const{aggregate:n,type:i}=e;return n?q(n)&&!Uq.has(n)?{valid:!1,reason:TW(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:NW(e)}:{valid:!0}:{valid:!1,reason:_W(e)}}function Vg(e,t,n,i){return e.explicit&&t.explicit&&M(IW(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function kJ(e){const t=ai(e.map(a=>{if(Bi(a)){const{sort:o,...u}=a;return u}return a}),le),n=ai(e.map(a=>{if(Bi(a)){const o=a.sort;return o!==void 0&&!Eu(o)&&("op"in o&&o.op==="count"&&delete o.field,o.order==="ascending"&&delete o.order),o}}).filter(a=>a!==void 0),le);if(t.length===0)return;if(t.length===1){const a=e[0];if(Bi(a)&&n.length>0){let o=n[0];if(n.length>1){M(vE);const u=n.filter(l=>j(l)&&"op"in l&&l.op!=="min");n.every(l=>j(l)&&"op"in l)&&u.length===1?o=u[0]:o=!0}else if(j(o)&&"field"in o){const u=o.field;a.field===u&&(o=o.order?{order:o.order}:!0)}return{...a,sort:o}}return a}const i=ai(n.map(a=>Eu(a)||!("op"in a)||q(a.op)&&H(Bq,a.op)?a:(M(UW(a)),!0)),le);let r;i.length===1?r=i[0]:i.length>1&&(M(vE),r=!0);const s=ai(e.map(a=>Bi(a)?a.data:null),a=>a);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(o=>o.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function Db(e){if(Bi(e)&&q(e.field))return e.field;if(jq(e)){let t;for(const n of e.fields)if(Bi(n)&&q(n.field)){if(!t)t=n.field;else if(t!==n.field)return M(jW),t}return M(qW),t}else if(qq(e)){M(WW);const t=e.fields[0];return q(t)?t:void 0}}function zd(e,t){const i=e.component.scales[t].get("domains").map(r=>(Bi(r)&&(r.data=e.lookupDataSource(r.data)),r));return kJ(i)}function g3(e){return ho(e)||Ob(e)?e.children.reduce((t,n)=>t.concat(g3(n)),xA(e)):xA(e)}function xA(e){return _(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:a,selectionExtent:o,domains:u,range:l,reverse:c,...f}=r,d=DJ(r.range,s,n,e),p=zd(e,n),h=o?xX(e,o,i,p):null;return t.push({name:s,type:a,...p?{domain:p}:{},...h?{domainRaw:h}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function DJ(e,t,n,i){if(je(n)){if(Gs(e))return{step:{signal:`${t}_step`}}}else if(j(e)&&Bi(e))return{...e,data:i.lookupDataSource(e.data)};return e}class m3 extends tr{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ue([ot.LOG,ot.TIME,ot.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ue([ot.LINEAR,ot.SQRT,ot.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,a=!1;for(const o of i){if(D(o)){const u=o[0],l=o[o.length-1];if(ge(u)&&ge(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}a=!0}if(r)return"definitely";if(s&&!a)return"definitely-not"}return"maybe"}}const OJ=["range","scheme"];function RJ(e){const t=e.component.scales;for(const n of Cy){const i=t[n];if(!i)continue;const r=_J(n,e);i.setWithExplicit("range",r)}}function vA(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,s=Ht(t),a=e.getName(s);if(j(i)&&i.binned&&i.step!==void 0)return new Je(()=>{const o=e.scaleName(t),u=`(domain("${o}")[1] - domain("${o}")[0]) / ${i.step}`;return`${e.getSignalName(a)} / (${u})`});if(De(i)){const o=Fb(e,r,i);return new Je(()=>{const u=e.getSignalName(o),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(a)} / (${l})`})}}}function _J(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of OJ)if(n[f]!==void 0){const d=Fg(s,f),p=tD(e,f);if(!d)M(Nk(s,f,e));else if(p)M(p);else switch(f){case"range":{const h=n.range;if(D(h)){if(je(e))return ii(h.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return Je.fromName(y,m)}return g}))}else if(j(h))return ii({data:t.requestDataName(Pe.Main),field:h.field,sort:{op:"min",field:t.vgField(e)}});return ii(h)}case"scheme":return ii(TJ(n[f]))}}const a=e===Me||e==="xOffset"?"width":"height",o=i[a];if(yi(o)){if(je(e))if(it(s)){const f=b3(o,t,e);if(f)return ii({step:f})}else M(Mk(a));else if(rl(e)){const f=e===Pr?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const h=x3(o,s);if(h)return ii(h)}}}const{rangeMin:u,rangeMax:l}=n,c=NJ(e,t);return(u!==void 0||l!==void 0)&&Fg(s,"rangeMin")&&D(c)&&c.length===2?ii([u??c[0],l??c[1]]):Yt(c)}function TJ(e){return DG(e)?{scheme:e.name,...zt(e,["name"])}:{scheme:e}}function y3(e,t,n,{center:i}={}){const r=Ht(e),s=t.getName(r),a=t.getSignalName.bind(t);return e===rt&&In(n)?i?[Je.fromName(o=>`${a(o)}/2`,s),Je.fromName(o=>`-${a(o)}/2`,s)]:[Je.fromName(a,s),0]:i?[Je.fromName(o=>`-${a(o)}/2`,s),Je.fromName(o=>`${a(o)}/2`,s)]:[0,Je.fromName(a,s)]}function NJ(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:a}=Xe(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case Me:case rt:{if(ue(["point","band"],u)){const f=v3(e,n,i.view);if(yi(f))return{step:b3(f,t,e)}}return y3(e,t,u)}case Pr:case ao:return MJ(e,t,u);case Ji:{const f=PJ(r,i),d=IJ(r,n,t,i);return La(u)?BJ(f,d,LJ(u,i,l,e)):[f,d]}case An:return[0,Math.PI*2];case js:return[0,360];case Vn:return[0,new Je(()=>{const f=t.getSignalName(tn(t.parent)?"child_width":"width"),d=t.getSignalName(tn(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Ir:return{step:1e3/i.scale.framesPerSecond};case jr:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case qr:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Gt:return"symbol";case Wt:case Ci:case wi:return u==="ordinal"?a==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Qi:case zr:case Ur:return[i.scale.minOpacity,i.scale.maxOpacity]}}function b3(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=xy(n),a=i[s];if(XD({step:e,offsetIsDiscrete:re(a)&&Yk(a.type)})==="offset"&&kD(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,p=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Vq(f)})`}}else return e.step}function x3(e,t){if(XD({step:e,offsetIsDiscrete:it(t)})==="offset")return{step:e.step}}function MJ(e,t,n){const i=e===Pr?"x":"y",r=t.getScaleComponent(i);if(!r)return y3(i,t,n,{center:!0});const s=r.get("type"),a=t.scaleName(i),{markDef:o,config:u}=t;if(s==="band"){const l=v3(i,t.size,t.config.view);if(yi(l)){const c=x3(l,n);if(c)return c}return[0,{signal:`bandwidth('${a}')`}]}else{const l=t.encoding[i];if(B(l)&&l.timeUnit){const c=Gk(l.timeUnit,h=>`scale('${a}', ${h})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=_r({fieldDef:l,markDef:o,config:u})-.5,p=d!==0?` + ${d}`:"";if(f){const h=Q(f)?`${f.signal}/2`+p:`${f/2+d}`,g=Q(f)?`(1 - ${f.signal}/2)`+p:`${1-f/2+d}`;return[{signal:`${h} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return nk(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function v3(e,t,n){const i=e===Me?"width":"height",r=t[i];return r||ef(n,i)}function LJ(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&D(n)?n.length+1:(M(ZW(i)),3)}}function BJ(e,t,n){const i=()=>{const r=_n(t),s=_n(e),a=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${a}, ${a})`};return Q(t)?new Je(i):{signal:i()}}function PJ(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(hd("size",e))}const EA=.95;function IJ(e,t,n,i){const r={x:vA(n,"x"),y:vA(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=AA(t,r,i.view);return ge(s)?s-1:new Je(()=>`${s.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 s=AA(t,r,i.view);return ge(s)?Math.pow(EA*s,2):new Je(()=>`pow(${EA} * ${s.signal}, 2)`)}}throw new Error(hd("size",e))}function AA(e,t,n){const i=yi(e.width)?e.width.step:Dg(n,"width"),r=yi(e.height)?e.height.step:Dg(n,"height");return t.x||t.y?new Je(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function E3(e,t){Be(e)?zJ(e,t):C3(e,t)}function zJ(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:a}=e;for(const o of _(n)){const u=a[o],l=n[o],c=e.getScaleComponent(o),f=Xe(r[o]),d=u[t],p=c.get("type"),h=c.get("padding"),g=c.get("paddingInner"),m=Fg(p,t),y=tD(o,t);if(d!==void 0&&(m?y&&M(y):M(Nk(p,t,o))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":Hs(u[t])||v==="temporal"||b?l.set(t,{signal:wd(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=T(CA,t)?CA[t]({model:e,channel:o,fieldOrDatumDef:f,scaleType:p,scalePadding:h,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:DD(r,o),hasSecondaryRangeChannel:!!r[Fi(o)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const CA={bins:({model:e,fieldOrDatumDef:t})=>B(t)?UJ(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>jJ(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>qJ(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>WJ(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>GJ(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>HJ(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=B(e)?e.sort:void 0;return VJ(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:a})=>XJ(e,t,n,i,r,s.scale,a)};function A3(e){Be(e)?RJ(e):C3(e,"range")}function C3(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?A3(i):E3(i,t);for(const i of _(n)){let r;for(const s of e.children){const a=s.component.scales[i];if(a){const o=a.getWithExplicit(t);r=Tr(r,o,t,"scale",oO((u,l)=>t==="range"&&u.step&&l.step?u.step-l.step:0))}}n[i].setWithExplicit(t,r)}}function UJ(e,t){const n=t.bin;if(De(n)){const i=Fb(e,t.field,n);return new Je(()=>e.getSignalName(i))}else if(st(n)&&Ws(n)&&n.step!==void 0)return{step:n.step}}function jJ(e,t){if(ue([Wt,Ci,wi],e)&&t!=="nominal")return"hcl"}function qJ(e,t,n,i,r,s){if(!(Un(s)?.bin||D(n)||r!=null||i!=null||ue([ot.TIME,ot.UTC],e)))return je(t)?!0:void 0}function WJ(e,t,n,i,r,s){if(je(e)){if(oi(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:a,orient:o}=r;if(a==="bar"&&!(B(i)&&(i.bin||i.timeUnit))&&(o==="vertical"&&e==="x"||o==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ot.POINT)return n.pointPadding}}function GJ(e,t,n,i,r,s=!1){if(e===void 0){if(je(t)){const{bandPaddingInner:a,barBandPaddingInner:o,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:Ue(a,n==="bar"?o:n==="tick"?l:u)}else if(rl(t)&&i===ot.BAND)return r.offsetBandPaddingInner}}function HJ(e,t,n,i,r,s=!1){if(e===void 0){if(je(t)){const{bandPaddingOuter:a,bandWithNestedOffsetPaddingOuter:o}=r;if(s)return o;if(n===ot.BAND)return Ue(a,Q(i)?{signal:`${i.signal}/2`}:i/2)}else if(rl(t)){if(n===ot.POINT)return .5;if(n===ot.BAND)return r.offsetBandPaddingOuter}}}function VJ(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return In(e)&&t==="descending"?Q(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(In(e)&&t==="descending")return!0}function XJ(e,t,n,i,r,s,a){if(!!n&&n!=="unaggregated"&&In(r)){if(D(n)){const u=n[0],l=n[n.length-1];if(ge(u)&&u<=0&&ge(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!La(r))return!0;if(!(B(t)&&t.bin)&&ue([...Zi,...kq],e)){const{orient:u,type:l}=i;return ue(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ue(["bar","area"],l)&&!a?!0:s?.zero}return!1}function YJ(e,t,n,i,r=!1){const s=KJ(t,n,i,r),{type:a}=e;return Si(t)?a!==void 0?LG(t,a)?B(n)&&!MG(a,n.type)?(M(BW(a,s)),s):a:(M(LW(t,a,s)),s):s:null}function KJ(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(ya(e)||Lh(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&M(Bh(e,"ordinal")),"ordinal";if(Mh(e))return"band";if(je(e)||rl(e)){if(ue(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in Ay)return"band";const r=n[Ht(e)];return ks(r)||Pa(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return ya(e)?"time":Lh(e)==="discrete"?(M(Bh(e,"temporal")),"ordinal"):B(t)&&t.timeUnit&&nt(t.timeUnit).utc?"utc":Mh(e)?"band":"time";case"quantitative":return ya(e)?B(t)&&De(t.bin)?"bin-ordinal":"linear":Lh(e)==="discrete"?(M(Bh(e,"quantitative")),"ordinal"):Mh(e)?"band":"linear";case"geojson":return}throw new Error(_k(t.type))}function JJ(e,{ignoreRange:t}={}){w3(e),p3(e);for(const n of NG)E3(e,n);t||A3(e)}function w3(e){Be(e)?e.component.scales=QJ(e):e.component.scales=eQ(e)}function QJ(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of Cy){const a=Xe(t[s]);if(a&&n===rD&&s===Gt&&a.type===oo)continue;let o=a&&a.scale;if(a&&o!==null&&o!==!1){o??(o={});const u=DD(t,s),l=YJ(o,s,a,i,u);r[s]=new m3(e.scaleName(`${s}`,!0),{value:l,explicit:o.type===l})}}return r}const ZJ=oO((e,t)=>AE(e)-AE(t));function eQ(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){w3(s);for(const a of _(s.component.scales))if((t=r.scale)[a]??(t[a]=t3(a,e)),r.scale[a]==="shared"){const o=i[a],u=s.component.scales[a].getWithExplicit("type");o?wG(o.value,u.value)?i[a]=Tr(o,u,"type","scale",ZJ):(r.scale[a]="independent",delete i[a]):i[a]=u}}for(const s of _(i)){const a=e.scaleName(s,!0),o=i[s];n[s]=new m3(a,o);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),a),l.merged=!0)}}return n}class Qh{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 Be(e){return e?.type==="unit"}function tn(e){return e?.type==="facet"}function Ob(e){return e?.type==="concat"}function ho(e){return e?.type==="layer"}class Rb{constructor(t,n,i,r,s,a,o){this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=at(o),this.name=t.name??r,this.title=lr(t.title)?{text:t.title}:t.title?at(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Qh,this.projectionNameMap=i?i.projectionNameMap:new Qh,this.signalNameMap=i?i.signalNameMap:new Qh,this.data=t.data,this.description=t.description,this.transforms=KV(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:eV(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Ed(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new tr,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?ie(a):{}},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(){JJ(this)}parseProjection(){f3(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){a3(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of _(i)){const a=i[s];a!==void 0&&(r[s]=Re(a))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Re(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:we(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=vK(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of dn)t[i].title&&n.push(pK(this,i));for(const i of Eb)n=n.concat(gK(this,i));return n}assembleAxes(){return tK(this.component.axes,this.config)}assembleLegends(){return u3(this)}assembleProjections(){return qK(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...Ck(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ue(["unit","layer"],this.type)?ue(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),we(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||tn(this.parent)?g3(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const a=this.assembleLegends();return a.length>0&&(n.legends=a),n}getName(t){return Ne((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Pe[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(tn(this.parent)){const n=ZO(t),i=cd(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),a=r.get("range");if(it(s)&&Gs(a)){const o=r.get("name"),u=zd(this,i),l=Db(u);if(l){const c=U({aggregate:"distinct",field:l},{expr:"datum"});return{signal:QO(o,r,c)}}else return M(Sy(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(gk(t)&&Si(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(Qq(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class F3 extends Rb{vgField(t,n={}){const i=this.fieldDef(t);if(i)return U(i,n)}reduceFieldDef(t,n){return DH(this.getMapping(),(i,r,s)=>{const a=Un(r);return a?t(i,a,s):i},n)}forEachFieldDef(t,n){eb(this.getMapping(),(i,r)=>{const s=Un(i);s&&t(s,r)},n)}}class Ud extends Ae{clone(){return new Ud(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(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 ${le(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class jd extends Ae{clone(){return new jd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${le(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class qd extends Ae{clone(){return new qd(this.parent,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,a)=>r[a]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${le(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Wd extends Ae{clone(){return new Wd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(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 ${le(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class va extends Ae{clone(){return new va(null,ie(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[[Yn,Xn],[vn,Kn]]){const s=r.map(a=>{const o=Xe(n.encoding[a]);return B(o)?o.field:$i(o)?{expr:`${o.datum}`}:zn(o)?{expr:`${o.value}`}:void 0});(s[0]||s[1])&&(t=new va(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Gt)){const r=n.typedFieldDef(Gt);r.type===oo&&(t=new va(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(q);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${le(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 $u extends Ae{clone(){return new $u(null,this.projection,ie(this.fields),ie(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[[Yn,Xn],[vn,Kn]]){const r=i.map(a=>{const o=Xe(n.encoding[a]);return B(o)?o.field:$i(o)?{expr:`${o.datum}`}:zn(o)?{expr:`${o.value}`}:void 0}),s=i[0]===vn?"2":"";(r[0]||r[1])&&(t=new $u(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(q))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${le(this.fields)} ${le(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ps extends Ae{clone(){return new ps(null,ie(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 ps(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(B(r)&&B(s)){const a=r.impute?r:s.impute?s:void 0;if(a===void 0)return;const o=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=a.impute,d=_D(n.mark,i);return new ps(t,{impute:a.field,key:o.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 ${le(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:a,frame:o=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:RV(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?a:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:o,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Gd extends Ae{clone(){return new Gd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(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 ${le(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class ku extends Ae{clone(){return new ku(null,ie(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:a}=i;let o=null;if(_V(a)){let u=k3(a.data,s);u||(u=new Ns(a.data),s.push(u));const l=n.getName(`lookup_${r}`);o=new Ut(u,l,Pe.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=o}else if(TV(a)){const u=a.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Ne(u),u)}catch{throw new Error(nW(u))}if(o=l.materialized,!o)throw new Error(iW(u))}return new ku(t,i,o.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?W(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${le({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:W(this.transform.as)}:{}};else{let n=this.transform.as;q(n)||(M(pW),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 Hd extends Ae{clone(){return new Hd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(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 ${le(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Vd extends Ae{clone(){return new Vd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ie(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 ${le(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Xd extends Ae{clone(){return new Xd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ai((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${le(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Yd extends Ae{clone(){return new Yd(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${le(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function S3(e){let t=0;function n(i,r){if(i instanceof Ns&&!i.isGenerator&&!za(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof vt&&(i.parent instanceof Ns&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof co){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 yl||i instanceof bl||i instanceof Ga||i instanceof lo||i instanceof ja||i instanceof $u||i instanceof Mn||i instanceof ku||i instanceof fo||i instanceof Js||i instanceof Wd||i instanceof qd||i instanceof Ud||i instanceof Gd||i instanceof Hd||i instanceof Vd||i instanceof Nr||i instanceof Yd||i instanceof Xd||i instanceof jd)&&r.transform.push(i.assemble()),(i instanceof fi||i instanceof li||i instanceof ps||i instanceof ji||i instanceof va)&&r.transform.push(...i.assemble()),i instanceof Ut&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Ut?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 Ut&&(!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 s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const a of i.children)n(a,{name:null,source:s,transform:[]});break}}}return n}function tQ(e){const t=[],n=S3(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function nQ(e,t){const n=[],i=S3(n);let r=0;for(const a of e.sources){a.hasName()||(a.dataName=`source_${r++}`);const o=a.assemble();i(a,o)}for(const a of n)a.transform.length===0&&delete a.transform;let s=0;for(const[a,o]of n.entries())(o.transform??[]).length===0&&!o.source&&n.splice(s++,0,n.splice(a,1)[0]);for(const a of n)for(const o of a.transform??[])o.type==="lookup"&&(o.from=e.outputNodes[o.from].getSource());for(const a of n)a.name in t&&(a.values=t[a.name]);return n}function iQ(e){return e==="top"||e==="left"||Q(e)?"header":"footer"}function rQ(e){for(const t of dn)sQ(e,t);wA(e,"x"),wA(e,"y")}function sQ(e,t){const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],o=Wa("title",null,i,t);let u=ba(a,i,{allowDisabling:!0,includeDefault:o===void 0||!!o});r.component.layoutHeaders[t].title&&(u=D(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const l=Wa("labelOrient",a.header,i,t),c=a.header!==null?Ue(a.header?.labels,i.header.labels,!0):!1,f=ue(["bottom","right"],l)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[f]:t==="facet"?[]:[$3(e,t,c)]}}}function $3(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 wA(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=wb(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",a=i[s];for(const o of n.component.axes[t]){const u=iQ(o.get("orient"));a[u]??(a[u]=[$3(e,s,!1)]);const l=Ho(o,"main",e.config,{header:!0});l&&a[u][0].axes.push(l),o.mainExtracted=!0}}}}function aQ(e){_b(e),af(e,"width"),af(e,"height")}function oQ(e){_b(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";af(e,t),af(e,n)}function _b(e){for(const t of e.children)t.parseLayoutSize()}function af(e,t){const n=ZO(t),i=cd(n),r=e.component.resolve,s=e.component.layoutSize;let a;for(const o of e.children){const u=o.component.layoutSize.getWithExplicit(n),l=r.scale[i]??t3(i,e);if(l==="independent"&&u.value==="step"){a=void 0;break}if(a){if(l==="independent"&&a.value!==u.value){a=void 0;break}a=Tr(a,u,n,"")}else a=u}if(a){for(const o of e.children)e.renameSignal(o.getName(n),e.getName(t)),o.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,a)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function uQ(e){const{size:t,component:n}=e;for(const i of Zi){const r=Ht(i);if(t[r]){const s=t[r];n.layoutSize.set(r,yi(s)?"step":s,!0)}else{const s=lQ(e,r);n.layoutSize.set(r,s,!1)}}}function lQ(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),a=r.get("range");if(it(s)){const o=ef(i.view,t);return Gs(a)||yi(o)?"step":o}else return kg(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return kg(i.view,t);{const s=ef(i.view,t);return yi(s)?s.step:s}}}function Xg(e,t,n){return U(t,{suffix:`by_${U(e)}`,...n})}class su extends F3{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=Bb(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ul(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=_(t),i={};for(const r of n){if(![Pi,Ii].includes(r)){M(hd(r,"facet"));break}const s=t[r];if(s.field===void 0){M(Cg(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Zy(t,n);return i.header?i.header=at(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return T(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Kd(this),this.child.parseData()}parseLayoutSize(){_b(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>ci(t))&&ky($y)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),rQ(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 dn)for(const i of Ab){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:a}=r;if(a){const o=Wa("titleOrient",a.header,this.config,n);if(["right","bottom"].includes(o)){const u=Pd(n,o);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s?.[0]){const o=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(o)&&(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 su))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof su?{...this.channelHasField("column")?{encode:{update:{columns:{field:U(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof su){if(this.child.channelHasField("column")){const r=U(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of Zi){const s=this.child.component.scales[r];if(s&&!s.merged){const a=s.get("type"),o=s.get("range");if(it(a)&&Gs(o)){const u=zd(this.child,r),l=Db(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):M(Sy(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:s,ops:a,as:o}=this.getCardinalityAggregateForChild(),u=[];for(const c of dn){const f=this.facet[c];if(f){u.push(U(f));const{bin:d,sort:p}=f;if(De(d)&&u.push(U(f,{binSuffix:"end"})),zi(p)){const{field:h,op:g=vd}=p,m=Xg(f,p);i&&r?(s.push(m),a.push("max"),o.push(m)):(s.push(h),a.push(g),o.push(m))}else if(D(p)){const h=qa(f,c);s.push(h),a.push("max"),o.push(h)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:a,as:o}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?zi(i.sort)?[Xg(i,i.sort,{expr:"datum"})]:D(i.sort)?[qa(i,t,{expr:"datum"})]:[U(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(zi(r)?r.order:!D(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;
vendor: 5,626 bytes, line 11
11if(t.facet)return Ug(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of Eb)if(t[r]){const s=Wa("labelOrient",t[r]?.header,n,r);if(i[r].includes(s))return Ug(t[r],r,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=tQ(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),a=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:dn.map(u=>this.facetSortFields(u)).flat(),order:dn.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(gX(this,[]))}]}getMapping(){return this.facet}}function cQ(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(zi(s.sort)){const{field:a,op:o=vd}=s.sort;e=r=new Js(e,{joinaggregate:[{op:o,field:a,as:Xg(s,s.sort,{forAs:!0})}],groupby:[U(s)]})}return r}return null}function k3(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,s=i.format?.feature;if(r&&s)continue;const a=e.format?.feature;if((a||s)&&a!==s)continue;const o=i.format?.mesh;if(!((r||o)&&r!==o)){if(wu(e)&&wu(i)){if(Jt(e.values,i.values))return n}else if(za(e)&&za(i)){if(e.url===i.url)return n}else if(uO(e)&&e.name===n.dataName)return n}}return null}function fQ(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Ns({values:[]});return t.push(i),i}const n=k3(e.data,t);if(n)return Cr(e.data)||(n.data.format=ik({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Ns(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 dQ(e,t,n){let i=0;for(const r of t.transforms){let s,a;if(qV(r))a=e=new ja(e,r),s="derived";else if(fb(r)){const o=nJ(r);a=e=vt.makeWithAncestors(e,{},o,n)??e,e=new lo(e,t,r.filter)}else if(iO(r))a=e=fi.makeFromTransform(e,r,t),s="number";else if(GV(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new vt(e,{[r.field]:s}),n.set(r.field,s,!1)),a=e=li.makeFromTransform(e,r);else if(HV(r))a=e=Mn.makeFromTransform(e,r),s="number",yb(t)&&(e=new Nr(e));else if(nO(r))a=e=ku.make(e,t,r,i++),s="derived";else if(zV(r))a=e=new fo(e,r),s="number";else if(UV(r))a=e=new Js(e,r),s="number";else if(VV(r))a=e=ji.makeFromTransform(e,r),s="derived";else if(XV(r))a=e=new Wd(e,r),s="derived";else if(YV(r))a=e=new jd(e,r),s="derived";else if(jV(r))a=e=new qd(e,r),s="derived";else if(NV(r))a=e=new Xd(e,r),s="derived";else if(IV(r))e=new Yd(e,r);else if(WV(r))a=e=ps.makeFromTransform(e,r),s="derived";else if(MV(r))a=e=new Ud(e,r),s="derived";else if(LV(r))a=e=new Hd(e,r),s="derived";else if(BV(r))a=e=new Vd(e,r),s="derived";else if(PV(r))a=e=new Gd(e,r),s="derived";else{M(hW(r));continue}if(a&&s!==void 0)for(const o of a.producedFields()??[])n.set(o,s,!1)}return e}function Kd(e){let t=fQ(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,a=!(r&&(Cr(r)||za(r)||wu(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new oX;Cr(r)?(lO(r)?t=new bl(t,r.sequence):db(r)&&(t=new yl(t,r.graticule)),a.parseNothing=!0):r?.format?.parse===null&&(a.parseNothing=!0),t=vt.makeExplicit(t,e,a)??t,t=new Nr(t);const o=e.parent&&ho(e.parent);(Be(e)||tn(e))&&o&&(t=fi.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=dQ(t,e,a));const u=rJ(e),l=iJ(e);t=vt.makeWithAncestors(t,{},{...u,...l},a)??t,Be(e)&&(t=va.parseAll(t,e),t=$u.parseAll(t,e)),(Be(e)||tn(e))&&(o||(t=fi.makeFromEncoding(t,e)??t),t=li.makeFromEncoding(t,e)??t,t=ja.parseAllForSortIndex(t,e));const c=t=Pl(Pe.Raw,e,t);if(Be(e)){const m=Mn.makeFromEncoding(t,e);m&&(t=m,yb(e)&&(t=new Nr(t))),t=ps.makeFromEncoding(t,e)??t,t=ji.makeFromEncoding(t,e)??t}let f,d;if(Be(e)){const{markDef:m,mark:y,config:b}=e,v=Ce("invalid",m,b),{marks:A,scales:E}=d=fO({invalid:v,isPath:Gr(y)});A!==E&&E==="include-invalid-values"&&(f=t=Pl(Pe.PreFilterInvalid,e,t)),A==="exclude-invalid-values"&&(t=Ga.make(t,e,d)??t)}const p=t=Pl(Pe.Main,e,t);let h;if(Be(e)&&d){const{marks:m,scales:y}=d;m==="include-invalid-values"&&y==="exclude-invalid-values"&&(t=Ga.make(t,e,d)??t,h=t=Pl(Pe.PostFilterInvalid,e,t))}Be(e)&&ZY(e,p);let g=null;if(tn(e)){const m=e.getName("facet");t=cQ(t,e.facet)??t,g=new co(t,e,m,p.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:p,facetRoot:g,ancestorParse:a,preFilterInvalid:f,postFilterInvalid:h}}function Pl(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),a=new Ut(n,s,e,r);return i[s]=a,a}class hQ extends Rb{constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&M(cW),this.children=this.getChildren(t).map((s,a)=>Bb(s,this,this.getName(`concat_${a}`),void 0,r))}parseData(){this.component.data=Kd(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 _(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ci(t))&&ky($y)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return $d(t)?t.vconcat:lb(t)?t.hconcat:t.concat}parseLayoutSize(){oQ(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}
vendor: 6,189 bytes, line 11
11assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Cb(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 pQ(e){return e===!1||e===null}const gQ={disable:1,gridScale:1,scale:1,...SD,labelExpr:1,encode:1},D3=_(gQ);class Tb extends tr{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Tb(ie(this.explicit),ie(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!pQ(this.get(t))}hasOrientSignalRef(){return Q(this.explicit.orient)}}function mQ(e,t,n){const{encoding:i,config:r}=e,s=Xe(i[t])??Xe(i[Fi(t)]),a=e.axis(t)||{},{format:o,formatType:u}=a;if(Ds(u))return{text:Tn({fieldOrDatumDef:s,field:"datum.value",format:o,formatType:u,config:r}),...n};if(o===void 0&&u===void 0&&r.customFormatTypes){if(Ba(s)==="quantitative"){if(Pa(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Tn({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Tn({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(Ba(s)==="temporal"&&r.timeFormatType&&B(s)&&!s.timeUnit)return{text:Tn({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function yQ(e){return Zi.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[wQ(n,e)]),t),{})}const bQ={bottom:"top",top:"bottom",left:"right",right:"left"};function xQ(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 s of _(r.component.axes))n.axis[s]=wb(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=vQ(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Zi){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const a of s.component.axes[r]){const{value:o,explicit:u}=a.getWithExplicit("orient");if(!Q(o)){if(i[o]>0&&!u){const l=bQ[o];i[o]>i[l]&&a.set("orient",l,!1)}i[o]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,a]of(t[r]||[]).entries())s>0&&a.get("grid")&&!a.explicit.grid&&(a.implicit.grid=!1)}}function vQ(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],s=t[i];if(!!r!=!!s)return;if(r&&s){const a=r.getWithExplicit("orient"),o=s.getWithExplicit("orient");if(a.explicit&&o.explicit&&a.value!==o.value)return;e[i]=EQ(r,s)}}}else return t.map(n=>n.clone());return e}function EQ(e,t){for(const n of D3){const i=Tr(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return Ok(r,s);case"gridScale":return{explicit:r.explicit,value:Ue(r.value,s.value)}}return Dd(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function AQ(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Q(n.labelAngle)?n.labelAngle:Au(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===XO(i,r))return!0}return e===n[t]}const CQ=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function wQ(e,t){let n=t.axis(e);const i=new Tb,r=Xe(t.encoding[e]),{mark:s,config:a}=t,o=n?.orient||a[e==="x"?"axisX":"axisY"]?.orient||a.axis?.orient||lK(e),u=t.getScaleComponent(e).get("type"),l=nK(e,u,o,t.config),c=n!==void 0?!n:Ig("disable",a.style,n?.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=aK(r,n,e,a.style,l),d=dD(n.formatType,r,u),p=fD(r,r.type,n.format,n.formatType,a,!0),h={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:o,labelAngle:f,format:p,formatType:d,mark:s,config:a};for(const y of D3){const b=y in lA?lA[y](h):DE(y)?n[y]:void 0,v=b!==void 0,A=AQ(b,y,n,t,e);if(v&&A)i.set(y,b,A);else{const{configValue:E=void 0,configFrom:C=void 0}=DE(y)&&y!=="values"?Ig(y,a.style,n.style,l):{},x=E!==void 0;v&&!x?i.set(y,b,A):(C!=="vgAxisConfig"||CQ.has(y)&&x||dl(E)||Q(E))&&i.set(y,E,!1)}}const g=n.encoding??{},m=FD.reduce((y,b)=>{if(!i.hasAxisPart(b))return y;const v=e3(g[b]??{},t),A=b==="labels"?mQ(t,e,v):v;return A!==void 0&&!we(A)&&(y[b]={update:A}),y},{});return we(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function FQ({encoding:e,size:t}){for(const n of Zi){const i=Ht(n);yi(t[i])&&br(e[n])&&(delete t[i],M(Mk(i)))}return t}const SQ={vgMark:"arc",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),..._t("x",e,{defaultPos:"mid"}),..._t("y",e,{defaultPos:"mid"}),...Gi(e,"radius"),...Gi(e,"theta")})},$Q={vgMark:"area",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...tf("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...tf("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...mb(e)})},kQ={vgMark:"rect",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gi(e,"x"),...Gi(e,"y")})},DQ={vgMark:"shape",encodeEntry:e=>({...Cn(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&&B(n)&&n.type===oo?{field:U(n,{expr:"datum"})}:{}}
vendor: 4,138 bytes, line 11
11]}},OQ={vgMark:"image",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Gi(e,"x"),...Gi(e,"y"),...pb(e,"url")})},RQ={vgMark:"line",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),..._t("x",e,{defaultPos:"mid"}),..._t("y",e,{defaultPos:"mid"}),...ut("size",e,{vgChannel:"strokeWidth"}),...mb(e)})},_Q={vgMark:"trail",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),..._t("x",e,{defaultPos:"mid"}),..._t("y",e,{defaultPos:"mid"}),...ut("size",e),...mb(e)})};function Nb(e,t){const{config:n}=e;return{...Cn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),..._t("x",e,{defaultPos:"mid"}),..._t("y",e,{defaultPos:"mid"}),...ut("size",e),...ut("angle",e),...TQ(e,n,t)}}function TQ(e,t,n){return n?{shape:{value:n}}:ut("shape",e)}const NQ={vgMark:"symbol",encodeEntry:e=>Nb(e)},MQ={vgMark:"symbol",encodeEntry:e=>Nb(e,"circle")},LQ={vgMark:"symbol",encodeEntry:e=>Nb(e,"square")},BQ={vgMark:"rect",encodeEntry:e=>({...Cn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gi(e,"x"),...Gi(e,"y")})},PQ={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Cn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...tf("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...tf("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ut("size",e,{vgChannel:"strokeWidth"})}}},IQ={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Cn(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),..._t("x",e,{defaultPos:"mid"}),..._t("y",e,{defaultPos:"mid"}),...pb(e),...ut("size",e,{vgChannel:"fontSize"}),...ut("angle",e),...QE("align",zQ(e.markDef,n,t)),...QE("baseline",UQ(e.markDef,n,t)),..._t("radius",e,{defaultPos:null}),..._t("theta",e,{defaultPos:null})}}};function zQ(e,t,n){if(Ce("align",e,n)===void 0)return"center"}function UQ(e,t,n){if(Ce("baseline",e,n)===void 0)return"middle"}const jQ={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",a=i==="horizontal"?"height":"width";return{...Cn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gi(e,r),..._t(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[a]:Re(Ce("thickness",n,t))}}},Il={arc:SQ,area:$Q,bar:kQ,circle:MQ,geoshape:DQ,image:OQ,line:RQ,point:NQ,rect:BQ,rule:PQ,square:LQ,text:IQ,tick:jQ,trail:_Q};function qQ(e){if(ue([bd,md,zG],e.mark)){const t=_D(e.mark,e.encoding);if(t.length>0)return WQ(e,t)}else if(e.mark===yd){const t=Eg.some(n=>Ce(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return GQ(e)}return Mb(e)}const FA="faceted_path_";function WQ(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:FA+e.requestDataName(Pe.Main),data:e.requestDataName(Pe.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Mb(e,{fromPrefix:FA})}]}const SA="stack_group_";function GQ(e){const[t]=Mb(e,{fromPrefix:SA}),n=e.scaleName(e.stack.fieldChannel),i=(l={})=>e.vgField(e.stack.fieldChannel,l),r=(l,c)=>{const f=[i({prefix:"min",suffix:"start",expr:c}),i({prefix:"max",suffix:"start",expr:c}),i({prefix:"min",suffix:"end",expr:c}),i({prefix:"max",suffix:"end",expr:c})];return`${l}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,a;e.stack.fieldChannel==="x"?(s={...Ra(t.encode.update,["y","yc","y2","height",...Eg]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...zt(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}
vendor: 4,224 bytes, line 11
11):(s={...Ra(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...zt(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of Eg){const c=gi(l,e.markDef,e.config);t.encode.update[l]?(s[l]=t.encode.update[l],delete t.encode.update[l]):c&&(s[l]=Re(c)),c&&(t.encode.update[l]={value:0})}const o=[];if(e.stack.groupbyChannels?.length>0)for(const l of e.stack.groupbyChannels){const c=e.fieldDef(l),f=U(c);f&&o.push(f),(c?.bin||c?.timeUnit)&&o.push(U(c,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,c)=>{if(t.encode.update[c])return{...l,[c]:t.encode.update[c]};{const f=gi(c,e.markDef,e.config);return f!==void 0?{...l,[c]:Re(f)}:l}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Pe.Main),name:SA+e.requestDataName(Pe.Main),groupby:o,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}function HQ(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,a=t.order;if(!(!D(a)&&zn(a)&&xg(a.value)||!a&&xg(Ce("order",r,s)))){if((D(a)||B(a))&&!n)return $k(a,{expr:"datum"});if(Gr(i)){const o=r.orient==="horizontal"?"y":"x",u=t[o];if(B(u))return{field:o}}}}function Mb(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,a=Ue(i.clip,VQ(e),XQ(e)),o=Fk(i),u=r.key,l=HQ(e),c=YQ(e),f=Ce("aria",i,s),d=Il[n].postEncodingTransform?Il[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Il[n].vgMark,...a?{clip:a}:{},...o?{style:o}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Pe.Main)},encode:{update:Il[n].encodeEntry(e)},...d?{transform:d}:{}}]}function VQ(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function XQ(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function YQ(e){if(!e.component.selection)return null;const t=_(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=_(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class O3 extends F3{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,RE(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>(l.from?.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+hO)),l.from?.facet?.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l);const a=mi(t.mark)?{...t.mark}:{type:t.mark},o=a.type;a.filled===void 0&&(a.filled=CV(a,s,{graticule:t.data&&db(t.data)}));const u=this.encoding=$H(t.encoding||{},o,a.filled,s);this.markDef=ZD(a,u,s),this.size=FQ({encoding:u,size:RE(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=QD(this.markDef,u),this.specifiedScales=this.initScales(o,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>ob(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===rD,i=t&&xq.some(r=>re(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 Cy.reduce((i,r)=>{const s=Xe(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=at(t);return D(n)&&(r.domain=n.map(Kt)),D(i)&&(r.range=i.map(Kt)),r}initAxes(t){return Zi.reduce((n,i)=>{const r=t[i];if(re(r)||i===Me&&re(t.x2)||i===rt&&re(t.y2)){const s=re(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=_(t),i={};for(const r of n){const s=t[r];
vendor: 14,854 bytes, line 11
11i[r]=dl(s)?wk(s):Kt(s)}return i}initLegends(t){return Oq.reduce((n,i)=>{const r=Xe(t[i]);if(r&&_q(i)){const s=r.legend;n[i]=s&&at(s)}return n},{})}parseData(){this.component.data=Kd(this)}parseLayoutSize(){uQ(this)}parseSelections(){this.component.selection=QY(this,this.selection)}parseMarkGroup(){this.component.mark=qQ(this)}parseAxesAndHeaders(){this.component.axes=yQ(this)}assembleSelectionTopLevelSignals(t){return mX(this,t)}assembleSignals(){return[...GO(this),...pX(this,[])]}assembleSelectionData(t){return yX(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Cb(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!ho(this.parent))&&(t=yO(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 ds(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Un(n)}typedFieldDef(t){const n=this.fieldDef(t);return Nt(n)?n:null}}class Lb extends Rb{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const a={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((o,u)=>{if(kd(o))return new Lb(o,this,this.getName(`layer_${u}`),a,s);if(er(o))return new O3(o,this,this.getName(`layer_${u}`),a,s);throw new Error(Fy(o))})}parseData(){this.component.data=Kd(this);for(const t of this.children)t.parseData()}parseLayoutSize(){aQ(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of _(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ci(t))&&ky($y)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){xQ(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),GO(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Cb(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 W(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 bX(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),u3(this))}}function Bb(e,t,n,i,r){if(Ed(e))return new su(e,t,n,r);if(kd(e))return new Lb(e,t,n,i,r);if(er(e))return new O3(e,t,n,i,r);if(JH(e))return new hQ(e,t,n,r);throw new Error(Fy(e))}function KQ(e,t={}){t.logger&&eG(t.logger),t.fieldTitle&&AD(t.fieldTitle);try{const n=JD(Va(t.config,e.config)),i=aO(e,n),r=Bb(i,null,"",void 0,n);return r.parse(),vJ(r.component.data,r),{spec:QQ(r,JQ(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&tG(),t.fieldTitle&&bH()}}function JQ(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):q(t)&&(t={type:t}),r&&s&&rX(t.type)){if(r==="step"&&s==="step")M(gE()),t.type="pad";else if(r==="step"||s==="step"){const a=r==="step"?"width":"height";M(gE(cd(a)));const o=a==="width"?"height":"width";t.type=sX(o)}}return{..._(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...qE(n,!1),...qE(e,!0)}}function QQ(e,t,n={},i){const r=e.config?fV(e.config):void 0,s=nQ(e.component.data,n),a=e.assembleSelectionData(s),o=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:d,...p}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...p,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:a,...o.length>0?{projections:o}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...VD(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const ZQ=hq.version,eZ=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Ta,accessPathWithDatum:gy,accessWithDatumToUnescapedPath:xe,compile:KQ,contains:ue,deepEqual:Jt,deleteNestedProperty:Gc,duplicate:ie,entries:Or,every:dy,fieldIntersection:py,flatAccessWithDatum:sk,getFirstDefined:Ue,hasIntersection:hy,hasProperty:T,hash:le,internalField:uk,isBoolean:Eu,isEmpty:we,isEqual:gq,isInternalField:lk,isNullOrFalse:xg,isNumeric:rd,keys:_,logicalExpr:nu,mergeDeep:ik,never:nk,normalize:aO,normalizeAngle:Au,omit:zt,pick:Ra,prefixGenerator:vg,removePathFromField:so,replaceAll:Cs,replacePathInField:xn,resetIdCounter:yq,setEqual:rk,some:_a,stringify:Fe,titleCase:tl,unique:ai,uniqueId:ok,vals:dt,varName:Ne,version:ZQ},Symbol.toStringTag,{value:"Module"}));function R3(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var tZ="2.15.0",nZ={version:tZ};const aa="#fff",$A="#888",iZ={background:"#333",view:{stroke:$A},title:{color:aa,subtitleColor:aa},style:{"guide-label":{fill:aa},"guide-title":{fill:aa}},axis:{domainColor:aa,gridColor:$A,tickColor:aa}},Kr="#4572a7",rZ={background:"#fff",arc:{fill:Kr},area:{fill:Kr},line:{stroke:Kr,strokeWidth:2},path:{stroke:Kr},rect:{fill:Kr},shape:{stroke:Kr},symbol:{fill:Kr,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"]}},Jr="#30a2da",Zh="#cbcbcb",sZ="#999",aZ="#333",kA="#f0f0f0",DA="#333",oZ={arc:{fill:Jr},area:{fill:Jr},axis:{domainColor:Zh,grid:!0,gridColor:Zh,gridWidth:1,labelColor:sZ,labelFontSize:10,titleColor:aZ,tickColor:Zh,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:kA,group:{fill:kA},legend:{labelColor:DA,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:DA,titleFontSize:14,titlePadding:10},line:{stroke:Jr,strokeWidth:2},path:{stroke:Jr,strokeWidth:.5},rect:{fill:Jr},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:Jr},bar:{binSpacing:2,fill:Jr,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Qr="#000",uZ={group:{fill:"#e5e5e5"},arc:{fill:Qr},area:{fill:Qr},line:{stroke:Qr},path:{stroke:Qr},rect:{fill:Qr},shape:{stroke:Qr},symbol:{fill:Qr,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"]}},lZ=22,cZ="normal",OA="Benton Gothic, sans-serif",RA=11.5,fZ="normal",Zr="#82c6df",ep="Benton Gothic Bold, sans-serif",_A="normal",TA=13,Do={"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"]},dZ={background:"#ffffff",title:{anchor:"start",color:"#000000",font:ep,fontSize:lZ,fontWeight:cZ},arc:{fill:Zr},area:{fill:Zr},line:{stroke:Zr,strokeWidth:2},path:{stroke:Zr},rect:{fill:Zr},shape:{stroke:Zr},symbol:{fill:Zr,size:30},axis:{labelFont:OA,labelFontSize:RA,labelFontWeight:fZ,titleFont:ep,titleFontSize:TA,titleFontWeight:_A},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:OA,labelFontSize:RA,symbolType:"square",titleFont:ep,titleFontSize:TA,titleFontWeight:_A},range:{category:Do["category-6"],diverging:Do["fireandice-6"],heatmap:Do["fire-7"],ordinal:Do["fire-7"],ramp:Do["fire-7"]}},es="#ab5787",zl="#979797",hZ={background:"#f9f9f9",arc:{fill:es},area:{fill:es},line:{stroke:es},path:{stroke:es},rect:{fill:es},shape:{stroke:es},symbol:{fill:es,size:30},axis:{domainColor:zl,domainWidth:.5,gridWidth:.2,labelColor:zl,tickColor:zl,tickWidth:.2,titleColor:zl},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"]}},ts="#3e5c69",pZ={background:"#fff",arc:{fill:ts},area:{fill:ts},line:{stroke:ts},path:{stroke:ts},rect:{fill:ts},shape:{stroke:ts},symbol:{fill:ts},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"]}},ln="#1696d2",NA="#000000",gZ="#FFFFFF",Ul="Lato",tp="Lato",mZ="Lato",yZ="#DEDDDD",bZ=18,Oo={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},xZ={background:gZ,title:{anchor:"start",fontSize:bZ,font:Ul},axisX:{domain:!0,domainColor:NA,domainWidth:1,grid:!1,labelFontSize:12,labelFont:tp,labelAngle:0,tickColor:NA,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Ul},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:yZ,gridWidth:1,labelFontSize:12,labelFont:tp,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Ul,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:tp,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Ul,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Oo["six-groups-cat-1"],diverging:Oo["diverging-colors"],heatmap:Oo["diverging-colors"],ordinal:Oo["six-groups-seq"],ramp:Oo["shades-blue"]},area:{fill:ln},rect:{fill:ln},line:{color:ln,stroke:ln,strokeWidth:5},trail:{color:ln,stroke:ln,strokeWidth:0,size:1},path:{stroke:ln,strokeWidth:.5},point:{filled:!0},text:{font:mZ,color:ln,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:ln,stroke:null}},arc:{fill:ln},shape:{stroke:ln},symbol:{fill:ln,size:30}},ns="#3366CC",MA="#ccc",jl="Arial, sans-serif",vZ={arc:{fill:ns},area:{fill:ns},path:{stroke:ns},rect:{fill:ns},shape:{stroke:ns},symbol:{stroke:ns},circle:{fill:ns},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:jl,fontSize:12},"guide-title":{font:jl,fontSize:12},"group-title":{font:jl,fontSize:12}},title:{font:jl,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:MA,tickColor:MA,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Pb=e=>e*(1/3+1),LA=Pb(9),BA=Pb(10),PA=Pb(12),Ro="Segoe UI",IA="wf_standard-font, helvetica, arial, sans-serif",zA="#252423",_o="#605E5C",UA="transparent",EZ="#C8C6C4",Sn="#118DFF",AZ="#12239E",CZ="#E66C37",wZ="#6B007B",FZ="#E044A7",SZ="#744EC2",$Z="#D9B300",kZ="#D64550",_3=Sn,T3="#DEEFFF",jA=[T3,_3],DZ=[T3,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",_3],OZ={view:{stroke:UA},background:UA,font:Ro,header:{titleFont:IA,titleFontSize:PA,titleColor:zA,labelFont:Ro,labelFontSize:BA,labelColor:_o},axis:{ticks:!1,grid:!1,domain:!1,labelColor:_o,labelFontSize:LA,titleFont:IA,titleColor:zA,titleFontSize:PA,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:EZ,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Sn},line:{stroke:Sn,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Ro,fontSize:LA,fill:_o},arc:{fill:Sn},area:{fill:Sn,line:!0,opacity:.6},path:{stroke:Sn},rect:{fill:Sn},point:{fill:Sn,filled:!0,size:75},shape:{stroke:Sn},symbol:{fill:Sn,strokeWidth:1.5,size:50},legend:{titleFont:Ro,titleFontWeight:"bold",titleColor:_o,labelFont:Ro,labelFontSize:BA,labelColor:_o,symbolType:"circle",symbolSize:75},range:{category:[Sn,AZ,CZ,wZ,FZ,SZ,$Z,kZ],diverging:jA,heatmap:jA,ordinal:DZ}},np='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',RZ='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',ip=400,ql={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"}},_Z=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],TZ=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Jd({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=ql.gridBg[e],r=ql.textPrimary[e],s=ql.textSecondary[e],a=n==="dark"?_Z:TZ,o=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:np,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:RZ,labelFontWeight:ip,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:ql.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:np,fill:s,fontWeight:ip},"guide-title":{font:np,fill:s,fontWeight:ip}},range:{category:a,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd
117d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const NZ=Jd({theme:"white",background:"#ffffff"}),MZ=Jd({theme:"g10",background:"#f4f4f4"}),LZ=Jd({theme:"g90",background:"#262626"}),BZ=Jd({theme:"g100",background:"#161616"}),PZ=nZ.version,IZ=Object.freeze(Object.defineProperty({__proto__:null,carbong10:MZ,carbong100:BZ,carbong90:LZ,carbonwhite:NZ,dark:iZ,excel:rZ,fivethirtyeight:oZ,ggplot2:uZ,googlecharts:vZ,latimes:dZ,powerbi:OZ,quartz:hZ,urbaninstitute:xZ,version:PZ,vox:pZ},Symbol.toStringTag,{value:"Module"}));function zZ(e,t,n,i){if(D(e))return`[${e.map(r=>t(q(r)?r:qA(r,n))).join(", ")}]`;if(j(e)){let r="";const{title:s,image:a,...o}=e;s&&(r+=`<h2>${t(s)}</h2>`),a&&(r+=`<img src="${new URL(t(a),i||location.href).href}">`);const u=Object.keys(o);if(u.length>0){r+="<table>";for(const l of u){let c=o[l];c!==void 0&&(j(c)&&(c=qA(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 UZ(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 qA(e,t){return JSON.stringify(e,UZ(t))}var jZ=`#vg-tooltip-element { 12 visibility: hidden; 13 padding: 8px; 14 position: fixed; 15 z-index: 1000; 16 font-family: sans-serif; 17 font-size: 11px; 18 border-radius: 3px; 19 box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); 20 /* The default theme is the light theme. */ 21 background-color: rgba(255, 255, 255, 0.95); 22 border: 1px solid #d9d9d9; 23 color: black; 24} 25#vg-tooltip-element.visible { 26 visibility: visible; 27} 28#vg-tooltip-element h2 { 29 margin-top: 0; 30 margin-bottom: 10px; 31 font-size: 13px; 32} 33#vg-tooltip-element table { 34 border-spacing: 0; 35} 36#vg-tooltip-element table tr { 37 border: none; 38} 39#vg-tooltip-element table tr td { 40 overflow: hidden; 41 text-overflow: ellipsis; 42 padding-top: 2px; 43 padding-bottom: 2px; 44} 45#vg-tooltip-element table tr td.key { 46 color: #808080; 47 max-width: 150px; 48 text-align: right; 49 padding-right: 4px; 50} 51#vg-tooltip-element table tr td.value { 52 display: block; 53 max-width: 300px; 54 max-height: 7em; 55 text-align: left; 56} 57#vg-tooltip-element.dark-theme { 58 background-color: rgba(32, 32, 32, 0.9); 59 border: 1px solid #f5f5f5; 60 color: white; 61} 62#vg-tooltip-element.dark-theme td.key { 63 color: #bfbfbf; 64} 65`;const N3="vg-tooltip-element",qZ={offsetX:10,offsetY:10,id:N3,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:WZ,maxDepth:2,formatTooltip:zZ,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function WZ(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function GZ(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return jZ.toString().replace(N3,e)}function M3(e,t,{offsetX:n,offsetY:i}){const r=L3({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,i),s=["bottom-right","bottom-left","top-right","top-left"];for(const a of s)if(B3(r[a],t))return r[a];return r["top-left"]}function HZ(e,t,n,i,r){const{position:s,offsetX:a,offsetY:o}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=VZ(u,l,n),f=L3(c,i,a,o),d=Array.isArray(s)?s:[s];for(const p of d)if(B3(f[p],i)&&!XZ(t,f[p],i))return f[p];return M3(t,i,r)}function VZ(e,t,n){const i=n.isVoronoi?n.datum.bounds:n.bounds;let r=e.left+t[0]+i.x1,s=e.top+t[1]+i.y1,a=n;for(;a.mark.group;)a=a.mark.group,r+=a.x??0,s+=a.y??0;const o=i.x2-i.x1,u=i.y2-i.y1;return{x1:r,x2:r+o,y1:s,y2:s+u}}function L3(e,t,n,i){const r=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,a=e.x1-t.width-n,o=r-t.width/2,u=e.x2+n,l=e.y1-t.height-i,c=s-t.height/2,f=e.y2+i;return{top:{x:o,y:l},bottom:{x:o,y:f},left:{x:a,y:c},right:{x:u,y:c},"top-left":{x:a,y:l},"top-right":{x:u,y:l},"bottom-left":{x:a,y:f},"bottom-right":{x:u,y:f}}}function B3(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}
65function XZ(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class YZ{constructor(t){this.options={...qZ,...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=GZ(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:s,y:a}=this.options.anchor==="mark"?HZ(t,n,i,this.el.getBoundingClientRect(),this.options):M3(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${a}px`,this.el.style.left=`${s}px`}}var rp={};var KZ=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},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)}})(),JZ=Object.prototype.hasOwnProperty;function Yg(e,t){return JZ.call(e,t)}function Kg(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)Yg(e,r)&&i.push(r);return i}function Qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Jg(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 is(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function P3(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qg(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(Qg(e[t]))return!0}else if(typeof e=="object"){for(var i=Kg(e),r=i.length,s=0;s<r;s++)if(Qg(e[i[s]]))return!0}}return!1}function WA(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(` 66`)}var I3=(function(e){KZ(t,e);function t(n,i,r,s,a){var o=this.constructor,u=e.call(this,WA(n,{name:i,index:r,operation:s,tree:a}))||this;return u.name=i,u.index=r,u.operation=s,u.tree=a,Object.setPrototypeOf(u,o.prototype),u.message=WA(n,{name:i,index:r,operation:s,tree:a}),u}return t})(Error),Ie=I3,QZ=Qt,ha={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=of(n,this.path);i&&(i=Qt(i));var r=gs(n,{op:"remove",path:this.from}).removed;return gs(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=of(n,this.from);return gs(n,{op:"add",path:this.path,value:Qt(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Du(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},ZZ={add:function(e,t,n){return Jg(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:ha.move,copy:ha.copy,test:ha.test,_get:ha._get};function of(e,t){if(t=="")return e;var n={op:"_get",path:t};return gs(e,n),n.value}function gs(e,t,n,i,r,s){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),s===void 0&&(s=0),n&&(typeof n=="function"?n(t,0,e,t.path):uf(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=of(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=Du(e,t.value),a.test===!1)throw new Ie("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(n)throw new Ie("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return a}}else{i||(e=Qt(e));var o=t.path||"",u=o.split("/"),l=e,c=1,f=u.length,d=void 0,p=void 0,h=void 0;for(typeof n=="function"?h=n:h=uf;;){if(p=u[c],p&&p.indexOf("~")!=-1&&(p=P3(p)),r&&(p=="__proto__"||p=="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[p]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&h(t,0,e,d)),c++,Array.isArray(l)){if(p==="-")p=l.length;
vendor: 5,381 bytes, line 66
66else{if(n&&!Jg(p))throw new Ie("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",s,t,e);Jg(p)&&(p=~~p)}if(c>=f){if(n&&t.op==="add"&&p>l.length)throw new Ie("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var a=ZZ[t.op].call(t,l,p,e);if(a.test===!1)throw new Ie("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return a}}else if(c>=f){var a=ha[t.op].call(t,l,p,e);if(a.test===!1)throw new Ie("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return a}if(l=l[p],n&&c<f&&(!l||typeof l!="object"))throw new Ie("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function Qd(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Ie("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Qt(e));for(var s=new Array(t.length),a=0,o=t.length;a<o;a++)s[a]=gs(e,t[a],n,!0,r,a),e=s[a].newDocument;return s.newDocument=e,s}function eee(e,t,n){var i=gs(e,t);if(i.test===!1)throw new Ie("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function uf(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ie("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(ha[e.op]){if(typeof e.path!="string")throw new Ie("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ie('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 Ie("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 Ie("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")&&Qg(e.value))throw new Ie("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,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Ie("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 Ie("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 a={op:"_get",path:e.from,value:void 0},o=z3([a],n);if(o&&o.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ie("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Ie("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function z3(e,t,n){try{if(!Array.isArray(e))throw new Ie("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Qd(Qt(t),Qt(e),n||!0);else{n=n||uf;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Ie)return r;throw r}}function Du(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,s,a;if(n&&i){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!Du(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var o=Object.keys(e);if(s=o.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!t.hasOwnProperty(o[r]))return!1;for(r=s;r--!==0;)if(a=o[r],!Du(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var tee=Object.freeze({__proto__:null,JsonPatchError:Ie,_areEquals:Du,applyOperation:gs,applyPatch:Qd,applyReducer:eee,deepClone:QZ,getValueByPointer:of,validate:z3,validator:uf});var Ib=new WeakMap,nee=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),iee=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function ree(e){return Ib.get(e)}function see(e,t){return e.observers.get(t)}function aee(e,t){e.observers.delete(t.callback)}function oee(e,t){t.unobserve()}function uee(e,t){var n=[],i,r=ree(e);if(!r)r=new nee(e),Ib.set(e,r);else{var s=see(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Qt(e),t){i.callback=t,i.next=null;var a=function(){Zg(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=n,i.object=e,i.unobserve=function(){Zg(i),clearTimeout(i.next),aee(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(t,new iee(t,i)),i}function Zg(e,t){t===void 0&&(t=!1);var n=Ib.get(e.object);zb(n.value,e.object,e.patches,"",t),e.patches.length&&Qd(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function zb(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Kg(t),a=Kg(e),o=!1,u=a.length-1;u>=0;u--){var l=a[u],c=e[l];
66if(Yg(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)?zb(c,f,n,i+"/"+is(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+is(l),value:Qt(c)}),n.push({op:"replace",path:i+"/"+is(l),value:Qt(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+is(l),value:Qt(c)}),n.push({op:"remove",path:i+"/"+is(l)}),o=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!o&&s.length==a.length))for(var u=0;u<s.length;u++){var l=s[u];!Yg(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+is(l),value:Qt(t[l])})}}}function lee(e,t,n){n===void 0&&(n=!1);var i=[];return zb(e,t,i,"",n),i}var cee=Object.freeze({__proto__:null,compare:lee,generate:Zg,observe:uee,unobserve:oee});Object.assign({},tee,cee,{JsonPatchError:I3,deepClone:Qt,escapePathComponent:is,unescapePathComponent:P3});function fee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sp,GA;function dee(){if(GA)return sp;GA=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const i=this.map.get(n);if(i!==void 0)return this.map.delete(n),this.map.set(n,i),i}delete(n){return this.map.delete(n)}set(n,i){if(!this.delete(n)&&i!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return sp=e,sp}var ap,HA;function Ub(){if(HA)return ap;HA=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return ap=i=>i?typeof i!="object"?e:i:t,ap}var Wl={exports:{}},op,VA;function jb(){if(VA)return op;VA=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return op={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},op}var up,XA;function Zd(){return XA||(XA=1,up=typeof process=="object"&&rp&&rp.NODE_DEBUG&&/\bsemver\b/i.test(rp.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),up}var YA;function qb(){return YA||(YA=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=jb(),s=Zd();t=e.exports={};const a=t.re=[],o=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],p=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},h=(g,m,y)=>{const b=p(m),v=c++;s(g,v,m),l[g]=v,u[v]=m,a[v]=new RegExp(m,y?"g":void 0),o[v]=new RegExp(b,y?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),h("FULL",`^${u[l.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),h("LOOSE",`^${u[l.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),h("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",u[l.COERCE],!0),h("COERCERTLFULL",u[l.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[l.LONECARET]}
66\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Wl,Wl.exports)),Wl.exports}var lp,KA;function hee(){if(KA)return lp;KA=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),a=e.test(r);return s&&a&&(i=+i,r=+r),i===r?0:s&&!a?-1:a&&!s?1:i<r?-1:1};return lp={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},lp}var cp,JA;function Wb(){if(JA)return cp;JA=1;const e=Zd(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=jb(),{safeRe:i,t:r}=qb(),s=Ub(),{compareIdentifiers:a}=hee();class o{constructor(l,c){if(c=s(c),l instanceof o){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const p=+d;if(p>=0&&p<n)return p}return d}):this.prerelease=[],this.build=f[5]?f[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(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return a(f,d)}while(++c)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return a(f,d)}while(++c)}inc(l,c,f){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);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 d=Number(f)?1:0;if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[d];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let p=[c,d];f===!1&&(p=[c]),a(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}
vendor: 10,739 bytes, lines 66-142
66default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return cp=o,cp}var fp,QA;function po(){if(QA)return fp;QA=1;const e=Wb();return fp=(n,i,r)=>new e(n,r).compare(new e(i,r)),fp}var dp,ZA;function pee(){if(ZA)return dp;ZA=1;const e=po();return dp=(n,i,r)=>e(n,i,r)===0,dp}var hp,e2;function gee(){if(e2)return hp;e2=1;const e=po();return hp=(n,i,r)=>e(n,i,r)!==0,hp}var pp,t2;function mee(){if(t2)return pp;t2=1;const e=po();return pp=(n,i,r)=>e(n,i,r)>0,pp}var gp,n2;function yee(){if(n2)return gp;n2=1;const e=po();return gp=(n,i,r)=>e(n,i,r)>=0,gp}var mp,i2;function bee(){if(i2)return mp;i2=1;const e=po();return mp=(n,i,r)=>e(n,i,r)<0,mp}var yp,r2;function xee(){if(r2)return yp;r2=1;const e=po();return yp=(n,i,r)=>e(n,i,r)<=0,yp}var bp,s2;function vee(){if(s2)return bp;s2=1;const e=pee(),t=gee(),n=mee(),i=yee(),r=bee(),s=xee();return bp=(o,u,l,c)=>{switch(u){case"===":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o===l;case"!==":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o!==l;case"":case"=":case"==":return e(o,l,c);case"!=":return t(o,l,c);case">":return n(o,l,c);case">=":return i(o,l,c);case"<":return r(o,l,c);case"<=":return s(o,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},bp}var xp,a2;function Eee(){if(a2)return xp;a2=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(" "),a("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,a("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 o(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(a("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new o(c,this.options)}catch{return!1}return s(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("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}xp=t;const n=Ub(),{safeRe:i,t:r}=qb(),s=vee(),a=Zd(),o=Wb(),u=U3();return xp}var vp,o2;function U3(){if(o2)return vp;o2=1;const e=/\s+/g;class t{constructor(O,I){if(I=r(I),O instanceof t)return O.loose===!!I.loose&&O.includePrerelease===!!I.includePrerelease?O:new t(O.raw,I);if(O instanceof s)return this.raw=O.value,this.set=[[O]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=O.trim().replace(e," "),this.set=this.raw.split("||").map(G=>this.parseRange(G.trim())).filter(G=>G.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const G=this.set[0];if(this.set=this.set.filter(X=>!g(X[0])),this.set.length===0)this.set=[G];else if(this.set.length>1){for(const X of this.set)if(X.length===1&&m(X[0])){this.set=[X];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let O=0;O<this.set.length;O++){O>0&&(this.formatted+="||");const I=this.set[O];for(let G=0;G<I.length;G++)G>0&&(this.formatted+=" "),this.formatted+=I[G].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(O){const G=((this.options.includePrerelease&&p)|(this.options.loose&&h))+":"+O,X=i.get(G);if(X)return X;const V=this.options.loose,te=V?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];O=O.replace(te,ne(this.options.includePrerelease)),a("hyphen replace",O),O=O.replace(u[l.COMPARATORTRIM],c),a("comparator trim",O),O=O.replace(u[l.TILDETRIM],f),a("tilde trim",O),O=O.replace(u[l.CARETTRIM],d),a("caret trim",O);let ye=O.split(" ").map(Le=>b(Le,this.options)).join(" ").split(/\s+/).map(Le=>J(Le,this.options));V&&(ye=ye.filter(Le=>(a("loose invalid filter",Le,this.options),!!Le.match(u[l.COMPARATORLOOSE])))),a("range list",ye);const oe=new Map,ke=ye.map(Le=>new s(Le,this.options));for(const Le of ke){if(g(Le))return[Le];oe.set(Le.value,Le)}oe.size>1&&oe.has("")&&oe.delete("");const gt=[...oe.values()];return i.set(G,gt),gt}intersects(O,I){if(!(O instanceof t))throw new TypeError("a Range is required");return this.set.some(G=>y(G,I)&&O.set.some(X=>y(X,I)&&G.every(V=>X.every(te=>V.intersects(te,I)))))}test(O){if(!O)return!1;if(typeof O=="string")try{O=new o(O,this.options)}catch{return!1}for(let I=0;I<this.set.length;I++)if(de(this.set[I],O,this.options))return!0;return!1}}vp=t;const n=dee(),i=new n,r=Ub(),s=Eee(),a=Zd(),o=Wb(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=qb(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:h}=jb(),g=N=>N.value==="<0.0.0-0",m=N=>N.value==="",y=(N,O)=>{let I=!0;const G=N.slice();let X=G.pop();for(;I&&G.length;)I=G.every(V=>X.intersects(V,O)),X=G.pop();return I},b=(N,O)=>(a("comp",N,O),N=C(N,O),a("caret",N),N=A(N,O),a("tildes",N),N=w(N,O),a("xrange",N),N=L(N,O),a("stars",N),N),v=N=>!N||N.toLowerCase()==="x"||N==="*",A=(N,O)=>N.trim().split(/\s+/).map(I=>E(I,O)).join(" "),E=(N,O)=>{const I=O.loose?u[l.TILDELOOSE]:u[l.TILDE];return N.replace(I,(G,X,V,te,ye)=>{a("tilde",N,G,X,V,te,ye);let oe;return v(X)?oe="":v(V)?oe=`>=${X}.0.0 <${+X+1}.0.0-0`:v(te)?oe=`>=${X}.${V}.0 <${X}.${+V+1}.0-0`:ye?(a("replaceTilde pr",ye),oe=`>=${X}.${V}.${te}-${ye} <${X}.${+V+1}.0-0`):oe=`>=${X}.${V}.${te} <${X}.${+V+1}.0-0`,a("tilde return",oe),oe})},C=(N,O)=>N.trim().split(/\s+/).map(I=>x(I,O)).join(" "),x=(N,O)=>{a("caret",N,O);const I=O.loose?u[l.CARETLOOSE]:u[l.CARET],G=O.includePrerelease?"-0":"";return N.replace(I,(X,V,te,ye,oe)=>{a("caret",N,X,V,te,ye,oe);let ke;return v(V)?ke="":v(te)?ke=`>=${V}.0.0${G} <${+V+1}.0.0-0`:v(ye)?V==="0"?ke=`>=${V}.${te}.0${G} <${V}.${+te+1}.0-0`:ke=`>=${V}.${te}.0${G} <${+V+1}.0.0-0`:oe?(a("replaceCaret pr",oe),V==="0"?te==="0"?ke=`>=${V}.${te}.${ye}-${oe} <${V}.${te}.${+ye+1}-0`:ke=`>=${V}.${te}.${ye}-${oe} <${V}.${+te+1}.0-0`:ke=`>=${V}.${te}.${ye}-${oe} <${+V+1}.0.0-0`):(a("no pr"),V==="0"?te==="0"?ke=`>=${V}.${te}.${ye}${G} <${V}.${te}.${+ye+1}-0`:ke=`>=${V}.${te}.${ye}${G} <${V}.${+te+1}.0-0`:ke=`>=${V}.${te}.${ye} <${+V+1}.0.0-0`),a("caret return",ke),ke})},w=(N,O)=>(a("replaceXRanges",N,O),N.split(/\s+/).map(I=>R(I,O)).join(" ")),R=(N,O)=>{N=N.trim();const I=O.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return N.replace(I,(G,X,V,te,ye,oe)=>{a("xRange",N,G,X,V,te,ye,oe);const ke=v(V),gt=ke||v(te),Le=gt||v(ye),Qn=Le;return X==="="&&Qn&&(X=""),oe=O.includePrerelease?"-0":"",ke?X===">"||X==="<"?G="<0.0.0-0":G="*":X&&Qn?(gt&&(te=0),ye=0,X===">"?(X=">=",gt?(V=+V+1,te=0,ye=0):(te=+te+1,ye=0)):X==="<="&&(X="<",gt?V=+V+1:te=+te+1),X==="<"&&(oe="-0"),G=`${X+V}.${te}.${ye}${oe}`):gt?G=`>=${V}.0.0${oe} <${+V+1}.0.0-0`:Le&&(G=`>=${V}.${te}.0${oe} <${V}.${+te+1}.0-0`),a("xRange return",G),G})},L=(N,O)=>(a("replaceStars",N,O),N.trim().replace(u[l.STAR],"")),J=(N,O)=>(a("replaceGTE0",N,O),N.trim().replace(u[O.includePrerelease?l.GTE0PRE:l.GTE0],"")),ne=N=>(O,I,G,X,V,te,ye,oe,ke,gt,Le,Qn)=>(v(G)?I="":v(X)?I=`>=${G}.0.0${N?"-0":""}`:v(V)?I=`>=${G}.${X}.0${N?"-0":""}`:te?I=`>=${I}`:I=`>=${I}${N?"-0":""}`,v(ke)?oe="":v(gt)?oe=`<${+ke+1}.0.0-0`:v(Le)?oe=`<${ke}.${+gt+1}.0-0`:Qn?oe=`<=${ke}.${gt}.${Le}-${Qn}`:N?oe=`<${ke}.${gt}.${+Le+1}-0`:oe=`<=${oe}`,`${I} ${oe}`.trim()),de=(N,O,I)=>{for(let G=0;G<N.length;G++)if(!N[G].test(O))return!1;if(O.prerelease.length&&!I.includePrerelease){for(let G=0;G<N.length;G++)if(a(N[G].semver),N[G].semver!==s.ANY&&N[G].semver.prerelease.length>0){const X=N[G].semver;if(X.major===O.major&&X.minor===O.minor&&X.patch===O.patch)return!0}return!1}return!0};return vp}var Ep,u2;function Aee(){if(u2)return Ep;u2=1;const e=U3();return Ep=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Ep}var Cee=Aee(),j3=fee(Cee);function wee(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let a=40;function o(l){l.source===i&&(a=0,e.removeEventListener("message",o,!1))}e.addEventListener("message",o,!1);function u(){a<=0||(i.postMessage(n,s),setTimeout(u,r),a-=1)}setTimeout(u,r)}var Fee=`.vega-embed { 67 position: relative; 68 display: inline-block; 69 box-sizing: border-box; 70} 71.vega-embed.has-actions { 72 padding-right: 38px; 73} 74.vega-embed details:not([open]) > :not(summary) { 75 display: none !important; 76} 77.vega-embed summary { 78 list-style: none; 79 position: absolute; 80 top: 0; 81 right: 0; 82 padding: 6px; 83 z-index: 1000; 84 background: white; 85 box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); 86 color: #1b1e23; 87 border: 1px solid #aaa; 88 border-radius: 999px; 89 opacity: 0.2; 90 transition: opacity 0.4s ease-in; 91 cursor: pointer; 92 line-height: 0px; 93} 94.vega-embed summary::-webkit-details-marker { 95 display: none; 96} 97.vega-embed summary:active { 98 box-shadow: #aaa 0px 0px 0px 1px inset; 99} 100.vega-embed summary svg { 101 width: 14px; 102 height: 14px; 103} 104.vega-embed details[open] summary { 105 opacity: 0.7; 106} 107.vega-embed:hover summary, .vega-embed:focus-within summary { 108 opacity: 1 !important; 109 transition: opacity 0.2s ease; 110} 111.vega-embed .vega-actions { 112 position: absolute; 113 z-index: 1001; 114 top: 35px; 115 right: -9px; 116 display: flex; 117 flex-direction: column; 118 padding-bottom: 8px; 119 padding-top: 8px; 120 border-radius: 4px; 121 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); 122 border: 1px solid #d9d9d9; 123 background: white; 124 animation-duration: 0.15s; 125 animation-name: scale-in; 126 animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); 127 text-align: left; 128} 129.vega-embed .vega-actions a { 130 padding: 8px 16px; 131 font-family: sans-serif; 132 font-size: 14px; 133 font-weight: 600; 134 white-space: nowrap; 135 color: #434a56; 136 text-decoration: none; 137} 138.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { 139 background-color: #f7f7f9; 140 color: black; 141} 142.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
143 content: ""; 144 display: inline-block; 145 position: absolute; 146} 147.vega-embed .vega-actions::before { 148 left: auto; 149 right: 14px; 150 top: -16px; 151 border: 8px solid rgba(0, 0, 0, 0); 152 border-bottom-color: #d9d9d9; 153} 154.vega-embed .vega-actions::after { 155 left: auto; 156 right: 15px; 157 top: -14px; 158 border: 7px solid rgba(0, 0, 0, 0); 159 border-bottom-color: #fff; 160} 161.vega-embed .chart-wrapper.fit-x { 162 width: 100%; 163} 164.vega-embed .chart-wrapper.fit-y { 165 height: 100%; 166} 167 168.vega-embed-wrapper { 169 max-width: 100%; 170 overflow: auto; 171 padding-right: 14px; 172} 173 174@keyframes scale-in { 175 from { 176 opacity: 0; 177 transform: scale(0.6); 178 } 179 to { 180 opacity: 1; 181 transform: scale(1); 182 } 183} 184`;function q3(e,...t){for(const n of t)See(e,n);return e}function See(e,t){for(const n of Object.keys(t))Xa(e,n,t[n],!0)}const ti=tq;let Ou=eZ;const l2=typeof window<"u"?window:void 0;Ou===void 0&&l2?.vl?.compile&&(Ou=l2.vl);const $ee={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},kee={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"},Xo={vega:"Vega","vega-lite":"Vega-Lite"},lf={vega:ti.version,"vega-lite":Ou?Ou.version:"not available"},Dee={vega:e=>e,"vega-lite":(e,t)=>Ou.compile(e,{config:t}).spec},Oee=` 185<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"> 186 <circle r="2" cy="8" cx="2"></circle> 187 <circle r="2" cy="8" cx="8"></circle> 188 <circle r="2" cy="8" cx="14"></circle> 189</svg>`,Ree="chart-wrapper";function _ee(e){return typeof e=="function"}function c2(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(r+e+s),a.document.title=`${Xo[i]} JSON Source`}function Tee(e,t){if(e.$schema){const n=R3(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Xo[n.library]}, but mode argument sets ${Xo[t]??t}.`);const i=n.library;return j3(lf[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Xo[i]} ${n.version}, but the current version of ${Xo[i]} is v${lf[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 W3(e){return!!(e&&"load"in e)}function f2(e){return W3(e)?e:ti.loader(e)}function Nee(e){const t=e.usermeta?.embedOptions??{};return q(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Mee(e,t,n={}){let i,r;q(t)?(r=f2(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=Nee(i),a=s.loader;(!r||a)&&(r=f2(n.loader??a));const o=await d2(s,r),u=await d2(n,r),l={...q3(u,o),config:Va(u.config??{},o.config??{})};return await Bee(e,i,l,r)}async function d2(e,t){const n=q(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=q(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function Lee(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 Bee(e,t,n={},i){const r=n.theme?Va(IZ[n.theme],n.config??{}):n.config,s=Mr(n.actions)?n.actions:q3({},$ee,n.actions??{}),a={...kee,...n.i18n},o=n.renderer??"canvas",u=n.logLevel??ti.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 E="vega-embed-style",{root:C,rootContainer:x}=Lee(c);if(!C.getElementById(E)){const w=document.createElement("style");w.id=E,w.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Fee.toString():n.defaultStyle,x.appendChild(w)}}const f=Tee(t,n.mode);let d=Dee[f](t,r);if(f==="vega-lite"&&d.$schema){const E=R3(d.$schema);j3(lf.vega,`^${E.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${E.version}, but current version is v${lf.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let p=c;if(s){const E=document.createElement("div");E.classList.add(Ree),c.appendChild(E),p=E}const h=n.patch;if(h&&(d=h instanceof Function?h(d):Qd(d,h,!0,!1).newDocument),n.formatLocale&&ti.formatLocale(n.formatLocale),n.timeFormatLocale&&ti.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const C=n.expressionFunctions[E];"fn"in C?ti.expressionFunction(E,C.fn,C.visitor):C instanceof Function&&ti.expressionFunction(E,C)}const{ast:g}=n,m=ti.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||ti.View)(m,{loader:i,logLevel:u,renderer:o,...g?{expr:ti.expressionInterpreter??n.expr??fq}:{}});if(y.addSignalListener("autosize",(E,C)=>{const{type:x}=C;x=="fit-x"?(p.classList.add("fit-x"),p.classList.remove("fit-y")):x=="fit-y"?(p.classList.remove("fit-x"),p.classList.add("fit-y")):x=="fit"?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:E,tooltip:C}=n,x=E&&!W3(E)?E?.baseURL:void 0,w=_ee(C)?C:new YZ({baseURL:x,...C===!0?{}:C}).call;y.tooltip(w)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:C}=typeof b=="boolean"?{}:b;
189y.hover(E,C)}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(p,n.bind).runAsync();let v;if(s!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const x=document.createElement("details");x.title=a.CLICK_TO_VIEW_ACTIONS,c.append(x),E=x;const w=document.createElement("summary");w.innerHTML=Oee,x.append(w),v=R=>{x.contains(R.target)||x.removeAttribute("open")},document.addEventListener("click",v)}const C=document.createElement("div");if(E.append(C),C.classList.add("vega-actions"),s===!0||s.export!==!1){for(const x of["svg","png"])if(s===!0||s.export===!0||s.export[x]){const w=a[`${x.toUpperCase()}_ACTION`],R=document.createElement("a"),L=j(n.scaleFactor)?n.scaleFactor[x]:n.scaleFactor;R.text=w,R.href="#",R.target="_blank",R.download=`${l}.${x}`,R.addEventListener("mousedown",async function(J){J.preventDefault();const ne=await y.toImageURL(x,L);this.href=ne}),C.append(R)}}if(s===!0||s.source!==!1){const x=document.createElement("a");x.text=a.SOURCE_ACTION,x.href="#",x.addEventListener("click",function(w){c2(nh(t),n.sourceHeader??"",n.sourceFooter??"",f),w.preventDefault()}),C.append(x)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const x=document.createElement("a");x.text=a.COMPILED_ACTION,x.href="#",x.addEventListener("click",function(w){c2(nh(d),n.sourceHeader??"",n.sourceFooter??"","vega"),w.preventDefault()}),C.append(x)}if(s===!0||s.editor!==!1){const x=n.editorUrl??"https://vega.github.io/editor/",w=document.createElement("a");w.text=a.EDITOR_ACTION,w.href="#",w.addEventListener("click",function(R){wee(window,x,{config:r,mode:h?"vega":f,renderer:o,spec:nh(h?d:t)}),R.preventDefault()}),C.append(w)}}function A(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:A,embedOptions:n}}var Pee=h2('<div class="caption layout svelte-1i8dfv0"> </div>'),Iee=h2('<div class="altair layout svelte-1i8dfv0"><div></div> <!></div>');function Ite(e,t){Q3(t,!0);let n=Y3(t,"colors",19,()=>[]),i,r,s,a=window.getComputedStyle(document.body),o=tx(null),u=tx(0),l=th(()=>t.value?.plot),c=th(()=>
189{if(!on(l))return null;let A=JSON.parse(on(l));return A&&A.params&&!t._selectable&&(A.params=A.params.filter(E=>E.name!=="brush")),nR(()=>{on(o)!==A&&(Zb(o,A,!0),Zb(u,A.width,!0)),t.value.chart&&A&&(A=k_(A,a,t.value.chart,n()))}),A}),f=th(()=>!(on(c)?.encoding?.column?.field||on(c)?.encoding?.row?.field||t.value.chart===void 0));const d=()=>Math.min(r.offsetWidth,on(u)||r.offsetWidth);let p=()=>{};const h=()=>{s&&(s.finalize(),s=void 0),on(f)&&(on(c).width=d()),Mee(i,on(c),{actions:t.show_actions_button}).then(function(A){if(s=A.view,p=()=>{s.signal("width",d()).run()},!t._selectable)return;const E=(C,x)=>{const w=s.signal("brush");if(w)if(Object.keys(w).length===0)t.onselect?.({value:null,index:null,selected:!1});else{const R=Object.keys(w)[0];let L=w[R].map(J=>J/1e3);t.onselect?.({value:w,index:L,selected:!0})}};s.addEventListener("mouseup",E),s.addEventListener("touchup",E)})},g=new ResizeObserver(()=>{on(f)&&on(c).width!==r.offsetWidth&&p()});Z3(()=>{if(!(!i||!r||!on(c)))return h(),g.observe(r),()=>{s&&(s.finalize(),s=void 0),g.disconnect()}});var m=Iee();K3(m,"data-testid","altair");var y=ex(m);Jb(y,A=>i=A,()=>i);var b=eR(y,2);{var v=A=>{var E=Pee(),C=ex(E,!0);nx(E),iR(()=>rR(C,t.caption)),Qb(A,E)};J3(b,A=>{t.caption&&A(v)})}nx(m),Jb(m,A=>r=A,()=>r),Qb(e,m),tR()}export{Ite as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.