1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/duckdb-browser.B-A5n9Vx.js","../chunks/tslib.es6.D0_rdc6B.js","../chunks/builder.Bex1SfVw.js"])))=>i.map(i=>d[i]); 2var dN=Object.defineProperty;var Kx=e=>{throw TypeError(e)};var hN=(e,t,n)=>t in e?dN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var gc=(e,t,n)=>hN(e,typeof t!="symbol"?t+"":t,n),gN=(e,t,n)=>t.has(e)||Kx("Cannot "+n);var We=(e,t,n)=>(gN(e,t,"read from private field"),n?n.call(e):t.get(e)),Wt=(e,t,n)=>t.has(e)?Kx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import"../chunks/disclose-version.Bg9kRutz.js";import{h as pN,p as wl,aI as $n,y as Jx,u as Qx,g as ee,d as Xt,a as El,D as Ht,f as zs,t as xf,s as er,c as Rr,r as Dr,n as kg}from"../chunks/runtime.DTfcg2pQ.js";import{l as mN,s as W0,d as yN}from"../chunks/render.u-_BODVR.js";import{a as wf,d as bN}from"../chunks/duckdb-mvp.BbAn9cJD.js";import{i as Zx}from"../chunks/if.D8xHY3jx.js";import{a as at,t as ui,e as Ef,d as e2}from"../chunks/template.DhhKykWY.js";import{p as G0,a as fn}from"../chunks/props.B5ODgPYV.js";import{c as vN,o as xN}from"../chunks/index-client.C-Gflp4a.js";import{r as Cg}from"../chunks/attributes.DAqU7OQi.js";import{aa as _f,F as wN,E as t2,D as KS,w as Xc,v as EN,u as _N,s as JS,b7 as QS,S as SN,R as n2,Q as ZS,b8 as Yc,H as AN,G as kN,U as H0,b9 as Hu,ba as CN,bb as $N,bc as i2,bd as FN,be as ON,bf as TN,b5 as RN,bg as DN,W as NN,bh as MN,X as LN,bi as IN,p as eA,bj as PN,ag as zN,Y as r2,ad as tA,r as pn,ae as BN,af as jN,V as Mu,bk as V0,bl as s2,bm as vs,bn as yi,bo as ke,bp as a2,bq as yt,br as UN,bs as Ia,bt as $g,bu as o2,bv as pt,bw as u2,bx as qN,by as WN,bz as GN,bA as nA,bB as HN,bC as VN,bD as XN,bE as YN,b as KN,bF as JN,aD as QN,bG as ZN,aC as eM,bH as tM,aE as nM,g as iM,bI as rM,bJ as sM,j as aM,a as oM,bK as uM,aB as iA,k as lM,m as cM,l as fM,aA as rA,ah as dM,i as hM,bL as gM,bM as Vu,az as pM,as as mM,au as yM,at as bM,bN as vM,av as xM,aJ as wM,aK as EM,bO as sA,bP as _M,bQ as SM,bR as AM,bS as kM,aF as CM,aH as $M,aG as FM,bT as OM,aI as TM,aw as RM,ay as DM,o as aA,bU as NM,ai as MM,aj as LM,ak as IM,al as PM,am as zM,an as BM,ao as jM,ap as UM,aq as qM,ar as WM,bV as GM,bW as X0,ab as oA,aL as HM,aS as Y0,bX as qr,bY as yu,bZ as l2,b_ as K0,b$ as Zt,c0 as en,c1 as uA,c2 as dt,c3 as dn,c4 as Za,c5 as VM,c6 as c2,c7 as XM,c8 as YM,c9 as Wa,ca as f2,cb as im,cc as lA,cd as KM,ce as pc,cf as d2,aR as JM,cg as QM,ch as ZM,ci as e5,cj as t5,ck as n5,cl as cA,aP as fA,b4 as i5,b0 as r5,a$ as s5,a_ as a5,b3 as o5,b2 as u5,b1 as l5,aZ as c5,aY as f5,aX as d5,aW as h5,aV as g5,aU as p5,aT as m5,e as Sf,n as y5,T as b5,t as v5,f as x5,cm as w5,cn as E5,co as _5,cp as S5,cq as A5}from"../chunks/timer.CsgchMQC.js";import{b as k5}from"../chunks/this.DGHUY47S.js";import{e as C5,i as $5}from"../chunks/each.DTZKRs46.js";import{t as h2}from"../chunks/class.Bvena8yX.js";import{_ as F5}from"../chunks/preload-helper.C1FmrZbK.js";import"../chunks/Doc.svelte_svelte_type_style_lang.C1hMKaC-.js";import{D as O5}from"../chunks/Doc.BEcYEn3Q.js";function Fg(e,t,n=t){mN(e,"change",()=>{var i=e.checked;n(i)}),t()==null&&n(!1),pN(()=>{var i=t();e.checked=!!i})}function T5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const R5=/("(?:[^\\"]|\\.)*")|[:,]/g;function Og(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(a,o,u){a&&typeof a.toJSON=="function"&&(a=a.toJSON());const l=JSON.stringify(a,r);if(l===void 0)return l;const c=i-o.length-u;if(l.length<=c){const f=l.replace(R5,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(a=JSON.parse(l),r=void 0),typeof a=="object"&&a!==null){const f=o+n,d=[];let h=0,g,p;if(Array.isArray(a)){g="[",p="]";const{length:m}=a;for(;h<m;h++)d.push(s(a[h],f,h===m-1?0:1)||"null")}else{g="{",p="}";const m=Object.keys(a),{length:y}=m;for(;h<y;h++){const b=m[h],v=`${JSON.stringify(b)}: `,x=s(a[b],f,v.length+(h===y-1?0:1));x!==void 0&&d.push(v+x)}}if(d.length>0)return[g,n+d.join(`, 3${f}`),p].join(` 4${o}`)}return l}(e,"",0)}function on(e,t,n){return e.fields=t||[],e.fname=n,e}function Pe(e){return e==null?null:e.fname}function _t(e){return e==null?null:e.fields}function dA(e){return e.length===1?D5(e[0]):N5(e)}const D5=e=>function(t){return t[e]},N5=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function D(e){throw Error(e)}function Ii(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||D("Access path missing open bracket: "+e),r>0&&l(),r=0,a=o+1)}return r&&D("Access path missing closing bracket: "+e),i&&D("Access path missing closing quote: "+e),o>a&&(o++,l()),t}function Dn(e,t,n){const i=Ii(e);return e=i.length===1?i[0]:e,on((n&&n.get||dA)(i),[e],t||e)}const _l=Dn("id"),Ct=on(e=>e,[],"identity"),Tr=on(()=>0,[],"zero"),$o=on(()=>1,[],"one"),Nn=on(()=>!0,[],"true"),_r=on(()=>!1,[],"false");function M5(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const hA=0,J0=1,Q0=2,gA=3,pA=4;function Z0(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M5,i=e||hA;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=J0&&n(t||"error","ERROR",arguments),this},warn(){return i>=Q0&&n(t||"warn","WARN",arguments),this},info(){return i>=gA&&n(t||"log","INFO",arguments),this},debug(){return i>=pA&&n(t||"log","DEBUG",arguments),this}}}var N=Array.isArray;function V(e){return e===Object(e)}const g2=e=>e!=="__proto__";function Fo(){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=L5(i.signals,r.signals);else{const a=s==="legend"?{layout:1}:s==="style"?!0:null;Oo(i,s,r[s],a)}return i},{})}function Oo(e,t,n,i){if(!g2(t))return;let r,s;if(V(n)&&!N(n)){s=V(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Oo(s,r,n[r]):g2(r)&&(s[r]=n[r])}else e[t]=n}function L5(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 fe(e){return e[e.length-1]}function wt(e){return e==null||e===""?null:+e}const mA=e=>t=>e*Math.exp(t),yA=e=>t=>Math.log(e*t),bA=e=>t=>
vendor: 4,500 bytes, line 4
4Math.sign(t)*Math.log1p(Math.abs(t/e)),vA=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Af=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Id(e,t,n,i){const r=n(e[0]),s=n(fe(e)),a=(s-r)*t;return[i(r-a),i(s-a)]}function xA(e,t){return Id(e,t,wt,Ct)}function wA(e,t){var n=Math.sign(e[0]);return Id(e,t,yA(n),mA(n))}function EA(e,t,n){return Id(e,t,Af(n),Af(1/n))}function _A(e,t,n){return Id(e,t,bA(n),vA(n))}function Pd(e,t,n,i,r){const s=i(e[0]),a=i(fe(e)),o=t!=null?i(t):(s+a)/2;return[r(o+(s-o)*n),r(o+(a-o)*n)]}function e1(e,t,n){return Pd(e,t,n,wt,Ct)}function t1(e,t,n){const i=Math.sign(e[0]);return Pd(e,t,n,yA(i),mA(i))}function kf(e,t,n,i){return Pd(e,t,n,Af(i),Af(1/i))}function n1(e,t,n,i){return Pd(e,t,n,bA(i),vA(i))}function SA(e){return 1+~~(new Date(e).getMonth()/3)}function AA(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?N(e)?e:[e]:[]}function kA(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 oe(e){return typeof e=="function"}const I5="descending";function i1(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],s={},a=n.comparator||P5;return X(e).forEach((o,u)=>{o!=null&&(i.push(t[u]===I5?-1:1),r.push(o=oe(o)?o:Dn(o,null,n)),(_t(o)||[]).forEach(l=>s[l]=1))}),r.length===0?null:on(a(r,i),Object.keys(s))}const zd=(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),P5=(e,t)=>e.length===1?z5(e[0],t[0]):B5(e,t,e.length),z5=(e,t)=>function(n,i){return zd(e(n),e(i))*t},B5=(e,t,n)=>(t.push(0),function(i,r){let s,a=0,o=-1;for(;a===0&&++o<n;)s=e[o],a=zd(s(i),s(r));return a*t[o]});function $t(e){return oe(e)?e:()=>e}function r1(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function ae(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 Oi(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 CA(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]}const j5=Object.prototype.hasOwnProperty;function K(e,t){return j5.call(e,t)}const mc={};function To(e){let t={},n;function i(s){return K(t,s)&&t[s]!==mc}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]===mc&&--r.empty),t[s]=a,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=mc),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!==mc&&(!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 $A(e,t,n,i,r,s){if(!n&&n!==0)return s;const a=+n;let o=e[0],u=fe(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 G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ae(i,n)}function Pa(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 us(e){return typeof e=="boolean"}function Wr(e){return Object.prototype.toString.call(e)==="[object Date]"}function FA(e){return e&&oe(e[Symbol.iterator])}function pe(e){return typeof e=="number"}function OA(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Y(e){return typeof e=="string"}function s1(e,t,n){e&&(e=t?X(e).map(o=>o.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||dA,s=o=>r(t?[o]:Ii(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 on(a,e,"key")}function TA(e,t){const n=e[0],i=fe(e),r=+t;return r?r===1?i:n+r*(i-n):n}const U5=1e4;function RA(e){e=+e||U5;let t,n,i;const r=()=>{t={},n={},i=0},s=(a,o)=>(++i>e&&(n=t,t={},i=1),t[a]=o);
4return r(),{clear:r,has:a=>K(t,a)||K(n,a),get:a=>K(t,a)?t[a]:K(n,a)?s(a,n[a]):void 0,set:(a,o)=>K(t,a)?t[a]=o:s(a,o)}}function DA(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 bu(e,t){let n="";for(;--t>=0;)n+=e;return n}function NA(e,t,n,i){const r=n||" ",s=e+"",a=t-s.length;return a<=0?s:i==="left"?bu(r,a)+s:i==="center"?bu(r,~~(a/2))+s+bu(r,Math.ceil(a/2)):s+bu(r,a)}function Sl(e){return e&&fe(e)-e[0]||0}function q(e){return N(e)?"["+e.map(q)+"]":V(e)||Y(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function a1(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const q5=e=>pe(e)||Wr(e)?e:Date.parse(e);function o1(e,t){return t=t||q5,e==null||e===""?null:t(e)}function u1(e){return e==null||e===""?null:e+""}function ti(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function MA(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 kr(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)}var p2={},Tg={},Rg=34,Jo=10,Dg=13;function LA(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function W5(e,t){var n=LA(e);return function(i,r){return t(n(i),r,e)}}function m2(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function Gt(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function G5(e){return e<0?"-"+Gt(-e,6):e>9999?"+"+Gt(e,6):Gt(e,4)}function H5(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":G5(e.getUTCFullYear())+"-"+Gt(e.getUTCMonth()+1,2)+"-"+Gt(e.getUTCDate(),2)+(r?"T"+Gt(t,2)+":"+Gt(n,2)+":"+Gt(i,2)+"."+Gt(r,3)+"Z":i?"T"+Gt(t,2)+":"+Gt(n,2)+":"+Gt(i,2)+"Z":n||t?"T"+Gt(t,2)+":"+Gt(n,2)+"Z":"")}function V5(e){var t=new RegExp('["'+e+` 5\r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?W5(m,d):LA(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,v=!1;f.charCodeAt(g-1)===Jo&&--g,f.charCodeAt(g-1)===Dg&&--g;function x(){if(b)return Tg;if(v)return v=!1,p2;var _,w=p,S;if(f.charCodeAt(w)===Rg){for(;p++<g&&f.charCodeAt(p)!==Rg||f.charCodeAt(++p)===Rg;);return(_=p)>=g?b=!0:(S=f.charCodeAt(p++))===Jo?v=!0:S===Dg&&(v=!0,f.charCodeAt(p)===Jo&&++p),f.slice(w+1,_-1).replace(/""/g,'"')}for(;p<g;){if((S=f.charCodeAt(_=p++))===Jo)v=!0;else if(S===Dg)v=!0,f.charCodeAt(p)===Jo&&++p;else if(S!==n)continue;return f.slice(w,_)}return b=!0,f.slice(w,g)}for(;(y=x())!==Tg;){for(var E=[];y!==p2&&y!==Tg;)E.push(y),y=x();d&&(E=d(E,m++))==null||h.push(E)}return h}function s(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function a(f,d){return d==null&&(d=m2(f)),[d.map(c).join(e)].concat(s(f,d)).join(` 6`)}function o(f,d){return d==null&&(d=m2(f)),s(f,d).join(` 7`)}function u(f){return f.map(l).join(` 8`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?H5(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:a,formatBody:o,formatRows:u,formatRow:l,formatValue:c}}function X5(e){return e}function Y5(e){if(e==null)return X5;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,u){u||(t=n=0);var l=2,c=o.length,f=new Array(c);for(f[0]=(t+=o[0])*i+s,f[1]=(n+=o[1])*r+a;l<c;)f[l]=o[l],++l;return f}}function K5(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function J5(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return y2(e,n)})}:y2(e,t)}function y2(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=IA(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function IA(e,t){var n=Y5(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&K5(f,g)}function s(c){return n(c)}function a(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);
vendor: 1,527 bytes, line 8
8return f.length<2&&f.push(f[0]),f}function o(c){for(var f=a(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(o)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=s(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(s);break;case"LineString":d=a(c.arcs);break;case"MultiLineString":d=c.arcs.map(a);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function Q5(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++a],t[a]=l,t[c]=d)}),t.forEach(function(l){var c=o(l),f=c[0],d=c[1],h,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function o(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),s.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function Z5(e){return IA(e,eL.apply(this,arguments))}
vendor: 79,524 bytes, lines 8-9
8function eL(e,t,n){var i,r,s;if(arguments.length>1)i=tL(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:Q5(e,i)}}function tL(e,t,n){var i=[],r=[],s;function a(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:s})}function o(f){f.forEach(a)}function u(f){f.forEach(o)}function l(f){f.forEach(u)}function c(f){switch(s=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":o(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function nL(e,...t){e=new _f(e),t=t.map(iL);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function iL(e){return e instanceof _f?e:new _f(e)}function rL(...e){const t=new _f;for(const n of e)for(const i of n)t.add(i);return t}const ct="year",tn="quarter",St="month",Ve="week",nn="date",xt="day",Ti="dayofyear",wn="hours",En="minutes",Mn="seconds",ni="milliseconds",l1=[ct,tn,St,Ve,nn,xt,Ti,wn,En,Mn,ni],Ng=l1.reduce((e,t,n)=>(e[t]=1+n,e),{});function c1(e){const t=X(e).slice(),n={};return t.length||D("Missing time unit."),t.forEach(r=>{K(Ng,r)?n[r]=1:D(`Invalid time unit: ${r}.`)}),(n[Ve]||n[xt]?1:0)+(n[tn]||n[St]||n[nn]?1:0)+(n[Ti]?1:0)>1&&D(`Incompatible time units: ${e}`),t.sort((r,s)=>Ng[r]-Ng[s]),t}const sL={[ct]:"%Y ",[tn]:"Q%q ",[St]:"%b ",[nn]:"%d ",[Ve]:"W%U ",[xt]:"%a ",[Ti]:"%j ",[wn]:"%H:00",[En]:"00:%M",[Mn]:":%S",[ni]:".%L",[`${ct}-${St}`]:"%Y-%m ",[`${ct}-${St}-${nn}`]:"%Y-%m-%d ",[`${wn}-${En}`]:"%H:%M"};function PA(e,t){const n=ae({},sL,t),i=c1(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 f1(e){return Rs.setFullYear(e),Rs.setMonth(0),Rs.setDate(1),Rs.setHours(0,0,0,0),Rs}function zA(e){return jA(new Date(e))}function BA(e){return rm(new Date(e))}function jA(e){return Xc.count(f1(e.getFullYear())-1,e)}function rm(e){return KS.count(f1(e.getFullYear())-1,e)}function sm(e){return f1(e).getDay()}function aL(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 UA(e){return WA(new Date(e))}function qA(e){return am(new Date(e))}function WA(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Yc.count(t-1,e)}function am(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return ZS.count(t-1,e)}function om(e){return Rs.setTime(Date.UTC(e,0,1)),Rs.getUTCDay()}function oL(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 GA(e,t,n,i,r){const s=t||1,a=fe(e),o=(y,b,v)=>(v=v||y,uL(n[v],i[v],y===a&&s,b)),u=new Date,l=ti(e),c=l[ct]?o(ct):$t(2012),f=l[St]?o(St):l[tn]?o(tn):Tr,d=l[Ve]&&l[xt]?o(xt,1,Ve+xt):l[Ve]?o(Ve,1):l[xt]?o(xt,1):l[nn]?o(nn,1):l[Ti]?o(Ti,1):$o,h=l[wn]?o(wn):Tr,g=l[En]?o(En):Tr,p=l[Mn]?o(Mn):Tr,m=l[ni]?o(ni):Tr;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function uL(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 eo(e,t,n){return t+e*7-(n+6)%7}const lL={[ct]:e=>e.getFullYear(),[tn]:e=>Math.floor(e.getMonth()/3),[St]:e=>e.getMonth(),[nn]:e=>e.getDate(),[wn]:e=>e.getHours(),[En]:e=>e.getMinutes(),[Mn]:e=>e.getSeconds(),[ni]:e=>e.getMilliseconds(),[Ti]:e=>jA(e),[Ve]:e=>rm(e),[Ve+xt]:(e,t)=>eo(rm(e),e.getDay(),sm(t)),[xt]:(e,t)=>eo(1,e.getDay(),sm(t))},cL={[tn]:e=>3*e,[Ve]:(e,t)=>eo(e,0,sm(t))};function HA(e,t){return GA(e,t||1,lL,cL,aL)}const fL={[ct]:e=>e.getUTCFullYear(),[tn]:e=>Math.floor(e.getUTCMonth()/3),[St]:e=>e.getUTCMonth(),[nn]:e=>e.getUTCDate(),[wn]:e=>e.getUTCHours(),[En]:e=>e.getUTCMinutes(),[Mn]:e=>e.getUTCSeconds(),[ni]:e=>e.getUTCMilliseconds(),[Ti]:e=>WA(e),[Ve]:e=>am(e),[xt]:(e,t)=>eo(1,e.getUTCDay(),om(t)),[Ve+xt]:(e,t)=>eo(am(e),e.getUTCDay(),om(t))},dL={[tn]:e=>3*e,[Ve]:(e,t)=>eo(e,0,om(t))};function VA(e,t){return GA(e,t||1,fL,dL,oL)}const hL={[ct]:wN,[tn]:t2.every(3),[St]:t2,[Ve]:KS,[nn]:Xc,[xt]:Xc,[Ti]:Xc,[wn]:EN,[En]:_N,[Mn]:JS,[ni]:QS},gL={[ct]:SN,[tn]:n2.every(3),[St]:n2,[Ve]:ZS,[nn]:Yc,[xt]:Yc,[Ti]:Yc,[wn]:AN,[En]:kN,[Mn]:JS,[ni]:QS};function Ro(e){return hL[e]}function Do(e){return gL[e]}function XA(e,t,n){return e?e.offset(t,n):void 0}function YA(e,t,n){return XA(Ro(e),t,n)}function KA(e,t,n){return XA(Do(e),t,n)}function JA(e,t,n,i){return e?e.range(t,n,i):void 0}function QA(e,t,n,i){return JA(Ro(e),t,n,i)}function ZA(e,t,n,i){return JA(Do(e),t,n,i)}const vu=1e3,xu=vu*60,wu=xu*60,Bd=wu*24,pL=Bd*7,b2=Bd*30,um=Bd*365,ek=[ct,St,nn,wn,En,Mn,ni],Eu=ek.slice(0,-1),_u=Eu.slice(0,-1),Su=_u.slice(0,-1),mL=Su.slice(0,-1),yL=[ct,Ve],v2=[ct,St],tk=[ct],Qo=[[Eu,1,vu],[Eu,5,5*vu],[Eu,15,15*vu],[Eu,30,30*vu],[_u,1,xu],[_u,5,5*xu],[_u,15,15*xu],[_u,30,30*xu],[Su,1,wu],[Su,3,3*wu],[Su,6,6*wu],[Su,12,12*wu],[mL,1,Bd],[yL,1,pL],[v2,1,b2],[v2,3,3*b2],[tk,1,um]];function nk(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Sl(t))/n;let r=H0(o=>o[2]).right(Qo,i),s,a;return r===Qo.length?(s=tk,a=Hu(t[0]/um,t[1]/um,n)):r?(r=Qo[i/Qo[r-1][2]<Qo[r][2]/i?r-1:r],s=r[0],a=r[1]):(s=ek,a=Math.max(Hu(t[0],t[1],n),1)),{units:s,step:a}}function Au(e){const t={};return n=>t[n]||(t[n]=e(n))}function bL(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=vL(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 vL(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 ik(e){const t=Au(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=i2(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return bL(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,a){a=i2(a??",f");const o=Hu(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=TN(o,u))||(a.precision=l),n(a,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=ON(o,u))||(a.precision=l-(a.type==="e"));break}case"f":case"%":{isNaN(l=FN(o))||(a.precision=l-(a.type==="%")*2);break}}return t(a)}}}let lm;rk();function rk(){return lm=ik({format:RN,formatPrefix:DN})}function sk(e){return ik(CN(e))}function Cf(e){return arguments.length?lm=sk(e):lm}function x2(e,t,n){n=n||{},V(n)||D(`Invalid time multi-format specifier: ${n}`);const i=t(Mn),r=t(En),s=t(wn),a=t(nn),o=t(Ve),u=t(St),l=t(tn),c=t(ct),f=e(n[ni]||".%L"),d=e(n[Mn]||":%S"),h=e(n[En]||"%I:%M"),g=e(n[wn]||"%I %p"),p=e(n[nn]||n[xt]||"%a %d"),m=e(n[Ve]||"%b %d"),y=e(n[St]||"%B"),b=e(n[tn]||"%B"),v=e(n[ct]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:s(x)<x?h:a(x)<x?g:u(x)<x?o(x)<x?p:m:c(x)<x?l(x)<x?y:b:v)(x)}function ak(e){const t=Au(e.format),n=Au(e.utcFormat);return{timeFormat:i=>Y(i)?t(i):x2(t,Ro,i),utcFormat:i=>Y(i)?n(i):x2(n,Do,i),timeParse:Au(e.parse),utcParse:Au(e.utcParse)}}let cm;ok();function ok(){return cm=ak({format:NN,parse:MN,utcFormat:LN,utcParse:IN})}function uk(e){return ak($N(e))}function Xu(e){return arguments.length?cm=uk(e):cm}const fm=(e,t)=>ae({},e,t);function lk(e,t){const n=e?sk(e):Cf(),i=t?uk(t):Xu();return fm(n,i)}function d1(e,t){const n=arguments.length;return n&&n!==2&&D("defaultLocale expects either zero or two arguments."),n?fm(Cf(e),Xu(t)):fm(Cf(),Xu())}function xL(){return rk(),ok(),d1()}const wL=/^(data:|([A-Za-z]+:)?\/\/)/,EL=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,_L=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,w2="file://";function SL(e,t){return n=>({options:n||{},sanitize:kL,load:AL,fileAccess:!!t,file:CL(t),http:FL(e)})}async function AL(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function kL(e,t){t=ae({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,a;const o=EL.test(e.replace(_L,""));(e==null||typeof e!="string"||!o)&&D("Sanitize failure, invalid URI: "+q(e));const u=wL.test(e);return(a=t.baseURL)&&!u&&(!e.startsWith("/")&&!a.endsWith("/")&&(e="/"+e),e=a+e),s=(r=e.startsWith(w2))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(w2.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 CL(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):$L}async function $L(){D("No file system access.")}function FL(e){return e?async function(t,n){const i=ae({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?oe(s[r])?s[r]():s.text():D(s.status+""+s.statusText)}:OL}async function OL(){D("No HTTP fetch method available.")}const TL=e=>e!=null&&e===e,RL=e=>e==="true"||e==="false"||e===!0||e===!1,DL=e=>!Number.isNaN(Date.parse(e)),ck=e=>!Number.isNaN(+e)&&!(e instanceof Date),NL=e=>ck(e)&&Number.isInteger(+e),dm={boolean:a1,integer:wt,number:wt,date:o1,string:u1,unknown:Ct},yc=[RL,NL,ck,DL],ML=["boolean","integer","number","date"];function fk(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=yc.length,r=yc.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]&&TL(u)&&!yc[o](u)&&(r[o]=0,++a,a===yc.length))return"string";return ML[r.reduce((s,a)=>s===0?a:s,0)-1]}function dk(e,t){return t.reduce((n,i)=>(n[i]=fk(e,i),n),{})}function E2(e){const t=function(n,i){const r={delimiter:e};return h1(n,i?ae(i,r):r)};return t.responseType="text",t}function h1(e,t){return t.header&&(e=t.header.map(q).join(t.delimiter)+` 9`+e),V5(t.delimiter).parse(e+"")}h1.responseType="text";function LL(e){return typeof Buffer=="function"&&oe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function g1(e,t){const n=t&&t.property?Dn(t.property):Ct;return V(e)&&!LL(e)?IL(n(e),t):n(JSON.parse(e))}g1.responseType="json";function IL(e,t){return!N(e)&&FA(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const PL={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function hk(e,t){let n,i,r,s;return e=g1(e,t),t&&t.feature?(n=J5,r=t.feature):t&&t.mesh?(n=Z5,r=t.mesh,s=PL[t.filter]):D("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):D("Invalid TopoJSON object: "+r),i&&i.features||[i]}hk.responseType="json";const Kc={dsv:h1,csv:E2(","),tsv:E2(" "),json:g1,topojson:hk};function p1(e,t){return arguments.length>1?(Kc[e]=t,this):K(Kc,e)?Kc[e]:null}function gk(e){const t=p1(e);return t&&t.responseType||"text"}function pk(e,t,n,i){t=t||{};const r=p1(t.type||"json");return r||D("Unknown data format type: "+t.type),e=r(e,t),t.parse&&zL(e,t.parse,n,i),K(e,"columns")&&delete e.columns,e}function zL(e,t,n,i){if(!e.length)return;const r=Xu();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=dk(e,s)),s=Object.keys(t);const d=s.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!dm[g])throw Error("Illegal format pattern: "+h+":"+g);return dm[g]});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 jd=SL(typeof fetch<"u"&&fetch,null);function Ud(e){const t=e||Ct,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 Jc(e,t){try{await t(e)}catch(n){e.error(n)}}const mk=Symbol("vega_id");let BL=1;function qd(e){return!!(e&&ne(e))}function ne(e){return e[mk]}function yk(e,t){return e[mk]=t,e}function ye(e){const t=e===Object(e)?e:{data:e};return ne(t)?t:yk(t,BL++)}function m1(e){return Wd(e,ye({}))}function Wd(e,t){for(const n in e)t[n]=e[n];return t}function bk(e,t){return yk(t,ne(e))}function la(e,t){return e?t?(n,i)=>e(n,i)||ne(t(n))-ne(t(i)):(n,i)=>e(n,i)||ne(n)-ne(i):null}function vk(e){return e&&e.constructor===ls}function ls(){const e=[],t=[],n=[],i=[],r=[];let s=null,a=!1;return{constructor:ls,insert(o){const u=X(o),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(o){const u=oe(o)?i:t,l=X(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:$t(l)};return oe(o)?(c.filter=o,r.push(c)):(c.tuple=o,n.push(c)),this},encode(o,u){return oe(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,h,g,p,m;for(f=0,d=u.length;f<d;++f)l[ne(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[ne(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[ne(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=ne(p),l[m]?l[m]=1:o.add.push(ye(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[ne(p)]<0&&o.rem.push(p);function y(b,v,x){x?b[v]=x(b):o.encode=v,a||(c[ne(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[ne(p)],m>0&&(y(p,g,h.value),o.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[ne(b)]>0&&y(b,h.field,h.value)}),o.modifies(h.field);if(a)o.mod=t.length||i.length?u.filter(b=>l[ne(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 Qc="_:mod:_";function Gd(){Object.defineProperty(this,Qc,{writable:!0,value:{}})}Gd.prototype={set(e,t,n,i){const r=this,s=r[e],a=r[Qc];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]=N(n)?1+n.length:-1),r},modified(e,t){const n=this[Qc];if(arguments.length){if(N(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[Qc]={},this}};let jL=0;const UL="pulse",qL=new Gd,WL=1,GL=2;function Ae(e,t,n,i){this.id=++jL,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 _2(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ae.prototype={targets(){return this._targets||(this._targets=Ud(_l))},set(e){return this.value!==e?(this.value=e,1):0},skip:_2(WL),modified:_2(GL),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Gd,r=this._argops=this._argops||[],s=[];let a,o,u,l;const c=(f,d,h)=>{h instanceof Ae?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(a in e)if(o=e[a],a===UL)X(o).forEach(f=>{f instanceof Ae?f!==this&&(f.targets().add(this),s.push(f)):D("Pulse parameters must be operator instances.")}),this.source=o;else if(N(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||qL,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 HL(e,t,n,i){let r=1,s;return e instanceof Ae?s=e:e&&e.prototype instanceof Ae?s=new e:oe(e)?s=new Ae(null,e):(r=0,s=new Ae(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function VL(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 XL=0;function Hd(e,t,n){this.id=++XL,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Sr(e,t,n){return new Hd(e,t,n)}Hd.prototype={_filter:Nn,_apply:Ct,targets(){return this._targets||(this._targets=Ud(_l))},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=Sr(e);return this.targets().add(t),t},apply(e){const t=Sr(null,e);return this.targets().add(t),t},merge(){const e=Sr();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=Sr();return this.targets().add(Sr(null,null,r1(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(Sr(null,null,()=>n=!0)),t.targets().add(Sr(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Nn,this._targets=null}};function YL(e,t,n,i){const r=this,s=Sr(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=X(e);const u=o.length;for(let l=0;l<u;++l)o[l].addEventListener(t,a);return s}function KL(e,t){const n=this.locale();return pk(e,t,n.timeParse,n.utcParse)}function JL(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function QL(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:gk(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 ZL(e,t,n){const i=this,r=i._pending||eI(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Nn).insert(s.data||[])),r.done(),s}function eI(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 tI={skip:!0};function nI(e,t,n,i,r){return(e instanceof Ae?rI:iI)(this,e,t,n,i,r),this}function iI(e,t,n,i,r,s){const a=ae({},s,tI);let o,u;oe(n)||(n=$t(n)),i===void 0?o=l=>e.touch(n(l)):oe(i)?(u=new Ae(null,i,r,!1),o=l=>{u.evaluate(l);const c=n(l),f=u.value;vk(f)?e.pulse(c,f,s):e.update(c,f,a)}):o=l=>e.update(n(l),i,a),t.apply(o)}function rI(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const a=s||{},o=new Ae(null,sI(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 sI(e,t){return t=oe(t)?t:$t(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function aI(e){e.rank=++this._rank}function oI(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&&D("Cycle detected in dataflow graph.")}const $f={},wi=1,Cr=2,Ji=4,uI=wi|Cr,S2=wi|Ji,Sa=wi|Cr|Ji,A2=8,Zo=16,k2=32,C2=64;function Gr(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Mg(e,t){const n=[];return kr(e,t,i=>n.push(i)),n}function $2(e,t){const n={};return e.visit(t,i=>{n[ne(i)]=1}),i=>n[ne(i)]?null:i}function bc(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Gr.prototype={StopPropagation:$f,ADD:wi,REM:Cr,MOD:Ji,ADD_REM:uI,ADD_MOD:S2,ALL:Sa,REFLOW:A2,SOURCE:Zo,NO_SOURCE:k2,NO_FIELDS:C2,fork(e){return new Gr(this.dataflow).init(this,e)},clone(){const e=this.fork(Sa);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(Sa|Zo)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Gr(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&C2)&&(n.fields=e.fields),t&wi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Cr?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Ji?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&k2?(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||Sa;return t&wi&&this.add.length||t&Cr&&this.rem.length||t&Ji&&this.mod.length},reflow(e){if(e)return this.fork(Sa).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ji,$2(this,wi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return N(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?N(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&wi&&(n.addF=bc(n.addF,t)),e&Cr&&(n.remF=bc(n.remF,t)),e&Ji&&(n.modF=bc(n.modF,t)),e&Zo&&(n.srcF=bc(n.srcF,t)),n},materialize(e){e=e||Sa;const t=this;return e&wi&&t.addF&&(t.add=Mg(t.add,t.addF),t.addF=null),e&Cr&&t.remF&&(t.rem=Mg(t.rem,t.remF),t.remF=null),e&Ji&&t.modF&&(t.mod=Mg(t.mod,t.modF),t.modF=null),e&Zo&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Zo)return kr(n.source,n.srcF,i),n;e&wi&&kr(n.add,n.addF,i),e&Cr&&kr(n.rem,n.remF,i),e&Ji&&kr(n.mod,n.modF,i);const r=n.source;if(e&A2&&r){const s=n.add.length+n.mod.length;s===r.length||(s?kr(r,$2(n,S2),i):kr(r,n.srcF,i))}return n}};function y1(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}G(y1,Gr,{fork(e){const t=new Gr(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?N(e)?e.some(i=>n[i]):n[e]:0},filter(){D("MultiPulse does not support filtering.")},materialize(){D("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 lI(e,t,n){const i=this,r=[];if(i._pulse)return xk(i);if(i._pending&&await i._pending,t&&await Jc(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new Gr(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ud(_l);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=$f),u!==$f&&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 Jc(i,c[f].callback)}return n&&await Jc(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 cI(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 fI(e,t,n){return this._pulse?xk(this):(this.evaluate(e,t,n),this)}function dI(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 xk(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function hI(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function gI(e,t){const n=e.source,i=this._clock;return n&&N(n)?new y1(this,i,n.map(r=>r.pulse),t):this._input[e.id]||pI(this._pulse,n&&n.pulse)}function pI(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==$f&&(e.source=t.source),e)}const b1={skip:!1,force:!1};function mI(e,t){const n=t||b1;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function yI(e,t,n){const i=n||b1;return(e.set(t)||i.force)&&this.touch(e,i),this}function bI(e,t,n){this.touch(e,n||b1);const i=new Gr(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 vI(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),wk(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,xI(t,0,e)):i=n,i}}}function wk(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 xI(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,wk(e,i,t,n)}function Ga(){this.logger(Z0()),this.logLevel(J0),this._clock=0,this._rank=0,this._locale=d1();try{this._loader=jd()}catch{}this._touched=Ud(_l),this._input={},this._pulse=null,this._heap=vI((e,t)=>e.qrank-t.qrank),this._postrun=[]}function eu(e){return function(){return this._log[e].apply(this,arguments)}}Ga.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:eu("error"),warn:eu("warn"),info:eu("info"),debug:eu("debug"),logLevel:eu("level"),cleanThreshold:1e4,add:HL,connect:VL,rank:aI,rerank:oI,pulse:bI,touch:mI,update:yI,changeset:ls,ingest:JL,parse:KL,preload:ZL,request:QL,events:YL,on:nI,evaluate:lI,run:fI,runAsync:cI,runAfter:dI,_enqueue:hI,_getPulse:gI};function O(e,t){Ae.call(this,e,null,t)}G(O,Ae,{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 to={};function Ek(e){const t=_k(e);return t&&t.Definition||null}function _k(e){return e=e&&e.toLowerCase(),K(to,e)?to[e]:null}function*Sk(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 v1(e,t,n){const i=Float64Array.from(Sk(e,n));return i.sort(eA),t.map(r=>PN(i,r))}function x1(e,t){return v1(e,[.25,.5,.75],t)}function w1(e,t){const n=e.length,i=zN(e,t),r=x1(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 Ak(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 h=e.span||a-s||Math.abs(s)||1;if(e.step)o=e.step;else if(e.steps){for(c=h/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(h)/i)-u));Math.ceil(h/o)>t;)o*=n;for(f=0,d=r.length;f<d;++f)c=o/r[f],c>=l&&h/c<=t&&(o=c)}c=Math.log(o);const g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/o+p)*o,s=s<c?c-o:c,a=Math.ceil(a/o)*o),{start:s,stop:a===s?s+o:a,step:o}}var Ln=Math.random;function wI(e){Ln=e}function kk(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(Sk(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[~~(Ln()*s)];c[l]=o/s}return c.sort(eA),[r2(c,n/2),r2(c,1-n/2)]}function Ck(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?EI(s,t+t/4):s}function EI(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 _I(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function SI(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*Ln())},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 $k=Math.sqrt(2*Math.PI),AI=Math.SQRT2;let tu=NaN;function Vd(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(tu===tu)n=tu,tu=NaN;else{do n=Ln()*2-1,i=Ln()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,tu=i*s}return e+n*t}function E1(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*$k)}function Xd(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 Yd(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*AI*kI(2*e-1)}function kI(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 _1(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:()=>Vd(n,i),pdf:s=>E1(s,n,i),cdf:s=>Xd(s,n,i),icdf:s=>Yd(s,n,i)};return r.mean(e).stdev(t)}function S1(e,t){const n=_1();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=w1(e)),r):t},sample(){return e[~~(Ln()*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 A1(e,t){return e=e||0,t=t??1,Math.exp(e+Vd()*t)}function k1(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*$k*e)}function C1(e,t,n){return Xd(Math.log(e),t,n)}function $1(e,t,n){return Math.exp(Yd(e,t,n))}function Fk(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:()=>A1(n,i),pdf:s=>k1(s,n,i),cdf:s=>C1(s,n,i),icdf:s=>$1(s,n,i)};return r.mean(e).stdev(t)}function Ok(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=Ln();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 F1(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Ln()}function O1(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function T1(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function R1(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Tk(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:()=>F1(n,i),pdf:s=>O1(s,n,i),cdf:s=>T1(s,n,i),icdf:s=>R1(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function D1(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 Al(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 Kd(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));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 kl(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 No(e,t,n,i,r){let s=0,a=0;return kl(e,t,n,(o,u)=>{const l=u-r(o),c=u-i;s+=l*l,a+=c*c}),1-s/a}function N1(e,t,n){let i=0,r=0,s=0,a=0,o=0;kl(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=Al(i,r,s,a),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:No(e,t,n,r,l)}}function Rk(e,t,n){let i=0,r=0,s=0,a=0,o=0;kl(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=Al(i,r,s,a),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:No(e,t,n,r,l)}}function Dk(e,t,n){const[i,r,s,a]=Kd(e,t,n);let o=0,u=0,l=0,c=0,f=0,d,h,g;kl(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),g=d*v,o+=(v*h-o)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=Al(u/a,o/a,l/a,c/a),y=b=>Math.exp(p+m*(b-s));return{coef:[Math.exp(p-m*s),m],predict:y,rSquared:No(e,t,n,a,y)}}function Nk(e,t,n){let i=0,r=0,s=0,a=0,o=0,u=0;kl(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,s+=(h*g-s)/u,a+=(h*h-a)/u,o+=(d-o)/u});const l=Al(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:No(e,t,n,o,c)}}function M1(e,t,n){const[i,r,s,a]=Kd(e,t,n),o=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<o;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,_=w=>(w=w-s,v*w*w+x*w+E+a);return{coef:[E-x*s+v*s*s+a,x-2*v*s,v],predict:_,rSquared:No(e,t,n,a,_)}}function Mk(e,t,n,i){if(i===0)return D1(e,t,n);if(i===1)return N1(e,t,n);if(i===2)return M1(e,t,n);const[r,s,a,o]=Kd(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*s[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=$I(c),b=v=>{v-=a;let x=o+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:CI(f,y,-a,o),predict:b,rSquared:No(e,t,n,o,b)}}function CI(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 $I(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 F2=2,O2=1e-12;function Lk(e,t,n,i){const[r,s,a,o]=Kd(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=F2;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],v=g[1],x=y-r[b]>r[v]-y?b:v;let E=0,_=0,w=0,S=0,A=0;const k=1/Math.abs(r[x]-y||1);for(let M=b;M<=v;++M){const C=r[M],$=s[M],T=FI(Math.abs(y-C)*k)*d[M],I=C*T;E+=T,_+=I,w+=$*T,S+=$*I,A+=C*I}const[F,L]=Al(_/E,w/E,S/E,A/E);c[m]=F+L*y,f[m]=Math.abs(s[m]-c[m]),OI(r,m+1,g)}if(h===F2)break;const p=tA(f);if(Math.abs(p)<O2)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?O2:(b=1-y*y)*b}return TI(r,c,a,o)}function FI(e){return(e=1-e*e*e)*e*e}function OI(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 TI(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 RI=.5*Math.PI/180;function Jd(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],s=t[0],a=t[1],o=a-s,u=o/i,l=[r(s)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(s+p/n*o));return l.push(r(a)),l}else{c.push(r(a));for(let p=n;--p>0;)c.push(r(s+p/n*o))}let f=l[0],d=c[c.length-1];const h=1/o,g=DI(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&NI(f,p,d,h,g)>RI?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function DI(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 NI(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 MI(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 hm(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:MI(e)}function Ik(e,t,n){return n||e+(t?"_"+t:"")}const Lg=()=>{},LI={init:Lg,add:Lg,rem:Lg,idx:0},Yu={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}},Cl=Object.keys(Yu).filter(e=>e!=="__count__");function II(e,t){return(n,i)=>ae({name:e,aggregate_param:i,out:n||e},LI,t)}[...Cl,"__count__"].forEach(e=>{Yu[e]=II(e,Yu[e])});function Pk(e,t,n){return Yu[e](n,t)}function zk(e,t){return e.idx-t.idx}function PI(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=Yu[r]())})};return e.forEach(n),Object.values(t).sort(zk)}function zI(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function BI(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function jI(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function UI(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function Bk(e,t){const n=t||Ct,i=PI(e),r=e.slice().sort(zk);function s(a){this._ops=i,this._out=r,this.cell=a,this.init()}return s.prototype.init=zI,s.prototype.add=BI,s.prototype.rem=jI,s.prototype.set=UI,s.prototype.get=n,s.fields=e.map(a=>a.out),s}function L1(e){this._key=e?Dn(e):ne,this.reset()}const gt=L1.prototype;gt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};gt.add=function(e){this._add.push(e)};gt.rem=function(e){this._rem.push(e)};gt.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};gt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",K(n,s)||(n[s]=1,++r);return r};gt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=CA(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};gt.argmin=function(e){return this.extent(e)[0]||{}};gt.argmax=function(e){return this.extent(e)[1]||{}};gt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};gt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};gt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=x1(this.values(),e),this._get=e),this._q};gt.q1=function(e){return this.quartile(e)[0]};gt.q2=function(e){return this.quartile(e)[1]};gt.q3=function(e){return this.quartile(e)[2]};gt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=kk(this.values(),1e3,.05,e),this._get=e),this._ci};gt.ci0=function(e){return this.ci(e)[0]};gt.ci1=function(e){return this.ci(e)[1]};function Yr(e){O.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Yr.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Cl},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(Yr,O,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,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 h=o?o+"|"+d:d;u[c]=f[d],l<r?a(h,u,l):t[h]||e.cell(h,u)}}a("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=X(_t(b)),x=v.length;let E=0,_;for(;E<x;++E)i[_=v[E]]||(i[_]=1,t.push(_))}this._dims=X(e.groupby),this._dnames=this._dims.map(b=>{const v=Pe(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:hm(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,h,g,p,m,y;for(l!==a.length&&D("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=a[y],h=o[y]||null,f==null&&d!=="count"&&D("Null aggregate field specified."),p=Pe(f),m=Ik(d,p,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}g=c[p],g||(r(f),g=c[p]=[],g.field=f,this._measures.push(g)),d!=="count"&&(this._countOnly=!1),g.push(Pk(d,h,m))}return this._measures=this._measures.map(b=>Bk(b,b.field)),Object.create(null)},cellkey:hm(),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 L1),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?bk(t.tuple,s):ye(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 qI=1e-14;function I1(e){O.call(this,null,e)}I1.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(I1,O,{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(_t(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=Ak(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=wt(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(qI+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=on(u,_t(t),e.name||"bin_"+Pe(t))}});function jk(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?DA(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function P1(e){O.call(this,[],e)}P1.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(P1,O,{transform(e,t){const n=t.fork(t.ALL),i=jk(ne,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(la(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function Uk(e){Ae.call(this,null,WI,e)}G(Uk,Ae);function WI(e){return this.value&&!e.modified()?this.value:i1(e.fields,e.orders)}function z1(e){O.call(this,null,e)}z1.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 GI(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(z1,O,{transform(e,t){const n=f=>d=>{for(var h=GI(o(d),e.case,s)||[],g,p=0,m=h.length;p<m;++p)a.test(g=h[p])||f(g)},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=ye({}),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 B1(e){O.call(this,null,e)}B1.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(B1,O,{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=HI(o,r,s,e.filter||Nn)):n.mod=o,n.source=this.value,n.modifies(i)}});function HI(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(ye(s)),s={},s[t]=l);return r}const T2={kde:S1,mixture:Ok,normal:_1,lognormal:Fk,uniform:Tk},VI="distributions",R2="function",XI="field";function qk(e,t){const n=e[R2];K(T2,n)||D("Unknown distribution function: "+n);const i=T2[n]();for(const r in e)r===XI?i.data((e.from||t()).map(e[r])):r===VI?i[r](e[r].map(s=>qk(s,t))):typeof i[r]===R2&&i[r](e[r]);return i}function j1(e){O.call(this,null,e)}const Wk=[{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}]}],YI={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Wk},{name:"weights",type:"number",array:!0}]};j1.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Wk.concat(YI)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(j1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=qk(e.distribution,KI(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let a=e.method||"pdf";a!=="pdf"&&a!=="cdf"&&D("Invalid density method: "+a),!e.extent&&!i.data&&D("Missing density extent parameter."),a=i[a];const o=e.as||["value","density"],u=e.extent||Oi(i.data()),l=Jd(a,u,r,s).map(c=>{const f={};return f[o[0]]=c[0],f[o[1]]=c[1],ye(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function KI(e){return()=>e.materialize(e.SOURCE).source}function Gk(e,t){return e?e.map((n,i)=>t[i]||Pe(n)):null}function U1(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 Hk="bin";function q1(e){O.call(this,null,e)}q1.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:Hk}]};const JI=(e,t)=>Sl(Oi(e,t))/30;G(q1,O,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=U1(t.source,e.groupby,Ct),r=e.smooth||!1,s=e.field,a=e.step||JI(n,s),o=la((g,p)=>s(g)-s(p)),u=e.as||Hk,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(o);h=-1;for(const p of Ck(g,a,r,s))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:a},t.reflow(!0).modifies(u)}});function Vk(e){Ae.call(this,null,QI,e),this.modified(!0)}G(Vk,Ae);function QI(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:on(n=>t(n,e),_t(t),Pe(t))}function W1(e){O.call(this,[void 0,void 0],e)}W1.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(W1,O,{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=wt(i(o));u!=null&&(u<s&&(s=u),u>a&&(a=u))}),!Number.isFinite(s)||!Number.isFinite(a)){let o=Pe(i);o&&(o=` for field "${o}"`),t.dataflow.warn(`Infinite extent${o}: [${s}, ${a}]`),s=a=void 0}this.value=[s,a]}});function G1(e,t){Ae.call(this,e),this.parent=t,this.count=0}G(G1,Ae,{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 Qd(e){O.call(this,{},e),this._keys=To();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Qd,O,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=K(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 G1(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=ne(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(ne(u),l),o(l).add(u)}),a||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ne(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(ne(u))).mod(u)}),a&&t.visit(t.REFLOW,u=>{const l=ne(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 Xk(e){Ae.call(this,null,ZI,e)}G(Xk,Ae);function ZI(e){return this.value&&!e.modified()?this.value:N(e.name)?X(e.name).map(t=>Dn(t)):Dn(e.name,e.as)}function H1(e){O.call(this,To(),e)}H1.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(H1,O,{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=ne(f);i.has(d)?i.delete(d):a.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(ne(f),1)});function c(f){const d=ne(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),s.push(f)):!h&&!g?(i.set(d,1),a.push(f)):l&&h&&!g&&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 V1(e){O.call(this,[],e)}V1.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(V1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Gk(i,e.as||[]),s=e.index||null,a=r.length;return n.rem=this.value,t.visit(t.SOURCE,o=>{const u=i.map(g=>g(o)),l=u.reduce((g,p)=>Math.max(g,p.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=m1(o),f=0;f<a;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function X1(e){O.call(this,[],e)}X1.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(X1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Pe),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=m1(l),f[a]=r[c],f[o]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function Y1(e){O.call(this,null,e)}Y1.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(Y1,O,{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 Yk(e){O.call(this,[],e)}G(Yk,O,{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=ye(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 vc={value:"value",median:tA,mean:BN,min:jN,max:Mu},eP=[];function K1(e){O.call(this,[],e)}K1.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 tP(e){var t=e.method||vc.value,n;if(vc[t]==null)D("Unrecognized imputation method: "+t);else return t===vc.value?(n=e.value!==void 0?e.value:0,()=>n):vc[t]}function nP(e){const t=e.field;return n=>n?t(n):NaN}G(K1,O,{transform(e,t){var n=t.fork(t.ALL),i=tP(e),r=nP(e),s=Pe(e.field),a=Pe(e.key),o=(e.groupby||[]).map(Pe),u=iP(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],E={_impute:!0},y=0,x=g.length;y<x;++y)E[o[y]]=g[y];E[a]=p,E[s]=Number.isNaN(h)?h=i(d,r):h,l.push(ye(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 iP(e,t,n,i){var r=y=>y(m),s=[],a=i?i.slice():[],o={},u={},l,c,f,d,h,g,p,m;for(a.forEach((y,b)=>o[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=o[g]||(o[g]=a.push(g)),c=(l=t?t.map(r):eP)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=a,s}function J1(e){Yr.call(this,e)}J1.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:Cl},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(J1,Yr,{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=>{ae(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 Q1(e){O.call(this,null,e)}Q1.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Q1,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=U1(i,e.groupby,e.field),s=(e.groupby||[]).map(Pe),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"&&D("Invalid density method: "+o),e.resolve==="shared"&&(c||(c=Oi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=S1(h,a)[o],p=e.counts?h.length:1,m=c||Oi(h);Jd(g,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*p,l.push(ye(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Kk(e){Ae.call(this,null,rP,e)}G(Kk,Ae);function rP(e){return this.value&&!e.modified()?this.value:s1(e.fields,e.flat)}function Jk(e){O.call(this,[],e),this._pending=null}G(Jk,O,{transform(e,t){const n=t.dataflow;return this._pending?Ig(this,t,this._pending):sP(e)?t.StopPropagation:e.values?Ig(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=X(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Ig(this,t,X(i.data)))}});function sP(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Ig(e,t,n){n.forEach(ye);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 Z1(e){O.call(this,{},e)}Z1.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(Z1,O,{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,h;return r?(d=r.length,o>1&&!c&&D('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==o*d&&D('The "as" parameter has too few output field names.'),c=c||r.map(Pe),f=function(g){for(var p=0,m=0,y,b;p<o;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=s;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||D("Missing output field names."),f=function(g){for(var p=0,m;p<o;++p)m=i.get(n[p](g)),g[c[p]]=m??s}),a?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function Qk(e){Ae.call(this,null,aP,e)}G(Qk,Ae);function aP(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 Zk(e){Ae.call(this,null,oP,e)}G(Zk,Ae);function oP(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function eC(e){O.call(this,null,e)}G(eC,O,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function ey(e){Yr.call(this,e)}ey.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:Cl,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(ey,Yr,{_transform:Yr.prototype.transform,transform(e,t){return this._transform(uP(e,t),t)}});function uP(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=_t(n).concat(_t(i)),a=cP(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=>lP(o,n,i,s)),as:a.map(o=>o+""),modified:e.modified.bind(e)}}function lP(e,t,n,i){return on(r=>t(r)===e?n(r):NaN,i,e+"")}function cP(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(zd),t?r.slice(0,t):r}function tC(e){Qd.call(this,e)}G(tC,Qd,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(ne(s),n,t,s);return(e.modified("field")||i&&t.modified(_t(i)))&&D("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(ye(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 ty(e){O.call(this,null,e)}ty.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(ty,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Gk(e.fields,e.as||[]),s=i?(o,u)=>fP(o,u,i,r):Wd;let a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,o=>{const u=ne(o);n.rem.push(a[u]),a[u]=null}),t.visit(t.ADD,o=>{const u=s(o,ye({}));a[ne(o)]=u,n.add.push(u)}),t.visit(t.MOD,o=>{n.mod.push(s(o,a[ne(o)]))}),n}});function fP(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function nC(e){O.call(this,null,e)}G(nC,O,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function ny(e){O.call(this,null,e)}ny.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 dP=1e-14;G(ny,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=U1(r,e.groupby,e.field),a=(e.groupby||[]).map(Pe),o=[],u=e.step||.01,l=e.probs||pn(u/2,1-dP,u),c=l.length;return s.forEach(f=>{const d=v1(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<a.length;++p)g[a[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],o.push(ye(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=o,n}});function iC(e){O.call(this,null,e)}G(iC,O,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=ne(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=m1(r);i[ne(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[ne(r)];for(const a in r)s[a]=r[a],n.modifies(a);n.mod.push(s)})),n}});function iy(e){O.call(this,[],e),this.count=0}iy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(iy,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[ne(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)*Ln()),d<a.length&&d>=u&&(f=a[d],s[ne(f)]&&n.rem.push(f),a[d]=c)),++o}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ne(c);s[f]&&(s[f]=-1,n.rem.push(c)),--o}),a=a.filter(c=>s[ne(c)]!==-1)),(t.rem.length||i)&&a.length<r&&t.source&&(u=o=a.length,t.visit(t.SOURCE,c=>{s[ne(c)]||l(c)}),u=-1),i&&a.length>r){const c=a.length-r;for(let f=0;f<c;++f)s[ne(a[f])]=-1,n.rem.push(a[f]);a=a.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[ne(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(c=>!s[ne(c)])),this.count=o,this.value=n.source=a,n}});function ry(e){O.call(this,null,e)}ry.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(ry,O,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=pn(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,ye(s)}),n.add=t.add.concat(this.value),n}});function rC(e){O.call(this,null,e),this.modified(!0)}G(rC,O,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function sy(e){O.call(this,null,e)}const sC=["unit0","unit1"];sy.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:l1,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:sC}]};G(sy,O,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),a=(r?Do:Ro)(s.unit).offset,o=e.as||sC,u=o[0],l=o[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(_t(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=s(p),i&&(g[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}:nk({extent:e.extent||Oi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=c1(i),a=this.value||{},o=(n?VA:HA)(s,r);return o.unit=fe(s),o.units=s,o.step=r,o.start=a.start,o.stop=a.stop,this.value=o}});function aC(e){O.call(this,To(),e)}G(aC,O,{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 oC(e){O.call(this,null,e)}G(oC,O,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(la(e.sort)):t.source).map(e.field))}});function hP(e,t,n,i){const r=Ku[e](t,n);return{init:r.init||Tr,update:function(s,a){a[i]=r.next(s)}}}const Ku={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=Ku.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||D("ntile num must be greater than zero.");const n=Ku.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||D("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=gP(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function gP(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const pP=Object.keys(Ku);function uC(e){const t=X(e.ops),n=X(e.fields),i=X(e.params),r=X(e.aggregate_params),s=X(e.as),a=this.outputs=[],o=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){X(_t(g)).forEach(p=>u[p]=1)}h(e.sort),t.forEach((g,p)=>{const m=n[p],y=i[p],b=r[p]||null,v=Pe(m),x=Ik(g,v,s[p]);if(h(m),a.push(x),K(Ku,g))o.push(hP(g,m,y,x));else{if(m==null&&g!=="count"&&D("Null aggregate field specified."),g==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(Pk(g,b,x))}}),(c.length||f.length)&&(this.cell=mP(f,c,d)),this.inputs=Object.keys(u)}const lC=uC.prototype;lC.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};lC.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 mP(e,t,n){e=e.map(u=>Bk(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 L1;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 ay(e){O.call(this,{},e),this._mlen=0,this._mods=[]}ay.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:pP.concat(Cl)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(ay,O,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=la(e.sort),r=hm(e.groupby),s=o=>this.group(r(o));let a=this.state;(!a||n)&&(a=this.state=new uC(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)yP(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]=jk(ne),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function yP(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?H0(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:o,compare:r||$t(-1)};t.init();for(let f=0;f<u;++f)bP(c,a,f,u),s&&vP(c,l),t.update(c,o[f])}function bP(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 vP(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 xP=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Yr,bin:I1,collect:P1,compare:Uk,countpattern:z1,cross:B1,density:j1,dotbin:q1,expression:Vk,extent:W1,facet:Qd,field:Xk,filter:H1,flatten:V1,fold:X1,formula:Y1,generate:Yk,impute:K1,joinaggregate:J1,kde:Q1,key:Kk,load:Jk,lookup:Z1,multiextent:Qk,multivalues:Zk,params:eC,pivot:ey,prefacet:tC,project:ty,proxy:nC,quantile:ny,relay:iC,sample:iy,sequence:ry,sieve:rC,subflow:G1,timeunit:sy,tupleindex:aC,values:oC,window:ay},Symbol.toStringTag,{value:"Module"}));function wP(e){return e.innerRadius}function EP(e){return e.outerRadius}function _P(e){return e.startAngle}function SP(e){return e.endAngle}function AP(e){return e&&e.padAngle}function kP(e,t,n,i,r,s,a,o){var u=n-e,l=i-t,c=a-r,f=o-s,d=f*u-c*l;if(!(d*d<yt))return d=(c*(t-s)-f*(e-r))/d,[e+d*u,t+d*l]}function xc(e,t,n,i,r,s,a){var o=e-n,u=t-i,l=(a?s:-s)/Ia(o*o+u*u),c=l*u,f=-l*o,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,v=p-h,x=b*b+v*v,E=r-s,_=d*p-g*h,w=(v<0?-1:1)*Ia(WN(0,E*E*
vendor: 13,495 bytes, line 9
9x-_*_)),S=(_*v-b*w)/x,A=(-_*b-v*w)/x,k=(_*v+b*w)/x,F=(-_*b+v*w)/x,L=S-m,M=A-y,C=k-m,$=F-y;return L*L+M*M>C*C+$*$&&(S=k,A=F),{cx:S,cy:A,x01:-c,y01:-f,x11:S*(r/E-1),y11:A*(r/E-1)}}function CP(){var e=wP,t=EP,n=ke(0),i=null,r=_P,s=SP,a=AP,o=null,u=V0(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-a2,p=s.apply(this,arguments)-a2,m=o2(p-g),y=p>g;if(o||(o=c=u()),h<d&&(f=h,h=d,d=f),!(h>yt))o.moveTo(0,0);else if(m>UN-yt)o.moveTo(h*vs(g),h*yi(g)),o.arc(0,0,h,g,p,!y),d>yt&&(o.moveTo(d*vs(p),d*yi(p)),o.arc(0,0,d,p,g,y));else{var b=g,v=p,x=g,E=p,_=m,w=m,S=a.apply(this,arguments)/2,A=S>yt&&(i?+i.apply(this,arguments):Ia(d*d+h*h)),k=$g(o2(h-d)/2,+n.apply(this,arguments)),F=k,L=k,M,C;if(A>yt){var $=u2(A/d*yi(S)),T=u2(A/h*yi(S));(_-=$*2)>yt?($*=y?1:-1,x+=$,E-=$):(_=0,x=E=(g+p)/2),(w-=T*2)>yt?(T*=y?1:-1,b+=T,v-=T):(w=0,b=v=(g+p)/2)}var I=h*vs(b),W=h*yi(b),j=d*vs(E),J=d*yi(E);if(k>yt){var ue=h*vs(v),se=h*yi(v),be=d*vs(x),Ue=d*yi(x),he;if(m<s2)if(he=kP(I,W,be,Ue,ue,se,j,J)){var qt=I-he[0],Yo=W-he[1],_a=ue-he[0],fc=se-he[1],dc=1/yi(qN((qt*_a+Yo*fc)/(Ia(qt*qt+Yo*Yo)*Ia(_a*_a+fc*fc)))/2),Ko=Ia(he[0]*he[0]+he[1]*he[1]);F=$g(k,(d-Ko)/(dc-1)),L=$g(k,(h-Ko)/(dc+1))}else F=L=0}w>yt?L>yt?(M=xc(be,Ue,I,W,h,L,y),C=xc(ue,se,j,J,h,L,y),o.moveTo(M.cx+M.x01,M.cy+M.y01),L<k?o.arc(M.cx,M.cy,L,pt(M.y01,M.x01),pt(C.y01,C.x01),!y):(o.arc(M.cx,M.cy,L,pt(M.y01,M.x01),pt(M.y11,M.x11),!y),o.arc(0,0,h,pt(M.cy+M.y11,M.cx+M.x11),pt(C.cy+C.y11,C.cx+C.x11),!y),o.arc(C.cx,C.cy,L,pt(C.y11,C.x11),pt(C.y01,C.x01),!y))):(o.moveTo(I,W),o.arc(0,0,h,b,v,!y)):o.moveTo(I,W),!(d>yt)||!(_>yt)?o.lineTo(j,J):F>yt?(M=xc(j,J,ue,se,d,-F,y),C=xc(I,W,be,Ue,d,-F,y),o.lineTo(M.cx+M.x01,M.cy+M.y01),F<k?o.arc(M.cx,M.cy,F,pt(M.y01,M.x01),pt(C.y01,C.x01),!y):(o.arc(M.cx,M.cy,F,pt(M.y01,M.x01),pt(M.y11,M.x11),!y),o.arc(0,0,d,pt(M.cy+M.y11,M.cx+M.x11),pt(C.cy+C.y11,C.cx+C.x11),y),o.arc(C.cx,C.cy,F,pt(C.y11,C.x11),pt(C.y01,C.x01),!y))):o.arc(0,0,d,E,x,y)}if(o.closePath(),c)return o=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-s2/2;return[vs(f)*c,yi(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ke(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ke(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:ke(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:ke(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:ke(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:ke(+c),l):s},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ke(+c),l):a},l.context=function(c){return arguments.length?(o=c??null,l):o},l}function cC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fC(e){this._context=e}fC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function oy(e){return new fC(e)}function dC(e){return e[0]}function hC(e){return e[1]}function gC(e,t){var n=ke(!0),i=null,r=oy,s=null,a=V0(o);e=typeof e=="function"?e:e===void 0?dC:ke(e),t=typeof t=="function"?t:t===void 0?hC:ke(t);function o(u){var l,c=(u=cC(u)).length,f,d=!1,h;for(i==null&&(s=r(h=a())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(f,l,u),+t(f,l,u));if(h)return s=null,h+""||null}return o.x=function(u){return arguments.length?(e=typeof u=="function"?u:ke(+u),o):e},o.y=function(u){return arguments.length?(t=typeof u=="function"?u:ke(+u),o):t},o.defined=function(u){return arguments.length?(n=typeof u=="function"?u:ke(!!u),o):n},o.curve=function(u){return arguments.length?(r=u,i!=null&&(s=r(i)),o):r},o.context=function(u){return arguments.length?(u==null?i=s=null:s=r(i=u),o):i},o}function pC(e,t,n){var i=null,r=ke(!0),s=null,a=oy,o=null,u=V0(l);e=typeof e=="function"?e:e===void 0?dC:ke(+e),t=typeof t=="function"?t:t===void 0?ke(0):ke(+t),n=typeof n=="function"?n:n===void 0?hC:ke(+n);function l(f){var d,h,g,p=(f=cC(f)).length,m,y=!1,b,v=new Array(p),x=new Array(p);for(s==null&&(o=a(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=d-1;g>=h;--g)o.point(v[g],x[g]);o.lineEnd(),o.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),o.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return o=null,b+""||null}function c(){return gC().defined(r).curve(a).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:ke(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ke(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:ke(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:ke(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ke(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ke(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:ke(!!f),l):r},l.curve=function(f){return arguments.length?(a=f,s!=null&&(o=a(s)),l):a},l.context=function(f){return arguments.length?(f==null?s=o=null:o=a(s=f),l):s},l}function Kr(){}function Ff(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Zd(e){this._context=e}Zd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ff(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $P(e){return new Zd(e)}function mC(e){this._context=e}mC.prototype={areaStart:Kr,areaEnd:Kr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function FP(e){return new mC(e)}function yC(e){this._context=e}yC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OP(e){return new yC(e)}function bC(e,t){this._basis=new Zd(e),this._beta=t}bC.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,a=t[n]-r,o=-1,u;++o<=n;)u=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+u*s),this._beta*t[o]+(1-this._beta)*(r+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const TP=function e(t){function n(i){return t===1?new Zd(i):new bC(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Of(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function uy(e,t){this._context=e,this._k=(1-t)/6}uy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Of(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Of(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const RP=function e(t){function n(i){return new uy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ly(e,t){this._context=e,this._k=(1-t)/6}ly.prototype={areaStart:Kr,areaEnd:Kr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Of(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const DP=function e(t){function n(i){return new ly(i,t)}return n.tension=function(i){return e(+i)},n}(0);function cy(e,t){this._context=e,this._k=(1-t)/6}cy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Of(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const NP=function e(t){function n(i){return new cy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function fy(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>yt){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>yt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,a,e._x2,e._y2)}function vC(e,t){this._context=e,this._alpha=t}vC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:fy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const MP=function e(t){function n(i){return t?new vC(i,t):new uy(i,0)}
vendor: 6,081 bytes, line 9
9return n.alpha=function(i){return e(+i)},n}(.5);function xC(e,t){this._context=e,this._alpha=t}xC.prototype={areaStart:Kr,areaEnd:Kr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LP=function e(t){function n(i){return t?new xC(i,t):new ly(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function wC(e,t){this._context=e,this._alpha=t}wC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const IP=function e(t){function n(i){return t?new wC(i,t):new cy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function EC(e){this._context=e}EC.prototype={areaStart:Kr,areaEnd:Kr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function PP(e){return new EC(e)}function D2(e){return e<0?-1:1}function N2(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return(D2(s)+D2(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function M2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Pg(e,t,n){var i=e._x0,r=e._y0,s=e._x1,a=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,r+o*t,s-o,a-o*n,s,a)}function Tf(e){this._context=e}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pg(this,this._t0,M2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Pg(this,M2(this,n=N2(this,e,t)),n);break;default:Pg(this,this._t0,n=N2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function _C(e){this._context=new SC(e)}(_C.prototype=Object.create(Tf.prototype)).point=function(e,t){Tf.prototype.point.call(this,t,e)};function SC(e){this._context=e}SC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function zP(e){return new Tf(e)}function BP(e){return new _C(e)}function AC(e){this._context=e}AC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=L2(e),r=L2(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function L2(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),a=new Array(n);for(r[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(r[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(a[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function jP(e){return new AC(e)}function eh(e,t){this._context=e,this._t=t}eh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 11,224 bytes, line 9
9default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function UP(e){return new eh(e,.5)}function qP(e){return new eh(e,0)}function WP(e){return new eh(e,1)}function Hr(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 GP=()=>typeof Image<"u"?Image:null;function HP(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function VP(e,t){var n=GN(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}var XP=1e-12;function I2(e){return((e=Math.exp(e))+1/e)/2}function YP(e){return((e=Math.exp(e))-1/e)/2}function KP(e){return((e=Math.exp(2*e))-1)/(e+1)}const JP=function e(t,n,i){function r(s,a){var o=s[0],u=s[1],l=s[2],c=a[0],f=a[1],d=a[2],h=c-o,g=f-u,p=h*h+g*g,m,y;if(p<XP)y=Math.log(d/l)/t,m=function(w){return[o+w*h,u+w*g,l*Math.exp(t*w*y)]};else{var b=Math.sqrt(p),v=(d*d-l*l+i*p)/(2*l*n*b),x=(d*d-l*l-i*p)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(x*x+1)-x);y=(_-E)/t,m=function(w){var S=w*y,A=I2(E),k=l/(n*b)*(A*KP(t*S+E)-YP(E));return[o+k*h,u+k*g,l*A/I2(t*S+E)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var a=Math.max(.001,+s),o=a*a,u=o*o;return e(a,o,u)},r}(Math.SQRT2,2,4),QP=Object.freeze(Object.defineProperty({__proto__:null,interpolate:nA,interpolateArray:HN,interpolateBasis:VN,interpolateBasisClosed:XN,interpolateCubehelix:YN,interpolateCubehelixLong:KN,interpolateDate:JN,interpolateDiscrete:HP,interpolateHcl:QN,interpolateHclLong:ZN,interpolateHsl:eM,interpolateHslLong:tM,interpolateHue:VP,interpolateLab:nM,interpolateNumber:iM,interpolateNumberArray:rM,interpolateObject:sM,interpolateRgb:aM,interpolateRgbBasis:oM,interpolateRgbBasisClosed:uM,interpolateRound:iA,interpolateString:lM,interpolateTransformCss:cM,interpolateTransformSvg:fM,interpolateZoom:JP,piecewise:rA,quantize:dM},Symbol.toStringTag,{value:"Module"}));function kC(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(u){return u!=null&&u<=u?r[Vu(i,u,0,n)]:s}function o(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return a}return a.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,o()):[e,t]},a.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,o()):r.slice()},a.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},a.unknown=function(u){return arguments.length&&(s=u),a},a.thresholds=function(){return i.slice()},a.copy=function(){return kC().domain([e,t]).range(r).unknown(s)},hM.apply(gM(a),arguments)}function dy(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const ZP="identity",no="linear",lr="log",$l="pow",Fl="sqrt",th="symlog",Vs="time",Xs="utc",Ci="sequential",Mo="diverging",io="quantile",nh="quantize",ih="threshold",hy="ordinal",gm="point",CC="band",gy="bin-ordinal",Ke="continuous",Ol="discrete",Tl="discretizing",zn="interpolating",py="temporal";function ez(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 tz(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 my(){const e=aA().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],h=i[1-d],g=dy(f,o,u);let p=i[d-0];r=(h-p)/(g||1),a&&(r=Math.floor(r)),p+=(h-p-r*(f-o))*l,s=r*(1-o),a&&(p=Math.round(p),s=Math.round(s));const m=pn(f).map(y=>p+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],h=d?n().reverse():n(),g=h.length-1;let p=+f[0],m=+f[1],y,b,v;if(!(p!==p||m!==m)&&(m<p&&(v=p,p=m,m=v),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Vu(h,p)-1),b=p===m?y:Vu(h,m)-1,p-h[y]>s+1e-10&&++y,d&&(v=y,y=g-b,b=g-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 my().domain(t()).range(i).round(a).paddingInner(o).paddingOuter(u).align(l)},c()}function $C(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return $C(t())},e}function nz(){return $C(my().paddingInner(1))}var iz=Array.prototype.map;function rz(e){return iz.call(e,wt)}const sz=Array.prototype.slice;function FC(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Vu(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=rz(i),n):e.slice()},n.range=function(i){return arguments.length?(t=sz.call(i),n):t.slice()},n.tickFormat=function(i,r){return NM(e[0],fe(e),i??10,r)},n.copy=function(){return FC().domain(n.domain()).range(n.range())},n}const Rf=new Map,OC=Symbol("vega_scale");function TC(e){return e[OC]=!0,e}function az(e){return e&&e[OC]===!0}function oz(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?ez(s):s.invertExtent?tz(s):void 0),s.type=e,TC(s)};return i.metadata=ti(X(n)),i}function me(e,t,n){return arguments.length>1?(Rf.set(e,oz(e,t,n)),this):RC(e)?Rf.get(e):void 0}me(ZP,pM);me(no,mM,Ke);me(lr,yM,[Ke,lr]);me($l,bM,Ke);me(Fl,vM,Ke);me(th,xM,Ke);me(Vs,wM,[Ke,py]);me(Xs,EM,[Ke,py]);me(Ci,sA,[Ke,zn]);me(`${Ci}-${no}`,sA,[Ke,zn]);me(`${Ci}-${lr}`,_M,[Ke,zn,lr]);me(`${Ci}-${$l}`,SM,[Ke,zn]);me(`${Ci}-${Fl}`,AM,[Ke,zn]);me(`${Ci}-${th}`,kM,[Ke,zn]);me(`${Mo}-${no}`,CM,[Ke,zn]);me(`${Mo}-${lr}`,$M,[Ke,zn,lr]);me(`${Mo}-${$l}`,FM,[Ke,zn]);me(`${Mo}-${Fl}`,OM,[Ke,zn]);me(`${Mo}-${th}`,TM,[Ke,zn]);me(io,RM,[Tl,io]);me(nh,kC,Tl);me(ih,DM,Tl);me(gy,FC,[Ol,Tl]);me(hy,aA,Ol);me(CC,my,Ol);me(gm,nz,Ol);function RC(e){return Rf.has(e)}function ca(e,t){const n=Rf.get(e);return n&&n.metadata[t]}function yy(e){return ca(e,Ke)}function ro(e){return ca(e,Ol)}function pm(e){return ca(e,Tl)}function DC(e){return ca(e,lr)}function uz(e){return ca(e,py)}function NC(e){return ca(e,zn)}function MC(e){return ca(e,io)}const lz=["clamp","base","constant","exponent"];function LC(e,t){const n=t[0],i=fe(t)-n;return function(r){return e(n+r*i)}}function rh(e,t,n){return rA(by(t||"rgb",n),e)}function IC(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function PC(e,t,n){const i=n-t;let r,s,a;return!i||!Number.isFinite(i)?$t(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),a=me(s)().domain([t,n]).range([0,1]),lz.forEach(o=>e[o]?a[o](e[o]()):0),a)}function by(e,t){const n=QP[cz(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function cz(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const fz={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5
9a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",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"},dz={accent:MM,category10:LM,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:IM,observable10:PM,paired:zM,pastel1:BM,pastel2:jM,set1:UM,set2:qM,set3:WM,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function zC(e){if(N(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 BC(e,t){for(const n in e)vy(n,t(e[n]))}const P2={};BC(dz,zC);BC(fz,e=>rh(zC(e)));function vy(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(P2[e]=t,this):P2[e]}const Zc="symbol",hz="discrete",gz="gradient",pz=e=>N(e)?e.map(t=>String(t)):String(e),mz=(e,t)=>e[1]-t[1],yz=(e,t)=>t[1]-e[1];function xy(e,t,n){let i;return pe(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Sl(e.domain())/n||1)+1))),V(t)&&(i=t.step,t=t.interval),Y(t)&&(t=e.type===Vs?Ro(t):e.type==Xs?Do(t):D("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function jC(e,t,n){let i=e.range(),r=i[0],s=fe(i),a=mz;if(r>s&&(i=s,s=r,r=i,a=yz),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],fe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=o)}return t}function wy(e,t){return e.bins?jC(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function UC(e,t,n,i,r,s){const a=t.type;let o=pz;if(a===Vs||r===Vs)o=e.timeFormat(i);else if(a===Xs||r===Xs)o=e.utcFormat(i);else if(DC(a)){const u=e.formatFloat(i);if(s||t.bins)o=u;else{const l=qC(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 qC(e,t,n){const i=wy(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 mm={[io]:"quantiles",[nh]:"thresholds",[ih]:"domain"},WC={[io]:"quantiles",[nh]:"domain"};function GC(e,t){return e.bins?xz(e.bins):e.type===lr?qC(e,t,!0):mm[e.type]?vz(e[mm[e.type]]()):wy(e,t)}function bz(e,t,n){const i=t[WC[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,3*10,n)}function vz(e){const t=[-1/0].concat(e);return t.max=1/0,t}function xz(e){const t=e.slice(0,-1);return t.max=fe(e),t}const wz=e=>mm[e.type]||e.bins;function HC(e,t,n,i,r,s,a){const o=WC[t.type]&&s!==Vs&&s!==Xs?bz(e,t,r):UC(e,t,n,r,s,a);return i===Zc&&wz(t)?Ez(o):i===hz?_z(o):Sz(o)}const Ez=e=>(t,n,i)=>{const r=z2(i[n+1],z2(i.max,1/0)),s=B2(t,e),a=B2(r,e);return s&&a?s+" â "+a:a?"< "+a:"⥠"+s},z2=(e,t)=>e??t,_z=e=>(t,n)=>n?e(t):null,Sz=e=>t=>e(t),B2=(e,t)=>
vendor: 31,470 bytes, line 9
9Number.isFinite(e)?t(e):null;function Az(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+fe(t),s=r-i;if(e.type===ih){const a=n?s/n:.1;i-=a,r+=a,s=r-i}return a=>(a-i)/s}function kz(e,t,n,i){const r=i||t.type;return Y(n)&&uz(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Vs?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Xs?e.utcFormat("%A, %d %B %Y, %X UTC"):HC(e,t,5,null,n,i,!0)}function VC(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=kz(e,t,n.format,n.formatType);if(pm(t.type)){const s=GC(t).slice(1).map(r),a=s.length;return`${a} boundar${a===1?"y":"ies"}: ${s.join(", ")}`}else if(ro(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(fe(s))}`}}let XC=0;function Cz(){XC=0}const Df="p_";function Ey(e){return e&&e.gradient}function YC(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Df:"";return r||(r=e.id="gradient_"+XC++,i==="radial"?(e.x1=bi(e.x1,.5),e.y1=bi(e.y1,.5),e.r1=bi(e.r1,0),e.x2=bi(e.x2,.5),e.y2=bi(e.y2,.5),e.r2=bi(e.r2,.5),s=Df):(e.x1=bi(e.x1,0),e.y1=bi(e.y1,0),e.x2=bi(e.x2,1),e.y2=bi(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function bi(e,t){return e??t}function KC(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 j2={basis:{curve:$P},"basis-closed":{curve:FP},"basis-open":{curve:OP},bundle:{curve:TP,tension:"beta",value:.85},cardinal:{curve:RP,tension:"tension",value:0},"cardinal-open":{curve:NP,tension:"tension",value:0},"cardinal-closed":{curve:DP,tension:"tension",value:0},"catmull-rom":{curve:MP,tension:"alpha",value:.5},"catmull-rom-closed":{curve:LP,tension:"alpha",value:.5},"catmull-rom-open":{curve:IP,tension:"alpha",value:.5},linear:{curve:oy},"linear-closed":{curve:PP},monotone:{horizontal:BP,vertical:zP},natural:{curve:jP},step:{curve:UP},"step-after":{curve:WP},"step-before":{curve:qP}};function _y(e,t,n){var i=K(j2,e)&&j2[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const $z={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Fz=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Oz=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Tz=/^((\s+,?\s*)|(,\s*))/,Rz=/^[01]/;function so(e){const t=[];return(e.match(Fz)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),a=$z[s],o=Dz(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 Dz(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)?Rz:Oz,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(Tz);u!==null&&(r+=u[0].length)}return i}const Jr=Math.PI/180,Nz=1e-14,Ds=Math.PI/2,Si=Math.PI*2,Aa=Math.sqrt(3)/2;var zg={},Bg={},JC=[].join;function Mz(e,t,n,i,r,s,a,o,u){const l=JC.call(arguments);if(zg[l])return zg[l];const c=a*Jr,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(o-e)*.5+f*(u-t)*.5,g=d*(u-t)*.5-f*(o-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*o+y*u,E=b*o+v*u,_=m*e+y*t,w=b*e+v*t;let A=1/((_-x)*(_-x)+(w-E)*(w-E))-.25;A<0&&(A=0);let k=Math.sqrt(A);s==r&&(k=-k);const F=.5*(x+_)-k*(w-E),L=.5*(E+w)+k*(_-x),M=Math.atan2(E-L,x-F);let $=Math.atan2(w-L,_-F)-M;$<0&&s===1?$+=Si:$>0&&s===0&&($-=Si);const T=Math.ceil(Math.abs($/(Ds+.001))),I=[];for(let W=0;W<T;++W){const j=M+W*$/T,J=M+(W+1)*$/T;I[W]=[F,L,j,J,n,i,f,d]}return zg[l]=I}function Lz(e){const t=JC.call(e);if(Bg[t])return Bg[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,h=l*o,g=Math.cos(r),p=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+g-x*p,_=i+p+x*g,w=n+m,S=i+y,A=w+x*y,k=S-x*m;return Bg[t]=[c*E+f*_,d*E+h*_,c*A+f*k,d*A+h*k,c*w+f*S,d*w+h*S]}const An=["l",0,0,0,0,0,0,0];function Iz(e,t,n){const i=An[0]=e[0];if(i==="a"||i==="A")An[1]=t*e[1],An[2]=n*e[2],An[3]=e[3],An[4]=e[4],An[5]=e[5],An[6]=t*e[6],An[7]=n*e[7];else if(i==="h"||i==="H")An[1]=t*e[1];else if(i==="v"||i==="V")An[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)An[r]=(r%2==1?t:n)*e[r];return An}function Ju(e,t,n,i,r,s){var a,o=null,u=0,l=0,c=0,f=0,d,h,g,p,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=Iz(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],h=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,h+i),u=d,l=h;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],h=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,h+i),c=u+a[1],f=l+a[2],u=d,l=h;break;case"S":d=a[3],h=a[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,a[1]+n,a[2]+i,d+n,h+i),u=d,l=h,c=a[1],f=a[2];break;case"q":d=u+a[3],h=l+a[4],c=u+a[1],f=l+a[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=a[3],h=a[4],e.quadraticCurveTo(a[1]+n,a[2]+i,d+n,h+i),u=d,l=h,c=a[1],f=a[2];break;case"t":d=u+a[1],h=l+a[2],o[0].match(/[QqTt]/)===null?(c=u,f=l):o[0]==="t"?(c=2*u-g,f=2*l-p):o[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+a[1],f=l+a[2];break;case"T":d=a[1],h=a[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":U2(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":U2(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 U2(e,t,n,i){const r=Mz(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=Lz(r[s]);e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}const q2=.5773502691896257,W2={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=Aa*n,r=i-n*q2,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=Aa*n,r=i-n*q2;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=Aa*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=Aa*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=Aa*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=Aa*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 QC(e){return K(W2,e)?W2[e]:Pz(e)}var jg={};function Pz(e){if(!K(jg,e)){const t=so(e);jg[e]={draw:function(n,i){Ju(n,t,0,0,Math.sqrt(i)/2)}}}return jg[e]}const Er=.448084975506;function zz(e){return e.x}function Bz(e){return e.y}function jz(e){return e.width}function Uz(e){return e.height}function Vi(e){return typeof e=="function"?e:()=>+e}function wc(e,t,n){return Math.max(t,Math.min(e,n))}function ZC(){var e=zz,t=Bz,n=jz,i=Uz,r=Vi(0),s=r,a=r,o=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=wc(+r.call(this,c),0,b),x=wc(+s.call(this,c),0,b),E=wc(+a.call(this,c),0,b),_=wc(+o.call(this,c),0,b);if(u||(u=h=X0()),v<=0&&x<=0&&E<=0&&_<=0)u.rect(g,p,m,y);else{var w=g+m,S=p+y;u.moveTo(g+v,p),u.lineTo(w-x,p),u.bezierCurveTo(w-Er*x,p,w,p+Er*x,w,p+x),u.lineTo(w,S-_),u.bezierCurveTo(w,S-Er*_,w-Er*_,S,w-_,S),u.lineTo(g+E,S),u.bezierCurveTo(g+Er*E,S,g,S-Er*E,g,S-E),u.lineTo(g,p+v),u.bezierCurveTo(g,p+Er*v,g+Er*v,p,g+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Vi(c),l):e},l.y=function(c){return arguments.length?(t=Vi(c),l):t},l.width=function(c){return arguments.length?(n=Vi(c),l):n},l.height=function(c){return arguments.length?(i=Vi(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Vi(c),s=f!=null?Vi(f):r,o=d!=null?Vi(d):r,a=h!=null?Vi(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function e$(){var e,t,n,i,r=null,s,a,o,u;function l(f,d,h){const g=h/2;if(s){var p=o-d,m=f-a;if(p||m){var y=Math.hypot(p,m),b=(p/=y)*u,v=(m/=y)*u,x=Math.atan2(m,p);r.moveTo(a-b,o-v),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,x-Math.PI,x),r.lineTo(a+b,o+v),r.arc(a,o,u,x,x+Math.PI)}else r.arc(f,d,g,0,Si);r.closePath()}else s=1;a=f,o=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=X0()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(s=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,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 Rl(e,t){return e??t}const Dl=e=>e.x||0,Nl=e=>e.y||0,qz=e=>e.width||0,Wz=e=>e.height||0,Gz=e=>(e.x||0)+(e.width||0),Hz=e=>(e.y||0)+(e.height||0),Vz=e=>e.startAngle||0,Xz=e=>e.endAngle||0,Yz=e=>e.padAngle||0,Kz=e=>e.innerRadius||0,Jz=e=>e.outerRadius||0,Qz=e=>e.cornerRadius||0,Zz=e=>Rl(e.cornerRadiusTopLeft,e.cornerRadius)||0,e6=e=>Rl(e.cornerRadiusTopRight,e.cornerRadius)||0,t6=e=>Rl(e.cornerRadiusBottomRight,e.cornerRadius)||0,n6=e=>Rl(e.cornerRadiusBottomLeft,e.cornerRadius)||0,i6=e=>Rl(e.size,64),r6=e=>e.size||1,sh=e=>e.defined!==!1,s6=e=>QC(e.shape||"circle"),a6=CP().startAngle(Vz).endAngle(Xz).padAngle(Yz).innerRadius(Kz).outerRadius(Jz).cornerRadius(Qz),o6=pC().x(Dl).y1(Nl).y0(Hz).defined(sh),u6=pC().y(Nl).x1(Dl).x0(Gz).defined(sh),l6=gC().x(Dl).y(Nl).defined(sh),c6=ZC().x(Dl).y(Nl).width(qz).height(Wz).cornerRadius(Zz,e6,t6,n6),f6=GM().type(s6).size(i6),d6=e$().x(Dl).y(Nl).defined(sh).size(r6);function Sy(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function h6(e,t){return a6.context(e)(t)}function g6(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?u6:o6).curve(_y(i,n.orient,n.tension)).context(e)(t)}function p6(e,t){const n=t[0],i=n.interpolate||"linear";return l6.curve(_y(i,n.orient,n.tension)).context(e)(t)}function Lo(e,t,n,i){return c6.context(e)(t,n,i)}function m6(e,t){return(t.mark.shape||t.shape).context(e)(t)}function y6(e,t){return f6.context(e)(t)}function b6(e,t){return d6.context(e)(t)}var t$=1;function n$(){t$=1}function Ay(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+t$++),a=r.clipping[s]||(r.clipping[s]={id:s});return oe(i)?a.path=i(null):Sy(n)?a.path=Lo(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+s+")"}function qe(e){this.clear(),e&&this.union(e)}qe.prototype={clone(){return new qe(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 ah(e){this.mark=e,this.bounds=this.bounds||new qe}function oh(e){ah.call(this,e),this.items=this.items||[]}G(oh,ah);class i${constructor(t){this._pending=0,this._loader=t||jd()}pending(){return this._pending}sanitizeURL(t){const n=this;return G2(n),n._loader.sanitize(t,{context:"href"}).then(i=>(nu(n),i)).catch(()=>(nu(n),null))}loadImage(t){const n=this,i=GP();return G2(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const a=new i,o=K(r,"crossOrigin")?r.crossOrigin:"anonymous";return o!=null&&(a.crossOrigin=o),a.onload=()=>nu(n),a.onerror=()=>nu(n),a.src=s,a}).catch(r=>(nu(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 G2(e){e._pending+=1}function nu(e){e._pending-=1}function hr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?v6(t,i):0))}return e}function v6(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const x6=Si-1e-8;let uh,ef,tf,Is,ym,nf,bm,vm;const Nr=(e,t)=>uh.add(e,t),rf=(e,t)=>Nr(ef=e,tf=t),H2=e=>Nr(e,uh.y1),V2=e=>Nr(uh.x1,e),Ns=(e,t)=>ym*e+bm*t,Ms=(e,t)=>nf*e+vm*t,Ug=(e,t)=>Nr(Ns(e,t),Ms(e,t)),qg=(e,t)=>rf(Ns(e,t),Ms(e,t));function Ml(e,t){return uh=e,t?(Is=t*Jr,ym=vm=Math.cos(Is),nf=Math.sin(Is),bm=-nf):(ym=vm=1,Is=nf=bm=0),w6}const w6={beginPath(){},closePath(){},moveTo:qg,lineTo:qg,rect(e,t,n,i){Is?(Ug(e+n,t),Ug(e+n,t+i),Ug(e,t+i),qg(e,t)):(Nr(e+n,t+i),rf(e,t))},quadraticCurveTo(e,t,n,i){const r=Ns(e,t),s=Ms(e,t),a=Ns(n,i),o=Ms(n,i);X2(ef,r,a,H2),X2(tf,s,o,V2),rf(a,o)},bezierCurveTo(e,t,n,i,r,s){const a=Ns(e,t),o=Ms(e,t),u=Ns(n,i),l=Ms(n,i),c=Ns(r,s),f=Ms(r,s);Y2(ef,a,u,c,H2),Y2(tf,o,l,f,V2),rf(c,f)},arc(e,t,n,i,r,s){if(i+=Is,r+=Is,ef=n*Math.cos(r)+e,tf=n*Math.sin(r)+t,Math.abs(r-i)>x6)Nr(e-n,t-n),Nr(e+n,t+n);else{const a=l=>Nr(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%Ds,u=0;u<4&&o>r;++u,o-=Ds)a(o);else for(o=i-i%Ds+Ds,u=0;u<4&&o<r;++u,o=o+Ds)a(o)}}};function X2(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function Y2(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)>Nz?(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(K2(u,e,t,n,i)),0<l&&l<1&&r(K2(l,e,t,n,i))}function K2(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 Vr=(Vr=Hr(1,1))?Vr.getContext("2d"):null;const xm=new qe;function ky(e){return function(t,n){if(!Vr)return!0;e(Vr,t),xm.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:a}=xm;for(let o=r;o<=a;++o)for(let u=i;u<=s;++u)if(Vr.isPointInPath(u,o))return!0;return!1}}function Cy(e,t){return t.contains(e.x||0,e.y||0)}function r$(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(xm.set(n,i,n+r,i+s))}function s$(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 za(t,n,i,r,s)}function za(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,h,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(s-t)),m===1&&(h=l,g=o-t),m===2&&(h=-c,g=-(a-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function ao(e,t){e.globalCompositeOperation=t.blend||"source-over"}function qn(e,t){return e??t}function J2(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function E6(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+qn(t.x1,.5)*i,n.y1+qn(t.y1,.5)*r,Math.max(i,r)*qn(t.r1,0),n.x1+qn(t.x2,.5)*i,n.y1+qn(t.y2,.5)*r,Math.max(i,r)*qn(t.r2,.5));else{const a=qn(t.x1,0),o=qn(t.y1,0),u=qn(t.x2,1),l=qn(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=Hr(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=J2(f.createLinearGradient(a,o,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return J2(s,t.stops)}function a$(e,t,n){return Ey(n)?E6(e,n,t.bounds):n}function Nf(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=a$(e,t,t.fill),!0):!1}var _6=[];function oo(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=a$(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||_6),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function S6(e,t){return e.zindex-t.zindex||e.index-t.index}function $y(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(S6)}function ii(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=$y(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 Mf(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=$y(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 Fy(e){return function(t,n,i){ii(n,r=>{(!i||i.intersects(r.bounds))&&o$(e,t,r,r)})}}function A6(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&o$(e,t,n.items[0],n.items)}}function o$(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(ao(t,n),n.fill&&Nf(t,n,r)&&t.fill(),n.stroke&&oo(t,n,r)&&t.stroke()))}function lh(e){return e=e||Nn,function(t,n,i,r,s,a){return i*=t.pixelRatio,r*=t.pixelRatio,Mf(n,o=>{const u=o.bounds;if(!(u&&!u.contains(s,a)||!u)&&e(t,o,i,r,s,a))return o})}}function Ll(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 Oy(e){return lh(Ll(e))}function Bs(e,t){return"translate("+e+","+t+")"}function Ty(e){return"rotate("+e+")"}function k6(e,t){return"scale("+e+","+t+")"}function u$(e){return Bs(e.x||0,e.y||0)}function C6(e){return Bs(e.x||0,e.y||0)+(e.angle?" "+Ty(e.angle):"")}function $6(e){return Bs(e.x||0,e.y||0)+(e.angle?" "+Ty(e.angle):"")+(e.scaleX||e.scaleY?" "+k6(e.scaleX||1,e.scaleY||1):"")}function Ry(e,t,n){function i(a,o){a("transform",C6(o)),a("d",t(null,o))}function r(a,o){return t(Ml(a,o.angle),o),hr(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*=Jr),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:Fy(s),pick:Oy(s),isect:n||ky(s)}}var F6=Ry("arc",h6);function O6(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 T6(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 R6(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 Dy(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(Ml(u),c),hr(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const a=Ll(s);function o(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,a(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:A6(s),pick:o,isect:Cy,tip:n}}var D6=Dy("area",g6,O6);function N6(e,t){var n=t.clip;e.save(),oe(n)?(e.beginPath(),n(e),e.clip()):l$(e,t.group)}function l$(e,t){e.beginPath(),Sy(t)?Lo(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function c$(e){const t=qn(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function M6(e,t){e("transform",u$(t))}function f$(e,t){const n=c$(t);e("d",Lo(null,t,n,n))}function L6(e,t){e("class","background"),e("aria-hidden",!0),f$(e,t)}function I6(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?f$(e,t):e("d","")}function P6(e,t,n){const i=t.clip?Ay(n,t,t):null;e("clip-path",i)}function z6(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),hr(e,t),e.translate(t.x||0,t.y||0)}function Qu(e,t,n,i){const r=c$(t);e.beginPath(),Lo(e,t,(n||0)+r,(i||0)+r)}const B6=Ll(Qu),j6=Ll(Qu,!1),U6=Ll(Qu,!0);function q6(e,t,n,i){ii(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&&(Qu(e,r,s,a),ao(e,r),r.fill&&Nf(e,r,u)&&e.fill(),r.stroke&&!o&&oo(e,r,u)&&e.stroke()),e.save(),e.translate(s,a),r.clip&&l$(e,r),n&&n.translate(-s,-a),ii(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&&(Qu(e,r,s,a),ao(e,r),oo(e,r,u)&&e.stroke())})}function W6(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 Mf(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 h=c+(u.width||0),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||s<f||s>g))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,p&&Sy(u)&&!U6(e,u,a,o))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&j6(e,u,a,o)?(e.restore(),u):(l=Mf(u,b=>G6(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&B6(e,u,a,o)&&(l=u),e.restore(),l||null)})}function G6(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var H6={type:"group",tag:"g",nested:!1,attr:M6,bound:z6,draw:q6,pick:W6,isect:r$,content:P6,background:L6,foreground:I6},Zu={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Ny(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 My(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 Ly(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 ch(e,t){return e==="center"?t/2:e==="right"?t:0}function fh(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function V6(e,t,n){const i=Ny(t,n),r=My(t,i),s=Ly(t,i),a=(t.x||0)-ch(t.align,r),o=(t.y||0)-fh(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Zu["xmlns:xlink"],"xlink:href"),e("transform",Bs(a,o)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function X6(e,t){const n=t.image,i=My(t,n),r=Ly(t,n),s=(t.x||0)-ch(t.align,i),a=(t.y||0)-fh(t.baseline,r);return e.set(s,a,s+i,a+r)}function Y6(e,t,n){ii(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Ny(i,this);let s=My(i,r),a=Ly(i,r);if(s===0||a===0)return;let o=(i.x||0)-ch(i.align,s),u=(i.y||0)-fh(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)&&(ao(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,o,u,s,a))})}var K6={type:"image",tag:"image",nested:!1,attr:V6,bound:X6,draw:Y6,pick:lh(),isect:Nn,get:Ny,xOffset:ch,yOffset:fh},J6=Dy("line",p6,T6);function Q6(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",$6(t)),e("d",t.path)}function sf(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)*Jr,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=so(n)).path=n),o&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(o),Ju(e,u,0,0,s,a),e.rotate(-o),e.translate(-i,-r)):Ju(e,u,i,r,s,a)}function Z6(e,t){return sf(Ml(e,t.angle),t)?e.set(0,0,0,0):hr(e,t,!0)}var e4={type:"path",tag:"path",nested:!1,attr:Q6,bound:Z6,draw:Fy(sf),pick:Oy(sf),isect:ky(sf)};function t4(e,t){e("d",Lo(null,t))}function n4(e,t){var n,i;return hr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function Q2(e,t){e.beginPath(),Lo(e,t)}var i4={type:"rect",tag:"path",nested:!1,attr:t4,bound:n4,draw:Fy(Q2),pick:Oy(Q2),isect:r$};function r4(e,t){e("transform",u$(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function s4(e,t){var n,i;return hr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function d$(e,t,n){var i,r,s,a;return t.stroke&&oo(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 a4(e,t,n){ii(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&d$(e,i,r)&&(ao(e,i),e.stroke())}})}function o4(e,t,n,i){return e.isPointInStroke?d$(e,t,1)&&e.isPointInStroke(n,i):!1}var u4={type:"rule",tag:"line",nested:!1,attr:r4,bound:s4,draw:a4,pick:lh(o4),isect:s$},l4=Ry("shape",m6),c4=Ry("symbol",y6,Cy);const Z2=RA();var bn={height:Pi,measureWidth:Iy,estimateWidth:Lf,width:Lf,canvas:h$};h$(!0);function h$(e){bn.width=e&&Vr?Iy:Lf}function Lf(e,t){return g$(Zr(e,t),Pi(e))}function g$(e,t){return~~(.8*e.length*t)}function Iy(e,t){return Pi(e)<=0||!(t=Zr(e,t))?0:p$(t,dh(e))}function p$(e,t){const n=`(${t}) ${e}`;let i=Z2.get(n);return i===void 0&&(Vr.font=t,i=Vr.measureText(e).width,Z2.set(n,i)),i}function Pi(e){return e.fontSize!=null?+e.fontSize||0:11}function Qr(e){return e.lineHeight!=null?e.lineHeight:Pi(e)+2}function f4(e){return N(e)?e.length>1?e:e[0]:e}function Il(e){return f4(e.lineBreak&&e.text&&!N(e.text)?e.text.split(e.lineBreak):e.text)}function Py(e){const t=Il(e);return(N(t)?t.length-1:0)*Qr(e)}function Zr(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?h4(e,n):n}function d4(e){if(bn.width===Iy){const t=dh(e);return n=>p$(n,t)}else if(bn.width===Lf){const t=Pi(e);return n=>g$(n,t)}else return t=>bn.width(e,t)}function h4(e,t){var n=+e.limit,i=d4(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 Pl(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function dh(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Pi(e)+"px "+Pl(e,t)}function zy(e){var t=e.baseline,n=Pi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Qr(e):t==="line-bottom"?.29*n-.5*Qr(e):0)}const g4={left:"start",center:"middle",right:"end"},Lu=new qe;function hh(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Ds,t+=i*Math.cos(r),n+=i*Math.sin(r)),Lu.x1=t,Lu.y1=n,Lu}function p4(e,t){var n=t.dx||0,i=(t.dy||0)+zy(t),r=hh(t),s=r.x1,a=r.y1,o=t.angle||0,u;e("text-anchor",g4[t.align]||"start"),o?(u=Bs(s,a)+" "+Ty(o),(n||i)&&(u+=" "+Bs(n,i))):u=Bs(s+n,a+i),e("transform",u)}function By(e,t,n){var i=bn.height(t),r=t.align,s=hh(t),a=s.x1,o=s.y1,u=t.dx||0,l=(t.dy||0)+zy(t)-Math.round(.8*i),c=Il(t),f;if(N(c)?(i+=Qr(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,bn.width(t,h)),0)):f=bn.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*Jr,a,o);else if(n===2)return e.rotatedPoints(t.angle*Jr,a,o);return e}function m4(e,t,n){ii(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=dh(i),e.textAlign=i.align||"left",s=hh(i),a=s.x1,o=s.y1,i.angle&&(e.save(),e.translate(a,o),e.rotate(i.angle*Jr),a=o=0),a+=i.dx||0,o+=(i.dy||0)+zy(i),c=Il(i),ao(e,i),N(c))for(l=Qr(i),u=0;u<c.length;++u)f=Zr(i,c[u]),i.fill&&Nf(e,i,r)&&e.fillText(f,a,o),i.stroke&&oo(e,i,r)&&e.strokeText(f,a,o),o+=l;else f=Zr(i,c),i.fill&&Nf(e,i,r)&&e.fillText(f,a,o),i.stroke&&oo(e,i,r)&&e.strokeText(f,a,o);i.angle&&e.restore()}})}function y4(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=hh(t),o=a.x1,u=a.y1,l=By(Lu,t,1),c=-t.angle*Jr,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(o-f*o+d*u),g=d*r+f*s+(u-d*o-f*u);return l.contains(h,g)}function b4(e,t){const n=By(Lu,e,2);return za(t,n[0],n[1],n[2],n[3])||za(t,n[0],n[1],n[4],n[5])||za(t,n[4],n[5],n[6],n[7])||za(t,n[2],n[3],n[6],n[7])}var v4={type:"text",tag:"text",nested:!1,attr:p4,bound:By,draw:m4,pick:lh(y4),isect:b4},x4=Dy("trail",b6,R6),_n={arc:F6,area:D6,group:H6,image:K6,line:J6,path:e4,rect:i4,rule:u4,shape:l4,symbol:c4,text:v4,trail:x4};function wm(e,t,n){var i=_n[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new qe),e,n)}var ew={mark:null};function m$(e,t,n){var i=_n[e.marktype],r=i.bound,s=e.items,a=s&&s.length,o,u,l,c;if(i.nested)return a?l=s[0]:(ew.mark=e,l=ew),c=wm(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new qe,a)for(o=0,u=s.length;o<u;++o)t.union(wm(s[o],r,n));
9return e.bounds=t}const w4=["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 y$(e,t){return JSON.stringify(e,w4,t)}function b$(e){const t=typeof e=="string"?JSON.parse(e):e;return v$(t)}function v$(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"&&v$(n[r]);return t&&m$(e),e}class x${constructor(t){arguments.length?this.root=b$(t):(this.root=tw({marktype:"group",name:"root",role:"frame"}),this.root.items=[new oh(this.root)])}toJSON(t){return y$(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=tw(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function tw(e,t){const n={bounds:new qe,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 Mr(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function jy(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=Mr(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 w$(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function gh(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function E4(e,t,n,i){var r=e&&e.mark,s,a;if(r&&(s=_n[r.marktype]).tip){for(a=gh(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 Uy=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||jd(),this._tooltip=n||_4}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=Mr(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=E4(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 _4(e,t,n,i){e.element().setAttribute("title",i||"")}class zl{constructor(t){this._el=null,this._bgcolor=null,this._loader=new i$(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 S4="keydown",A4="keypress",k4="keyup",E$="dragenter",af="dragleave",_$="dragover",Em="pointerdown",C4="pointerup",If="pointermove",of="pointerout",S$="pointerover",_m="mousedown",$4="mouseup",A$="mousemove",Pf
9="mouseout",k$="mouseover",zf="click",F4="dblclick",O4="wheel",C$="mousewheel",Bf="touchstart",jf="touchmove",Uf="touchend",T4=[S4,A4,k4,E$,af,_$,Em,C4,If,of,S$,_m,$4,A$,Pf,k$,zf,F4,O4,C$,Bf,jf,Uf],Sm=If,Iu=Pf,Am=zf;class Bl extends Uy{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=T4,this.pointermove=iw([If,A$],[S$,k$],[of,Pf]),this.dragover=iw([_$],[E$],[af]),this.pointerout=rw([of,Pf]),this.dragleave=rw([af])}initialize(t,n,i){return this._canvas=t&&jy(t,"canvas"),[zf,_m,Em,If,of,af].forEach(r=>nw(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(C$,t)}pointerdown(t){this._down=this._active,this.fire(Em,t)}mousedown(t){this._down=this._active,this.fire(_m,t)}click(t){this._down===this._active&&(this.fire(zf,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Bf,t,!0)}touchmove(t){this.fire(jf,t,!0)}touchend(t){this.fire(Uf,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===Am&&r&&r.href?this.handleHref(n,r,r.href):(t===Sm||t===Iu)&&this.handleTooltip(n,r,t!==Iu),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&&(nw(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=gh(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 _n[t.marktype].pick.call(this,a,t,n,i,r,s)}}const R4=e=>e===Bf||e===jf||e===Uf?[Bf,jf,Uf]:[e];function nw(e,t){R4(t).forEach(n=>D4(e,n))}function D4(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 ku(e,t,n){t.forEach(i=>e.fire(i,n))}function iw(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?ku(this,e,i):((!r||!r.exit)&&ku(this,n,i),this._active=s,ku(this,t,i),ku(this,e,i))}}function rw(e){return function(t){ku(this,e,t),this._active=null}}function N4(){return typeof window<"u"&&window.devicePixelRatio||1}function M4(e,t,n,i,r,s){const a=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,o=e.getContext("2d"),u=a?N4():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 qf extends zl{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new qe,this._tempb=new qe}initialize(t,n,i,r,s,a){return this._options=a||{},this._canvas=this._options.externalContext?null:Hr(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)M4(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||D("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=L4(r,s,a);i.save();const l=this._redraw||o.empty()?(this._redraw=!1,u.expand(1)):I4(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=_n[n.marktype];
9n.clip&&N6(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 L4=(e,t,n)=>new qe().set(0,0,t,n).translate(-e[0],-e[1]);function I4(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 $$ extends Uy{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Wg(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=Wg(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Iu)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(Am,this._hrefHandler),r.removeEventListener(Sm,this._tooltipHandler),r.removeEventListener(Iu,this._tooltipHandler)),this._svg=r=t&&jy(t,"svg"),r&&(r.addEventListener(Am,this._hrefHandler),r.addEventListener(Sm,this._tooltipHandler),r.addEventListener(Iu,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:Wg(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 Wg=(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)},F$="aria-hidden",qy="aria-label",Wy="role",Gy="aria-roledescription",O$="graphics-object",Hy="graphics-symbol",T$=(e,t,n)=>({[Wy]:e,[Gy]:t,[qy]:n||void 0}),P4=ti(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),sw={axis:{desc:"axis",caption:j4},legend:{desc:"legend",caption:U4},"title-text":{desc:"title",caption:e=>`Title text '${ow(e)}'`}
vendor: 8,682 bytes, line 9
9,"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${ow(e)}'`}},aw={ariaRole:Wy,ariaRoleDescription:Gy,description:qy};function R$(e,t){const n=t.aria===!1;if(e(F$,n||void 0),n||t.description==null)for(const i in aw)e(aw[i],void 0);else{const i=t.mark.marktype;e(qy,t.description),e(Wy,t.ariaRole||(i==="group"?O$:Hy)),e(Gy,t.ariaRoleDescription||`${i} mark`)}}function D$(e){return e.aria===!1?{[F$]:!0}:P4[e.role]?null:sw[e.role]?B4(e,sw[e.role]):z4(e)}function z4(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return T$(n?O$:Hy,`${t} mark container`,e.description)}function B4(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return T$(t.role||Hy,t.desc,n.description||i(n))}catch{return null}}function ow(e){return X(e.text).join(" ")}function j4(e){const t=e.datum,n=e.orient,i=t.title?N$(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 ${ro(o)?"discrete":o} scale with ${VC(a,s,e)}`}function U4(e){const t=e.datum,n=t.title?N$(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 W4(i)+(n?` titled '${n}'`:"")+` for ${q4(s)} with ${VC(u,o,e)}`}function N$(e){try{return X(fe(e.items).items[0].text).join(" ")}catch{return null}}function q4(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+fe(e)}function W4(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const M$=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),G4=e=>M$(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function Vy(){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}="${G4(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 h in d)a(h,d[h]);return o},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),o},attr:a,text:u=>(n+=M$(u),o),toString:()=>e};return o}const L$=e=>I$(Vy(),e)+"";function I$(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):I$(e,i)}return e.close()}const Wf={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"},Gf={blend:"mix-blend-mode"},P$={fill:"none","stroke-miterlimit":10},iu=0,uw="http://www.w3.org/2000/xmlns/",Ge=Zu.xmlns;class Xy extends zl{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(uw,"xmlns",Ge),this._svg.setAttributeNS(uw,"xmlns:xlink",Zu["xmlns:xlink"]),this._svg.setAttribute("version",Zu.version),this._svg.setAttribute("class","marks"),Cn(t,1),this._root=He(this._svg,iu,"g",Ge),Lr(this._root,P$),Cn(this._svg,iu+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&&(Lr(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,iu,"rect",Ge),Lr(i,{width:this._width,height:this._height,fill:n}));const r=L$(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=_n[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,lw(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,lw(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=_n[a],u=n.interactive===!1?"none":null,l=o.tag==="g",c=cw(n,t,i,"g",s);if(a!=="group"&&r!=null&&!r.includes(a))return Cn(c,0),n._svg;c.setAttribute("class",w$(n));const f=D$(n);for(const p in f)Tt(c,p,f[p]);l||Tt(c,"pointer-events",u),Tt(c,"clip-path",n.clip?Ay(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=cw(p,c,d,o.tag,s);m&&(this._update(o,y,p),l&&X4(this,y,p,r)),d=y,++h};return o.nested?n.items.length&&g(n.items[0]):ii(n,g),Cn(c,h),c}_update(t,n,i){tr=n,vt=n.__values__,R$(Pu,i),t.attr(Pu,i,this);const r=K4[t.type];r&&r.call(this,t,n,i),tr&&this.style(tr,i)}style(t,n){if(n!=null){for(const i in Wf){let r=i==="font"?Pl(n):n[i];if(r===vt[i])continue;const s=Wf[i];r==null?t.removeAttribute(s):(Ey(r)&&(r=YC(r,this._defs.gradient,z$())),t.setAttribute(s,r+"")),vt[i]=r}for(const i in Gf)uf(t,Gf[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,iu+1,"defs",Ge)),r=H4(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=He(t,iu+1,"defs",Ge)),r=V4(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 lw(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 H4(e,t,n){let i,r,s;if(t.gradient==="radial"){let a=He(e,n++,"pattern",Ge);Lr(a,{id:Df+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a=He(a,0,"rect",Ge),Lr(a,{width:1,height:1,fill:`url(${z$()}#${t.id})`}),e=He(e,n++,"radialGradient",Ge),Lr(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),Lr(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 V4(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),Lr(i,{x:0,y:0,width:t.width,height:t.height})),Cn(e,1),n+1}function X4(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;ii(n,a=>{r=e.mark(t,a,r,i),++s}),Cn(t,1+s)}function cw(e,t,n,i,r){let s=e._svg,a;if(!s&&(a=t.ownerDocument,s=Mr(a,i,Ge),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const o=Mr(a,"path",Ge);s.appendChild(o),o.__data__=e;const u=Mr(a,"g",Ge);s.appendChild(u),u.__data__=e;const l=Mr(a,"path",Ge);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||Y4(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function Y4(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let tr=null,vt=null;const K4={group(e,t,n){const i=tr=t.childNodes[2];vt=i.__values__,e.foreground(Pu,n,this),vt=t.__values__,tr=t.childNodes[1],e.content(Pu,n,this);const r=tr=t.childNodes[0];e.background(Pu,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==vt.events&&(Tt(i,"pointer-events",s),Tt(r,"pointer-events",s),vt.events=s),n.strokeForeground&&n.stroke){const a=n.fill;Tt(i,"display",null),this.style(r,n),Tt(r,"stroke",null),a&&(n.fill=null),vt=i.__values__,this.style(i,n),a&&(n.fill=a),tr=null}else Tt(i,"display","none")},image(e,t,n){n.smooth===!1?(uf(t,"image-rendering","optimizeSpeed"),uf(t,"image-rendering","pixelated")):uf(t,"image-rendering",null)},text(e,t,n){const i=Il(n);let r,s,a,o;N(i)?(s=i.map(u=>Zr(n,u)),r=s.join(`
10`),r!==vt.text&&(Cn(t,0),a=t.ownerDocument,o=Qr(n),s.forEach((u,l)=>{const c=Mr(a,"tspan",Ge);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",o)),t.appendChild(c)}),vt.text=r)):(s=Zr(n,i),s!==vt.text&&(t.textContent=s,vt.text=s)),Tt(t,"font-family",Pl(n)),Tt(t,"font-size",Pi(n)+"px"),Tt(t,"font-style",n.fontStyle),Tt(t,"font-variant",n.fontVariant),Tt(t,"font-weight",n.fontWeight)}};function Pu(e,t,n){t!==vt[e]&&(n?J4(tr,e,t,n):Tt(tr,e,t),vt[e]=t)}function uf(e,t,n){n!==vt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),vt[t]=n)}function Lr(e,t){for(const n in t)Tt(e,n,t[n])}function Tt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function J4(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function z$(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class B$ extends zl{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=Vy();n.open("svg",ae({},Zu,{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",P$,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=_n[n.marktype],r=i.tag,s=[R$,i.attr];t.open("g",{class:w$(n),"clip-path":n.clip?Ay(this,n,n.group):null},D$(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=Il(o);if(N(l)){const c={x:0,dy:Qr(o)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Zr(o,l[f])).close()}else t.text(Zr(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)),ii(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]):ii(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&&Q4(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:Df+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 Q4(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"]=Pl(t),e["font-size"]=Pi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in Wf){let o=t[a];const u=Wf[a];o==="transparent"&&(u==="fill"||u==="stroke")||o!=null&&(Ey(o)&&(o=YC(o,r.gradient,"")),e[u]=o)}for(const a in Gf){const o=t[a];o!=null&&(s=s||[],s.push(`${Gf[a]}: ${o};`))}return s&&(e.style=s.join(" ")),e}const Gn={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function Z4(e){Gn.svgMarkTypes=e.svgMarkTypes??["text"],Gn.svgOnTop=e.svgOnTop??!0,Gn.debug=e.debug??!1}class km extends zl{constructor(t){super(t),this._svgRenderer=new Xy(t),this._canvasRenderer=new qf(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",Gn.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=Gn.svgOnTop?o:a,this._canvasEl=Gn.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 Gn.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=>!Gn.svgMarkTypes.includes(s));this._svgRenderer.render(t,Gn.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 Gn.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class j$ extends Bl{constructor(t,n){super(t,n)}initialize(t,n,i){const r=He(He(t,0,"div"),Gn.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const U$="canvas",q$="hybrid",W$="png",G$="svg",H$="none",Ir={Canvas:U$,PNG:W$,SVG:G$,Hybrid:q$,None:H$},Ys={};Ys[U$]=Ys[W$]={renderer:qf,headless:qf,handler:Bl};Ys[G$]={renderer:Xy,headless:B$,handler:$$};Ys[q$]={renderer:km,headless:km,handler:j$};Ys[H$]={};function ph(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ys[e]=t,this):Ys[e]}function V$(e,t,n){const i=[],r=new qe().union(t),s=e.marktype;return s?X$(e,r,n,i):s==="group"?Y$(e,r,n,i):D("Intersect scene must be mark node or group item.")}
vendor: 58,826 bytes, line 10
10function X$(e,t,n,i){if(e8(e,t,n)){const r=e.items,s=e.marktype,a=r.length;let o=0;if(s==="group")for(;o<a;++o)Y$(r[o],t,n,i);else for(const u=_n[s].isect;o<a;++o){const l=r[o];K$(l,t,u)&&i.push(l)}}return i}function e8(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function Y$(e,t,n,i){n&&n(e.mark)&&K$(e,t,_n.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)X$(r[u],t,n,i);t.translate(a,o)}return i}function K$(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Gg=new qe;function J$(e){const t=e.clip;if(oe(t))t(Ml(Gg.clear()));else if(t)Gg.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Gg)}const t8=1e-9;function Yy(e,t,n){return e===t?!0:n==="path"?Q$(e,t):e instanceof Date&&t instanceof Date?+e==+t:pe(e)&&pe(t)?Math.abs(e-t)<=t8:!e||!t||!V(e)&&!V(t)?e==t:n8(e,t)}function Q$(e,t){return Yy(so(e),so(t))}function n8(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],!Yy(e[r],t[r],r))return!1;return typeof e==typeof t}function i8(){n$(),Cz()}const uo="top",Xn="left",Yn="right",es="bottom",r8="top-left",s8="top-right",a8="bottom-left",o8="bottom-right",Ky="start",Cm="middle",Rt="end",u8="x",l8="y",mh="group",Jy="axis",Qy="title",c8="frame",f8="scope",Zy="legend",Z$="row-header",eF="row-footer",tF="row-title",nF="column-header",iF="column-footer",rF="column-title",d8="padding",h8="symbol",sF="fit",aF="fit-x",oF="fit-y",g8="pad",eb="none",Ec="all",$m="each",tb="flush",Pr="column",zr="row";function uF(e){O.call(this,null,e)}G(uF,O,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=_n[r],a=s.bound;let o=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),o=_c(i,a),i.items.forEach(l=>{l.bounds.clear().union(o)});else if(r===mh||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),o.clear(),i.items.forEach(l=>o.union(_c(l,a))),i.role){case Jy:case Zy:case Qy:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{o.union(_c(l,a))}),t.visit(t.MOD,l=>{u=u||o.alignsWith(l.bounds),n.dirty(l),o.union(_c(l,a))}),u&&(o.clear(),i.items.forEach(l=>o.union(l.bounds)));return J$(i),t.modifies("bounds")}});function _c(e,t,n){return t(e.bounds.clear(),e,n)}const fw=":vega_identifier:";function nb(e){O.call(this,0,e)}nb.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(nb,O,{transform(e,t){const n=p8(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 p8(e){return e._signals[fw]||(e._signals[fw]=e.add(0))}function lF(e){O.call(this,null,e)}G(lF,O,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,m8(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===mh?oh:ah;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 m8(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 cF(e){O.call(this,null,e)}const dw={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!fF(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},fF=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),hw=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(fF(r,s=e[n].bounds,t))return!0},y8=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},b8=(e,t,n)=>{var i=e.range(),r=new qe;return t===uo||t===es?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)},gw=e=>(e.forEach(t=>t.opacity=1),e),pw=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(cF,O,{transform(e,t){const n=dw[e.method]||dw.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")&&(gw(r),t=pw(t,e)),t;if(r=r.filter(y8),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=gw(r),t=pw(t,e),s.length>=3&&hw(s,i)){do s=n(s,i);while(s.length>=3&&hw(s,i));s.length<3&&!fe(r).opacity&&(s.length>1&&(fe(s).opacity=0),fe(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(a=b8(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 dF(e){O.call(this,null,e)}G(dF,O,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const bt=new qe;function Ba(e,t,n){return e[t]===n?0:(e[t]=n,1)}function v8(e){var t=e.items[0].orient;return t===Xn||t===Yn}function x8(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function w8(e,t,n,i){var r=t.items[0],s=r.datum,a=r.translate!=null?r.translate:.5,o=r.orient,u=x8(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=s.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&Py(g),b=0,v=0,x,E;switch(bt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),o){case uo:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),g&&Sc(e,g,E,p,y,0,-1,m);break;case Xn:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),g&&Sc(e,g,E,p,y,1,-1,m);break;case Yn:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),g&&Sc(e,g,E,p,y,1,1,m);break;case es:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),g&&Sc(e,g,E,p,0,0,1,m);break;default:b=r.x,v=r.y}return hr(m.translate(b,v),r),Ba(r,"x",b+a)|Ba(r,"y",v+a)&&(r.bounds=bt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Sc(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 mw=(e,t)=>Math.floor(Math.min(e,t)),yw=(e,t)=>Math.ceil(Math.max(e,t));function E8(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===mh)switch(r.role){case Jy:case Zy:case Qy:break;case Z$:a.rowheaders.push(...s);break;case eF:a.rowfooters.push(...s);break;case nF:a.colheaders.push(...s);break;case iF:a.colfooters.push(...s);break;case tF:a.rowtitle=s[0];break;case rF:a.coltitle=s[0];break;default:a.marks.push(...s)}return a}function _8(e){return new qe().set(0,0,e.width||0,e.height||0)}function S8(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Oe(e,t,n){const i=V(e)?e[t]:e;return i??(n!==void 0?n:0)}function bw(e){return e<0?Math.ceil(-e):0}function hF(e,t,n){var i=!n.nodirty,r=n.bounds===tb?_8:S8,s=bt.set(0,0,0,0),a=Oe(n.align,Pr),o=Oe(n.align,zr),u=Oe(n.padding,Pr),l=Oe(n.padding,zr),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),_,w,S,A,k,F,L,M,C,$,T;for(w=0;w<c;++w)g[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)F=t[w],k=E[w]=r(F),F.x=F.x||0,v[w]=0,F.y=F.y||0,x[w]=0,S=w%c,A=~~(w/c),p=Math.max(p,L=Math.ceil(k.x2)),b=Math.max(b,M=Math.ceil(k.y2)),g[S]=Math.max(g[S],L),y[A]=Math.max(y[A],M),h[w]=u+bw(k.x1),m[w]=l+bw(k.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(a===$m)for(S=1;S<c;++S){for(T=0,w=S;w<d;w+=c)T<h[w]&&(T=h[w]);for(w=S;w<d;w+=c)h[w]=T+g[S-1]}else if(a===Ec){for(T=0,w=0;w<d;++w)w%c&&T<h[w]&&(T=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=T+p)}else for(a=!1,S=1;S<c;++S)for(w=S;w<d;w+=c)h[w]+=g[S-1];if(o===$m)for(A=1;A<f;++A){for(T=0,w=A*c,_=w+c;w<_;++w)T<m[w]&&(T=m[w]);for(w=A*c;w<_;++w)m[w]=T+y[A-1]}else if(o===Ec){for(T=0,w=c;w<d;++w)T<m[w]&&(T=m[w]);for(w=c;w<d;++w)m[w]=T+b}else for(o=!1,A=1;A<f;++A)for(w=A*c,_=w+c;w<_;++w)m[w]+=y[A-1];for(C=0,w=0;w<d;++w)C=h[w]+(w%c?C:0),v[w]+=C-t[w].x;for(S=0;S<c;++S)for($=0,w=S;w<d;w+=c)$+=m[w],x[w]+=$-t[w].y;if(a&&Oe(n.center,Pr)&&f>1)for(w=0;w<d;++w)k=a===Ec?p:g[w%c],C=k-E[w].x2-t[w].x-v[w],C>0&&(v[w]+=C/2);if(o&&Oe(n.center,zr)&&c!==1)for(w=0;w<d;++w)k=o===Ec?b:y[~~(w/c)],$=k-E[w].y2-t[w].y-x[w],$>0&&(x[w]+=$/2);for(w=0;w<d;++w)s.union(E[w].translate(v[w],x[w]));switch(C=Oe(n.anchor,u8),$=Oe(n.anchor,l8),Oe(n.anchor,Pr)){case Rt:C-=s.width();break;case Cm:C-=s.width()/2}switch(Oe(n.anchor,zr)){case Rt:$-=s.height();break;case Cm:$-=s.height()/2}for(C=Math.round(C),$=Math.round($),s.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)F=t[w],F.x+=v[w]+=C,F.y+=x[w]+=$,s.union(F.mark.bounds.union(F.bounds.translate(v[w],x[w]))),i&&e.dirty(F);return s}function A8(e,t,n){var i=E8(t),r=i.marks,s=n.bounds===tb?k8:C8,a=n.offset,o=n.columns||r.length,u=o<=0?1:Math.ceil(r.length/o),l=u*o,c,f,d,h,g,p,m;const y=hF(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=Oe(n.headerBand,zr,null),c=Ac(e,i.rowheaders,r,o,u,-Oe(a,"rowHeader"),mw,0,s,"x1",0,o,1,p)),i.colheaders&&(p=Oe(n.headerBand,Pr,null),f=Ac(e,i.colheaders,r,o,o,-Oe(a,"columnHeader"),mw,1,s,"y1",0,1,o,p)),i.rowfooters&&(p=Oe(n.footerBand,zr,null),d=Ac(e,i.rowfooters,r,o,u,Oe(a,"rowFooter"),yw,0,s,"x2",o-1,o,1,p)),i.colfooters&&(p=Oe(n.footerBand,Pr,null),h=Ac(e,i.colfooters,r,o,o,Oe(a,"columnFooter"),yw,1,s,"y2",l-o,1,o,p)),i.rowtitle&&(g=Oe(n.titleAnchor,zr),m=Oe(a,"rowTitle"),m=g===Rt?d+m:c-m,p=Oe(n.titleBand,zr,.5),vw(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=Oe(n.titleAnchor,Pr),m=Oe(a,"columnTitle"),m=g===Rt?h+m:f-m,p=Oe(n.titleBand,Pr,.5),vw(e,i.coltitle,m,1,y,p))}function k8(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 C8(e,t){return e.bounds[t]}function Ac(e,t,n,i,r,s,a,o,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,v,x,E,_,w,S,A;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=a(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=s,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(_=t[b],E=_.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);o?(S=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),A=p):(S=p,A=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(_.bounds.translate(S-(_.x||0),A-(_.y||0))),_.x=S,_.y=A,e.dirty(_),m=a(m,E[l])}return m}function vw(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 $8(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function F8(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 O8(e,t,n,i,r,s,a){const o=$8(n,t),u=F8(e,o("offset",0)),l=o("anchor",Ky),c=l===Rt?1:l===Cm?.5:0,f={align:$m,bounds:o("bounds",tb),columns:o("direction")==="vertical"?1:e.length,padding:o("margin",8),center:o("center"),nodirty:!0};switch(t){case Xn:f.anchor={x:Math.floor(i.x1)-u,column:Rt,y:c*(a||i.height()+2*i.y1),row:l};break;case Yn:f.anchor={x:Math.ceil(i.x2)+u,y:c*(a||i.height()+2*i.y1),row:l};break;case uo:f.anchor={y:Math.floor(r.y1)-u,row:Rt,x:c*(s||r.width()+2*r.x1),column:l};break;case es:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case r8:f.anchor={x:u,y:u};break;case s8:f.anchor={x:s-u,y:u,column:Rt};break;case a8:f.anchor={x:u,y:a-u,row:Rt};break;case o8:f.anchor={x:s-u,y:a-u,column:Rt,row:Rt};break}return f}function T8(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(),D8(e,n,n.items[0].items[0]),s=R8(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===h8&&N8(n.items[0].items[0].items[0].items),r!==eb&&(n.x=a=0,n.y=o=0),n.width=u,n.height=l,hr(s.set(a,o,a+u,o+l),n),n.mark.bounds.clear().union(s),n}function R8(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function D8(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&ru(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 Xn:r+=Math.ceil(a.bounds.width())+u;break;case Yn:case es:break;default:s+=a.bounds.height()+u}switch((r||s)&&ru(e,n,r,s),a.orient){case Xn:c+=ka(t,n,a,o,1,1);break;case Yn:l+=ka(t,n,a,Rt,0,0)+u,c+=ka(t,n,a,o,1,1);break;case es:l+=ka(t,n,a,o,0,0),c+=ka(t,n,a,Rt,-1,0,1)+u;break;default:l+=ka(t,n,a,o,0,0)}(l||c)&&ru(e,a,l,c),(l=Math.round(a.bounds.x1-i))<0&&(ru(e,n,-l,0),ru(e,a,-l,0))}}function ka(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,h=r<=0?0:Py(n);return Math.round(i===Ky?f:i===Rt?d-h:.5*(c-h))}function ru(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 N8(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 M8(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],h=o===Xn||o===Yn?i:n,g=0,p=0,m=0,y=0,b=0,v;if(a!==mh?o===Xn?(g=r.y2,h=r.y1):o===Yn?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):o===Xn&&(g=i,h=0),v=u===Ky?g:u===Rt?h:(g+h)/2,d&&d.text){switch(o){case uo:case es:b=f.bounds.height()+c;break;case Xn:y=f.bounds.width()+c;break;case Yn:y=-f.bounds.width()-c;break}bt.clear().union(d.bounds),bt.translate(y-(d.x||0),b-(d.y||0)),Ba(d,"x",y)|Ba(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(bt),d.mark.bounds.clear().union(bt),e.dirty(d)),bt.clear().union(d.bounds)}else bt.clear();switch(bt.union(f.bounds),o){case uo:p=v,m=r.y1-bt.height()-l;break;case Xn:p=r.x1-bt.width()-l,m=v;break;case Yn:p=r.x2+bt.width()+l,m=v;break;case es:p=v,m=r.y2+l;break;default:p=s.x,m=s.y}return Ba(s,"x",p)|Ba(s,"y",m)&&(bt.translate(p,m),e.dirty(s),s.bounds.clear().union(bt),t.bounds.clear().union(bt),e.dirty(s)),s.bounds}function gF(e){O.call(this,null,e)}G(gF,O,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&A8(n,i,e.layout),I8(n,i,e)}),L8(e.mark.group)?t.reflow():t}});function L8(e){return e&&e.mark.role!=="legend-entry"}function I8(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),a=new qe().set(0,0,r,s),o=a.clone(),u=a.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case Jy:h=v8(f)?o:u,h.union(w8(e,f,r,s));break;case Qy:c=f;break;case Zy:l.push(T8(e,f));break;case c8:case f8:case Z$:case eF:case tF:case nF:case iF:case rF: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||Yn,d!==eb&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];hF(e,b,O8(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===sF||n.autosize.type===aF||n.autosize.type===oF))switch(y.orient){case Xn:case Yn:a.add(b.x1,0).add(b.x2,0);break;case uo:case es:a.add(0,b.y1).add(0,b.y2)}else a.union(b)})}a.union(o).union(u),c&&a.union(M8(e,c,r,s,a)),t.clip&&a.set(0,0,t.width||0,t.height||0),P8(e,t,a,n)}function P8(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)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===d8){const g=e.padding();a-=g.left+g.right,o-=g.top+g.bottom}s===eb?(l=0,f=0,u=a,c=o):s===sF?(u=Math.max(0,a-l-d),c=Math.max(0,o-f-h)):s===aF?(u=Math.max(0,a-l-d),o=c+f+h):s===oF?(a=u+l+d,c=Math.max(0,o-f-h)):s===g8&&(a=u+l+d,o=c+f+h),e._resizeView(a,o,u,c,[l,f],r.resize)}const z8=Object.freeze(Object.defineProperty({__proto__:null,bound:uF,identifier:nb,mark:lF,overlap:cF,render:dF,viewlayout:gF},Symbol.toStringTag,{value:"Module"}));function pF(e){O.call(this,null,e)}G(pF,O,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,a=e.count==null?e.values?e.values.length:10:e.count,o=xy(s,a,e.minstep),u=e.format||UC(n,s,o,e.formatSpecifier,e.formatType,!!e.values),l=e.values?jC(s,e.values,o):wy(s,o);return r&&(i.rem=r),r=l.map((c,f)=>ye({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(ye({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function mF(e){O.call(this,null,e)}function B8(){return ye({})}function j8(e){const t=To().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(mF,O,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||B8,s=e.key||ne,a=this.value;return N(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(s))&&D("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=j8(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 yF(e){O.call(this,null,e)}G(yF,O,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(N(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||_r,u=r.enter||_r,l=r.exit||_r,c=(s&&!a?r[s]:o)||_r;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!==_r&&c!==o&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==_r&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),a||c!==_r){const f=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function bF(e){O.call(this,[],e)}G(bF,O,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Zc,a=e.scale,o=+e.limit,u=xy(a,e.count==null?5:e.count,e.minstep),l=!!e.values||s===Zc,c=e.format||HC(n,a,u,s,e.formatSpecifier,e.formatType,l),f=e.values||GC(a,u),d,h,g,p,m;return r&&(i.rem=r),s===Zc?(o&&f.length>o?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,o-1),m=!0):r=f,oe(g=e.size)?(!e.values&&a(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=$t(p=g||8),r=r.map((y,b)=>ye({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(ye({index:r.length,label:`â¦${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):s===gz?(d=a.domain(),h=PC(a,d[0],fe(d)),f.length<3&&!e.values&&d[0]!==fe(d)&&(f=[d[0],fe(d)]),r=f.map((y,b)=>ye({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=Az(a),r=f.map((y,b)=>ye({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const U8=e=>e.source.x,q8=e=>e.source.y,W8=e=>e.target.x,G8=e=>e.target.y;function ib(e){O.call(this,{},e)}ib.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(ib,O,{transform(e,t){var n=e.sourceX||U8,i=e.sourceY||q8,r=e.targetX||W8,s=e.targetY||G8,a=e.as||"path",o=e.orient||"vertical",u=e.shape||"line",l=xw.get(u+"-"+o)||xw.get(u);return l||D("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 vF=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,H8=(e,t,n,i)=>vF(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),xF=(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},V8=(e,t,n,i)=>xF(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),wF=(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},X8=(e,t,n,i)=>wF(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Y8=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,K8=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,J8=(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},Q8=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},Z8=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},e9=(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},xw=To({line:vF,"line-radial":H8,arc:xF,"arc-radial":V8,curve:wF,"curve-radial":X8,"orthogonal-horizontal":Y8,"orthogonal-vertical":K8,"orthogonal-radial":J8,"diagonal-horizontal":Q8,"diagonal-vertical":Z8,"diagonal-radial":e9});function rb(e){O.call(this,null,e)}rb.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(rb,O,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||$o,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)/oA(l),h=pn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const t9=5;function n9(e){const t=e.type;return!e.bins&&(t===no||t===$l||t===Fl)}function EF(e){return yy(e)&&e!==Ci}const i9=ti(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function _F(e){O.call(this,null,e),this.modified(!0)}G(_F,O,{transform(e,t){var n=t.dataflow,i=this.value,r=r9(e);(!i||r!==i.type)&&(this.value=i=me(r)());for(r in e)if(!i9[r]){if(r==="padding"&&EF(i.type))continue;oe(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return c9(i,e,l9(i,e,a9(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function r9(e){var t=e.type,n="",i;return t===Ci?Ci+"-"+no:(s9(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Ci+"-":i===3?Mo+"-":""),(n+t||no).toLowerCase())}function s9(e){const t=e.type;return yy(t)&&t!==Vs&&t!==Xs&&(e.scheme||e.range&&e.range.length&&e.range.every(Y))}function a9(e,t,n){const i=o9(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,a=t.zero||t.zero===void 0&&n9(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 EF(s)&&t.padding&&r[0]!==fe(r)&&(r=u9(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(SF(s,r,n)),s===hy&&e.unknown(t.domainImplicit?HM:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&xy(e,t.nice)||null),r.length}function o9(e,t,n){return t?(e.domain(SF(e.type,t,n)),t.length):-1}function u9(e,t,n,i,r,s){var a=Math.abs(fe(n)-n[0]),o=a/(a-2*i),u=e===lr?t1(t,null,o):e===Fl?kf(t,null,o,.5):e===$l?kf(t,null,o,r||1):e===th?n1(t,null,o,s||1):e1(t,null,o);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function SF(e,t,n){if(DC(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: "+q(t))}return t}function l9(e,t,n){let i=t.bins;if(i&&!N(i)){const r=e.domain(),s=r[0],a=fe(r),o=i.step;let u=i.start==null?s:i.start,l=i.stop==null?a:i.stop;o||D("Scale bins parameter missing step property."),u<s&&(u=o*Math.ceil(s/o)),l>a&&(l=o*Math.floor(a/o)),i=pn(u,l+o/2,o)}return i?e.bins=i:e.bins&&delete e.bins,e.type===gy&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function c9(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=f9(i,t,n);else if(t.scheme&&(s=d9(i,t,n),oe(s))){if(e.interpolator)return e.interpolator(s);D(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&NC(i))return e.interpolator(rh(Fm(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(by(t.interpolate,t.interpolateGamma)):oe(e.round)?e.round(r):oe(e.rangeRound)&&e.interpolate(r?iA:nA),s&&e.range(Fm(s,t.reverse))}function f9(e,t,n){e!==CC&&e!==gm&&D("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===gm?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*dy(n,r,i)]}function d9(e,t,n){var i=t.schemeExtent,r,s;return N(t.scheme)?s=rh(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=vy(r),s||D(`Unrecognized scheme name: ${t.scheme}`)),n=e===ih?n+1:e===gy?n-1:e===io||e===nh?+t.schemeCount||t9:n,NC(e)?ww(s,i,t.reverse):oe(s)?IC(ww(s,i),n):e===hy?s:s.slice(0,n)}function ww(e,t,n){return oe(e)&&(t||n)?LC(e,Fm(t||[0,1],n)):e}function Fm(e,t){return t?e.slice().reverse():e}function AF(e){O.call(this,null,e)}G(AF,O,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(la(e.sort)),this.modified(n),t}});const Ew="zero",kF="center",CF="normalize",$F=["y0","y1"];function sb(e){O.call(this,null,e)}sb.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:Ew,values:[Ew,kF,CF]},{name:"as",type:"string",array:!0,length:2,default:$F}]};G(sb,O,{transform(e,t){var n=e.as||$F,i=n[0],r=n[1],s=la(e.sort),a=e.field||$o,o=e.offset===kF?h9:e.offset===CF?g9:p9,u,l,c,f;for(u=m9(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 h9(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 g9(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 p9(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 m9(e,t,n,i){var r=[],s=p=>p(c),a,o,u,l,c,f,d,h,g;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,g=0,l=r.length;f<l;++f){for(d=r[f],o=0,h=0,u=d.length;o<u;++o)h+=Math.abs(i(d[o]));d.sum=h,h>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const y9=Object.freeze(Object.defineProperty({__proto__:null,axisticks:pF,datajoin:mF,encode:yF,legendentries:bF,linkpath:ib,pie:rb,scale:_F,sortitems:AF,stack:sb},Symbol.toStringTag,{value:"Module"}));var Hf=new qr,Vf=new qr,FF,OF,Om,Tm,Rm,Ri={point:yu,lineStart:yu,lineEnd:yu,polygonStart:function(){Hf=new qr,Ri.lineStart=b9,Ri.lineEnd=v9},polygonEnd:function(){var e=+Hf;Vf.add(e<0?l2+e:e),this.lineStart=this.lineEnd=this.point=yu},sphere:function(){Vf.add(l2)}};function b9(){Ri.point=x9}function v9(){TF(FF,OF)}function x9(e,t){Ri.point=TF,FF=e,OF=t,e*=dt,t*=dt,Om=e,Tm=Zt(t=t/2+uA),Rm=en(t)}function TF(e,t){e*=dt,t*=dt,t=t/2+uA;var n=e-Om,i=n>=0?1:-1,r=i*n,s=Zt(t),a=en(t),o=Rm*a,u=Tm*s+o*Zt(r),l=o*i*en(r);Hf.add(K0(l,u)),Om=e,Tm=s,Rm=a}function w9(e){return Vf=new qr,Y0(e,Ri),Vf*2}var De,Yt,Me,hn,Os,RF,DF,Ha,zu,$r,cr,Qi={point:Dm,lineStart:_w,lineEnd:Sw,polygonStart:function(){Qi.point=MF,Qi.lineStart=E9,Qi.lineEnd=_9,zu=new qr,Ri.polygonStart()},polygonEnd:function(){Ri.polygonEnd(),Qi.point=Dm,Qi.lineStart=_w,Qi.lineEnd=Sw,Hf<0?(De=-(Me=180),Yt=-(hn=90)):zu>dn?hn=90:zu<-dn&&(Yt=-90),cr[0]=De,cr[1]=Me},sphere:function(){De=-(Me=180),Yt=-(hn=90)}};function Dm(e,t){$r.push(cr=[De=e,Me=e]),t<Yt&&(Yt=t),t>hn&&(hn=t)}function NF(e,t){var n=VM([e*dt,t*dt]);if(Ha){var i=c2(Ha,n),r=[i[1],-i[0],0],s=c2(r,i);XM(s),s=YM(s);var a=e-Os,o=a>0?1:-1,u=s[0]*Wa*o,l,c=Za(a)>180;c^(o*Os<u&&u<o*e)?(l=s[1]*Wa,l>hn&&(hn=l)):(u=(u+360)%360-180,c^(o*Os<u&&u<o*e)?(l=-s[1]*Wa,l<Yt&&(Yt=l)):(t<Yt&&(Yt=t),t>hn&&(hn=t))),c?e<Os?cn(De,e)>cn(De,Me)&&(Me=e):cn(e,Me)>cn(De,Me)&&(De=e):Me>=De?(e<De&&(De=e),e>Me&&(Me=e)):e>Os?cn(De,e)>cn(De,Me)&&(Me=e):cn(e,Me)>cn(De,Me)&&(De=e)}else $r.push(cr=[De=e,Me=e]);t<Yt&&(Yt=t),t>hn&&(hn=t),Ha=n,Os=e}function _w(){Qi.point=NF}function Sw(){cr[0]=De,cr[1]=Me,Qi.point=Dm,Ha=null}function MF(e,t){if(Ha){var n=e-Os;zu.add(Za(n)>180?n+(n>0?360:-360):n)}else RF=e,DF=t;Ri.point(e,t),NF(e,t)}function E9(){Ri.lineStart()}function _9(){MF(RF,DF),Ri.lineEnd(),Za(zu)>dn&&(De=-(Me=180)),cr[0]=De,cr[1]=Me,Ha=null}function cn(e,t){return(t-=e)<0?t+360:t}function S9(e,t){return e[0]-t[0]}function Aw(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function A9(e){var t,n,i,r,s,a,o;if(hn=Me=-(De=Yt=1/0),$r=[],Y0(e,Qi),n=$r.length){for($r.sort(S9),t=1,i=$r[0],s=[i];t<n;++t)r=$r[t],Aw(i,r[0])||Aw(i,r[1])?(cn(i[0],r[1])>cn(i[0],i[1])&&(i[1]=r[1]),cn(r[0],i[1])>cn(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(a=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(o=cn(i[1],r[0]))>a&&(a=o,De=r[0],Me=i[1])}return $r=cr=null,De===1/0||Yt===1/0?[[NaN,NaN],[NaN,NaN]]:[[De,Yt],[Me,hn]]}var Cu,Xf,Yf,Kf,Jf,Qf,Zf,ed,Nm,Mm,Lm,LF,IF,Dt,Nt,Mt,Kn={sphere:yu,point:ab,lineStart:kw,lineEnd:Cw,polygonStart:function(){Kn.lineStart=$9,Kn.lineEnd=F9},polygonEnd:function(){Kn.lineStart=kw,Kn.lineEnd=Cw}};function ab(e,t){e*=dt,t*=dt;var n=Zt(t);jl(n*Zt(e),n*en(e),en(t))}function jl(e,t,n){++Cu,Yf+=(e-Yf)/Cu,Kf+=(t-Kf)/Cu,Jf+=(n-Jf)/Cu}function kw(){Kn.point=k9}function k9(e,t){e*=dt,t*=dt;var n=Zt(t);Dt=n*Zt(e),Nt=n*en(e),Mt=en(t),Kn.point=C9,jl(Dt,Nt,Mt)}function C9(e,t){e*=dt,t*=dt;var n=Zt(t),i=n*Zt(e),r=n*en(e),s=en(t),a=K0(KM((a=Nt*s-Mt*r)*a+(a=Mt*i-Dt*s)*a+(a=Dt*r-Nt*i)*a),Dt*i+Nt*r+Mt*s);Xf+=a,Qf+=a*(Dt+(Dt=i)),Zf+=a*(Nt+(Nt=r)),ed+=a*(Mt+(Mt=s)),jl(Dt,Nt,Mt)}function Cw(){Kn.point=ab}function $9(){Kn.point=O9}function F9(){PF(LF,IF),Kn.point=ab}function O9(e,t){LF=e,IF=t,e*=dt,t*=dt,Kn.point=PF;var n=Zt(t);Dt=n*Zt(e),Nt=n*en(e),Mt=en(t),jl(Dt,Nt,Mt)}function PF(e,t){e*=dt,t*=dt;var n=Zt(t),i=n*Zt(e),r=n*en(e),s=en(t),a=Nt*s-Mt*r,o=Mt*i-Dt*s,u=Dt*r-Nt*i,l=im(a,o,u),c=lA(l),f=l&&-c/l;Nm.add(f*a),Mm.add(f*o),Lm.add(f*u),Xf+=c,Qf+=c*(Dt+(Dt=i)),Zf+=c*(Nt+(Nt=r)),ed+=c*(Mt+(Mt=s)),jl(Dt,Nt,Mt)}function T9(e){Cu=Xf=Yf=Kf=Jf=Qf=Zf=ed=0,Nm=new qr,Mm=new qr,Lm=new qr,Y0(e,Kn);var t=+Nm,n=+Mm,i=+Lm,r=im(t,n,i);return r<f2&&(t=Qf,n=Zf,i=ed,Xf<dn&&(t=Yf,n=Kf,i=Jf),r=im(t,n,i),r<f2)?[NaN,NaN]:[K0(n,t)*Wa,lA(i/r)*Wa]}function $w(e,t,n){var i=pn(e,t-dn,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function Fw(e,t,n){var i=pn(e,t-dn,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function R9(){var e,t,n,i,r,s,a,o,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return pn(pc(i/c)*c,n,c).map(g).concat(pn(pc(o/f)*f,a,f).map(p)).concat(pn(pc(t/u)*u,e,u).filter(function(v){return Za(v%c)>dn}).map(d)).concat(pn(pc(s/l)*l,r,l).filter(function(v){return Za(v%f)>dn}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(a).slice(1),g(n).reverse().slice(1),p(o).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],o=+v[0][1],a=+v[1][1],i>n&&(v=i,i=n,n=v),o>a&&(v=o,o=a,a=v),y.precision(m)):[[i,o],[n,a]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=$w(s,r,90),h=Fw(t,e,m),g=$w(o,a,90),p=Fw(i,n,m),y):m},y.extentMajor([[-180,-90+dn],[180,90-dn]]).extentMinor([[-180,-80-dn],[180,80+dn]])}function D9(){var e=1,t=0,n=0,i=1,r=1,s=0,a,o,u=null,l,c,f,d=1,h=1,g=n5({point:function(x,E){var _=v([x,E]);this.stream.point(_[0],_[1])}}),p=d2,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,_=x[1]*h;if(s){var w=_*a-E*o;E=E*a+_*o,_=w}return[E+t,_+n]}return v.invert=function(x){var E=x[0]-t,_=x[1]-n;if(s){var w=_*a+E*o;E=E*a-_*o,_=w}return[E/d,_/h]},v.stream=function(x){return m&&y===x?m:m=g(p(y=x))},v.postclip=function(x){return arguments.length?(p=x,u=l=c=f=null,b()):p},v.clipExtent=function(x){return arguments.length?(p=x==null?(u=l=c=f=null,d2):JM(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(s=x%360*dt,o=en(s),a=Zt(s),b()):s*Wa},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return QM(v,x,E)},v.fitSize=function(x,E){return ZM(v,x,E)},v.fitWidth=function(x,E){return e5(v,x,E)},v.fitHeight=function(x,E){return t5(v,x,E)},v}function zF(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}zF.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,a=s*s;n-=r=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Za(r)>dn&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function N9(){return cA(zF).scale(175.295)}var M9=Math.abs,Im=Math.cos,td=Math.sin,L9=1e-6,BF=Math.PI,Pm=BF/2,Ow=I9(2);function Tw(e){return e>1?Pm:e<-1?-Pm:Math.asin(e)}function I9(e){return e>0?Math.sqrt(e):0}function P9(e,t){var n=e*td(t),i=30,r;do t-=r=(t+td(t)-n)/(1+Im(t));while(M9(r)>L9&&--i>0);return t/2}function z9(e,t,n){function i(r,s){return[e*r*Im(s=P9(n,s)),t*td(s)]}return i.invert=function(r,s){return s=Tw(s/t),[r/(e*Im(s)),Tw((2*s+td(2*s))/n)]},i}var B9=z9(Ow/Pm,Ow,BF);function j9(){return cA(B9).scale(169.529)}const U9=fA(),zm=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function q9(e,t){return function n(){const i=t();return i.type=e,i.path=fA().projection(i),i.copy=i.copy||function(){const r=n();return zm.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},TC(i)}}function ob(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(nd[e]=q9(e,t),this):nd[e]||null}function jF(e){return e&&e.path||U9}const nd={albers:i5,albersusa:r5,azimuthalequalarea:s5,azimuthalequidistant:a5,conicconformal:o5,conicequalarea:u5,conicequidistant:l5,equalEarth:c5,equirectangular:f5,gnomonic:d5,identity:D9,mercator:h5,mollweide:j9,naturalEarth1:N9,orthographic:g5,stereographic:p5,transversemercator:m5};for(const e in nd)ob(e,nd[e]);function W9(){}const Xi=[[],[[[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 UF(){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),G9(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(H9((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,Xi[m<<1].forEach(v);++h<e-1;)p=m,m=u[h+1]>=l,Xi[p|m<<1].forEach(v);for(Xi[m<<0].forEach(v);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,Xi[m<<1|y<<2].forEach(v);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,Xi[p|m<<1|y<<2|b<<3].forEach(v);Xi[m|y<<3].forEach(v)}for(h=-1,y=u[g*e]>=l,Xi[y<<2].forEach(v);++h<e-1;)b=y,y=u[g*e+h+1]>=l,Xi[y<<2|b<<3].forEach(v);Xi[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+g],_=[x[1][0]+h,x[1][1]+g],w=a(E),S=a(_),A,k;(A=d[w])?(k=f[S])?(delete d[A.end],delete f[k.start],A===k?(A.ring.push(_),c(A.ring)):f[A.start]=d[k.end]={start:A.start,end:k.end,ring:A.ring.concat(k.ring)}):(delete d[A.end],A.ring.push(_),d[A.end=S]=A):(A=f[S])?(k=d[w])?(delete f[A.start],delete d[k.end],A===k?(A.ring.push(_),c(A.ring)):f[k.start]=d[A.end]={start:k.start,end:A.end,ring:k.ring.concat(A.ring)}):(delete f[A.start],A.ring.unshift(E),f[A.start=w]=A):f[w]=d[S]={start:w,end:S,ring:[E,_]}}}function a(u){return u[0]*2+u[1]*(e+1)*4}function o(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||D("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?o:W9,i):n===o},i}function G9(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 H9(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=V9(e,t[n]))return r;return 0}function V9(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],h=f[1];if(X9(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function X9(e,t,n){var i;return Y9(e,t,n)&&K9(e[i=+(e[0]===t[0])],n[i],t[i])}function Y9(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function K9(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function qF(e,t,n){return function(i){var r=Oi(i),s=n?Math.min(r[0],0):r[0],a=r[1],o=a-s,u=t?Hu(s,a,e):o/(e+1);return pn(s+u,a,u)}}function ub(e){O.call(this,null,e)}ub.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(ub,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Ct,s=UF().smooth(e.smooth!==!1),a=e.thresholds||J9(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,N(a)?a:a(c.values));Q9(f,c,l,e),f.forEach(d=>{u.push(Wd(l,ye(o!=null?{[o]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function J9(e,t,n){const i=qF(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Mu(t(r).values)))}function Q9(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(oe(r)&&(r=r(n,i)),oe(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const a=(pe(r)?r:r[0])||1,o=(pe(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(WF(t,a,o,u,l))}function WF(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 Rw(e,t,n){const i=e>=0?e:w1(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Hg(e){return oe(e)?e:$t(+e)}function GF(){var e=u=>u[0],t=u=>u[1],n=$o,i=[-1,-1],r=960,s=500,a=2;function o(u,l){const c=Rw(i[0],u,e)>>a,f=Rw(i[1],u,t)>>a,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>a),p=2*h+(s>>a),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(x=>{const E=d+(+e(x)>>a),_=h+(+t(x)>>a);E>=0&&E<g&&_>=0&&_<p&&(m[E+_*g]+=+n(x))}),c>0&&f>0?(Ca(g,p,m,y,c),$a(g,p,y,m,f),Ca(g,p,m,y,c),$a(g,p,y,m,f),Ca(g,p,m,y,c),$a(g,p,y,m,f)):c>0?(Ca(g,p,m,y,c),Ca(g,p,y,m,c),Ca(g,p,m,y,c),b=y):f>0&&($a(g,p,m,y,f),$a(g,p,y,m,f),$a(g,p,m,y,f),b=y);const v=l?Math.pow(2,-2*a):1/oA(b);for(let x=0,E=g*p;x<E;++x)b[x]*=v;return{values:b,scale:1<<a,width:g,height:p,x1:d,y1:h,x2:d+(r>>a),y2:h+(s>>a)}}return o.x=function(u){return arguments.length?(e=Hg(u),o):e},o.y=function(u){return arguments.length?(t=Hg(u),o):t},o.weight=function(u){return arguments.length?(n=Hg(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||D("invalid size"),r=l,s=c,o},o.cellSize=function(u){return arguments.length?((u=+u)>=1||D("invalid cell size"),a=Math.floor(Math.log(u)/Math.LN2),o):1<<a},o.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&D("invalid bandwidth"),i=u,o):i},o}function Ca(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 $a(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 lb(e){O.call(this,null,e)}lb.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 Z9=["x","y","weight","size","cellSize","bandwidth"];function HF(e,t){return Z9.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(lb,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e7(i,e.groupby),s=(e.groupby||[]).map(Pe),a=HF(GF(),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=>ye(l({[o]:a(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function e7(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 cb(e){O.call(this,null,e)}cb.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(cb,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=UF().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||qF(e.count||10,e.nice,!!r),a=e.size,o,u;return r||(r=t.materialize(t.SOURCE).source,o=HF(GF(),e)(r,!0),u=WF(o,o.scale||1,o.scale||1,0,0),a=[o.width,o.height],r=o.values),s=N(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(ye),n}});const Bm="Feature",fb="FeatureCollection",t7="MultiPoint";function db(e){O.call(this,null,e)}db.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(db,O,{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&&Ct,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(_t(o))||s&&t.modified(_t(s))||a&&t.modified(_t(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:Bm,geometry:{type:t7,coordinates:i}})),this.value={type:fb,features:n}}});function hb(e){O.call(this,null,e)}hb.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(hb,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Ct,s=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=jF(e.projection),n.materialize().reflow()):a=r===Ct||t.modified(r.fields)?n.ADD_MOD:n.ADD;const o=n7(i,e.pointRadius);return n.visit(a,u=>u[s]=i(r(u))),i.pointRadius(o),n.modifies(s)}});function n7(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function gb(e){O.call(this,null,e)}gb.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(gb,O,{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 pb(e){O.call(this,null,e)}pb.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(pb,O,{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=i7(jF(e.projection),e.field||Dn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,a=>a[r]=i),n.modifies(r)}});function i7(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 mb(e){O.call(this,[],e),this.generator=R9()}mb.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(mb,O,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)oe(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(bk(n[0],r)):t.add.push(ye(r)),n[0]=r,t}});function yb(e){O.call(this,null,e)}yb.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(yb,O,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Ct,s=s7(e.opacity,e),a=r7(e.color,e),o=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Mu(n.map(l=>Mu(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ae({},l,u);i||(f.$max=Mu(c.values||[])),l[o]=a7(c,f,a.dep?a:$t(a(f)),s.dep?s:$t(s(f)))}),t.reflow(!0).modifies(o)}});function r7(e,t){let n;return oe(e)?(n=i=>Sf(e(i,t)),n.dep=VF(e)):n=$t(Sf(e||"#888")),n}function s7(e,t){let n;return oe(e)?(n=i=>e(i,t),n.dep=VF(e)):e?n=$t(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function VF(e){if(!oe(e))return!1;const t=ti(_t(e));return t.$x||t.$y||t.$value||t.$max}function a7(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]:Tr,d=Hr(u-a,l-o),h=d.getContext("2d"),g=h.getImageData(0,0,u-a,l-o),p=g.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 x=n(t);p[y+0]=x.r,p[y+1]=x.g,p[y+2]=x.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function XF(e){O.call(this,null,e),this.modified(!0)}G(XF,O,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=u7(e.type),zm.forEach(i=>{e[i]!=null&&Dw(n,i,e[i])})):zm.forEach(i=>{e.modified(i)&&Dw(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&o7(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function o7(e,t){const n=l7(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function u7(e){const t=ob((e||"mercator").toLowerCase());return t||D("Unrecognized projection type: "+e),t()}function Dw(e,t,n){oe(e[t])&&e[t](n)}function l7(e){return e=X(e),e.length===1?e[0]:{type:fb,features:e.reduce((t,n)=>t.concat(c7(n)),[])}}function c7(e){return e.type===fb?e.features:X(e).filter(t=>t!=null).map(t=>t.type===Bm?t:{type:Bm,geometry:t})}const f7=Object.freeze(Object.defineProperty({__proto__:null,contour:cb,geojson:db,geopath:hb,geopoint:gb,geoshape:pb,graticule:mb,heatmap:yb,isocontour:ub,kde2d:lb,projection:XF},Symbol.toStringTag,{value:"Module"}));function d7(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,a=n.length,o,u=0,l=0;for(s=0;s<a;++s)o=n[s],u+=o.x,l+=o.y;for(u=(u/a-e)*i,l=(l/a-t)*i,s=0;s<a;++s)o=n[s],o.x-=u,o.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function h7(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return YF(this.cover(t,n),t,n,e)}function YF(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,a={data:i},o=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,g,p,m,y,b;if(!s)return e._root=a,e;for(;s.length;)if((p=t>=(f=(o+l)/2))?o=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|p]))return r[y]=a,e;if(h=+e._x.call(null,s.data),g=+e._y.call(null,s.data),t===h&&n===g)return a.next=s,r?r[y]=a:e._root=a,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(p=t>=(f=(o+l)/2))?o=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=s,r[y]=a,e}function g7(e){var t,n,i=e.length,r,s,a=new Array(i),o=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(a[n]=r,o[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)YF(this,a[n],o[n],e[n]);return this}function p7(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var a=r-n||1,o=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=o,o=u,a*=2,l){case 0:r=n+a,s=i+a;break;case 1:n=r-a,s=i+a;break;case 2:r=n+a,i=s-a;break;case 3:n=r-a,i=s-a;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function m7(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function y7(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Lt(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function b7(e,t,n){var i,r=this._x0,s=this._y0,a,o,u,l,c=this._x1,f=this._y1,d=[],h=this._root,g,p;for(h&&d.push(new Lt(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(a=g.x0)>c||(o=g.y0)>f||(u=g.x1)<r||(l=g.y1)<s))if(h.length){var m=(a+u)/2,y=(o+l)/2;d.push(new Lt(h[3],m,y,u,l),new Lt(h[2],a,y,m,l),new Lt(h[1],m,o,u,y),new Lt(h[0],a,o,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,s=t-E,c=e+E,f=t+E,i=h.data}}return i}function v7(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,a=this._x0,o=this._y0,u=this._x1,l=this._y1,c,f,d,h,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(a+u)/2))?a=d:u=d,(p=f>=(h=(o+l)/2))?o=h:l=h,t=n,!(n=n[m=p<<1|g]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function x7(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function w7(){return this._root}function E7(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function _7(e){var t=[],n,i=this._root,r,s,a,o,u;for(i&&t.push(new Lt(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,a=n.y0,o=n.x1,u=n.y1)&&i.length){var l=(s+o)/2,c=(a+u)/2;(r=i[3])&&t.push(new Lt(r,l,c,o,u)),(r=i[2])&&t.push(new Lt(r,s,c,l,u)),(r=i[1])&&t.push(new Lt(r,l,a,o,c)),(r=i[0])&&t.push(new Lt(r,s,a,l,c))}return this}function S7(e){var t=[],n=[],i;for(this._root&&t.push(new Lt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,a=i.x0,o=i.y0,u=i.x1,l=i.y1,c=(a+u)/2,f=(o+l)/2;(s=r[0])&&t.push(new Lt(s,a,o,c,f)),(s=r[1])&&t.push(new Lt(s,c,o,u,f)),(s=r[2])&&t.push(new Lt(s,a,f,c,l)),(s=r[3])&&t.push(new Lt(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function A7(e){return e[0]}function k7(e){return arguments.length?(this._x=e,this):this._x}function C7(e){return e[1]}function $7(e){return arguments.length?(this._y=e,this):this._y}function bb(e,t,n){var i=new vb(t??A7,n??C7,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function vb(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function Nw(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var jt=bb.prototype=vb.prototype;jt.copy=function(){var e=new vb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=Nw(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=Nw(i));return e};jt.add=h7;jt.addAll=g7;jt.cover=p7;jt.data=m7;jt.extent=y7;jt.find=b7;jt.remove=v7;jt.removeAll=x7;jt.root=w7;jt.size=E7;jt.visit=_7;jt.visitAfter=S7;jt.x=k7;jt.y=$7;function It(e){return function(){return e}}function Br(e){return(e()-.5)*1e-6}function F7(e){return e.x+e.vx}function O7(e){return e.y+e.vy}function T7(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=It(e==null?1:+e));function a(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<s;++y)for(f=bb(t,F7,O7).visitAfter(o),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(v,x,E,_,w){var S=v.data,A=v.r,k=p+A;if(S){if(S.index>d.index){var F=h-S.x-S.vx,L=g-S.y-S.vy,M=F*F+L*L;M<k*k&&(F===0&&(F=Br(i),M+=F*F),L===0&&(L=Br(i),M+=L*L),M=(k-(M=Math.sqrt(M)))/M*r,d.vx+=(F*=M)*(k=(A*=A)/(m+A)),d.vy+=(L*=M)*k,S.vx-=F*(k=1-k),S.vy-=L*k)}return}return x>h+k||_<h-k||E>g+k||w<g-k}}function o(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return a.initialize=function(l,c){t=l,i=c,u()},a.iterations=function(l){return arguments.length?(s=+l,a):s},a.strength=function(l){return arguments.length?(r=+l,a):r},a.radius=function(l){return arguments.length?(e=typeof l=="function"?l:It(+l),u(),a):e},a}function R7(e){return e.index}function Mw(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function D7(e){var t=R7,n=f,i,r=It(30),s,a,o,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(o[m.source.index],o[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,_,w,S,A,k;v<b;++v)x=e[v],E=x.source,_=x.target,w=_.x+_.vx-E.x-E.vx||Br(l),S=_.y+_.vy-E.y-E.vy||Br(l),A=Math.sqrt(w*w+S*S),A=(A-s[v])/A*m*i[v],w*=A,S*=A,_.vx-=w*(k=u[v]),_.vy-=S*k,E.vx+=w*(k=1-k),E.vy+=S*k}function h(){if(a){var m,y=a.length,b=e.length,v=new Map(a.map((E,_)=>[t(E,_,a),E])),x;for(m=0,o=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=Mw(v,x.source)),typeof x.target!="object"&&(x.target=Mw(v,x.target)),o[x.source.index]=(o[x.source.index]||0)+1,o[x.target.index]=(o[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=o[x.source.index]/(o[x.source.index]+o[x.target.index]);i=new Array(b),g(),s=new Array(b),p()}}function g(){if(a)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){if(a)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){a=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c}
10,d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:It(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:It(+m),p(),d):r},d}function N7(e,t,n){var i=new b5,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,a,o){a=+a,o=o==null?y5():+o,i._restart(function u(l){l+=r,i._restart(u,r+=a,o),s(l)},a,o)},i.restart(e,t,n),i)}const M7=1664525,L7=1013904223,Lw=4294967296;function I7(){let e=1;return()=>(e=(M7*e+L7)%Lw)/Lw}function P7(e){return e.x}function z7(e){return e.y}var B7=10,j7=Math.PI*(3-Math.sqrt(5));function U7(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,a=.6,o=new Map,u=v5(f),l=x5("tick","end"),c=I7();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var v=0;v<p;++v)for(n+=(s-n)*r,o.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=a:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=a:(b.y=b.fy,b.vy=0);return t}function h(){for(var p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=B7*Math.sqrt(.5+p),v=p*j7;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),o.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(s=+p,t):s},velocityDecay:function(p){return arguments.length?(a=1-p,t):1-a},randomSource:function(p){return arguments.length?(c=p,o.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?o.delete(p):o.set(p,g(m)),t):o.get(p)},find:function(p,m,y){var b=0,v=e.length,x,E,_,w,S;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=p-w.x,E=m-w.y,_=x*x+E*E,_<y&&(S=w,y=_);return S},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function q7(){var e,t,n,i,r=It(-30),s,a=1,o=1/0,u=.81;function l(h){var g,p=e.length,m=bb(e,P7,z7).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(s=new Array(g),h=0;h<g;++h)p=e[h],s[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(p=h[x])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,v+=m*p.y);h.x=b/y,h.y=v/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=s[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-g,x=y*y+b*b;if(v*v/u<x)return x<o&&(y===0&&(y=Br(n),x+=y*y),b===0&&(b=Br(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=o)return;(h.data!==t||h.next)&&(y===0&&(y=Br(n),x+=y*y),b===0&&(b=Br(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)));do h.data!==t&&(v=s[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:It(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.distanceMax=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function W7(e){var t=It(.1),n,i,r;typeof e!="function"&&(e=It(e==null?0:+e));function s(o){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*o}function a(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+e(n[o],o,n))?0:+t(n[o],o,n)}}return s.initialize=function(o){n=o,a()},s.strength=function(o){return arguments.length?(t=typeof o=="function"?o:It(+o),a(),s):t},s.x=function(o){return arguments.length?(e=typeof o=="function"?o:It(+o),a(),s):e},s}function G7(e){var t=It(.1),n,i,r;typeof e!="function"&&(e=It(e==null?0:+e));function s(o){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*o}function a(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+e(n[o],o,n))?0:+t(n[o],o,n)}}return s.initialize=function(o){n=o,a()},s.strength=function(o){return arguments.length?(t=typeof o=="function"?o:It(+o),a(),s):t},s.y=function(o){return arguments.length?(e=typeof o=="function"?o:It(+o),a(),s):e},s}const Iw={center:d7,collide:T7,nbody:q7,link:D7,x:W7,y:G7},$u="forces",jm=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],H7=["static","iterations"],KF=["x","y","vx","vy"];function xb(e){O.call(this,null,e)}xb.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:KF}]};G(xb,O,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(jm),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&JF(n,e,0,t)):(this.value=n=X7(t.source,e),n.on("tick",V7(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(H7)||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!==$u||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(KF)}});function V7(e,t){return()=>e.touch(t).run()}function X7(e,t){const n=U7(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),JF(n,t,!0).on("end",()=>s=!0)}function JF(e,t,n,i){var r=X(t.forces),s,a,o,u;for(s=0,a=jm.length;s<a;++s)o=jm[s],o!==$u&&t.modified(o)&&e[o](t[o]);for(s=0,a=r.length;s<a;++s)u=$u+s,o=n||t.modified($u,s)?K7(r[s]):i&&Y7(r[s],i)?e.force(u):null,o&&e.force(u,o);for(a=e.numForces||0;s<a;++s)e.force($u+s,null);return e.numForces=r.length,e}function Y7(e,t){var n,i;for(n in e)if(oe(i=e[n])&&t.modified(_t(i)))return 1;return 0}function K7(e){var t,n;K(Iw,e.force)||D("Unrecognized force: "+e.force),t=Iw[e.force]();for(n in e)oe(t[n])&&J7(t[n],e[n],e);return t}function J7(e,t,n){e(oe(t)?i=>t(i,n):t)}const Q7=Object.freeze(Object.defineProperty({__proto__:null,force:xb},Symbol.toStringTag,{value:"Module"}));function Z7(e,t){return e.parent===t.parent?1:2}function eB(e){return e.reduce(tB,0)/e.length}function tB(e,t){return e+t.x}function nB(e){return 1+e.reduce(iB,0)}function iB(e,t){return Math.max(e,t.y)}function rB(e){for(var t;t=e.children;)e=t[0];return e}function sB(e){for(var t;t=e.children;)e=t[t.length-1];return e}function aB(){var e=Z7,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(d){var h=d.children;h?(d.x=eB(h),d.y=nB(h)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var u=rB(s),l=sB(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function oB(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function uB(){return this.eachAfter(oB)}function lB(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function cB(e,t){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(e.call(t,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function fB(e,t){for(var n=this,i=[n],r=[],s,a,o,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)i.push(s[a]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function dB(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function hB(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function gB(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function pB(e){for(var t=this,n=mB(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function mB(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function yB(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function bB(){return Array.from(this)}function vB(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function xB(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*wB(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function wb(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=SB)):t===void 0&&(t=_B);for(var n=new lo(e),i,r=[n],s,a,o,u;i=r.pop();)if((a=t(i.data))&&(u=(a=Array.from(a)).length))for(i.children=a,o=u-1;o>=0;--o)r.push(s=a[o]=new lo(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(QF)}function EB(){return wb(this).eachBefore(AB)}function _B(e){return e.children}function SB(e){return Array.isArray(e)?e[1]:null}function AB(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function QF(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lo(e){this.data=e,this.depth=this.height=0,this.parent=null}lo.prototype=wb.prototype={constructor:lo,count:uB,each:lB,eachAfter:fB,eachBefore:cB,find:dB,sum:hB,sort:gB,path:pB,ancestors:yB,descendants:bB,leaves:vB,links:xB,copy:EB,[Symbol.iterator]:wB};function lf(e){return e==null?null:ZF(e)}function ZF(e){if(typeof e!="function")throw new Error;return e}function Ls(){return 0}function Ma(e){return function(){return e}}const kB=1664525,CB=1013904223,Pw=4294967296;function $B(){let e=1;return()=>(e=(kB*e+CB)%Pw)/Pw}function FB(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function OB(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function TB(e,t){for(var n=0,i=(e=OB(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&eO(a,s)?++n:(a=DB(r=RB(r,s)),n=0);return a}function RB(e,t){var n,i;if(Vg(t,e))return[t];for(n=0;n<e.length;++n)if(kc(t,e[n])&&Vg(Fu(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(kc(Fu(e[n],e[i]),t)&&kc(Fu(e[n],t),e[i])&&kc(Fu(e[i],t),e[n])&&Vg(tO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function kc(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function eO(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Vg(e,t){for(var n=0;n<t.length;++n)if(!eO(e,t[n]))return!1;return!0}function DB(e){switch(e.length){case 1:return NB(e[0]);case 2:return Fu(e[0],e[1]);case 3:return tO(e[0],e[1],e[2])}}function NB(e){return{x:e.x,y:e.y,r:e.r}}function Fu(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,u=s-n,l=a-i,c=o-r,f=M
vendor: 4,177 bytes, line 10
10ath.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+a+l/f*c)/2,r:(f+r+o)/2}}function tO(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-a,h=i-l,g=r-o,p=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,v=b-a*a-o*o+u*u,x=b-l*l-c*c+f*f,E=h*g-d*p,_=(g*x-p*v)/(E*2)-i,w=(p*m-g*y)/E,S=(h*v-d*x)/(E*2)-r,A=(d*y-h*m)/E,k=w*w+A*A-1,F=2*(s+_*w+S*A),L=_*_+S*S-s*s,M=-(Math.abs(k)>1e-6?(F+Math.sqrt(F*F-4*k*L))/(2*k):L/F);return{x:i+_+w*M,y:r+S+A*M,r:M}}function zw(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,u,l=i*i+a*a;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),o=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(l+s-u)/(2*l),o=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-o*a,n.y=t.y+r*a+o*i)):(n.x=t.x+n.r,n.y=t.y)}function Bw(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function jw(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Cc(e){this._=e,this.next=null,this.previous=null}function MB(e,t){if(!(s=(e=FB(e)).length))return 0;var n,i,r,s,a,o,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;zw(i,n,r=e[2]),n=new Cc(n),i=new Cc(i),r=new Cc(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){zw(n._,i._,r=e[u]),r=new Cc(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(Bw(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(Bw(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=jw(n);(r=r.next)!==i;)(o=jw(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=TB(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function LB(e){return Math.sqrt(e.value)}function IB(){var e=null,t=1,n=1,i=Ls;function r(s){const a=$B();return s.x=t/2,s.y=n/2,e?s.eachBefore(Uw(e)).eachAfter(Xg(i,.5,a)).eachBefore(qw(1)):s.eachBefore(Uw(LB)).eachAfter(Xg(Ls,1,a)).eachAfter(Xg(i,s.r/Math.min(t,n),a)).eachBefore(qw(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=lf(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Ma(+s),r):i},r}function Uw(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xg(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,u;if(o)for(s=0;s<a;++s)r[s].r+=o;if(u=MB(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=u+o}}}function qw(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function nO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ul(e,t,n,i,r){for(var s=e.children,a,o=-1,u=s.length,l=e.value&&(i-t)/e.value;++o<u;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*l}function PB(){var e=1,t=1,n=0,i=!1;function r(a){var o=a.height+1;return a.x0=a.y0=n,a.x1=e,a.y1=t/o,a.eachBefore(s(t,o)),i&&a.eachBefore(nO),a}function s(a,o){return function(u){u.children&&Ul(u,u.x0,a*(u.depth+1)/o,u.x1,a*(u.depth+2)/o);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(a){return arguments.length?(i=!!a,r):i},r.size=function(a){return arguments.length?(e=+a[0],t=+a[1],r):[e,t]},r.padding=function(a){return arguments.length?(n=+a,r):n},r}var zB={depth:-1},Ww={},Yg={};function BB(e){return e.id}function jB(e){return e.parentId}function Gw(){var e=BB,t=jB,n;function i(r){var s=Array.from(r),a=e,o=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=s.map((x,E)=>UB(n(x,E,r))),b=y.map(Hw),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(Hw(x)),s.push(Yg));a=(x,E)=>y[E],o=(x,E)=>b[E]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new lo(l),(g=a(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?Ww:h)),(g=o(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=s[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===Ww)throw new Error("ambiguous: "+g);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");
10if(n!=null){for(;f.data===Yg&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Yg);--y)h.data=null}if(f.parent=zB,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(QF),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=lf(r),i):e},i.parentId=function(r){return arguments.length?(t=lf(r),i):t},i.path=function(r){return arguments.length?(n=lf(r),i):n},i}function UB(e){e=`${e}`;let t=e.length;return Um(e,t-1)&&!Um(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Hw(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Um(e,t););return e.slice(0,t)}function Um(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function qB(e,t){return e.parent===t.parent?1:2}function Kg(e){var t=e.children;return t?t[0]:e.t}function Jg(e){var t=e.children;return t?t[t.length-1]:e.t}function WB(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function GB(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function HB(e,t,n){return e.a.parent===t.parent?e.a:n}function cf(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}cf.prototype=Object.create(lo.prototype);function VB(e){for(var t=new cf(e,0),n,i=[t],r,s,a,o;n=i.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)i.push(r=n.children[a]=new cf(s[a],a)),r.parent=n;return(t.parent=new cf(null,0)).children=[t],t}function XB(){var e=qB,t=1,n=1,i=null;function r(l){var c=VB(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(a),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){GB(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=o(l,d,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function o(l,c,f){if(c){for(var d=l,h=l,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,v=p.m,x;g=Jg(g),d=Kg(d),g&&d;)p=Kg(p),h=Jg(h),h.a=l,x=g.z+b-d.z-m+e(g._,d._),x>0&&(WB(HB(g,l,f),l,x),m+=x,y+=x),b+=g.m,m+=d.m,v+=p.m,y+=h.m;g&&!Jg(h)&&(h.t=g,h.m+=b-y),d&&!Kg(p)&&(p.t=d,p.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function yh(e,t,n,i,r){for(var s=e.children,a,o=-1,u=s.length,l=e.value&&(r-n)/e.value;++o<u;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*l}var iO=(1+Math.sqrt(5))/2;function rO(e,t,n,i,r,s){for(var a=[],o=t.children,u,l,c=0,f=0,d=o.length,h,g,p=t.value,m,y,b,v,x,E,_;c<d;){h=r-n,g=s-i;do m=o[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(g/h,h/g)/(p*e),_=m*m*E,x=Math.max(b/_,_/y);f<d;++f){if(m+=l=o[f].value,l<y&&(y=l),l>b&&(b=l),_=m*m*E,v=Math.max(b/_,_/y),v>x){m-=l;break}x=v}a.push(u={value:m,dice:h<g,children:o.slice(c,f)}),u.dice?Ul(u,n,i,r,p?i+=g*m/p:s):yh(u,n,i,p?n+=h*m/p:r,s),p-=m,c=f}return a}const sO=function e(t){function n(i,r,s,a,o){rO(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(iO);function YB(){var e=sO,t=!1,n=1,i=1,r=[0],s=Ls,a=Ls,o=Ls,u=Ls,l=Ls;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(nO),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=s(d)/2,g+=l(d)-h,p+=a(d)-h,m-=o(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=ZF(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Ma(+d),c):s},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:Ma(+d),c):a},c.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:Ma(+d),c):o},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Ma(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Ma(+d),c):l},c}function KB(e,t,n,i,r){var s=e.children,a,o=s.length,u,l=new Array(o+1);for(l[0]=u=a=0;a<o;++a)l[a+1]=u+=s[a].value;c(0,o,e.value,t,n,i,r);function c(f,d,h,g,p,m,y){if(f>=d-1){var b=s[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,_=d-1;E<_;){var w=E+_>>>1;l[w]<x?E=w+1:_=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var S=l[E]-v,A=h-S;if(m-g>y-p){var k=h?(g*A+m*S)/h:m;c(f,E,S,g,p,k,y),c(E,d,A,k,p,m,y)}else{var F=h?(p*A+y*S)/h:y;c(f,E,S,g,p,m,F),c(E,d,A,g,F,m,y)}}}function JB(e,t,n,i,r){(e.depth&1?yh:Ul)(e,t,n,i,r)}const QB=function e(t){function n(i,r,s,a,o){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?Ul(l,r,s,a,p?s+=(o-s)*l.value/p:o):yh(l,r,s,p?r+=(a-r)*l.value/p:a,o),p-=l.value}else i._squarify=u=rO(t,i,r,s,a,o),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(iO);function qm(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function Eb(e){O.call(this,null,e)}Eb.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const ZB=e=>e.values;
vendor: 52,415 bytes, line 10
10G(Eb,O,{transform(e,t){t.source||D("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&&qd(a.data)&&r.rem.push(a.data)}),this.value=s=wb({values:X(e.keys).reduce((a,o)=>(a.key(o),a),ej()).entries(r.source)},ZB),n&&s.each(a=>{a.children&&(a=ye(a.data),r.add.push(a),r.source.push(a))}),qm(s,ne,ne)),r.source.root=s,r}});function ej(){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,h;for(;++c<a;)f=o(d=r[c])+"",(h=u[f])?h.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 gr(e){O.call(this,null,e)}const tj=(e,t)=>e.parent===t.parent?1:2;G(gr,O,{transform(e,t){(!t.source||!t.source.root)&&D(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(la(e.sort,a=>a.data)),nj(n,this.params,e),n.separation&&n.separation(e.separation!==!1?tj:$o);try{this.value=n(r)}catch(a){D(a)}return r.each(a=>ij(a,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function nj(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 ij(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 Wm=["x","y","r","depth","children"];function _b(e){gr.call(this,e)}_b.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:Wm.length,default:Wm}]};G(_b,gr,{layout:IB,params:["radius","size","padding"],fields:Wm});const Gm=["x0","y0","x1","y1","depth","children"];function Sb(e){gr.call(this,e)}Sb.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:Gm.length,default:Gm}]};G(Sb,gr,{layout:PB,params:["size","round","padding"],fields:Gm});function Ab(e){O.call(this,null,e)}Ab.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(Ab,O,{transform(e,t){t.source||D("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?qm(Gw().id(e.key).parentId(e.parentKey)(r.source),e.key,Nn):qm(Gw()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Vw={tidy:XB,cluster:aB},Hm=["x","y","depth","children"];function kb(e){gr.call(this,e)}kb.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:Hm.length,default:Hm}]};G(kb,gr,{layout(e){const t=e||"tidy";if(K(Vw,t))return Vw[t]();D("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Hm});function Cb(e){O.call(this,[],e)}Cb.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(Cb,O,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||D("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,a=>s[ne(a)]=1),i.each(a=>{const o=a.data,u=a.parent&&a.parent.data;u&&s[ne(o)]&&s[ne(u)]&&r.add.push(ye({source:u,target:o}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,a=>s[ne(a)]=1),n.forEach(a=>{(s[ne(a.source)]||s[ne(a.target)])&&r.mod.push(a)})),r}});const Xw={binary:KB,dice:Ul,slice:yh,slicedice:JB,squarify:sO,resquarify:QB},Vm=["x0","y0","x1","y1","depth","children"];function $b(e){gr.call(this,e)}$b.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:Vm.length,default:Vm}]};G($b,gr,{layout(){const e=YB();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{K(Xw,t)?e.tile(Xw[t]):D("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Vm});const rj=Object.freeze(Object.defineProperty({__proto__:null,nest:Eb,pack:_b,partition:Sb,stratify:Ab,tree:kb,treelinks:Cb,treemap:$b},Symbol.toStringTag,{value:"Module"})),Qg=4278190080;function sj(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function aj(e,t,n,i,r){const s=e.width,a=e.height,o=i||r,u=Hr(s,a).getContext("2d"),l=Hr(s,a).getContext("2d"),c=o&&Hr(s,a).getContext("2d");n.forEach(S=>ff(u,S,!1)),ff(l,t,!1),o&&ff(c,t,!0);const f=Zg(u,s,a),d=Zg(l,s,a),h=o&&Zg(c,s,a),g=e.bitmap(),p=o&&e.bitmap();let m,y,b,v,x,E,_,w;for(y=0;y<a;++y)for(m=0;m<s;++m)x=y*s+m,E=f[x]&Qg,w=d[x]&Qg,_=o&&h[x]&Qg,(E||_||w)&&(b=e(m),v=e(y),!r&&(E||w)&&g.set(b,v),o&&(E||_)&&p.set(b,v));return[g,p]}function Zg(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function ff(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>ff(e,s.items,n))}):_n[i].draw(e,{items:n?t.map(oj):t})}function oj(e){const t=Wd(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Yi=5,Ft=31,el=32,Fr=new Uint32Array(el+1),Vn=new Uint32Array(el+1);Vn[0]=0;Fr[0]=~Vn[0];for(let e=1;e<=el;++e)Vn[e]=Vn[e-1]<<1|1,Fr[e]=~Vn[e];function uj(e,t){const n=new Uint32Array(~~((e*t+el)/el));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>>>Yi]&1<<(o&Ft)},set:(s,a)=>{const o=a*e+s;i(o>>>Yi,1<<(o&Ft))},clear:(s,a)=>{const o=a*e+s;r(o>>>Yi,~(1<<(o&Ft)))},getRange:(s,a,o,u)=>{let l=u,c,f,d,h;for(;l>=a;--l)if(c=l*e+s,f=l*e+o,d=c>>>Yi,h=f>>>Yi,d===h){if(n[d]&Fr[c&Ft]&Vn[(f&Ft)+1])return!0}else{if(n[d]&Fr[c&Ft]||n[h]&Vn[(f&Ft)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])return!0}return!1},setRange:(s,a,o,u)=>{let l,c,f,d,h;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Yi,d=c>>>Yi,f===d)i(f,Fr[l&Ft]&Vn[(c&Ft)+1]);else for(i(f,Fr[l&Ft]),i(d,Vn[(c&Ft)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,a,o,u)=>{let l,c,f,d,h;for(;a<=u;++a)if(l=a*e+s,c=a*e+o,f=l>>>Yi,d=c>>>Yi,f===d)r(f,Vn[l&Ft]|Fr[(c&Ft)+1]);else for(r(f,Vn[l&Ft]),r(d,Fr[(c&Ft)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,a,o,u)=>s<0||a<0||u>=t||o>=e}}function lj(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=()=>uj(r,s),a.ratio=i,a.padding=n,a.width=e,a.height=t,a}function cj(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=bn.width(a.datum,a.datum.text);let f=0,d,h,g,p,m,y,b;for(let v=0;v<u;++v)d=o[v].x,g=o[v].y,h=o[v].x2===void 0?d:o[v].x2,p=o[v].y2===void 0?g:o[v].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),b>=f&&(f=b,a.x=m,a.y=y);return m=c/2,y=l/2,d=a.x-m,h=a.x+m,g=a.y-y,p=a.y+y,a.align="center",d<0&&h<=r?a.align="left":0<=d&&r<h&&(a.align="right"),a.baseline="middle",g<0&&p<=s?a.baseline="top":0<=g&&s<p&&(a.baseline="bottom"),!0}}function id(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 jr(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 fj(e,t,n,i){const r=e.width,s=e.height,a=t[0],o=t[1];function u(l,c,f,d,h){const g=e.invert(l),p=e.invert(c);let m=f,y=s,b;if(!id(g,p,d,h,r,s)&&!jr(e,g,p,h,d,m,a,o)&&!jr(e,g,p,h,d,h,a,null)){for(;y-m>=1;)b=(m+y)/2,jr(e,g,p,h,d,b,a,o)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=bn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,v,x,E,_,w,S,A,k,F,L,M,C,$,T,I,W;for(let j=0;j<f;++j){for(b=c[j].x,x=c[j].y,v=c[j].x2===void 0?b:c[j].x2,E=c[j].y2===void 0?x:c[j].y2,b>v&&(W=b,b=v,v=W),x>E&&(W=x,x=E,E=W),k=e(b),L=e(v),F=~~((k+L)/2),M=e(x),$=e(E),C=~~((M+$)/2),S=F;S>=k;--S)for(A=C;A>=M;--A)I=u(S,A,g,h,d),I&&([l.x,l.y,g,p]=I);for(S=F;S<=L;++S)for(A=C;A<=$;++A)I=u(S,A,g,h,d),I&&([l.x,l.y,g,p]=I);!p&&!n&&(T=Math.abs(v-b+E-x),_=(b+v)/2,w=(x+E)/2,T>=y&&!id(_,w,h,d,r,s)&&!jr(e,_,w,d,h,d,a,null)&&(y=T,l.x=_,l.y=w,m=!0))}return p||m?(_=h/2,w=d/2,a.setRange(e(l.x-_),e(l.y-w),e(l.x+_),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const dj=[-1,-1,1,1],hj=[-1,1,-1,1];function gj(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,h=bn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,v,x,E,_,w,S,A,k,F,L,M,C;for(let $=0;$<f;++$){for(v=c[$].x,E=c[$].y,x=c[$].x2===void 0?v:c[$].x2,_=c[$].y2===void 0?E:c[$].y2,g.push([e((v+x)/2),e((E+_)/2)]);g.length;)if([A,k]=g.pop(),!(a.get(A,k)||o.get(A,k)||u.get(A,k))){u.set(A,k);for(let T=0;T<4;++T)w=A+dj[T],S=k+hj[T],u.outOfBounds(w,S,w,S)||g.push([w,S]);if(w=e.invert(A),S=e.invert(k),F=p,L=s,!id(w,S,h,d,r,s)&&!jr(e,w,S,d,h,F,a,o)&&!jr(e,w,S,d,h,d,a,null)){for(;L-F>=1;)M=(F+L)/2,jr(e,w,S,d,h,M,a,o)?L=M:F=M;F>p&&(l.x=w,l.y=S,p=F,m=!0)}}!m&&!n&&(C=Math.abs(x-v+_-E),w=(v+x)/2,S=(E+_)/2,C>=b&&!id(w,S,h,d,r,s)&&!jr(e,w,S,d,h,d,a,null)&&(b=C,l.x=w,l.y=S,y=!0))}return m||y?(w=h/2,S=d/2,a.setRange(e(l.x-w),e(l.y-S),e(l.x+w),e(l.y+S)),l.align="center",l.baseline="middle",!0):!1}}const pj=["right","center","left"],mj=["bottom","middle","top"];function yj(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,h,g,p,m,y,b,v,x,E,_,w,S,A,k,F;for(let L=0;L<u;++L){if(h=(n[L]&3)-1,g=(n[L]>>>2&3)-1,p=h===0&&g===0||i[L]<0,m=h&&g?Math.SQRT1_2:1,y=i[L]<0?-1:1,b=c[1+h]+i[L]*h*m,w=c[4+g]+y*f*g/2+i[L]*g*m,x=w-f/2,E=w+f/2,S=e(b),k=e(x),F=e(E),!d)if(Yw(S,S,k,F,a,o,b,b,x,E,c,p))d=bn.width(l.datum,l.datum.text);else continue;if(_=b+y*d*h/2,b=_-d/2,v=_+d/2,S=e(b),A=e(v),Yw(S,A,k,F,a,o,b,v,x,E,c,p))return l.x=h?h*y<0?v:b:_,l.y=g?g*y<0?E:x:w,l.align=pj[h*y+1],l.baseline=mj[g*y+1],a.setRange(S,k,A,F),!0}return!1}}function Yw(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 ep=0,tp=4,np=8,ip=0,rp=1,sp=2,bj={"top-left":ep+ip,top:ep+rp,"top-right":ep+sp,left:tp+ip,middle:tp+rp,right:tp+sp,"bottom-left":np+ip,bottom:np+rp,"bottom-right":np+sp},vj={naive:cj,"reduced-search":fj,floodfill:gj};function xj(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=wj(i,f),h=Ej(r,f),g=_j(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=Sj(g,p,o,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const _=e.map(k=>{const F=b?bn.width(k,k.text):void 0;return x=Math.max(x,F),E=Math.max(E,k.fontSize),{datum:k,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(k),textWidth:F}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=lj(t[0],t[1],l);let S;if(!v){n&&_.sort((L,M)=>n(L.datum,M.datum));let k=!1;for(let L=0;L<h.length&&!k;++L)k=h[L]===5||d[L]<0;const F=(g&&a||m)&&e.map(L=>L.datum);S=s.length||F?aj(w,F||[],s,k,m):sj(w,a&&_)}const A=m?vj[c](w,S,a,u):yj(w,S,h,d);return _.forEach(k=>k.opacity=+A(k)),_}function wj(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 Ej(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=bj[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function _j(e){return e&&e.mark&&e.mark.marktype}function Sj(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 Xm=["x","y","opacity","align","baseline"],aO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Fb(e){O.call(this,null,e)}Fb.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:aO},{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:Xm.length,default:Xm}]};G(Fb,O,{transform(e,t){function n(s){const a=e[s];return oe(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)&&D("Size parameter should be specified as a [width, height] array.");const r=e.as||Xm;return xj(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||aO),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 Aj=Object.freeze(Object.defineProperty({__proto__:null,label:Fb},Symbol.toStringTag,{value:"Module"}));function oO(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 Ob(e){O.call(this,null,e)}Ob.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(Ob,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=oO(i,e.groupby),s=(e.groupby||[]).map(Pe),a=s.length,o=e.as||[Pe(e.x),Pe(e.y)],u=[];r.forEach(l=>{Lk(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(ye(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const Ym={constant:D1,linear:N1,log:Rk,exp:Dk,pow:Nk,quad:M1,poly:Mk},kj=(e,t)=>e==="poly"?t:e==="quad"?2:1;function Tb(e){O.call(this,null,e)}Tb.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(Ym)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(Tb,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=oO(i,e.groupby),s=(e.groupby||[]).map(Pe),a=e.method||"linear",o=e.order==null?3:e.order,u=kj(a,o),l=e.as||[Pe(e.x),Pe(e.y)],c=Ym[a],f=[];let d=e.extent;K(Ym,a)||D("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(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const p=c(h,e.x,e.y,o);if(e.params){f.push(ye({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||Oi(h,e.x),y=b=>{const v={};for(let x=0;x<s.length;++x)v[s[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(ye(v))};a==="linear"||a==="constant"?m.forEach(b=>y([b,p.predict(b)])):Jd(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Cj=Object.freeze(Object.defineProperty({__proto__:null,loess:Ob,regression:Tb},Symbol.toStringTag,{value:"Module"})),ir=11102230246251565e-32,mt=134217729,$j=(3+8*ir)*ir;function ap(e,t,n,i,r){let s,a,o,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(a=l+s,o=s-(a-l),l=t[++f]):(a=c+s,o=s-(a-c),c=i[++d]),s=a,o!==0&&(r[h++]=o);f<e&&d<n;)c>l==c>-l?(a=s+l,u=a-s,o=s-(a-u)+(l-u),l=t[++f]):(a=s+c,u=a-s,o=s-(a-u)+(c-u),c=i[++d]),s=a,o!==0&&(r[h++]=o);for(;f<e;)a=s+l,u=a-s,o=s-(a-u)+(l-u),l=t[++f],s=a,o!==0&&(r[h++]=o);for(;d<n;)a=s+c,u=a-s,o=s-(a-u)+(c-u),c=i[++d],s=a,o!==0&&(r[h++]=o);return(s!==0||h===0)&&(r[h++]=s),h}function Fj(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function ql(e){return new Float64Array(e)}const Oj=(3+16*ir)*ir,Tj=(2+12*ir)*ir,Rj=(9+64*ir)*ir*ir,Fa=ql(4),Kw=ql(8),Jw=ql(12),Qw=ql(16),Ot=ql(4);function Dj(e,t,n,i,r,s,a){let o,u,l,c,f,d,h,g,p,m,y,b,v,x,E,_,w,S;const A=e-r,k=n-r,F=t-s,L=i-s;x=A*L,d=mt*A,h=d-(d-A),g=A-h,d=mt*L,p=d-(d-L),m=L-p,E=g*m-(x-h*p-g*p-h*m),_=F*k,d=mt*F,h=d-(d-F),g=F-h,d=mt*k,p=d-(d-k),m=k-p,w=g*m-(_-h*p-g*p-h*m),y=E-w,f=E-y,Fa[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Fa[1]=v-(y+f)+(f-_),S=b+y,f=S-b,Fa[2]=b-(S-f)+(y-f),Fa[3]=S;let M=Fj(4,Fa),C=Tj*a;if(M>=C||-M>=C||(f=e-A,o=e-(A+f)+(f-r),f=n-k,l=n-(k+f)+(f-r),f=t-F,u=t-(F+f)+(f-s),f=i-L,c=i-(L+f)+(f-s),o===0&&u===0&&l===0&&c===0)||(C=Rj*a+$j*Math.abs(M),M+=A*c+L*o-(F*l+k*u),M>=C||-M>=C))return M;x=o*L,d=mt*o,h=d-(d-o),g=o-h,d=mt*L,p=d-(d-L),m=L-p,E=g*m-(x-h*p-g*p-h*m),_=u*k,d=mt*u,h=d-(d-u),g=u-h,d=mt*k,p=d-(d-k),m=k-p,w=g*m-(_-h*p-g*p-h*m),y=E-w,f=E-y,Ot[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Ot[1]=v-(y+f)+(f-_),S=b+y,f=S-b,Ot[2]=b-(S-f)+(y-f),Ot[3]=S;const $=ap(4,Fa,4,Ot,Kw);x=A*c,d=mt*A,h=d-(d-A),g=A-h,d=mt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),_=F*l,d=mt*F,h=d-(d-F),g=F-h,d=mt*l,p=d-(d-l),m=l-p,w=g*m-(_-h*p-g*p-h*m),y=E-w,f=E-y,Ot[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Ot[1]=v-(y+f)+(f-_),S=b+y,f=S-b,Ot[2]=b-(S-f)+(y-f),Ot[3]=S;const T=ap($,Kw,4,Ot,Jw);x=o*c,d=mt*o,h=d-(d-o),g=o-h,d=mt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),_=u*l,d=mt*u,h=d-(d-u),g=u-h,d=mt*l,p=d-(d-l),m=l-p,w=g*m-(_-h*p-g*p-h*m),y=E-w,f=E-y,Ot[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-_,f=v-y,Ot[1]=v-(y+f)+(f-_),S=b+y,f=S-b,Ot[2]=b-(S-f)+(y-f),Ot[3]=S;const I=ap(T,Jw,4,Ot,Qw);return Qw[I-1]}function $c(e,t,n,i,r,s){const a=(t-s)*(n-r),o=(e-r)*(i-s),u=a-o,l=Math.abs(a+o);return Math.abs(u)>=Oj*l?u:-Dj(e,t,n,i,r,s,l)}const Zw=Math.pow(2,-52),Fc=new Uint32Array(512);class rd{static from(t,n=Pj,i=zj){const r=t.length,s=new Float64Array(r*2);for(let a=0;a<r;a++){const o=t[a];s[2*a]=n(o),s[2*a+1]=i(o)}return new rd(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,a=t.length>>1;let o=1/0,u=1/0,l=-1/0,c=-1/0;for(let A=0;A<a;A++){const k=t[2*A],F=t[2*A+1];k<o&&(o=k),F<u&&(u=F),k>l&&(l=k),F>c&&(c=F),this._ids[A]=A}const f=(o+l)/2,d=(u+c)/2;let h,g,p;for(let A=0,k=1/0;A<a;A++){const F=op(f,d,t[2*A],t[2*A+1]);F<k&&(h=A,k=F)}const m=t[2*h],y=t[2*h+1];for(let A=0,k=1/0;A<a;A++){if(A===h)continue;const F=op(m,y,t[2*A],t[2*A+1]);F<k&&F>0&&(g=A,k=F)}let b=t[2*g],v=t[2*g+1],x=1/0;for(let A=0;A<a;A++){if(A===h||A===g)continue;const k=Lj(m,y,b,v,t[2*A],t[2*A+1]);k<x&&(p=A,x=k)}let E=t[2*p],_=t[2*p+1];if(x===1/0){for(let F=0;F<a;F++)this._dists[F]=t[2*F]-t[0]||t[2*F+1]-t[1];ja(this._ids,this._dists,0,a-1);const A=new Uint32Array(a);let k=0;for(let F=0,L=-1/0;F<a;F++){const M=this._ids[F],C=this._dists[M];C>L&&(A[k++]=M,L=C)}this.hull=A.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if($c(m,y,b,v,E,_)<0){const A=g,k=b,F=v;g=p,b=E,v=_,p=A,E=k,_=F}const w=Ij(m,y,b,v,E,_);this._cx=w.x,this._cy=w.y;for(let A=0;A<a;A++)this._dists[A]=op(t[2*A],t[2*A+1],w.x,w.y);ja(this._ids,this._dists,0,a-1),this._hullStart=h;let S=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,s.fill(-1),s[this._hashKey(m,y)]=h,s[this._hashKey(b,v)]=g,s[this._hashKey(E,_)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let A=0,k,F;A<this._ids.length;A++){const L=this._ids[A],M=t[2*L],C=t[2*L+1];if(A>0&&Math.abs(M-k)<=Zw&&Math.abs(C-F)<=Zw||(k=M,F=C,L===h||L===g||L===p))continue;let $=0;for(let J=0,ue=this._hashKey(M,C);J<this._hashSize&&($=s[(ue+J)%this._hashSize],!($!==-1&&$!==i[$]));J++);$=n[$];let T=$,I;for(;I=i[T],$c(M,C,t[2*T],t[2*T+1],t[2*I],t[2*I+1])>=0;)if(T=I,T===$){T=-1;break}if(T===-1)continue;let W=this._addTriangle(T,L,i[T],-1,-1,r[T]);r[L]=this._legalize(W+2),r[T]=W,S++;let j=i[T];for(;I=i[j],$c(M,C,t[2*j],t[2*j+1],t[2*I],t[2*I+1])<0;)W=this._addTriangle(j,L,I,r[L],-1,r[j]),r[L]=this._legalize(W+2),i[j]=j,S--,j=I;if(T===$)for(;I=n[T],$c(M,C,t[2*I],t[2*I+1],t[2*T],t[2*T+1])<0;)W=this._addTriangle(I,L,T,-1,r[T],r[I]),this._legalize(W+2),r[I]=W,i[T]=T,S--,T=I;this._hullStart=n[L]=T,i[T]=n[j]=L,i[L]=j,s[this._hashKey(M,C)]=L,s[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(S);for(let A=0,k=this._hullStart;A<S;A++)this.hull[A]=k,k=i[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(Nj(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,a=0;for(;;){const o=i[t],u=t-t%3;if(a=u+(t+2)%3,o===-1){if(s===0)break;t=Fc[--s];continue}const l=o-o%3,c=u+(t+1)%3,f=l+(o+2)%3,d=n[a],h=n[t],g=n[c],p=n[f];if(Mj(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,n[o]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(o,i[a]),this._link(a,f);const b=l+(o+1)%3;s<Fc.length&&(Fc[s++]=b)}else{if(s===0)break;t=Fc[--s]}}return a}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,a){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=n,this._triangles[o+2]=i,this._link(o,r),this._link(o+1,s),this._link(o+2,a),this.trianglesLen+=3,o}}function Nj(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function op(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Mj(e,t,n,i,r,s,a,o){const u=e-a,l=t-o,c=n-a,f=i-o,d=r-a,h=s-o,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function Lj(e,t,n,i,r,s){const a=n-e,o=i-t,u=r-e,l=s-t,c=a*a+o*o,f=u*u+l*l,d=.5/(a*l-o*u),h=(l*c-o*f)*d,g=(a*f-u*c)*d;return h*h+g*g}function Ij(e,t,n,i,r,s){const a=n-e,o=i-t,u=r-e,l=s-t,c=a*a+o*o,f=u*u+l*l,d=.5/(a*l-o*u),h=e+(l*c-o*f)*d,g=t+(a*f-u*c)*d;return{x:h,y:g}}function ja(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],a=t[s];let o=r-1;for(;o>=n&&t[e[o]]>a;)e[o+1]=e[o--];e[o+1]=s}else{const r=n+i>>1;let s=n+1,a=i;su(e,r,s),t[e[n]]>t[e[i]]&&su(e,n,i),t[e[s]]>t[e[i]]&&su(e,s,i),t[e[n]]>t[e[s]]&&su(e,n,s);const o=e[s],u=t[o];for(;;){do s++;while(t[e[s]]<u);do a--;while(t[e[a]]>u);if(a<s)break;su(e,s,a)}e[n+1]=e[a],e[a]=o,i-s+1>=a-n?(ja(e,t,s,i),ja(e,t,n,a-1)):(ja(e,t,n,a-1),ja(e,t,s,i))}}function su(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Pj(e){return e[0]}function zj(e){return e[1]}const eE=1e-6;class Ps{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>eE||Math.abs(this._y1-s)>eE)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Km{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Bj=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,a;const o=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let p=0,m=0,y=i.length,b,v;p<y;p+=3,m+=2){const x=i[p]*2,E=i[p+1]*2,_=i[p+2]*2,w=t[x],S=t[x+1],A=t[E],k=t[E+1],F=t[_],L=t[_+1],M=A-w,C=k-S,$=F-w,T=L-S,I=(M*T-C*$)*2;if(Math.abs(I)<1e-9){if(s===void 0){s=a=0;for(const j of n)s+=t[j*2],a+=t[j*2+1];s/=n.length,a/=n.length}const W=1e9*Math.sign((s-w)*T-(a-S)*$);b=(w+F)/2-W*T,v=(S+L)/2+W*$}else{const W=1/I,j=M*M+C*C,J=$*$+T*T;b=w+(T*j-C*J)*W,v=S+(M*J-$*j)*W}o[m]=b,o[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Ps:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:a,vectors:o}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,g=Math.floor(d/3)*2,p=a[h],m=a[h+1],y=a[g],b=a[g+1];this._renderSegment(p,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=a[f],h=a[f+1],g=u*4,p=this._project(d,h,o[g+2],o[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Ps:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Ps:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let a=2;a<s;a+=2)(r[a]!==r[a-2]||r[a+1]!==r[a-1])&&n.lineTo(r[a],r[a+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new Km;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let a;const o=this._regioncode(t,n),u=this._regioncode(i,r);o===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(a=this._clipSegment(t,n,i,r,o,u))&&(s.moveTo(a[0],a[1]),s.lineTo(a[2],a[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,a=n.length;s<a;s+=2)for(let o=0,u=r.length;o<u;o+=2)if(n[s]===r[o]&&n[s+1]===r[o+1]&&n[(s+2)%a]===r[(o+u-2)%u]&&n[(s+3)%a]===r[(o+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,a=i[t];if(a===-1)return null;const o=[];let u=a;do{const l=Math.floor(u/3);if(o.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==a&&u!==-1);return o}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,a,o=n[i-2],u=n[i-1],l,c=this._regioncode(o,u),f,d=0;for(let h=0;h<i;h+=2)if(s=o,a=u,o=n[h],u=n[h+1],l=c,c=this._regioncode(o,u),l===0&&c===0)f=d,d=0,r?r.push(o,u):r=[o,u];else{let g,p,m,y,b;if(l===0){if((g=this._clipSegment(s,a,o,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(o,u,s,a,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,s,a){const o=s<a;for(o&&([t,n,i,r,s,a]=[i,r,t,n,a,s]);;){if(s===0&&a===0)return o?[i,r,t,n]:[t,n,i,r];if(s&a)return null;let u,l,c=s||a;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,a=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,a){let o=Array.from(n),u;if((u=this._project(o[0],o[1],i,r))&&o.unshift(u[0],u[1]),(u=this._project(o[o.length-2],o[o.length-1],s,a))&&o.push(u[0],u[1]),o=this._clipFinite(t,o))for(let l=0,c=o.length,f,d=this._edgecode(o[c-2],o[c-1]);l<c;l+=2)f=d,d=this._edgecode(o[l],o[l+1]),f&&d&&(l=this._edge(t,f,d,o,l),c=o.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(t,n,i,r,s){for(;n!==i;){let a,o;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,o=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,o=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,o=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,o=this.ymin;break}(r[s]!==a||r[s+1]!==o)&&this.contains(t,a,o)&&(r.splice(s,0,a,o),s+=2)}return s}_project(t,n,i,r){let s=1/0,a,o,u;if(r<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/r)<s&&(u=this.ymin,o=t+(s=a)*i)}else if(r>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/r)<s&&(u=this.ymax,o=t+(s=a)*i)}if(i>0){if(t>=this.xmax)return null;(a=(this.xmax-t)/i)<s&&(o=this.xmax,u=n+(s=a)*r)}else if(i<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/i)<s&&(o=this.xmin,u=n+(s=a)*r)}return[o,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const jj=2*Math.PI,Oa=Math.pow;function Uj(e){return e[0]}function qj(e){return e[1]}function Wj(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],a=2*t[i+2];if((n[a]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}function Gj(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Rb{static from(t,n=Uj,i=qj,r){return new Rb("length"in t?Hj(t,n,i,r):Float64Array.from(Vj(t,n,i,r)))}constructor(t){this._delaunator=new rd(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Wj(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const g=Gj(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new rd(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=r.length;u<l;++u)o[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,r.length===2&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Bj(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:a,collinear:o}=this;if(o){const f=o.indexOf(t);f>0&&(yield o[f-1]),f<o.length-1&&(yield o[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:a,halfedges:o,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Oa(n-l[t*2],2)+Oa(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=Oa(n-l[g*2],2)+Oa(i-l[g*2+1],2);if(p<f&&(f=p,c=g),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=o[h],h===-1){if(h=s[(a[t]+1)%s.length],h!==g&&Oa(n-l[h*2],2)+Oa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Ps:void 0,{points:i,halfedges:r,triangles:s}=this;for(let a=0,o=r.length;a<o;++a){const u=r[a];if(u<a)continue;const l=s[a]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Ps:void 0,{points:r}=this;for(let s=0,a=r.length;s<a;s+=2){const o=r[s],u=r[s+1];t.moveTo(o+n,u),t.arc(o,u,n,0,jj)}return i&&i.value()}renderHull(t){const n=t==null?t=new Ps:void 0,{hull:i,points:r}=this,s=i[0]*2,a=i.length;t.moveTo(r[s],r[s+1]);for(let o=1;o<a;++o){const u=2*i[o];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Km;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Ps:void 0,{points:r,triangles:s}=this,a=s[t*=3]*2,o=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[a],r[a+1]),n.lineTo(r[o],r[o+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Km;return this.renderTriangle(t,n),n.value()}}function Hj(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let a=0;a<r;++a){const o=e[a];s[a*2]=t.call(i,o,a,e),s[a*2+1]=n.call(i,o,a,e)}return s}function*Vj(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}function Db(e){O.call(this,null,e)}Db.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 Xj=[-1e5,-1e5,1e5,1e5];G(Db,O,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:Xj;const s=this.value=Rb.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&&!Kj(u)?Yj(u):null}return t.reflow(e.modified()).modifies(n)}});function Yj(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 Kj(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const Jj=Object.freeze(Object.defineProperty({__proto__:null,voronoi:Db},Symbol.toStringTag,{value:"Module"}));var up=Math.PI/180,Ou=64,df=2048;function Qj(){var e=[256,256],t,n,i,r,s,a,o,u=uO,l=[],c=Math.random,f={};f.layout=function(){for(var g=d(Hr()),p=rU((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(_=>({text:t(_),font:n(_),style:r(_),weight:s(_),rotate:a(_),size:~~(i(_)+1e-14),padding:o(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,w)=>w.size-_.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,Zj(g,E,x,b),E.hasText&&h(p,E,m)&&(v.push(E),m?tU(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(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(Ou<<5)/p,g.height=df/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,_=-E,w,S,A;(w=x(_+=E))&&(S=~~w[0],A=~~w[1],!(Math.min(Math.abs(S),Math.abs(A))>=v));)if(p.x=y+S,p.y=b+A,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!eU(p,g,e[0]))&&(!m||nU(p,m))){for(var k=p.sprite,F=p.width>>5,L=e[0]>>5,M=p.x-(F<<4),C=M&127,$=32-C,T=p.y1-p.y0,I=(p.y+p.y0)*L+(M>>5),W,j=0;j<T;j++){W=0;for(var J=0;J<=F;J++)g[I+J]|=W<<$|(J<F?(W=k[j*F+J])>>>C:0);I+=L}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=xs(g),f):n},f.fontStyle=function(g){return arguments.length?(r=xs(g),f):r},f.fontWeight=function(g){return arguments.length?(s=xs(g),f):s},f.rotate=function(g){return arguments.length?(a=xs(g),f):a},f.text=function(g){return arguments.length?(t=xs(g),f):t},f.spiral=function(g){return arguments.length?(u=sU[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=xs(g),f):i},f.padding=function(g){return arguments.length?(o=xs(g),f):o},f.random=function(g){return arguments.length?(c=g,f):c},f}function Zj(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Ou<<5)/s,df/s);var a=0,o=0,u=0,l=n.length,c,f,d,h,g;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 p=Math.sin(t.rotate*up),m=Math.cos(t.rotate*up),y=c*m,b=c*p,v=d*m,x=d*p;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),a+c>=Ou<<5&&(a=0,o+=u,u=0),o+d>=df)break;r.translate((a+(c>>1))/s,(o+(d>>1))/s),t.rotate&&r.rotate(t.rotate*up),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,(Ou<<5)/s,df/s).data,_=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)_[h]=0;if(a=t.xoff,a==null)return;o=t.yoff;var w=0,S=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var A=f*g+(h>>5),k=E[(o+g)*(Ou<<5)+(a+h)<<2]?1<<31-h%32:0;_[A]|=k,w|=k}w?S=g:(t.y0++,d--,g--,o++)}t.y1=t.y0+S,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function eU(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 tU(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 nU(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 uO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function iU(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 rU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function xs(e){return typeof e=="function"?e:function(){return e}}var sU={archimedean:uO,rectangular:iU};const lO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],aU=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Nb(e){O.call(this,Qj(),e)}Nb.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:lO}]};G(Nb,O,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&D("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return oe(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||aU.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,a=e.as||lO;let o=e.fontSize||14,u;if(oe(o)?u=e.fontSizeRange:o=$t(o),u){const g=o,p=me("sqrt")().domain(Oi(r,g)).range(u);o=m=>p(g(m))}r.forEach(g=>{g[a[0]]=NaN,g[a[1]]=NaN,g[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(Ln).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[a[0]]=p.x+f,m[a[1]]=p.y+d,m[a[2]]=p.font,m[a[3]]=p.size,m[a[4]]=p.style,m[a[5]]=p.weight,m[a[6]]=p.rotate;return t.reflow(i).modifies(a)}});const oU=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:Nb},Symbol.toStringTag,{value:"Module"})),uU=e=>new Uint8Array(e),lU=e=>new Uint16Array(e),Bu=e=>new Uint32Array(e);function cU(){let e=8,t=[],n=Bu(0),i=Oc(0,e),r=Oc(0,e);return{data:()=>t,seen:()=>n=fU(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=Oc(s,e,i),r=Oc(s,e))}}}function fU(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Oc(e,t,n){const i=(t<257?uU:t<65537?lU:Bu)(e);return n&&i.set(n),i}function tE(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 nE(){let e=Bu(0),t=[],n=0;function i(o,u,l){if(!u.length)return[];const c=n,f=u.length,d=Bu(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=o(u[m]),d[m]=m;if(h=dU(h,d),c)g=t,p=e,t=Array(c+f),e=Bu(c+f),hU(l,g,p,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(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),[w5(u,o[0],0,l),Vu(u,o[1],0,l)]}return{insert:i,remove:r,bisect:a,reindex:s,index:()=>e,size:()=>n}}function dU(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 hU(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 Mb(e){O.call(this,cU(),e),this._indices=null,this._dims=null}Mb.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(Mb,O,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],a=i.length;let o=0,u,l;for(;o<a;++o)u=n[o].fname,l=r[u]||(r[u]=nE()),s.push(tE(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,h=r.length,g={};let p,m,y,b,v,x,E,_,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&o.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,_=b.length;E<_;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!a[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(p=g[y])||(s[y]=m=nE(),g[y]=p=m.insert(w,t.source,0)),a[E]=tE(m,E,r[E]).onAdd(p,u));for(E=0,_=o.data().length;E<_;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return o.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,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(),h,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=o[h].fname,p=u[g]||(u[g]=a[g].insert(o[h],i,d)),s[h].onAdd(p,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,h,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,a[h]=g=s[h],s[h]=o,g!==o&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const 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],h=l[0],g=l[1],p=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],s[b]!==n&&(o[b]=a[b],s[b]=n,i.push(b)),a[b]^=p;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],h=e.one;let g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=a[g],s[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=a[g],s[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=a[g],s[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=a[g],s[m]^=h,i.push(m);e.range=t.slice()}});function Lb(e){O.call(this,null,e)}Lb.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(Lb,O,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))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 gU=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Mb,resolvefilter:Lb},Symbol.toStringTag,{value:"Module"})),pU="RawCode",Ks="Literal",mU="Property",yU="Identifier",bU="ArrayExpression",vU="BinaryExpression",cO="CallExpression",xU="ConditionalExpression",wU="LogicalExpression",EU="MemberExpression",_U="ObjectExpression",SU="UnaryExpression";function li(e){this.type=e}li.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=AU(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function AU(e){switch(e.type){case bU:return e.elements;case vU:case wU:return[e.left,e.right];case cO:return[e.callee].concat(e.arguments);case xU:return[e.test,e.consequent,e.alternate];case EU:return[e.object,e.property];case _U:return e.properties;case mU:return[e.key,e.value];case SU:return[e.argument];case yU:case Ks:case pU:default:return[]}}var zi,Q,R,At,ve,bh=1,Wl=2,Js=3,cs=4,vh=5,fa=6,Vt=7,Gl=8,kU=9;zi={};zi[bh]="Boolean";zi[Wl]="<end>";zi[Js]="Identifier";zi[cs]="Keyword";zi[vh]="Null";zi[fa]="Numeric";zi[Vt]="Punctuator";zi[Gl]="String";zi[kU]="RegularExpression";var CU="ArrayExpression",$U="BinaryExpression",FU="CallExpression",OU="ConditionalExpression",fO="Identifier",TU="Literal",RU="LogicalExpression",DU="MemberExpression",NU="ObjectExpression",MU="Property",LU="UnaryExpression",Qe="Unexpected token %0",IU="Unexpected number",PU="Unexpected string",zU="Unexpected identifier",BU="Unexpected reserved word",jU="Unexpected end of input",Jm="Invalid regular expression",lp="Invalid regular expression: missing /",dO="Octal literals are not allowed in strict mode.",UU="Duplicate data property in object literal not allowed in strict mode",lt="ILLEGAL",tl="Disabled.",qU=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
100AE1\\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]"),WU
vendor: 5,883 bytes, line 10
10=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 x
vendor: 55,925 bytes, lines 10-16
10h(e,t){if(!e)throw new Error("ASSERT: "+t)}function Zi(e){return e>=48&&e<=57}function Ib(e){return"0123456789abcdefABCDEF".includes(e)}function ju(e){return"01234567".includes(e)}function GU(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 nl(e){return e===10||e===13||e===8232||e===8233}function Hl(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&qU.test(String.fromCharCode(e))}function sd(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&WU.test(String.fromCharCode(e))}const HU={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 hO(){for(;R<At;){const e=Q.charCodeAt(R);if(GU(e)||nl(e))++R;else break}}function Qm(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<At&&Ib(Q[R])?(i=Q[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):ge({},Qe,lt);return String.fromCharCode(r)}function VU(){var e,t,n,i;for(e=Q[R],t=0,e==="}"&&ge({},Qe,lt);R<At&&(e=Q[R++],!!Ib(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&ge({},Qe,lt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function gO(){var e,t;for(e=Q.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(Q.charCodeAt(R)!==117&&ge({},Qe,lt),++R,e=Qm("u"),(!e||e==="\\"||!Hl(e.charCodeAt(0)))&&ge({},Qe,lt),t=e);R<At&&(e=Q.charCodeAt(R),!!sd(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Q.charCodeAt(R)!==117&&ge({},Qe,lt),++R,e=Qm("u"),(!e||e==="\\"||!sd(e.charCodeAt(0)))&&ge({},Qe,lt),t+=e);return t}function XU(){var e,t;for(e=R++;R<At;){if(t=Q.charCodeAt(R),t===92)return R=e,gO();if(sd(t))++R;else break}return Q.slice(e,R)}function YU(){var e,t,n;return e=R,t=Q.charCodeAt(R)===92?gO():XU(),t.length===1?n=Js:HU.hasOwnProperty(t)?n=cs:t==="null"?n=vh:t==="true"||t==="false"?n=bh:n=Js,{type:n,value:t,start:e,end:R}}function cp(){var e=R,t=Q.charCodeAt(R),n,i=Q[R],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++R,{type:Vt,value:String.fromCharCode(t),start:e,end:R};default:if(n=Q.charCodeAt(R+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 R+=2,{type:Vt,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,Q.charCodeAt(R)===61&&++R,{type:Vt,value:Q.slice(e,R),start:e,end:R}}}if(a=Q.substr(R,4),a===">>>=")return R+=4,{type:Vt,value:a,start:e,end:R};if(s=a.substr(0,3),s===">>>"||s==="<<="||s===">>=")return R+=3,{type:Vt,value:s,start:e,end:R};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:Vt,value:r,start:e,end:R};if(r==="//"&&ge({},Qe,lt),"<>=!+-*%&|^/".includes(i))return++R,{type:Vt,value:i,start:e,end:R};ge({},Qe,lt)}function KU(e){let t="";for(;R<At&&Ib(Q[R]);)t+=Q[R++];return t.length===0&&ge({},Qe,lt),Hl(Q.charCodeAt(R))&&ge({},Qe,lt),{type:fa,value:parseInt("0x"+t,16),start:e,end:R}}function JU(e){let t="0"+Q[R++];for(;R<At&&ju(Q[R]);)t+=Q[R++];return(Hl(Q.charCodeAt(R))||Zi(Q.charCodeAt(R)))&&ge({},Qe,lt),{type:fa,value:parseInt(t,8),octal:!0,start:e,end:R}}function iE(){var e,t,n;if(n=Q[R],xh(Zi(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=Q[R++],n=Q[R],e==="0"){if(n==="x"||n==="X")return++R,KU(t);if(ju(n))return JU(t);n&&Zi(n.charCodeAt(0))&&ge({},Qe,lt)}for(;Zi(Q.charCodeAt(R));)e+=Q[R++];n=Q[R]}if(n==="."){for(e+=Q[R++];Zi(Q.charCodeAt(R));)e+=Q[R++];n=Q[R]}if(n==="e"||n==="E")if(e+=Q[R++],n=Q[R],(n==="+"||n==="-")&&(e+=Q[R++]),Zi(Q.charCodeAt(R)))for(;Zi(Q.charCodeAt(R));)e+=Q[R++];else ge({},Qe,lt);return Hl(Q.charCodeAt(R))&&ge({},Qe,lt),{type:fa,value:parseFloat(e),start:t,end:R}}function QU(){var e="",t,n,i,r,s=!1;for(t=Q[R],xh(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<At;)if(i=Q[R++],i===t){t="";break}else if(i==="\\")if(i=Q[R++],!i||!nl(i.charCodeAt(0)))switch(i){case"u":case"x":Q[R]==="{"?(++R,e+=VU()):e+=Qm(i);break;case"n":e+=` 11`;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:ju(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),R<At&&ju(Q[R])&&(s=!0,r=r*8+"01234567".indexOf(Q[R++]),"0123".includes(i)&&R<At&&ju(Q[R])&&(r=r*8+"01234567".indexOf(Q[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Q[R]===` 12`&&++R;else{if(nl(i.charCodeAt(0)))break;e+=i}return t!==""&&ge({},Qe,lt),{type:Gl,value:e,octal:s,start:n,end:R}}function ZU(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";ge({},Jm)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{ge({},Jm)}try{return new RegExp(e,t)}catch{return null}}function eq(){var e,t,n,i,r;for(e=Q[R],xh(e==="/","Regular expression literal must start with a slash"),t=Q[R++],n=!1,i=!1;R<At;)if(e=Q[R++],t+=e,e==="\\")e=Q[R++],nl(e.charCodeAt(0))&&ge({},lp),t+=e;else if(nl(e.charCodeAt(0)))ge({},lp);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||ge({},lp),r=t.substr(1,t.length-2),{value:r,literal:t}}function tq(){var e,t,n;for(t="",n="";R<At&&(e=Q[R],!!sd(e.charCodeAt(0)));)++R,e==="\\"&&R<At?ge({},Qe,lt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&ge({},Jm,n),{value:n,literal:t}}function nq(){var e,t,n,i;return ve=null,hO(),e=R,t=eq(),n=tq(),i=ZU(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function iq(e){return e.type===Js||e.type===cs||e.type===bh||e.type===vh}function pO(){if(hO(),R>=At)return{type:Wl,start:R,end:R};const e=Q.charCodeAt(R);return Hl(e)?YU():e===40||e===41||e===59?cp():e===39||e===34?QU():e===46?Zi(Q.charCodeAt(R+1))?iE():cp():Zi(e)?iE():cp()}function Kt(){const e=ve;return R=e.end,ve=pO(),R=e.end,e}function mO(){const e=R;ve=pO(),R=e}function rq(e){const t=new li(CU);return t.elements=e,t}function rE(e,t,n){const i=new li(e==="||"||e==="&&"?RU:$U);return i.operator=e,i.left=t,i.right=n,i}function sq(e,t){const n=new li(FU);return n.callee=e,n.arguments=t,n}function aq(e,t,n){const i=new li(OU);return i.test=e,i.consequent=t,i.alternate=n,i}function Pb(e){const t=new li(fO);return t.name=e,t}function Tu(e){const t=new li(TU);return t.value=e.value,t.raw=Q.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function sE(e,t,n){const i=new li(DU);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function oq(e){const t=new li(NU);return t.properties=e,t}function aE(e,t,n){const i=new li(MU);return i.key=t,i.value=n,i.kind=e,i}function uq(e,t){const n=new li(LU);return n.operator=e,n.argument=t,n.prefix=!0,n}function ge(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,a)=>(xh(a<i.length,"Message reference must be in range"),i[a]));throw n=new Error(r),n.index=R,n.description=r,n}function wh(e){e.type===Wl&&ge(e,jU),e.type===fa&&ge(e,IU),e.type===Gl&&ge(e,PU),e.type===Js&&ge(e,zU),e.type===cs&&ge(e,BU),ge(e,Qe,e.value)}function kt(e){const t=Kt();(t.type!==Vt||t.value!==e)&&wh(t)}function $e(e){return ve.type===Vt&&ve.value===e}function fp(e){return ve.type===cs&&ve.value===e}function lq(){const e=[];for(R=ve.start,kt("[");!$e("]");)$e(",")?(Kt(),e.push(null)):(e.push(Qs()),$e("]")||kt(","));return Kt(),rq(e)}function oE(){R=ve.start;const e=Kt();return e.type===Gl||e.type===fa?(e.octal&&ge(e,dO),Tu(e)):Pb(e.value)}function cq(){var e,t,n,i;if(R=ve.start,e=ve,e.type===Js)return n=oE(),kt(":"),i=Qs(),aE("init",n,i);if(e.type===Wl||e.type===Vt)wh(e);else return t=oE(),kt(":"),i=Qs(),aE("init",t,i)}function fq(){var e=[],t,n,i,r={},s=String;for(R=ve.start,kt("{");!$e("}");)t=cq(),t.key.type===fO?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?ge({},UU):r[i]=!0,e.push(t),$e("}")||kt(",");return kt("}"),oq(e)}function dq(){kt("(");const e=zb();return kt(")"),e}const hq={if:1};function gq(){var e,t,n;if($e("("))return dq();if($e("["))return lq();if($e("{"))return fq();if(e=ve.type,R=ve.start,e===Js||hq[ve.value])n=Pb(Kt().value);else if(e===Gl||e===fa)ve.octal&&ge(ve,dO),n=Tu(Kt());else{if(e===cs)throw new Error(tl);e===bh?(t=Kt(),t.value=t.value==="true",n=Tu(t)):e===vh?(t=Kt(),t.value=null,n=Tu(t)):$e("/")||$e("/=")?(n=Tu(nq()),mO()):wh(Kt())}return n}function pq(){const e=[];if(kt("("),!$e(")"))for(;R<At&&(e.push(Qs()),!$e(")"));)kt(",");return kt(")"),e}function mq(){R=ve.start;const e=Kt();return iq(e)||wh(e),Pb(e.value)}function yq(){return kt("."),mq()}function bq(){kt("[");const e=zb();return kt("]"),e}function vq(){var e,t,n;for(e=gq();;)if($e("."))n=yq(),e=sE(".",e,n);else if($e("("))t=pq(),e=sq(e,t);else if($e("["))n=bq(),e=sE("[",e,n);else break;return e}function uE(){const e=vq();if(ve.type===Vt&&($e("++")||$e("--")))throw new Error(tl);return e}function hf(){var e,t;if(ve.type!==Vt&&ve.type!==cs)t=uE();else{if($e("++")||$e("--"))throw new Error(tl);if($e("+")||$e("-")||$e("~")||$e("!"))e=Kt(),t=hf(),t=uq(e.value,t);else{if(fp("delete")||fp("void")||fp("typeof"))throw new Error(tl);t=uE()}}return t}function lE(e){let t=0;if(e.type!==Vt&&e.type!==cs)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 xq(){var e,t,n,i,r,s,a,o,u,l;if(e=ve,u=hf(),i=ve,r=lE(i),r===0)return u;for(i.prec=r,Kt(),t=[e,ve],a=hf(),s=[u,i,a];(r=lE(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=rE(o,u,a),s.push(n);i=Kt(),i.prec=r,s.push(i),t.push(ve),n=hf(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=rE(s[l-1].value,s[l-2],n),l-=2;return n}function Qs(){var e,t,n;return e=xq(),$e("?")&&(Kt(),t=Qs(),kt(":"),n=Qs(),e=aq(e,t,n)),e}function zb(){const e=Qs();if($e(","))throw new Error(tl);return e}function Bb(e){Q=e,R=0,At=Q.length,ve=null,mO();const t=zb();if(ve.type!==Wl)throw new Error("Unexpect token after expression.");return t}var yO={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 bO(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&&D("Missing arguments to clamp function."),a.length>3&&D("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),regexp:s,test:n("test",s),if:function(a){a.length<3&&D("Missing arguments to if function."),a.length>3&&D("Too many arguments to if function.");const o=a.map(e);return"("+o[0]+"?"+o[1]+":"+o[2]+")"}}}function wq(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function vO(e){e=e||{};const t=e.allowed?ti(e.allowed):{},n=e.forbidden?ti(e.forbidden):{},i=e.constants||yO,r=(e.functions||bO)(f),s=e.globalvar,a=e.fieldvar,o=oe(s)?s:g=>`${s}["${g}"]`;let u={},l={},c=0;function f(g){if(Y(g))return g;const p=d[g.type];return p==null&&D("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:K(n,p)?D("Illegal identifier: "+p):K(i,p)?i[p]:K(t,p)?p:(u[p]=1,o(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===a&&(l[wq(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&D("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=K(r,p)&&r[p];return y||D("Unrecognized function: "+p),oe(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const cE=Symbol("vega_selection_getter");function xO(e){return(!e.getter||!e.getter[cE])&&(e.getter=Dn(e.field),e.getter[cE]=!0),e.getter}const jb="intersect",fE="union",Eq="vlMulti",_q="vlPoint",dE="or",Sq="and",_i="_vgsid_",il=Dn(_i),Aq="E",kq="R",Cq="R-E",$q="R-LE",Fq="R-RE",ad="index:unit";function hE(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=xO(o)(e),Wr(a)&&(a=wt(a)),Wr(i[s])&&(i[s]=wt(i[s])),N(i[s])&&Wr(i[s][0])&&(i[s]=i[s].map(wt)),o.type===Aq){if(N(i[s])?i[s].indexOf(a)<0:a!==i[s])return!1}else if(o.type===kq){if(!Pa(a,i[s]))return!1}else if(o.type===Fq){if(!Pa(a,i[s],!0,!1))return!1}else if(o.type===Cq){if(!Pa(a,i[s],!1,!1))return!1}else if(o.type===$q&&!Pa(a,i[s],!1,!0))return!1;return!0}function Oq(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[ad]&&i[ad].value:void 0,a=n===jb,o=r.length,u=0,l,c,f,d,h;u<o;++u)if(l=r[u],s&&a){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=hE(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=hE(t,l),a^h)return h;return o&&a}const wO=H0(il),Tq=wO.left,Rq=wO.right;function Dq(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[ad]&&i[ad].value:void 0,a=n===jb,o=il(t),u=Tq(r,o);if(u===r.length||il(r[u])!==o)return!1;if(s&&a){if(s.size===1)return!0;if(Rq(r,o)-u<s.size)return!1}return!0}function Nq(e,t){return e.map(n=>ae(t.fields?{values:t.fields.map(i=>xO(i)(n.datum))}:{[_i]:il(n.datum)},t))}function Mq(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],a={},o={},u={},l,c,f,d,h,g,p,m,y,b,v=s.length,x=0,E,_;x<v;++x)if(l=s[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,_=c.length;E<_;++E)h=c[E],p=a[h.field]||(a[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=dp[`${y}_union`],p[d]=b(m,X(f[E]));n&&(m=o[d]||(o[d]=[]),m.push(X(f).reduce((w,S,A)=>(w[c[A].field]=S,w),{})))}else h=_i,g=il(l),p=a[h]||(a[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=o[d]||(o[d]=[]),m.push({[_i]:g}));if(t=t||fE,a[_i]?a[_i]=dp[`${_i}_${t}`](...Object.values(a[_i])):Object.keys(a).forEach(w=>{a[w]=Object.keys(a[w]).map(S=>a[w][S]).reduce((S,A)=>S===void 0?A:dp[`${u[w]}_${t}`](S,A))}),s=Object.keys(o),n&&s.length){const w=i?_q:Eq;a[w]=t===fE?{[dE]:s.reduce((S,A)=>(S.push(...o[A]),S),[])}:{[Sq]:s.map(S=>({[dE]:o[S]}))}}return a}var dp={[`${_i}_union`]:rL,[`${_i}_intersect`]:nL,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=wt(t[0]),i=wt(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=wt(t[0]),i=wt(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 Lq=":",Iq="@";function Ub(e,t,n,i){t[0].type!==Ks&&D("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&fe(t).value,a="unit",o=Iq+a,u=Lq+r;s===jb&&!K(i,o)&&(i[o]=n.getData(r).indataRef(n,a)),K(i,u)||(i[u]=n.getData(r).tuplesRef())}function EO(e){const t=this.context.data[e];return t?t.values.value:[]}function Pq(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function zq(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Nn).insert(t)),1}function Bq(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 Vl=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},jq=Vl("format"),_O=Vl("timeFormat"),Uq=Vl("utcFormat"),qq=Vl("timeParse"),Wq=Vl("utcParse"),Tc=new Date(2e3,0,1);function Eh(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Tc.setYear(2e3),Tc.setMonth(e),Tc.setDate(t),_O.call(this,Tc,n))}function Gq(e){return Eh.call(this,e,1,"%B")}function Hq(e){return Eh.call(this,e,1,"%b")}function Vq(e){return Eh.call(this,0,2+e,"%A")}function Xq(e){return Eh.call(this,0,2+e,"%a")}const Yq=":",Kq="@",Zm="%",SO="$";function qb(e,t,n,i){t[0].type!==Ks&&D("First argument to data functions must be a string literal.");const r=t[0].value,s=Yq+r;if(!K(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function Jq(e,t,n,i){t[0].type!==Ks&&D("First argument to indata must be a string literal."),t[1].type!==Ks&&D("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,a=Kq+s;K(a,i)||(i[a]=n.getData(r).indataRef(n,s))}function zt(e,t,n,i){if(t[0].type===Ks)gE(n,i,t[0].value);else for(e in n.scales)gE(n,i,e)}function gE(e,t,n){const i=Zm+n;if(!K(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Bi(e,t){if(oe(e))return e;if(Y(e)){const n=t.scales[e];return n&&az(n.value)?n.value:void 0}}function Qq(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=zt,n._range=zt,n._scale=zt;const i=r=>"_["+(r.type===Ks?q(Zm+r.value):q(Zm)+"+"+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 Wb(e,t){return function(n,i,r){if(n){const s=Bi(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Zq=Wb("area",w9),eW=Wb("bounds",A9),tW=Wb("centroid",T9);function nW(e,t){const n=Bi(e,(t||this).context);return n&&n.scale()}function iW(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 Gb(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function rW(){return Gb(this.context.dataflow,"warn",arguments)}function sW(){return Gb(this.context.dataflow,"info",arguments)}function aW(){return Gb(this.context.dataflow,"debug",arguments)}function hp(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function e0(e){const t=Sf(e),n=hp(t.r),i=hp(t.g),r=hp(t.b);return .2126*n+.7152*i+.0722*r}function oW(e,t){const n=e0(e),i=e0(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function uW(){const e=[].slice.call(arguments);return e.unshift({}),ae(...e)}function AO(e,t){return e===t||e!==e&&t!==t?!0:N(e)?N(t)&&e.length===t.length?lW(e,t):!1:V(e)&&V(t)?kO(e,t):!1}function lW(e,t){for(let n=0,i=e.length;n<i;++n)if(!AO(e[n],t[n]))return!1;return!0}function kO(e,t){for(const n in e)if(!AO(e[n],t[n]))return!1;return!0}function pE(e){return t=>kO(e,t)}function cW(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;if(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?Nn:N(n)||qd(n)?n:pE(n),c.remove(f)),t&&c.insert(t),i&&(f=pE(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 fW(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 dW(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const mE={};function hW(e,t){const n=mE[t]||(mE[t]=Dn(t));return N(e)?e.map(n):n(e)}function Hb(e){return N(e)||ArrayBuffer.isView(e)?e:null}function Vb(e){return Hb(e)||(Y(e)?e:null)}function gW(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 Hb(e).join(...n)}function pW(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 Vb(e).indexOf(...n)}function mW(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 Vb(e).lastIndexOf(...n)}function yW(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 Vb(e).slice(...n)}function bW(e,t,n){return oe(n)&&D("Function argument passed to replace."),String(e).replace(t,n)}function vW(e){return Hb(e).slice().reverse()}function xW(e,t,n){return dy(e||0,t||0,n||0)}function wW(e,t){const n=Bi(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function EW(e,t){const n=Bi(e,(t||this).context);return n?n.copy():void 0}function _W(e,t){const n=Bi(e,(t||this).context);return n?n.domain():[]}function SW(e,t,n){const i=Bi(e,(n||this).context);return i?N(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function AW(e,t){const n=Bi(e,(t||this).context);return n&&n.range?n.range():[]}function kW(e,t,n){const i=Bi(e,(n||this).context);return i?i(t):void 0}function CW(e,t,n,i,r){e=Bi(e,(r||this).context);const s=KC(t,n);let a=e.domain(),o=a[0],u=fe(a),l=Ct;return u-o?l=PC(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!==fe(a)&&a.push(u)),a.forEach(c=>s.stop(l(c),e(c))),s}function $W(e,t,n){const i=Bi(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function FW(e){let t=null;return function(n){return n?Ju(n,t=t||so(e)):e}}const CO=e=>e.data;function $O(e,t){const n=EO.call(t,e);return n.root&&n.root.lookup||{}}function OW(e,t,n){const i=$O(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(CO):void 0}function TW(e,t){const n=$O(e,this)[t];return n?n.ancestors().map(CO):void 0}const FO=()=>typeof window<"u"&&window||null;function RW(){const e=FO();return e?e.screen:{}}function DW(){const e=FO();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function NW(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function OO(e,t,n){if(!e)return[];const[i,r]=e,s=new qe().set(i[0],i[1],r[0],r[1]),a=n||this.context.dataflow.scenegraph().root;return V$(a,s,MW(t))}function MW(e){let t=null;if(e){const n=X(e.marktype),i=X(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function LW(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=X(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function IW(e){return X(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 PW(e,t,n){const{x:i,y:r,mark:s}=n,a=new qe().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),OO([[a.x1,a.y1],[a.x2,a.y2]],e,s).filter(u=>zW(u.x,u.y,t))}function zW(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 rl={random(){return Ln()},cumulativeNormal:Xd,cumulativeLogNormal:C1,cumulativeUniform:T1,densityNormal:E1,densityLogNormal:k1,densityUniform:O1,quantileNormal:Yd,quantileLogNormal:$1,quantileUniform:R1,sampleNormal:Vd,sampleLogNormal:A1,sampleUniform:F1,isArray:N,isBoolean:us,isDate:Wr,isDefined(e){return e!==void 0},isNumber:pe,isObject:V,isRegExp:OA,isString:Y,isTuple:qd,isValid(e){return e!=null&&e===e},toBoolean:a1,toDate(e){return o1(e)},toNumber:wt,toString:u1,indexof:pW,join:gW,lastindexof:mW,replace:bW,reverse:vW,slice:yW,flush:$A,lerp:TA,merge:uW,pad:NA,peek:fe,pluck:hW,span:Sl,inrange:Pa,truncate:MA,rgb:Sf,lab:_5,hcl:S5,hsl:A5,luminance:e0,contrast:oW,sequence:pn,format:jq,utcFormat:Uq,utcParse:Wq,utcOffset:KA,utcSequence:ZA,timeFormat:_O,timeParse:qq,timeOffset:YA,timeSequence:QA,timeUnitSpecifier:PA,monthFormat:Gq,monthAbbrevFormat:Hq,dayFormat:Vq,dayAbbrevFormat:Xq,quarter:SA,utcquarter:AA,week:BA,utcweek:qA,dayofyear:zA,utcdayofyear:UA,warn:rW,info:sW,debug:aW,extent(e){return Oi(e)},inScope:iW,intersect:OO,clampRange:kA,pinchDistance:fW,pinchAngle:dW,screen:RW,containerSize:NW,windowSize:DW,bandspace:xW,setdata:zq,pathShape:FW,panLinear:xA,panLog:wA,panPow:EA,panSymlog:_A,zoomLinear:e1,zoomLog:t1,zoomPow:kf,zoomSymlog:n1,encode:Bq,modify:cW,lassoAppend:LW,lassoPath:IW,intersectLasso:PW},BW=["view","item","group","xy","x","y"],jW="event.vega.",TO="this.",Xb={},RO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${q(SO+e)}]`,functions:UW,constants:yO,visitors:Xb},t0=vO(RO);function UW(e){const t=bO(e);BW.forEach(n=>t[n]=jW+n);for(const n in rl)t[n]=TO+n;return ae(t,Qq(e,rl,Xb)),t}function je(e,t,n){return arguments.length===1?rl[e]:(rl[e]=t,n&&(Xb[e]=n),t0&&(t0.functions[e]=TO+e),this)}je("bandwidth",wW,zt);je("copy",EW,zt);je("domain",_W,zt);je("range",AW,zt);je("invert",SW,zt);je("scale",kW,zt);je("gradient",CW,zt);je("geoArea",Zq,zt);je("geoBounds",eW,zt);je("geoCentroid",tW,zt);je("geoShape",$W,zt);je("geoScale",nW,zt);je("indata",Pq,Jq);je("data",EO,qb);je("treePath",OW,qb);je("treeAncestors",TW,qb);je("vlSelectionTest",Oq,Ub);je("vlSelectionIdTest",Dq,Ub);je("vlSelectionResolve",Mq,Ub);je("vlSelectionTuples",Nq);function Di(e,t){const n={};let i;try{e=Y(e)?e:q(e)+"",i=Bb(e)}catch{D("Expression parse error: "+e)}i.visit(s=>{if(s.type!==cO)return;const a=s.callee.name,o=RO.visitors[a];o&&o(a,s.arguments,t,n)});const r=t0(i);return r.globals.forEach(s=>{const a=SO+s;!K(n,a)&&t.getSignal(s)&&(n[a]=t.signalRef(s))}),{$expr:ae({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function qW(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 WW=ti(["rule"]),yE=ti(["group","image","rect"]);function GW(e,t){let n="";return WW[t]||(e.x2&&(e.x?(yE[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?(yE[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 Yb(e){return(e+"").toLowerCase()}function HW(e){return Yb(e)==="operator"}function VW(e){return Yb(e)==="collect"}function au(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function XW(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} 13 : (u > v || v == null) && u != null ? ${i} 14 : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} 15 : v !== v && u === u ? ${i} : `}var YW={operator:(e,t)=>au(e,["_"],t.code),parameter:(e,t)=>au(e,["datum","_"],t.code),event:(e,t)=>au(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return au(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["+q(s)+"]";r+=`$=${i[s].code};if(${a}!==$)${a}=$,m=1;`}return r+=GW(i,n),r+="return m;",au(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(q).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)`),XW(u,l,-o,o)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function KW(e){const t=this;HW(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function JW(e){const t=this;if(e.params){const n=t.get(e.id);n||D("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function QW(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=N(r)?r.map(s=>bE(s,n,t)):bE(r,n,t)}return t}function bE(e,t,n){if(!e||!V(e))return e;for(let i=0,r=vE.length,s;i<r;++i)if(s=vE[i],K(e,s.key))return s.parse(e,t,n);return e}var vE=[{key:"$ref",parse:ZW},{key:"$key",parse:tG},{key:"$expr",parse:eG},{key:"$field",parse:nG},{key:"$encode",parse:rG},{key:"$compare",parse:iG},{key:"$context",parse:sG},{key:"$subflow",parse:aG},{key:"$tupleid",parse:oG}];function ZW(e,t){return t.get(e.$ref)||D("Operator not defined: "+e.$ref)}function eG(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=on(t.parameterExpression(e.$expr),e.$fields))}function tG(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=s1(e.$key,e.$flat,t.expr.codegen))}function nG(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Dn(e.$field,e.$name,t.expr.codegen))}function iG(e,t){const n="c:"+e.$compare+"_"+e.$order,i=X(e.$compare).map(r=>r&&r.$tupleid?ne:r);return t.fn[n]||(t.fn[n]=i1(i,e.$order,t.expr.codegen))}function rG(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=on(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function sG(e,t){return t}function aG(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 oG(){return ne}function uG(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&&D("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function lG(e){var t=this,n=V(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,a=void 0;i||D("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 cG={skip:!0};function fG(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 dG(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],cG)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Nn).insert(i[s]))}),(e.subcontext||[]).forEach((s,a)=>{const o=t.subcontext[a];o&&o.setState(s)})}function DO(e,t,n,i){return new NO(e,t,n,i)}function NO(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||YW,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function xE(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)}NO.prototype=xE.prototype={fork(){const e=new xE(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),VW(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[Yb(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:qW,parseOperator:KW,parseOperatorParameters:JW,parseParameters:QW,parseStream:uG,parseUpdate:lG,getState:fG,setState:dG};function hG(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),MO(t,e.description()))}function MO(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function gG(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const gp="default";function pG(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:gp,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?Y(r)?r:r.user:gp,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 Y(i)||(r=i.item,i=i.user),n0(e,i&&i!==gp?i:r||i),r},{cursor:t})}function n0(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 od(e,t){var n=e._runtime.data;return K(n,t)||D("Unrecognized data set: "+t),n[t]}function mG(e,t){return arguments.length<2?od(this,e).values.value:_h.call(this,e,ls().remove(Nn).insert(t))}function _h(e,t){vk(t)||D("Second argument to changes must be a changeset.");const n=od(this,e);return n.modified=!0,this.pulse(n.input,t)}function yG(e,t){return _h.call(this,e,ls().insert(t))}function bG(e,t){return _h.call(this,e,ls().remove(t))}function LO(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function IO(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Sh(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function vG(e){var t=Sh(e),n=LO(e),i=IO(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 xG(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,a,o;return r&&(o=Sh(e),a=t.changedTouches?t.changedTouches[0]:t,s=gh(a,r),s[0]-=o[0],s[1]-=o[1]),t.dataflow=e,t.item=n,t.vega=wG(e,n,s),t}function wG(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;Y(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:$t(e),item:$t(t||{}),group:r,xy:s,x:a=>s(a)[0],y:a=>s(a)[1]}}const wE="view",EG="timer",_G="window",SG={trap:!1};function AG(e){const t=ae({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{N(i[s])&&(i[s]=ti(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function PO(e,t,n,i){e._eventListeners.push({type:n,sources:X(t),handler:i})}function kG(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 Rc(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||V(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function CG(e,t,n){var i=this,r=new Hd(n),s=function(l,c){i.runAsync(null,()=>{e===wE&&kG(i,t)&&l.preventDefault(),r.receive(xG(i,l,c))})},a;if(e===EG)Rc(i,"timer",t)&&i.timer(s,t);else if(e===wE)Rc(i,"view",t)&&i.addEventListener(t,s,SG);else if(e===_G?Rc(i,"window",t)&&typeof window<"u"&&(a=[window]):typeof document<"u"&&Rc(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);PO(i,a,t,s)}return r}function EE(e){return e.item}function _E(e){return e.item.mark.source}function SE(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function $G(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",EE),_E,SE(e)),this.on(this.events("view","pointerout",EE),_E,SE(t)),this}function FG(){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 vn(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 OG="vega-bind",TG="vega-bind-name",RG="vega-bind-radio";function DG(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=r1(i.debounce,r.update))),(i.input==null&&i.element?NG:LG)(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 NG(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),PO(i,t,r,s),e.set=a=>{t.value=a,t.dispatchEvent(MG(r))}}function MG(e){return typeof Event<"u"?new Event(e):{type:e}}function LG(e,t,n,i){const r=i.signal(n.signal),s=vn("div",{class:OG}),a=n.input==="radio"?s:s.appendChild(vn("label"));a.appendChild(vn("span",{class:TG},n.name||n.signal)),t.appendChild(s);let o=IG;switch(n.input){case"checkbox":o=PG;break;case"select":o=zG;break;case"radio":o=BG;break;case"range":o=jG;break}o(e,a,n,r)}function IG(e,t,n,i){const r=vn("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 PG(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=vn("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=a=>s.checked=!!a||null}function zG(e,t,n,i){const r=vn("select",{name:n.signal}),s=n.labels||[];n.options.forEach((a,o)=>{const u={value:a};ud(a,i)&&(u.selected=!0),r.appendChild(vn("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(ud(n.options[o],a)){r.selectedIndex=o;return}}}function BG(e,t,n,i){const r=vn("span",{class:RG}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((a,o)=>{const u={type:"radio",name:n.signal,value:a};ud(a,i)&&(u.checked=!0);const l=vn("input",u);l.addEventListener("change",()=>e.update(a));const c=vn("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)ud(o[l].value,a)&&(o[l].checked=!0)}}function jG(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||Hu(s,r,100),o=vn("input",{type:"range",name:n.signal,min:s,max:r,step:a});o.value=i;const u=vn("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 ud(e,t){return e===t||e+""==t+""}function zO(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,LO(e),IO(e),Sh(e),r,s).background(e.background())}function Kb(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function UG(e,t,n,i){const r=new i(e.loader(),Kb(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Sh(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function qG(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=ph(i);e=n._el=e?pp(n,e,!0):null,hG(n),s||n.error("Unrecognized renderer type: "+i);const a=s.handler||Bl,o=e?s.renderer:s.headless;return n._renderer=o?zO(n,n._renderer,e,o):null,n._handler=UG(n,n._handler,e,a),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=pp(n,t,!0):e.appendChild(vn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=pp(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{DG(n,u.element||t,u)})),n}function pp(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 ou=e=>+e||0,WG=e=>({top:e,bottom:e,left:e,right:e});function AE(e){return V(e)?{top:ou(e.top),bottom:ou(e.bottom),left:ou(e.left),right:ou(e.right)}:WG(ou(e))}async function Jb(e,t,n,i){const r=ph(t),s=r&&r.headless;return s||D("Unrecognized renderer type: "+t),await e.runAsync(),zO(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function GG(e,t){e!==Ir.Canvas&&e!==Ir.SVG&&e!==Ir.PNG&&D("Unrecognized image type: "+e);const n=await Jb(this,e,t);return e===Ir.SVG?HG(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function HG(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function VG(e,t){return(await Jb(this,Ir.Canvas,e,t)).canvas()}async function XG(e){return(await Jb(this,Ir.SVG,e)).svg()}function YG(e,t,n){return DO(e,to,rl,n).parse(t)}function KG(e){var t=this._runtime.scales;return K(t,e)||D("Unrecognized scale or projection: "+e),t[e].value}var BO="width",jO="height",Qb="padding",kE={skip:!0};function UO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===Qb?i.left+i.right:0)}function qO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===Qb?i.top+i.bottom:0)}function JG(e){var t=e._signals,n=t[BO],i=t[jO],r=t[Qb];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,o=>{e._width=o.size,e._viewWidth=UO(e,o.size),s()},{size:n}),e._resizeHeight=e.add(null,o=>{e._height=o.size,e._viewHeight=qO(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 QG(e,t,n,i,r,s){this.runAfter(a=>{let o=0;a._autosize=0,a.width()!==n&&(o=1,a.signal(BO,n,kE),a._resizeWidth.skip(!0)),a.height()!==i&&(o=1,a.signal(jO,i,kE),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 ZG(e){return this._runtime.getState(e||{data:eH,signals:tH,recurse:!0})}function eH(e,t){return t.modified&&N(t.input.value)&&!e.startsWith("_:vega:_")}function tH(e,t){return!(e==="parent"||t instanceof to.proxy)}function nH(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function iH(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(N7(n,t))}function rH(e,t,n,i){const r=e.element();r&&r.setAttribute("title",sH(i))}function sH(e){return e==null?"":N(e)?WO(e):V(e)&&!Wr(e)?aH(e):e+""}function aH(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(N(n)?WO(n):GO(n))}).join(` 16`)}function WO(e){return"["+e.map(GO).join(", ")+"]"}function GO(e){return N(e)?"[â¦]":V(e)&&!Wr(e)?"{â¦}":e}function oH(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function HO(e,t){const n=this;if(t=t||{},Ga.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=ae({},e.locale,t.locale);n.locale(lk(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Ir.Canvas,n._scenegraph=new x$;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||rH,n._redraw=!0,n._handler=new Bl().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=AG(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=YG(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:ae({},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=UO(n,n._width),n._viewHeight=qO(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,JG(n),gG(n),pG(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Dc(e,t){return K(e._signals,t)?e._signals[t]:D("Unrecognized signal name: "+q(t))}function VO(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function CE(e,t,n,i){let r=VO(n,i);return r||(r=Kb(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function $E(e,t,n){const i=VO(t,n);return i&&t._targets.remove(i),e}G(HO,Ga,{async evaluate(e,t,n){if(await Ga.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,vG(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Jc(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&&MO(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=Dc(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",AE(e)):AE(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?(ph(e)||D("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&&(Ga.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Dc(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:QG,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=Kb(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 CE(this,e,Dc(this,e),t)},removeSignalListener(e,t){return $E(this,Dc(this,e),t)},addDataListener(e,t){return CE(this,e,od(this,e).values,t)},removeDataListener(e,t){return $E(this,od(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=n0(this,null);this._globalCursor=!!e,t&&n0(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:iH,events:CG,finalize:FG,hover:$G,data:mG,change:_h,insert:yG,remove:bG,scale:KG,initialize:qG,toImageURL:GG,toCanvas:VG,toSVG:XG,getState:ZG,setState:nH,_watchPixelRatio:oH});const uH="view",ld="[",cd="]",XO="{",YO="}",lH=":",KO=",",cH="@",fH=">",dH=/[[\]{}]/,hH={"*":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 JO,QO;function fs(e,t,n){return JO=t||uH,QO=n||hH,ZO(e.trim()).map(i0)}function gH(e){return QO[e]}function Uu(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 ZO(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Uu(e,r,KO,ld+XO,cd+YO),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function i0(e){return e[0]==="["?pH(e):mH(e)}function pH(e){const t=e.length;let n=1,i;if(n=Uu(e,n,cd,ld,cd),n===t)throw"Empty between selector: "+e;if(i=ZO(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==fH)throw"Expected '>' after between selector: "+e;i=i.map(i0);const r=i0(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function mH(e){const t={source:JO},n=[];let i=[0,0],r=0,s=0,a=e.length,o=0,u,l;if(e[a-1]===YO){if(o=e.lastIndexOf(XO),o>=0){try{i=yH(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]===cH&&(r=++o),u=Uu(e,o,lH),u<a&&(n.push(e.substring(s,u).trim()),s=o=++u),o=Uu(e,o,ld),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=Uu(e,o,cd),o===a)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,o).trim()),o<a-1&&e[++o]!==ld)throw"Expected left bracket: "+e;s=++o}if(!(a=n.length)||dH.test(n[a-1]))throw"Invalid event selector: "+e;return a>1?(t.type=n[1],r?t.markname=n[0].slice(1):gH(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 yH(e){const t=e.split(KO);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function bH(e){return V(e)?e:{type:e||"pad"}}const uu=e=>+e||0,vH=e=>({top:e,bottom:e,left:e,right:e});function xH(e){return V(e)?e.signal?e:{top:uu(e.top),bottom:uu(e.bottom),left:uu(e.left),right:uu(e.right)}:vH(uu(e))}const Ze=e=>V(e)&&!N(e)?ae({},e):{value:e};function FE(e,t,n,i){return n!=null?(V(n)&&!N(n)||N(n)&&n.length&&V(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function ht(e,t,n){for(const i in t)FE(e,i,t[i]);for(const i in n)FE(e,i,n[i],"update")}function Io(e,t,n){for(const i in t)n&&K(n,i)||(e[i]=ae(e[i]||{},t[i]));return e}function La(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const Zb="mark",ev="frame",tv="scope",wH="axis",EH="axis-domain",_H="axis-grid",SH="axis-label",AH="axis-tick",kH="axis-title",CH="legend",$H="legend-band",FH="legend-entry",OH="legend-gradient",eT="legend-label",TH="legend-symbol",RH="legend-title",DH="title",NH="title-text",MH="title-subtitle";function LH(e,t,n,i,r){const s={},a={};let o,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!La(u,e)&&mp(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===ev?r.group:n===Zb?ae({},r.mark,r[t]):null;for(u in c)l=La(u,e)||(u==="fill"||u==="stroke")&&(La("fill",e)||La("stroke",e)),l||mp(s,u,c[u]);X(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)La(h,e)||mp(s,h,d[h])}),e=ae({},e);for(u in s)c=s[u],c.signal?(o=o||{})[u]=c:a[u]=c;return e.enter=ae(a,e.enter),o&&(e.update=ae(o,e.update)),e}function mp(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const tT=e=>Y(e)?q(e):e.signal?`(${e.signal})`:nT(e);function Ah(e){if(e.gradient!=null)return PH(e);let t=e.signal?`(${e.signal})`:e.color?IH(e.color):e.field!=null?nT(e.field):e.value!==void 0?q(e.value):void 0;return e.scale!=null&&(t=zH(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${gf(e.exponent)})`),e.mult!=null&&(t+=`*${gf(e.mult)}`),e.offset!=null&&(t+=`+${gf(e.offset)}`),e.round&&(t=`round(${t})`),t}const Nc=(e,t,n,i)=>`(${e}(${[t,n,i].map(Ah).join(",")})+'')`;function IH(e){return e.c?Nc("hcl",e.h,e.c,e.l):e.h||e.s?Nc("hsl",e.h,e.s,e.l):e.l||e.a?Nc("lab",e.l,e.a,e.b):e.r||e.g||e.b?Nc("rgb",e.r,e.g,e.b):null}function PH(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:q(n));for(;t.length&&fe(t)==null;)t.pop();return t.unshift(tT(e.gradient)),`gradient(${t.join(",")})`}function gf(e){return V(e)?"("+Ah(e)+")":e}function nT(e){return iT(V(e)?e:{datum:e})}function iT(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):D("Invalid field reference: "+q(e));return e.signal||(i=Y(i)?Ii(i).map(q).join("]["):iT(i)),t+"["+i+"]"}function zH(e,t){const n=tT(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}
16)`+(+e.band==1?"":"*"+gf(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function BH(e){let t="";return e.forEach(n=>{const i=Ah(n);t+=n.test?`(${n.test})?${i}:`:i}),fe(t)===":"&&(t+="null"),t}function rT(e,t,n,i,r,s){const a={};s=s||{},s.encoders={$encode:a},e=LH(e,t,n,i,r.config);for(const o in e)a[o]=jH(e[o],t,s,r);return s}function jH(e,t,n,i){const r={},s={};for(const a in e)e[a]!=null&&(r[a]=qH(UH(e[a]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function UH(e){return N(e)?BH(e):Ah(e)}function qH(e,t,n,i){const r=Di(e,t);return r.$fields.forEach(s=>i[s]=1),ae(n,r.$params),r.$expr}const WH="outer",GH=["value","update","init","react","bind"];function OE(e,t){D(e+' for "outer" push: '+q(t))}function sT(e,t){const n=e.name;if(e.push===WH)t.signals[n]||OE("No prior signal definition",n),GH.forEach(i=>{e[i]!==void 0&&OE("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 r0(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function kh(e,t,n,i){return new r0(e,t,n,i)}function fd(e,t){return kh("operator",e,t)}function te(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function sl(e,t){return t?{$field:e,$name:t}:{$field:e}}const s0=sl("key");function TE(e,t){return{$compare:e,$order:t}}function HH(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const VH="ascending",XH="descending";function YH(e){return V(e)?(e.order===XH?"-":"+")+Ch(e.op,e.field):""}function Ch(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const nv="scope",a0="view";function Ye(e){return e&&e.signal}function KH(e){return e&&e.expr}function pf(e){if(Ye(e))return!0;if(V(e)){for(const t in e)if(pf(e[t]))return!0}return!1}function Hn(e,t){return e??t}function js(e){return e&&e.signal||e}const RE="timer";function al(e,t){return(e.merge?QH:e.stream?ZH:e.type?eV:D("Invalid stream specification: "+q(e)))(e,t)}function JH(e){return e===nv?a0:e||a0}function QH(e,t){const n=e.merge.map(r=>al(r,t)),i=iv({merge:n},e,t);return t.addStream(i).id}function ZH(e,t){const n=al(e.stream,t),i=iv({stream:n},e,t);return t.addStream(i).id}function eV(e,t){let n;e.type===RE?(n=t.event(RE,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(JH(e.source),e.type);const i=iv({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function iv(e,t,n){let i=t.between;return i&&(i.length!==2&&D('Stream "between" parameter must have 2 entries: '+q(t)),e.between=[al(i[0],n),al(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(tV(t.marktype,t.markname,t.markrole)),t.source===nv&&i.push("inScope(event.item)"),i.length&&(e.filter=Di("("+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 tV(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 nV={code:"_.$value",ast:{type:"Identifier",value:"value"}};function iV(e,t,n){const i=e.encode,r={target:n};let s=e.events,a=e.update,o=[];s||D("Signal update missing events specification."),Y(s)&&(s=fs(s,t.isSubscope()?nv:a0)),s=X(s).filter(u=>u.signal||u.scale?(o.push(u),0):1),o.length>1&&(o=[sV(o)]),s.length&&o.push(s.length>1?{merge:s}:s[0]),i!=null&&(a&&D("Signal encode and update are mutually exclusive."),a="encode(item(),"+q(i)+")"),r.update=Y(a)?Di(a,t):a.expr!=null?Di(a.expr,t):a.value!=null?a.value:a.signal!=null?{$expr:nV,$params:{$value:t.signalRef(a.signal)}}:D("Invalid signal update specification."),e.force&&(r.options={force:!0}),o.forEach(u=>t.addUpdate(ae(rV(u,t),r)))}function rV(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):al(e,t)}}function sV(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function aV(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?D("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=Di(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>iV(r,t,n.id))}const Se=e=>(t,n,i)=>kh(e,n,t||void 0,i),aT=Se("aggregate"),oV=Se("axisticks"),oT=Se("bound"),ci=Se("collect"),DE=Se("compare"),uV=Se("datajoin"),uT=Se("encode"),lV=Se("expression"),cV=Se("facet"),fV=Se("field"),dV=Se("key"),hV=Se("legendentries"),gV=Se("load"),pV=Se("mark"),mV=Se("multiextent"),yV=Se("multivalues"),bV=Se("overlap"),vV=Se("params"),lT=Se("prefacet"),xV=Se("projection"),wV=Se("proxy"),EV=Se("relay"),cT=Se("render"),_V=Se("scale"),da=Se("sieve"),SV=Se("sortitems"),fT=Se("viewlayout"),AV=Se("values");let kV=0;const dT={min:"min",max:"max",count:"sum"};function CV(e,t){const n=e.type||"linear";RC(n)||D("Unrecognized scale type: "+q(n)),t.addScale(e.name,{type:n,domain:void 0})}function $V(e,t){const n=t.getScale(e.name).params;let i;n.domain=hT(e.domain,e,t),e.range!=null&&(n.range=pT(e,t,n)),e.interpolate!=null&&PV(e.interpolate,n),e.nice!=null&&(n.nice=IV(e.nice,t)),e.bins!=null&&(n.bins=LV(e.bins,t));for(i in e)K(n,i)||i==="name"||(n[i]=Fn(e[i],t))}function Fn(e,t){return V(e)?e.signal?t.signalRef(e.signal):D("Unsupported object: "+q(e)):e}function mf(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Fn(n,t))}function $h(e){D("Can not find data set: "+q(e))}function hT(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&D("No scale domain defined for domainMin/d
16omainMax to override.");return}return e.signal?n.signalRef(e.signal):(N(e)?FV:e.fields?TV:OV)(e,t,n)}function FV(e,t,n){return e.map(i=>Fn(i,n))}function OV(e,t,n){const i=n.getData(e.data);return i||$h(e.data),ro(t.type)?i.valuesRef(n,e.field,gT(e.sort,!1)):MC(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function TV(e,t,n){const i=e.data,r=e.fields.reduce((s,a)=>(a=Y(a)?{data:i,field:a}:N(a)||a.signal?RV(a,n):a,s.push(a),s),[]);return(ro(t.type)?DV:MC(t.type)?NV:MV)(e,n,r)}function RV(e,t){const n="_:vega:_"+kV++,i=ci({});if(N(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+q(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,da({})]),{data:n,field:"data"}}function DV(e,t,n){const i=gT(e.sort,!0);let r,s;const a=n.map(l=>{const c=t.getData(l.data);return c||$h(l.data),c.countsRef(t,l.field,i)}),o={groupby:s0,pulse:a};i&&(r=i.op||"count",s=i.field?Ch(r,i.field):"count",o.ops=[dT[r]],o.fields=[t.fieldRef(s)],o.as=[s]),r=t.add(aT(o));const u=t.add(ci({pulse:te(r)}));return s=t.add(AV({field:s0,sort:t.sortRef(i),pulse:te(u)})),te(s)}function gT(e,t){return e&&(!e.field&&!e.op?V(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?D("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!dT[e.op]&&D("Multiple domain scales can not be sorted using "+e.op)),e}function NV(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||$h(r.data),s.domainRef(t,r.field)});return te(t.add(yV({values:i})))}function MV(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||$h(r.data),s.extentRef(t,r.field)});return te(t.add(mV({extents:i})))}function LV(e,t){return e.signal||N(e)?mf(e,t):t.objectProperty(e)}function IV(e,t){return e.signal?t.signalRef(e.signal):V(e)?{interval:Fn(e.interval),step:Fn(e.step)}:Fn(e)}function PV(e,t){t.interpolate=Fn(e.type||e),e.gamma!=null&&(t.interpolateGamma=Fn(e.gamma))}function pT(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(Y(r)){if(i&&K(i,r))return e=ae({},e,{range:i[r]}),pT(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=ro(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:D("Unrecognized scale range value: "+q(r))}else if(r.scheme){n.scheme=N(r.scheme)?mf(r.scheme,t):Fn(r.scheme,t),r.extent&&(n.schemeExtent=mf(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(ro(e.type)&&!N(r))return hT(r,e,t);N(r)||D("Unsupported range type: "+q(r))}return r.map(s=>(N(s)?mf:Fn)(s,t))}function zV(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=o0(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=o0(n[r],r,t));t.addProjection(e.name,i)}function o0(e,t,n){return N(e)?e.map(i=>o0(i,t,n)):V(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:D("Unsupported parameter object: "+q(e)):e}const fi="top",Po="left",zo="right",ts="bottom",mT="center",BV="vertical",jV="start",UV="middle",qV="end",u0="index",rv="label",WV="offset",co="perc",GV="perc2",Tn="value",Xl="guide-label",sv="guide-title",HV="group-title",VV="group-subtitle",NE="symbol",yf="gradient",l0="discrete",c0="size",XV="shape",YV="fill",KV="stroke",JV="strokeWidth",QV="strokeDash",ZV="opacity",av=[c0,XV,YV,KV,JV,QV,ZV],Yl={name:1,style:1,interactive:1},de={value:0},Rn={value:1},Fh="group",yT="rect",ov="rule",eX="symbol",ha="text";function ol(e){return e.type=Fh,e.interactive=e.interactive||!1,e}function un(e,t){const n=(i,r)=>Hn(e[i],Hn(t[i],r));return n.isVertical=i=>BV===Hn(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Hn(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Hn(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Hn(e.columns,Hn(t.columns,+n.isVertical(!0))),n}function bT(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 tX(e,t,n){const i=t.config.style[n];return i&&i[e]}function Oh(e,t,n){return`item.anchor === '${jV}' ? ${e} : item.anchor === '${qV}' ? ${t} : ${n}`}const uv=Oh(q(Po),q(zo),q(mT));function nX(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'`},V(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 vT(e,t){return t?e?V(e)?Object.assign({},e,{offset:vT(e.offset,t)}):{value:e,offset:t}:t:e}function Sn(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Io(e.encode,t,Yl)):e.interactive=!1,e}function iX(e,t,n,i){const r=un(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 h={enter:u={opacity:de,x:de,y:de,width:Ze(f),height:Ze(d)},update:ae({},u,{opacity:Rn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:de}};return ht(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Sn({type:yT,role:OH,encode:h},i)}function rX(e,t,n,i,r){const s=un(e,n),a=s.isVertical(),o=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const g={opacity:de,fill:{scale:t,field:Tn}};g[l]={signal:h+"datum."+co,mult:u},g[c]=de,g[f]={signal:h+"datum."+GV,mult:u},g[d]=Ze(o);const p={enter:g,update:ae({},g,{opacity:Rn}),exit:{opacity:de}};return ht(p,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),Sn({type:yT,role:$H,key:Tn,from:r,encode:p},i)}const sX=`datum.${co}<=0?"${Po}":datum.${co}>=1?"${zo}":"${mT}"`,aX=`datum.${co}<=0?"${ts}":datum.${co}>=1?"${fi}":"${UV}"`;function ME(e,t,n,i){const r=un(e,t),s=r.isVertical(),a=Ze(r.gradientThickness()),o=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const g={enter:l={opacity:de},update:c={opacity:Rn,text:{field:rv}},exit:{opacity:de}};return ht(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:Hn(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:aX},f="y",d="x",h="1-"):(l.align=c.align={signal:sX},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+co,mult:o},l[d]=c[d]=a,a.offset=Hn(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+u0}:void 0,Sn({type:ha,role:eT,style:Xl,key:Tn,from:i,encode:g,overlap:u},n)}function oX(e,t,n,i,r){const s=un(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.${WV} : datum.${c0}`,h=l?Ze(l):{field:c0},g=`datum.${u0}`,p=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:de,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Rn,x:y.x,y:y.y},exit:{opacity:de}};let E=null,_=null;e.fill||(E=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),ht(m,{fill:s("symbolFillColor",E
vendor: 1,798 bytes, line 16
16),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",_),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),av.forEach(k=>{e[k]&&(b[k]=y[k]={scale:e[k],field:Tn})});const w=Sn({type:eX,role:TH,key:Tn,from:f,clip:l?!0:void 0,encode:m},n.symbols),S=Ze(c);S.offset=s("labelOffset"),m={enter:y={opacity:de,x:{signal:d,offset:S},y:h},update:b={opacity:Rn,text:{field:rv},x:y.x,y:y.y},exit:{opacity:de}},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 A=Sn({type:ha,role:eT,style:Xl,key:Tn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:de,height:l?Ze(l):de,opacity:de},exit:{opacity:de},update:b={opacity:Rn,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${p})`,b.row.signal=`${g}%${v}`,b.column.signal=`floor(${g} / ${v})`,x={field:["row",g]}):(b.row.signal=`floor(${g} / ${p})`,b.column.signal=`${g} % ${p}`,x={field:g}),b.column.signal=`(${r})?${b.column.signal}:${g}`,i={facet:{data:i,name:"value",groupby:u0}},ol({role:tv,from:i,encode:Io(m,a,Yl),marks:[w,A],name:u,interactive:o,sort:x})}function uX(e,t){const n=un(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const lv='item.orient === "left"',cv='item.orient === "right"',Th=`(${lv} || ${cv})`,lX=`datum.vgrad && ${Th}`,cX=Oh('"top"','"bottom"','"middle"'),fX=Oh('"right"','"left"','"center"'),dX=`datum.vgrad && ${cv} ? (${fX}) : (${Th} && !(datum.vgrad && ${lv})) ? "left" : ${uv}
16`,hX=`item._anchor || (${Th} ? "middle" : "start")`,gX=`${lX} ? (${lv} ? -90 : 90) : 0`,pX=`${Th} ? (datum.vgrad ? (${cv} ? "bottom" : "top") : ${cX}) : "top"`;function mX(e,t,n,i){const r=un(e,t),s={enter:{opacity:de},update:{opacity:Rn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:de}};return ht(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:hX},angle:{signal:gX},align:{signal:dX},baseline:{signal:pX},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")}),Sn({type:ha,role:RH,style:sv,from:i,encode:s},n)}function yX(e,t){let n;return V(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+LE(e.path)+")":e.sphere&&(n="geoShape("+LE(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function LE(e){return V(e)&&e.signal?e.signal:q(e)}function xT(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===Fh?tv:t||Zb}function bX(e){return{marktype:e.type,name:e.name||void 0,role:e.role||xT(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function vX(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function fv(e,t){const n=Ek(e.type);n||D("Unrecognized transform type: "+q(e.type));const i=kh(n.type.toLowerCase(),null,wT(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function wT(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const a=e.params[s];i[a.name]=xX(a,t,n)}return i}function xX(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return wX(e,t,n);if(r===void 0){e.required&&D("Missing required "+q(t.type)+" parameter: "+q(e.name));return}else{if(i==="param")return EX(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!Ye(r)?r.map(s=>IE(e,s,n)):IE(e,r,n)}function IE(e,t,n){const i=e.type;if(Ye(t))return zE(i)?D("Expression references can not be signals."):yp(i)?n.fieldRef(t):BE(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||yp(i);return r&&_X(t)?n.exprRef(t.expr,t.as):r&&SX(t)?sl(t.field,t.as):zE(i)?Di(t,n):AX(i)?te(n.getData(t).values):yp(i)?sl(t):BE(i)?n.compareRef(t):t}}function wX(e,t,n){return Y(t.from)||D('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function EX(e,t,n){const i=t[e.name];return e.array?(N(i)||D("Expected an array of sub-parameters. Instead: "+q(i)),i.map(r=>PE(e,r,n))):PE(e,i,n)}function PE(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||D("Unsupported parameter: "+q(t));const s=ae(wT(r,t,n),r.key);return te(n.add(vV(s)))}const _X=e=>e&&e.expr,SX=e=>e&&e.field,AX=e=>e==="data",zE=e=>e==="expr",yp=e=>e==="field",BE=e=>e==="compare";function kX(e,t,n){let i,r,s,a,o;return e?(i=e.facet)&&(t||D("Only group marks can be faceted."),i.field!=null?a=o=bf(i,n):(e.data?o=te(n.getData(e.data).aggregate):(s=fv(ae({type:"aggregate",groupby:X(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=bf(i,n),a=o=te(n.add(s))),r=n.keyRef(i.groupby,!0))):a=te(n.add(ci(null,[{}]))),a||(a=bf(e,n)),{key:r,pulse:a,parent:o}}function bf(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:te(t.getData(e.data).output)}function Zs(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}Zs.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=te(t[o-1]),e.add(t[o]),t[o].type==="aggregate"&&(a=t[o]);return new Zs(e,s,r,i,a)};function ET(e){return Y(e)?e:null}function jE(e,t,n){const i=Ch(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 lu(e,t,n,i,r,s,a){const o=t[n]||(t[n]={}),u=YH(s);let l=ET(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=o[l]),!c){const d=s?{field:s0,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:te(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(kh(i,void 0,d)),a&&(t.index[r]=f),c=te(f),l!=null&&(o[l]=c)}return c}Zs.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=ET(t);let a,o,u;return s!=null&&(e=i.scope,a=r[s]),a?n&&n.field&&jE(e,a.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:te(i.output)},n&&n.field&&jE(e,u,n),o=e.add(aT(u)),a=e.add(ci({pulse:te(o)})),a={agg:o,ref:te(a)},s!=null&&(r[s]=a)),a.ref},tuplesRef(){return te(this.values)},extentRef(e,t){return lu(e,this,"extent","extent",t,!1)},domainRef(e,t){return lu(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return lu(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return lu(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return lu(e,this,"indata","tupleindex",t,!0,!0)}};function CX(e,t,n){const i=e.from.facet,r=i.name,s=bf(i,t);let a;i.name||D("Facet must have a name: "+q(i)),i.data||D("Facet must reference a data set: "+q(i)),i.field?a=t.add(lT({field:t.fieldRef(i.field),pulse:s})):i.groupby?a=t.add(cV({key:t.keyRef(i.groupby),group:te(t.proxy(n.parent)),pulse:s})):D("Facet must specify groupby or field: "+q(i));const o=t.fork(),u=o.add(ci()),l=o.add(da({pulse:te(u)}));o.addData(r,new Zs(o,u,u,l)),o.addSignal("parent",null),a.params.subflow={$subflow:o.parse(e).toRuntime()}}
vendor: 32,923 bytes, line 16
16function $X(e,t,n){const i=t.add(lT({pulse:n.pulse})),r=t.fork();r.add(da()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function _T(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,a=e.modify,o=e.values,u=t.add(fd()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,a,o].map(f=>f??"null").join(",")+"),0)",c=Di(l,t);u.update=c.$expr,u.params=c.$params}function Rh(e,t){const n=xT(e),i=e.type===Fh,r=e.from&&e.from.facet,s=e.overlap;let a=e.layout||n===tv||n===ev,o,u,l,c,f,d,h;const g=n===Zb||a||r,p=kX(e.from,i,t);u=t.add(uV({key:p.key||(e.key?sl(e.key):void 0),pulse:p.pulse,clean:!i}));const m=te(u);u=l=t.add(ci({pulse:m})),u=t.add(pV({markdef:bX(e),interactive:vX(e.interactive,t),clip:yX(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:te(u)}));const y=te(u);u=c=t.add(uT(rT(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{const w=fv(_,t),S=w.metadata;(S.generates||S.changes)&&D("Mark transforms should not generate new data."),S.nomod||(c.params.mod=!0),w.params.pulse=te(u),t.add(u=w)}),e.sort&&(u=t.add(SV({sort:t.compareRef(e.sort),pulse:te(u)})));const b=te(u);(r||a)&&(a=t.add(fT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=te(a));const v=t.add(oT({mark:y,pulse:d||b}));h=te(v),i&&(g&&(o=t.operators,o.pop(),a&&o.pop()),t.pushState(b,d||h,m),r?CX(e,t,p):g?$X(e,t,p):t.parse(e),t.popState(),g&&(a&&o.push(a),o.push(v))),s&&(h=FX(s,h,t));const x=t.add(cT({pulse:h})),E=t.add(da({pulse:te(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Zs(t,l,x,E)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&D("Marks only support modify triggers."),_T(_,t,f)}))}function FX(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 te(n.add(bV(a)))}function OX(e,t){const n=t.config.legend,i=e.encode||{},r=un(e,n),s=i.legend||{},a=s.name||void 0,o=s.interactive,u=s.style,l={};let c=0,f,d,h;av.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||D("Missing valid scale for legend.");const g=TX(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=te(t.add(ci(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=te(t.add(hV(d={type:g,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 g===yf?(h=[iX(e,c,n,i.gradient),ME(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${js(r.gradientLength())})/100))`)):g===l0?h=[rX(e,c,n,i.gradient,b),ME(e,n,i.labels,b)]:(f=uX(e,n),h=[oX(e,n,i,b,js(f.columns))],d.size=NX(e,t,h[0].marks)),h=[ol({role:FH,from:m,encode:y,marks:h,layout:f,interactive:o})],p.title&&h.push(mX(e,n,i.title,m)),Rh(ol({role:CH,from:m,encode:Io(DX(r,e,n),s,Yl),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:o,style:u}),t)}function TX(e,t){let n=e.type||NE;return!e.type&&RX(e)===1&&(e.fill||e.stroke)&&(n=yy(t)?yf:pm(t)?l0:NE),n!==yf?n:pm(t)?l0:yf}function RX(e){return av.reduce((t,n)=>t+(e[n]?1:0),0)}function DX(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 NX(e,t,n){const i=js(UE("size",e,n)),r=js(UE("strokeWidth",e,n)),s=js(MX(n[1].encode,t,Xl));return Di(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function UE(e,t,n){return t[e]?`scale("${t[e]}",datum)`:bT(e,n[0].encode)}function MX(e,t,n){return bT("fontSize",e)||tX("fontSize",t,n)}const LX=`item.orient==="${Po}"?-90:item.orient==="${zo}"?90:0`;function IX(e,t){e=Y(e)?{text:e}:e;const n=un(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,a=r.interactive,o=r.style,u=[],l={},c=te(t.add(ci(null,[l])));return u.push(BX(e,n,PX(e),c)),e.subtitle&&u.push(jX(e,n,i.subtitle,c)),Rh(ol({role:DH,from:c,encode:zX(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:a,style:o}),t)}function PX(e){const t=e.encode;return t&&t.title||ae({name:e.name,interactive:e.interactive,style:e.style},t)}function zX(e,t){const n={enter:{},update:{}};return ht(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:uv},angle:{signal:LX},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Io(n,t,Yl)}function BX(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")}),Sn({type:ha,role:NH,style:HV,from:i,encode:a},n)}function jX(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")}),Sn({type:ha,role:MH,style:VV,from:i,encode:a},n)}function UX(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(fv(i,t))}),e.on&&e.on.forEach(i=>{_T(i,t,e.name)}),t.addDataPipeline(e.name,qX(e,t,n))}function qX(e,t,n){const i=[];let r=null,s=!1,a=!1,o,u,l,c,f;for(e.values?Ye(e.values)||pf(e.format)?(i.push(qE(t,e)),i.push(r=ws())):i.push(r=ws({$ingest:e.values,$format:e.format})):e.url?pf(e.url)||pf(e.format)?(i.push(qE(t,e)),i.push(r=ws())):i.push(r=ws({$request:e.url,$format:e.format})):e.source&&(r=o=X(e.source).map(d=>te(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=ws()),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]=EV({derive:s,pulse:l?o:o[0]}),(s||l)&&i.splice(1,0,ws())),r||i.push(ws()),i.push(da({})),i}function ws(e){const t=ci({},e);return t.metadata={source:!0},t}function qE(e,t){return gV({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 ST=e=>e===ts||e===fi,Dh=(e,t,n)=>Ye(e)?VX(e.signal,t,n):e===Po||e===fi?t:n,et=(e,t,n)=>Ye(e)?GX(e.signal,t,n):ST(e)?t:n,Zn=(e,t,n)=>Ye(e)?HX(e.signal,t,n):ST(e)?n:t,AT=(e,t,n)=>Ye(e)?XX(e.signal,t,n):e===fi?{value:t}:{value:n},WX=(e,t,n)=>Ye(e)?YX(e.signal,t,n):e===zo?{value:t}:{value:n},GX=(e,t,n)=>kT(`${e} === '${fi}' || ${e} === '${ts}'`,t,n),HX=(e,t,n)=>kT(`${e} !== '${fi}' && ${e} !== '${ts}'`,t,n),VX=(e,t,n)=>dv(`${e} === '${Po}' || ${e} === '${fi}'`,t,n),XX=(e,t,n)=>dv(`${e} === '${fi}'`,t,n),YX=(e,t,n)=>dv(`${e} === '${zo}'`,t,n),kT=(e,t,n)=>(t=t!=null?Ze(t):t,n=n!=null?Ze(n):n,WE(t)&&WE(n)?(t=t?t.signal||q(t.value):null,n=n?n.signal||q(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ae({test:e},t)].concat(n||[])),WE=e=>e==null||Object.keys(e).length===1,dv=(e,t,n)=>({signal:`${e} ? (${Ua(t)}) : (${Ua(n)})`}),KX=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Po}' ? (${Ua(i)}) : `:"")+(n!=null?`${e} === '${ts}' ? (${Ua(n)}) : `:"")+(r!=null?`${e} === '${zo}' ? (${Ua(r)}) : `:"")+(t!=null?`${e} === '${fi}' ? (${Ua(t)}) : `:"")+"(null)"}),Ua=e=>Ye(e)?e.signal:e==null?null:q(e),JX=(e,t)=>t===0?0:Ye(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Va=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Ta(e,t,n,i){let r;if(t&&K(t,e))return t[e];if(K(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[sv][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[Xl][r]}return null}function GE(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function QX(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=GE([n.axisX,n.axisY]),d=GE([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);o={};for(l of f)o[l]=et(a,Ta(l,n.axisX,r,i),Ta(l,n.axisY,r,i));u={};for(l of d)u[l]=KX(a.signal,Ta(l,n.axisTop,r,i),Ta(l,n.axisBottom,r,i),Ta(l,n.axisLeft,r,i),Ta(l,n.axisRight,r,i))}else o=a===fi||a===ts?n.axisX:n.axisY,u=n["axis"+a[0].toUpperCase()+a.slice(1)];return o||u||s?ae({},r,o,u,s):r}function ZX(e,t,n,i){const r=un(e,t),s=e.orient;let a,o;const u={enter:a={opacity:de},update:o={opacity:Rn},exit:{opacity:de}};ht(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=HE(e,0),c=HE(e,1);return a.x=o.x=et(s,l,de),a.x2=o.x2=et(s,c),a.y=o.y=Zn(s,l,de),a.y2=o.y2=Zn(s,c),Sn({type:ov,role:EH,from:i,encode:u},n)}function HE(e,t){return{scale:e.scale,range:t}}function eY(e,t,n,i,r){const s=un(e,t),a=e.orient,o=e.gridScale,u=Dh(a,1,-1),l=tY(e.offset,u);let c,f,d;const h={enter:c={opacity:de},update:d={opacity:Rn},exit:f={opacity:de}};ht(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const g={scale:e.scale,field:Tn,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},p=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}:ae(p,{mult:u,offset:l});return c.x=d.x=et(a,g,m),c.y=d.y=Zn(a,g,m),c.x2=d.x2=Zn(a,y),c.y2=d.y2=et(a,y),f.x=et(a,g),f.y=Zn(a,g),Sn({type:ov,role:_H,key:Tn,from:i,encode:h},n)}function tY(e,t){if(t!==1)if(!V(e))e=Ye(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=ae({},e);for(;n.mult!=null;)if(V(n.mult))n=n.mult=ae({},n.mult);else return n.mult=Ye(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function nY(e,t,n,i,r,s){const a=un(e,t),o=e.orient,u=Dh(o,-1,1);let l,c,f;const d={enter:l={opacity:de},update:f={opacity:Rn},exit:c={opacity:de}};ht(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=Ze(r);h.mult=u;const g={scale:e.scale,field:Tn,band:s.band,extra:s.extra,offset:s.offset,round:a("tickRound")};return f.y=l.y=et(o,de,g),f.y2=l.y2=et(o,h),c.x=et(o,g),f.x=l.x=Zn(o,de,g),f.x2=l.x2=Zn(o,h),c.y=Zn(o,g),Sn({type:ov,role:AH,key:Tn,from:i,encode:d},n)}function bp(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function iY(e,t,n,i,r,s){const a=un(e,t),o=e.orient,u=e.scale,l=Dh(o,-1,1),c=js(a("labelFlush")),f=js(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let g=c===0||!!c,p;const m=Ze(r);m.mult=l,m.offset=Ze(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Tn,band:.5,offset:vT(s.offset,a("labelOffset"))},b=et(o,g?bp(u,c,'"left"','"right"','"center"'):{value:"center"},WX(o,"left","right")),v=et(o,AT(o,"bottom","top"),g?bp(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=bp(u,c,`-(${f})`,f,0);g=g&&f;const E={opacity:de,x:et(o,y,m),y:Zn(o,y,m)},_={enter:E,update:p={opacity:Rn,text:{field:rv},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:de,x:E.x,y:E.y}};ht(_,{dx:!d&&g?et(o,x):null,dy:!h&&g?Zn(o,x):null}),ht(_,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const w=a("labelBound");let S=a("labelOverlap");return S=S||w?{separation:a("labelSeparation"),method:S,order:"datum.index",bound:w?{scale:u,orient:o,tolerance:w}:null}:void 0,p.align!==b&&(p.align=Va(p.align,b)),p.baseline!==v&&(p.baseline=Va(p.baseline,v)),Sn({type:ha,role:SH,style:Xl,key:Tn,from:i,encode:_,overlap:S},n)}function rY(e,t,n,i){const r=un(e,t),s=e.orient,a=Dh(s,-1,1);let o,u;const l={enter:o={opacity:de,anchor:Ze(r("titleAnchor",null)),align:{signal:uv}},update:u=ae({},o,{opacity:Rn,text:Ze(e.title)}),exit:{opacity:de}},c={signal:`lerp(range("${e.scale}"), ${Oh(0,1,.5)})`};return u.x=et(s,c),u.y=Zn(s,c),o.angle=et(s,de,JX(a,90)),o.baseline=et(s,AT(s,ts,fi),{value:ts}),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")}),sY(r,s,l,n),l.update.align=Va(l.update.align,o.align),l.update.angle=Va(l.update.angle,o.angle),l.update.baseline=Va(l.update.baseline,o.baseline),Sn({type:ha,role:kH,style:sv,from:i,encode:l},n)}function sY(e,t,n,i){const r=(o,u)=>o!=null?(n.update[u]=Va(Ze(o),n.update[u]),!1):!La(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 aY(e,t){const n=QX(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,a=r.interactive,o=r.style,u=un(e,n),l=nX(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=te(t.add(ci({},[c]))),d=te(t.add(oV({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let g;return c.grid&&h.push(eY(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(nY(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(iY(e,n,i.labels,d,g,l))),c.domain&&h.push(ZX(e,n,i.domain,f)),c.title&&h.push(rY(e,n,i.title,f)),Rh(ol({role:wH,from:f,encode:Io(oY(u,e),r,Yl),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:a,style:o}),t)}function oY(e,t){const n={enter:{},update:{}};return ht(n,{orient:e("orient"),offset:e("offset")||0,position:Hn(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 CT(e,t,n){const i=X(e.signals),r=X(e.scales);return n||i.forEach(s=>sT(s,t)),X(e.projections).forEach(s=>zV(s,t)),r.forEach(s=>CV(s,t)),X(e.data).forEach(s=>UX(s,t)),r.forEach(s=>$V(s,t)),(n||i).forEach(s=>aV(s,t)),X(e.axes).forEach(s=>aY(s,t)),X(e.marks).forEach(s=>Rh(s,t)),X(e.legends).forEach(s=>OX(s,t)),e.title&&IX(e.title,t),t.parseLambdas(),t}const uY=e=>Io({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function lY(e,t){const n=t.config,i=te(t.root=t.add(fd())),r=cY(e,n);r.forEach(l=>sT(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(ci()),a=t.add(uT(rT(uY(e.encode),Fh,ev,e.style,t,{pulse:te(s)}))),o=t.add(fT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:te(a)}));t.operators.pop(),t.pushState(te(a),te(o),null),CT(e,t,r),t.operators.push(o);let u=t.add(oT({mark:i,pulse:te(o)}));return u=t.add(cT({pulse:te(u)})),u=t.add(da({pulse:te(u)})),t.addData("root",new Zs(t,s,s,u)),t}function cu(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function cY(e,t){const n=a=>Hn(e[a],t[a]),i=[cu("background",n("background")),cu("autosize",bH(n("autosize"))),cu("padding",xH(n("padding"))),cu("width",n("width")||0),cu("height",n("height")||0)],r=i.reduce((a,o)=>(a[o.name]=o,a),{}),s={};return X(e.signals).forEach(a=>{K(r,a.name)?a=ae(r[a.name],a):i.push(a),s[a.name]=a}),X(t.signals).forEach(a=>{!K(s,a.name)&&!K(r,a.name)&&i.push(a)}),i}function $T(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 VE(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}$T.prototype=VE.prototype={parse(e){return CT(e,this)},fork(){return new VE(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 r0?te(e):e;return this.add(wV({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(te(this.add(da({pulse:e})))),this._parent.push(t),this._lookup.push(n?te(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return fe(this._parent)},encode(){return fe(this._encode)},lookup(){return fe(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Y(e))return sl(e,t);e.signal||D("Unsupported field reference: "+q(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=te(this.add(fV(r)))}return i},compareRef(e){let t=!1;const n=s=>Ye(s)?(t=!0,this.signalRef(s.signal)):KH(s)?(t=!0,this.exprRef(s.expr)):s,i=X(e.field).map(n),r=X(e.order).map(n);return t?te(this.add(DE({fields:i,orders:r}))):TE(i,r)},keyRef(e,t){let n=!1;const i=s=>Ye(s)?(n=!0,te(r[s.signal])):s,r=this.signals;return e=X(e).map(i),n?te(this.add(dV({fields:e,flat:t}))):HH(e,t)},sortRef(e){if(!e)return e;const t=Ch(e.op,e.field),n=e.order||VH;return n.signal?te(this.add(DE({fields:t,orders:this.signalRef(n.signal)}))):TE(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 K(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&D("Duplicate signal name: "+q(e));const n=t instanceof r0?t:this.add(fd(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||D("Unrecognized signal name: "+q(e)),this.signals[e]},signalRef(e){return this.signals[e]?te(this.signals[e]):(K(this.lambdas,e)||(this.lambdas[e]=this.add(fd(null))),te(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=Di(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||!V(e)?e:this.signalRef(e.signal||hv(e))},exprRef(e,t){const n={expr:Di(e,this)};return t&&(n.expr.$name=t),te(this.add(lV(n)))},addBinding(e,t){this.bindings||D("Nested signals do not support binding: "+q(e)),this.bindings.push(ae({signal:e},t))},addScaleProj(e,t){K(this.scales,e)&&D("Duplicate scale or projection name: "+q(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,_V(t))},addProjection(e,t){this.addScaleProj(e,xV(t))},getScale(e){return this.scales[e]||D("Unrecognized scale name: "+q(e)),this.scales[e]},scaleRef(e){return te(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 K(this.data,e)&&D("Duplicate data set name: "+q(e)),this.data[e]=t},getData(e){return this.data[e]||D("Undefined data set name: "+q(e)),this.data[e]},addDataPipeline(e,t){return K(this.data,e)&&D("Duplicate data set name: "+q(e)),this.addData(e,Zs.fromEntries(this,t))}};function hv(e){return(N(e)?fY:dY)(e)}function fY(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(V(r)?r.signal||hv(r):q(r))}return n+"]"}function dY(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+q(i)+":"+(V(r)?r.signal||hv(r):q(r));return t+"}"}function hY(){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 gY(e,t,n){return V(e)||D("Input Vega specification must be an object."),t=Fo(hY(),t,e.config),lY(e,new $T(t,n)).toRuntime()}var pY="5.30.0";ae(to,xP,z8,y9,f7,Q7,Aj,rj,Cj,Jj,oU,gU);const mY=Object.freeze(Object.defineProperty({__proto__:null,Bounds:qe,CanvasHandler:Bl,CanvasRenderer:qf,DATE:nn,DAY:xt,DAYOFYEAR:Ti,Dataflow:Ga,Debug:pA,Error:J0,EventStream:Hd,Gradient:KC,GroupItem:oh,HOURS:wn,Handler:Uy,HybridHandler:j$,HybridRenderer:km,Info:gA,Item:ah,MILLISECONDS:ni,MINUTES:En,MONTH:St,Marks:_n,MultiPulse:y1,None:hA,Operator:Ae,Parameters:Gd,Pulse:Gr,QUARTER:tn,RenderType:Ir,Renderer:zl,ResourceLoader:i$,SECONDS:Mn,SVGHandler:$$,SVGRenderer:Xy,SVGStringRenderer:B$,Scenegraph:x$,TIME_UNITS:l1,Transform:O,View:HO,WEEK:Ve,Warn:Q0,YEAR:ct,accessor:on,accessorFields:_t,accessorName:Pe,array:X,ascending:zd,bandwidthNRD:w1,bin:Ak,bootstrapCI:kk,boundClip:J$,boundContext:Ml,boundItem:wm,boundMark:m$,boundStroke:hr,changeset:ls,clampRange:kA,codegenExpression:vO,compare:i1,constant:$t,cumulativeLogNormal:C1,cumulativeNormal:Xd,cumulativeUniform:T1,dayofyear:zA,debounce:r1,defaultLocale:d1,definition:Ek,densityLogNormal:k1,densityNormal:E1,densityUniform:O1,domChild:He,domClear:Cn,domCreate:Mr,domFind:jy,dotbin:Ck,error:D,expressionFunction:je,extend:ae,extent:Oi,extentIndex:CA,falsy:_r,fastmap:To,field:Dn,flush:$A,font:dh,fontFamily:Pl,fontSize:Pi,format:Kc,formatLocale:Cf,formats:p1,hasOwnProperty:K,id:_l,identity:Ct,inferType:fk,inferTypes:dk,ingest:ye,inherits:G,inrange:Pa,interpolate:by,interpolateColors:rh,interpolateRange:LC,intersect:V$,intersectBoxLine:za,intersectPath:ky,intersectPoint:Cy,intersectRule:s$,isArray:N,isBoolean:us,isDate:Wr,isFunction:oe,isIterable:FA,isNumber:pe,isObject:V,isRegExp:OA,isString:Y,isTuple:qd,key:s1,lerp:TA,lineHeight:Qr,loader:jd,locale:lk,logger:Z0,lruCache:RA,markup:Vy,merge:DA,mergeConfig:Fo,multiLineOffset:Py,one:$o,pad:NA,panLinear:xA,panLog:wA,panPow:EA,panSymlog:_A,parse:gY,parseExpression:Bb,parseSelector:fs,path:X0,pathCurves:_y,pathEqual:Q$,pathParse:so,pathRectangle:ZC,pathRender:Ju,pathSymbols:QC,pathTrail:e$,peek:fe,point:gh,projection:ob,quantileLogNormal:$1,quantileNormal:Yd,quantileUniform:R1,quantiles:v1,quantizeInterpolator:IC,quarter:SA,quartiles:x1,get random(){return Ln},randomInteger:SI,randomKDE:S1,randomLCG:_I,randomLogNormal:Fk,randomMixture:Ok,randomNormal:_1,randomUniform:Tk,read:pk,regressionConstant:D1,regressionExp:Dk,regressionLinear:N1,regressionLoess:Lk,regressionLog:Rk,regressionPoly:Mk,regressionPow:Nk,regressionQuad:M1,renderModule:ph,repeat:bu,resetDefaultLocale:xL,resetSVGClipId:n$,resetSVGDefIds:i8,responseType:gk,runtimeContext:DO,sampleCurve:Jd,sampleLogNormal:A1,sampleNormal:Vd,sampleUniform:F1,scale:me,sceneEqual:Yy,sceneFromJSON:b$,scenePickVisit:Mf,sceneToJSON:y$,sceneVisit:ii,sceneZOrder:$y,scheme:vy,serializeXML:L$,setHybridRendererOptions:Z4,setRandom:wI,span:Sl,splitAccessPath:Ii,stringValue:q,textMetrics:bn,timeBin:nk,timeFloor:HA,timeFormatLocale:Xu,timeInterval:Ro,timeOffset:YA,timeSequence:QA,timeUnitSpecifier:PA,timeUnits:c1,toBoolean:a1,toDate:o1,toNumber:wt,toSet:ti,toString:u1,transform:_k,transforms:to,truncate:MA,truthy:Nn,tupleid:ne,typeParsers:dm,utcFloor:VA,utcInterval:Do,utcOffset:KA,utcSequence:ZA,utcdayofyear:UA,utcquarter:AA,utcweek:qA,version:pY,visitArray:kr,week:BA,writeConfig:Oo,zero:Tr,zoomLinear:e1,zoomLog:t1,zoomPow:kf,zoomSymlog:n1},Symbol.toStringTag,{value:"Module"}));function yY(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var bY={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},vY={"*":(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},xY={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const wY=Array.prototype.slice,Es=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,wY.call(t,1))},EY=(e,t,n,i,r,s,a)=>new Date(e,t||0,n??1,i||0,r||0,s||0,a||0);var _Y={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:EY,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 Es("join",arguments)},indexof:function(){return Es("indexOf",arguments)},lastindexof:function(){return Es("lastIndexOf",arguments)},slice:function(){return Es("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Es("substring",arguments,String)},split:function(){return Es("split",arguments,String)},replace:function(){return Es("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const SY=["view","item","group","xy","x","y"],f0=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&f0.add(setImmediate);const AY={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:bY[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),f0.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]||_Y[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>vY[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>xY[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,f0.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function fu(e,t,n,i,r,s){const a=o=>AY[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,SY.forEach(o=>a.fn[o]=function(){return r.vega[o](...arguments)}),a(e)}var kY={operator(e,t){const n=t.ast,i=e.functions;return r=>fu(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>fu(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>fu(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 fu(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=fu(i[f].ast,r,o,u,void 0,a),a[f]!==c&&(a[f]=c,l=1);return n!=="rule"&&yY(a,i,s),l}}};const CY="vega-lite",$Y='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',FY="5.21.0",OY=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],TY="https://vega.github.io/vega-lite/",RY="Vega-Lite is a concise high-level language for interactive visualization.",DY=["vega","chart","visualization"],NY="build/vega-lite.js",MY="build/vega-lite.min.js",LY="build/vega-lite.min.js",IY="build/src/index",PY="build/src/index.d.ts",zY={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"}
16,BY=["bin","build","src","vega-lite*","tsconfig.json"],jY={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},UY={type:"git",url:"https://github.com/vega/vega-lite.git"},qY="BSD-3-Clause",WY={url:"https://github.com/vega/vega-lite/issues"},GY={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},HY={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},VY={vega:"^5.24.0"},XY={node:">=18"},YY="[email protected]",KY={name:CY,author:$Y,version:FY,collaborators:OY,homepage:TY,description:RY,keywords:DY,main:NY,unpkg:MY,jsdelivr:LY,module:IY,types:PY,bin:zY,files:BY,scripts:jY,repository:UY,license:qY,bugs:WY,devDependencies:GY,dependencies:HY,peerDepen
vendor: 6,854 bytes, line 16
16dencies:VY,engines:XY,packageManager:YY};function gv(e){return z(e,"or")}function pv(e){return z(e,"and")}function mv(e){return z(e,"not")}function vf(e,t){if(mv(e))vf(e.not,t);else if(pv(e))for(const n of e.and)vf(n,t);else if(gv(e))for(const n of e.or)vf(n,t);else t(e)}function Xa(e,t){return mv(e)?{not:Xa(e.not,t)}:pv(e)?{and:e.and.map(n=>Xa(n,t))}:gv(e)?{or:e.or.map(n=>Xa(n,t))}:t(e)}const ie=structuredClone;function FT(e){throw new Error(e)}function fo(e,t){const n={};for(const i of t)K(e,i)&&(n[i]=e[i]);return n}function Jt(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>_e(e)).join(",")})`};function ce(e){if(pe(e))return e;const t=Y(e)?e:_e(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 d0(e){return e===!1||e===null}function le(e,t){return e.includes(t)}function ho(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function yv(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function OT(e,...t){for(const n of t)JY(e,n??{});return e}function JY(e,t){for(const n of P(t))Oo(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 QY(e,t){const n=P(e),i=P(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function TT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function bv(e,t){for(const n of e)if(t.has(n))return!0;return!1}function h0(e){const t=new Set;for(const n of e){const r=Ii(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 vv(e,t){return e===void 0||t===void 0?!0:bv(h0(e),h0(t))}function Ee(e){return P(e).length===0}const P=Object.keys,ft=Object.values,ns=Object.entries;function ul(e){return e===!0||e===!1}function Te(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function qu(e,t){return mv(e)?`!(${qu(e.not,t)})`:pv(e)?`(${e.and.map(n=>qu(n,t)).join(") && (")})`:gv(e)?`(${e.or.map(n=>qu(n,t)).join(") || (")})`:t(e)}function dd(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&dd(e[n],t)&&delete e[n],Ee(e)}function Kl(e){return e.charAt(0).toUpperCase()+e.substr(1)}function xv(e,t="datum"){const n=Ii(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(q).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function RT(e,t="datum"){return`${t}[${q(Ii(e).join("."))}]`}function ZY(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function In(e){return`${Ii(e).map(ZY).join("\\.")}`}function ea(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Bo(e){return`${Ii(e).join(".")}`}function go(e){return e?Ii(e).length:0}function ze(...e){return e.find(t=>t!==void 0)}let DT=42;function NT(e){const t=++DT;return e?String(e)+t:t}function eK(){DT=42}function MT(e){return LT(e)?e:`__${e}`}function LT(e){return e.startsWith("__")}function ll(e){if(e!==void 0)return(e%360+360)%360}function Nh(e){return pe(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const XE=Object.getPrototypeOf(structuredClone({}));function mn(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(!mn(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(!mn(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!==XE.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==XE.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(!mn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _e(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 z(e,t){return V(e)&&K(e,t)&&e[t]!==void 0}const rr="row",sr="column",Mh="facet",Re="x",it="y",di="x2",ji="y2",ds="xOffset",jo="yOffset",hi="radius",pr="radius2",Bn="theta",mr="theta2",gi="latitude",pi="longitude",mi="latitude2",Pn="longitude2",rn="color",Ui="fill",qi="stroke",sn="shape",yr="size",ga="angle",br="opacity",hs="fillOpacity",gs="strokeOpacity",ps="strokeWidth",ms="strokeDash",Jl="text",po="order",Ql="detail",Lh="key",ta="tooltip",Ih="href",Ph="url",zh="description",tK={x:1,y:1,x2:1,y2:1},IT={theta:1,theta2:1,radius:1,radius2:1};function PT(e){return K(IT,e)}const wv={longitude:1,longitude2:1,latitude:1,latitude2:1};function zT(e){switch(e){case gi:return"y";case mi:return"y2";case pi:return"x";case Pn:return"x2"}}function BT(e){return K(wv,e)}const nK=P(wv),Ev={...tK,...IT,...wv,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Ya(e){return e===rn||e===Ui||e===qi}const jT={row:1,column:1,facet:1},On=P(jT),_v={...Ev,...jT},iK=P(_v),{order:moe,detail:yoe,tooltip:boe,...rK}=_v,{row:voe,column:xoe,facet:woe,...sK}=rK;function aK(e){return K(sK,e)}function UT(e){return K(_v,e)}const oK=[di,ji,mi,Pn,mr,pr];function qT(e){return pa(e)!==e}function pa(e){switch(e){case di:return Re;case ji:return it;case mi:return gi;case Pn:return pi;case mr:return Bn;case pr:return hi}return e}function is(e){if(PT(e))switch(e){case Bn:return"startAngle";case mr:return"endAngle";case hi:return"outerRadius";case pr:return"innerRadius"}return e}function Wi(e){switch(e){case Re:return di;case it:return ji;case gi:return mi;case pi:return Pn;case Bn:return mr;case hi:return pr}}function an(e){switch(e){case Re:case di:return"width";
16case it:case ji:return"height"}}function WT(e){switch(e){case Re:return"xOffset";case it:return"yOffset";case di:return"x2Offset";case ji:return"y2Offset";case Bn:return"thetaOffset";case hi:return"radiusOffset";case mr:return"theta2Offset";case pr:return"radius2Offset"}}function Sv(e){switch(e){case Re:return"xOffset";case it:return"yOffset"}}function uK(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const lK=P(Ev),{x:Eoe,y:_oe,x2:Soe,y2:Aoe,xOffset:koe,yOffset:Coe,latitude:$oe,longitude:Foe,latitude2:Ooe,longitude2:Toe,theta:Roe,theta2:Doe,radius:Noe,radius2:Moe,...Av}=Ev,cK=P(Av),kv={x:1,y:1},vr=P(kv);function Be(e){return K(kv,e)}const Cv={theta:1,radius:1},fK=P(Cv);function Bh(e){return e==="width"?Re:it}const GT={xOffset:1,yOffset:1};function Zl(e){return K(GT,e)}const{text:Loe,tooltip:Ioe,href:Poe,url:zoe,description:Boe,detail:joe,key:Uoe,order:qoe,...HT}=Av,dK=P(HT);function hK(e){return K(Av,e)}function gK(e){switch(e){case rn:case Ui:case qi:case yr:case sn:case br:case ps:case ms:return!0;case hs:case gs:case ga:return!1}}const VT={...kv,...Cv,...GT,...HT},$v=P(VT);function Gi(e){return K(VT,e)}function pK(e,t){return yK(e)[t]}const XT={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:Woe,...mK}=XT;function yK(e){switch(e){case rn:case Ui:case qi:case zh:case Ql:case Lh:case ta:case Ih:case po:case br:case hs:case gs:case ps:case Mh:case rr:case sr:return XT;case Re:case it:case ds:case jo:case gi:case pi:return mK;case di:case ji:case mi:case Pn:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case yr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case ms:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case sn:return{point:"always",geoshape:"always"};case Jl:return{text:"always"};case ga:return{point:"always",square:"always",text:"always"};case Ph:return{image:"always"};case Bn:return{text:"always",arc:"always"};case hi:return{text:"always",arc:"always"};case mr:case pr:return{arc:"always"}}}function vp(e){switch(e){case Re:case it:case Bn:case hi:case ds:case jo:case yr:case ga:case ps:case br:case hs:case gs:case di:case ji:case mr:case pr:return;case Mh:case rr:case sr:case sn:case ms:case Jl:case ta:case Ih:case Ph:case zh:return"discrete";case rn:case Ui:case qi:return"flexible";case gi:case pi:case mi:case Pn:case Ql:case Lh:case po:return}}const bK={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},vK={count:1,min:1,max:1};function fr(e){return z(e,"argmin")}function ys(e){return z(e,"argmax")}function Fv(e){return Y(e)&&K(bK,e)}const xK=new Set(["count","valid","missing","distinct"]);function jh(e){return Y(e)&&xK.has(e)}function wK(e){return Y(e)&&le(["min","max"],e)}const EK=new Set(["count","sum","distinct","valid","missing"]),_K=new Set(["mean","average","median","q1","q3","min","max"]);function YT(e){return us(e)&&(e=Zh(e,void 0)),"bin"+P(e).map(t=>Uh(e[t])?Te(`_${t}_${ns(e[t])}`):Te(`_${t}_${e[t]}`)).join("")}function Ce(e){return e===!0||ma(e)&&!e.binned}function rt(e){return e==="binned"||ma(e)&&e.binned===!0}function ma(e){return V(e)}function Uh(e){return z(e,"param")}function YE(e){switch(e){case rr:case sr:case yr:case rn:case Ui:case qi:case ps:case br:case hs:case gs:case sn:return 6;case ms:return 4;default:return 10}}function ec(e){return z(e,"expr")}function st(e,{level:t}={level:0}){const n=P(e||{}),i={};for(const r of n)i[r]=t===0?gn(e[r]):st(e[r],{level:t-1});return i}function KT(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:a,color:o,subtitleColor:u,subtitleFont:l,subt
vendor: 22,323 bytes, line 16
16itleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:g,...p}=e,m={...p,...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}:{},...h?{subtitleLineHeight:h}:{},...g?{subtitlePadding:g}:{}},v=fo(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function Or(e){return Y(e)||N(e)&&Y(e[0])}function Z(e){return z(e,"signal")}function ya(e){return z(e,"step")}function SK(e){return N(e)?!1:z(e,"fields")&&!z(e,"data")}function AK(e){return N(e)?!1:z(e,"fields")&&z(e,"data")}function nr(e){return N(e)?!1:z(e,"field")&&z(e,"data")}const kK={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},CK=P(kK),$K={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},g0=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function JT(e){const t=N(e.condition)?e.condition.map(KE):KE(e.condition);return{...gn(e),condition:t}}function gn(e){if(ec(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function KE(e){if(ec(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Fe(e){if(ec(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Z(e)?e:e!==void 0?{value:e}:void 0}function FK(e){return Z(e)?e.signal:q(e)}function JE(e){return Z(e)?e.signal:q(e.value)}function Jn(e){return Z(e)?e.signal:e==null?null:q(e)}function OK(e,t,n){for(const i of n){const r=Ni(i,t.markDef,t.config);r!==void 0&&(e[i]=Fe(r))}return e}function QT(e){return[].concat(e.type,e.style??[])}function we(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&z(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:Ni(e,t,n,i)}function Ni(e,t,n,{vgChannel:i}={}){const r=p0(e,t,n.style);return ze(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function p0(e,t,n){return ZT(e,QT(t),n)}function ZT(e,t,n){t=X(t);let i;for(const r of t){const s=n[r];z(s,e)&&(i=s[e])}return i}function eR(e,t){return X(e).reduce((n,i)=>(n.field.push(H(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function tR(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(mn(r,i))return;n.push(i)}),n}function nR(e,t){return mn(e,t)||!t?e:e?[...X(e),...X(t)].join(", "):t}function iR(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Or(n)||Z(n))&&(Or(i)||Z(i)))return{explicit:e.explicit,value:nR(n,i)};if(Or(n)||Z(n))return{explicit:e.explicit,value:n};if(Or(i)||Z(i))return{explicit:e.explicit,value:i};if(!Or(n)&&!Z(n)&&!Or(i)&&!Z(i))return{explicit:e.explicit,value:tR(n,i)};throw new Error("It should never reach here")}function Ov(e){return`Invalid specification ${_e(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const TK='Autosize "fit" only works for single views and layered views.';function QE(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function ZE(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 e_(e){return e?`Dropping "fit-${e}" because spec has discrete ${an(e)}.`:'Dropping "fit" because spec has discrete size.'}function Tv(e){return`Unknown field for ${e}. Cannot calculate view size.`}function t_(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function RK(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function DK(e){return`The "nearest" transform is not supported for ${e} marks.`}function rR(e){return`Selection not supported for ${e} yet.`}function NK(e){return`Cannot find a selection named "${e}".`}const MK="Scale bindings are currently only supported for scales with unbinned, continuous domains.",LK="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",IK="Legend bindings are only supported for selections over an individual field or encoding channel.";function PK(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function zK(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const BK="The same selection must be used to override scale domains in a layered view.",jK='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function UK(e){return`Unknown repeated value "${e}".`}function n_(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const qK="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function WK(e){return`Unrecognized parse "${e}".`}function i_(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const GK="Attempt to add the same child twice.";function HK(e){return`Ignoring an invalid transform: ${_e(e)}.`}const VK='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 r_(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function XK(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${_e(t)} is overridden by a child projection ${_e(n)}.`}const YK="Arc marks uses theta channel rather than angle, replacing angle with theta.";function KK(e){return`${e}Offset dropped because ${e} is continuous`}function JK(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${_e(n)}}.`}function sR(e){return`Invalid field type "${e}".`}function QK(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function ZK(e){return`Invalid aggregation operator "${e}".`}function aR(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 eJ(e){return`Position range does not support relative band size for ${e}.`}function m0(e,t){return`Dropping ${_e(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const tJ="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function qh(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function nJ(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function iJ(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function rJ(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function sJ(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function xp(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function aJ(e){return`The ${e} for range marks cannot be an expression`}function oJ(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 uJ(e,t){return`Specified orient "${e}" overridden with "${t}".`}function lJ(e){return`Cannot use the scale property "${e}" with non-color channel.`}function cJ(e){return`Cannot use the relative band size with ${e} scale.`}function fJ(e){return`Using unaggregated domain with raw field has no effect (${_e(e)}).`}function dJ(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function hJ(e){return`Unaggregated domain is currently unsupported for log scale (${_e(e)}).`}function gJ(e){return`Cannot apply size to non-oriented mark "${e}".`}function pJ(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function mJ(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function oR(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function uR(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function yJ(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${_e(n)} and ${_e(i)}). Using ${_e(n)}.`}function bJ(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${_e(n)} and ${_e(i)}). Using the union of the two domains.`}function vJ(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 xJ(e){return`Dropping sort property ${_e(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const s_="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",wJ="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.",EJ="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.",_J="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 SJ(e){return`Cannot stack "${e}" if there is already "${e}2".`}function AJ(e){return`Stack is applied to a non-linear scale (${e}).`}function kJ(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function hd(e,t){return`Invalid ${e}: ${_e(t)}.`}function CJ(e){return`Dropping day from datetime ${_e(e)} as day cannot be combined with other units.`}function $J(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function FJ(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function OJ(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function a_(e){return`1D error band does not support ${e}.`}function lR(e){return`Channel ${e} is required for "binned" bin.`}function TJ(e){return`Channel ${e} should not be used with "binned" bin.`}function RJ(e){return`Domain for ${e} is required for threshold scale.`}const cR=Z0(Q0);let mo=cR;function DJ(e){return mo=e,mo}function NJ(){return mo=cR,mo}function B(...e){mo.warn(...e)}function MJ(...e){mo.debug(...e)}function ba(e){if(e&&V(e)){for(const t of Dv)if(z(e,t))return!0}return!1}const fR=["january","february","march","april","may","june","july","august","september","october","november","december"],LJ=fR.map(e=>e.substr(0,3)),dR=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],IJ=dR.map(e=>e.substr(0,3));function PJ(e){if(Nh(e)&&(e=+e),pe(e))return e>4&&B(hd("quarter",e)),e-1;throw new Error(hd("quarter",e))}function zJ(e){if(Nh(e)&&(e=+e),pe(e))return e-1;{const t=e.toLowerCase(),n=fR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=LJ.indexOf(i);if(r!==-1)return r;throw new Error(hd("month",e))}}function BJ(e){if(Nh(e)&&(e=+e),pe(e))return e%7;{const t=e.toLowerCase(),n=dR.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=IJ.indexOf(i);if(r!==-1)return r;throw new Error(hd("day",e))}}function Rv(e,t){const n=[];if(t&&e.day!==void 0&&P(e).length>1&&(B(CJ(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?zJ(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?PJ(e.quarter):e.quarter;n.push(pe(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?BJ(e.day):e.day;n.push(pe(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 na(e){const n=Rv(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function jJ(e){const n=Rv(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function UJ(e){const t=Rv(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const hR={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Dv=P(hR);function qJ(e){return K(hR,e)}function va(e){return V(e)?e.binned:gR(e)}function gR(e){return e&&e.startsWith("binned")}function Nv(e){return e.startsWith("utc")}function WJ(e){return e.substring(3)}const GJ={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Wh(e){return Dv.filter(t=>mR(e,t))}function pR(e){const t=Wh(e);return t[t.length-1]}function mR(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 HJ(e,t,{end:n}={end:!1}){const i=xv(t),r=Nv(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let a;const o={};for(const u of Dv)mR(e,u)&&(o[u]=s(u),a=u);return n&&(o[a]+="+1"),jJ(o)}function yR(e){if(!e)return;const t=Wh(e);return`timeUnitSpecifier(${_e(t)}, ${_e(GJ)})`}function VJ(e,t,n){if(!e)return;const i=yR(e);return`${n||Nv(e)?"utc":"time"}Format(${t}, ${i})`}function tt(e){if(!e)return;let t;return Y(e)?gR(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:V(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Nv(t.unit)&&(t.utc=!0,t.unit=WJ(t.unit)),t}function XJ(e){const{utc:t,...n}=tt(e);return n.unit?(t?"utc":"")+P(n).map(i=>Te(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+P(n).map(i=>Te(`_${i}_${n[i]}`)).join("")}function bR(e,t=n=>n){const n=tt(e),i=pR(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}=vR(i,n.step),o={...r,[a]:+r[a]+s};return`${t(na(o))} - ${t(na(r))}`}}const YJ={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function KJ(e){return K(YJ,e)}function vR(e,t=1){if(KJ(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 JJ(e){return z(e,"param")}function Mv(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Lv(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Iv(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Pv(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function zv(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Bv(e){if(e!=null&&e.field){if(N(e.range)&&e.range.length===2)return!0;if(Z(e.range))return!0}return!1}function jv(e){return!!(e!=null&&e.field)&&(N(e.oneOf)||N(e.in))}function QJ(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function xR(e){return jv(e)||Mv(e)||Bv(e)||Lv(e)||Pv(e)||Iv(e)||zv(e)}function vi(e,t){return eg(e,{timeUnit:t,wrapTime:!0})}function ZJ(e,t){return e.map(n=>vi(n,t))}function wR(e,t=!0){const{field:n}=e,i=tt(e.timeUnit),{unit:r,binned:s}=i||{},a=H(e,{expr:"datum"}),o=r?`time(${s?a:HJ(r,n)})`:a;if(Mv(e))return`${o}===${vi(e.equal,r)}`;if(Lv(e)){const u=e.lt;return`${o}<${vi(u,r)}`}else if(Pv(e)){const u=e.gt;return`${o}>${vi(u,r)}`}else if(Iv(e)){const u=e.lte;return`${o}<=${vi(u,r)}`}else if(zv(e)){const u=e.gte;return`${o}>=${vi(u,r)}`}else{if(jv(e))return`indexof([${ZJ(e.oneOf,r).join(",")}], ${o}) !== -1`;if(QJ(e))return Gh(o,e.valid);if(Bv(e)){const{range:u}=st(e),l=Z(u)?{signal:`${u.signal}[0]`}:u[0],c=Z(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+o+", ["+vi(l,r)+", "+vi(c,r)+"])";const f=[];return l!==null&&f.push(`${o} >= ${vi(l,r)}`),c!==null&&f.push(`${o} <= ${vi(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${_e(e)}`)}function Gh(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function eQ(e){return xR(e)&&e.timeUnit?{...e,timeUnit:tt(e.timeUnit)}:e}const tc={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function tQ(e){return e==="quantitative"||e==="temporal"}function ER(e){return e==="ordinal"||e==="nominal"}const ia=tc.quantitative,Uv=tc.ordinal,yo=tc.temporal,qv=tc.nominal,Uo=tc.geojson;function nQ(e){if(e)switch(e=e.toLowerCase(),e){case"q":case ia:return"quantitative";case"t":case yo:return"temporal";case"o":case Uv:return"ordinal";case"n":case qv:return"nominal";case Uo:return"geojson"}}const ot={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},y0={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 iQ(e,t){const n=y0[e],i=y0[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const rQ={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 o_(e){return rQ[e]}const _R=new Set(["linear","log","pow","sqrt","symlog"]),SR=new Set([..._R,"time","utc"]);function AR(e){return _R.has(e)}const kR=new Set(["quantile","quantize","threshold"]),sQ=new Set([...SR,...kR,"sequential","identity"]),aQ=new Set(["ordinal","bin-ordinal","point","band"]);function nt(e){return aQ.has(e)}function ri(e){return sQ.has(e)}function ki(e){return SR.has(e)}function bo(e){return kR.has(e)}const oQ={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function uQ(e){return!Y(e)&&z(e,"name")}function CR(e){return z(e,"param")}function lQ(e){return z(e,"unionWith")}function cQ(e){return V(e)&&"field"in e}const fQ={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:Goe,domain:Hoe,range:Voe,rangeMax:Xoe,rangeMin:Yoe,scheme:Koe,...dQ}=fQ,hQ=P(dQ);function b0(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 ki(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return ki(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 ki(e);case"nice":return ki(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return ri(e)&&!le(["log","time","utc","threshold","quantile"],e)}}function $R(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Ya(e)?void 0:lJ(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 gQ(e,t){return le([Uv,qv],t)?e===void 0||nt(e):t===yo?le([ot.TIME,ot.UTC,void 0],e):t===ia?AR(e)||bo(e)||e===void 0:!0}function pQ(e,t,n=!1){if(!Gi(e))return!1;switch(e){case Re:case it:case ds:case jo:case Bn:case hi:return ki(t)||t==="band"?!0:t==="point"?!n:!1;case yr:case ps:case br:case hs:case gs:case ga:return ki(t)||bo(t)||le(["band","point","ordinal"],t);case rn:case Ui:case qi:return t!=="band";case ms:case sn:return t==="ordinal"||bo(t)}}function mQ(e){return V(e)&&"value"in e}const Ut={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"},FR=Ut.arc,Hh=Ut.area,Vh=Ut.bar,yQ=Ut.image,Xh=Ut.line,Yh=Ut.point,bQ=Ut.rect,gd=Ut.rule,OR=Ut.text,Wv=Ut.tick,vQ=Ut.trail,Gv=Ut.circle,Hv=Ut.square,TR=Ut.geoshape;function bs(e){return["line","area","trail"].includes(e)}function cl(e){return["rect","bar","image","arc","tick"].includes(e)}const xQ=new Set(P(Ut));function Mi(e){return z(e,"type")}const wQ=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],EQ=["fill","fillOpacity"],_Q=[...wQ,...EQ],SQ={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},u_=P(SQ),wp=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],AQ={area:["line","point"],bar:wp,rect:wp,line:["point"],tick:["bandSize","thickness",...wp]}
16,kQ={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},CQ={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},RR=P(CQ);function ra(e){return z(e,"band")}const $Q={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},FQ=5,Vv={binSpacing:0,continuousBandSize:FQ,minBandSize:.25,timeUnitBandPosition:.5},OQ={...Vv,binSpacing:1},TQ={...Vv,thickness:1};function RQ(e){return Mi(e)?e.type:e}function DR(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Xv({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var o,u;if(!i||!ri(i)||r)return"always-valid";const s=DR(we("invalid",e,t),{isPath:bs(e.type)});return((u=(o=t.scale)==null?void 0:o.invalid)==null?void 0:u[n])!==void 0?"show":s}function DQ(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function NR({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 MR({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const a=n==null?void 0:n.get("type"),o=ai(t),u=jh(o==null?void 0:o.aggregate),l=Xv({scaleChannel:e,markDef:r,config:s,scaleType:a,isCountAggregate:u});if(o&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:Gh(H(o,{expr:"datum"}),!1),...NQ(f,n,i)}}}function NQ(e,t,n){if(mQ(e)){const{value:i}=e;return Z(i)?{signal:i.signal}:{value:i}}return NR({scale:t,scaleName:n,mode:"zeroOrMin"})}function Yv(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:a}=e,o=pa(t),u=Kv(e),l=MR({scaleChannel:o,channelDef:n,scale:r,scaleName:s,markDef:i,config:a});return l!==void 0?[l,u]:u}function MQ(e){const{datum:t}=e;return ba(t)?na(t):`${_e(t)}`}function Us(e,t,n,i){const r={};if(t&&(r.scale=t),Hi(e)){const{datum:s}=e;ba(s)?r.signal=na(s):Z(s)?r.signal=s.signal:ec(s)?r.signal=s.expr:r.value=s}else r.field=H(e,n);if(i){const{offset:s,band:a}=i;s&&(r.offset=s),a&&(r.band=a)}return r}function pd({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:a=.5}){const o=!Z(a)&&0<a&&a<1?"datum":void 0,u=H(t,{expr:o,suffix:r}),l=n!==void 0?H(n,{expr:o}):H(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=Z(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 LQ({scaleName:e,fieldDef:t}){const n=H(t,{expr:"datum"}),i=H(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function Kv({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==null?void 0:a.get("type");if(Bt(t)){c??(c=rs({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(Ce(d)||c&&h&&g===yo)return o!=null&&o.impute?Us(t,s,{binSuffix:"mid"},{offset:u}):c&&!nt(f)?pd({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):Us(t,s,ac(t,e)?{binSuffix:"range"}:{},{offset:u});if(rt(d)){if(U(n))return pd({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});B(lR(e===Re?di:ji))}}return Us(t,s,nt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(si(t)){const f=t.value,d=u?{offset:u}:{};return{...Wu(e,f),...d}}}return oe(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Wu(e,t){return le(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:le(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Fe(t)}function sa(e){return e&&e!=="number"&&e!=="time"}function LR(e,t,n){return`${e}(${t}${n?`, ${_e(n)}`:""})`}const IQ=" â ";function Jv({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var u,l;if(sa(n))return Qn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const a=IR(e,i,r),o=vo(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(o==="quantitative"){if(r&&s.normalizedNumberFormatType)return Qn({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return Qn({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(o==="temporal"&&s.timeFormatType&&U(e)&&e.timeUnit===void 0)return Qn({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}if(wo(e)){const c=zQ({field:a,timeUnit:U(e)?(u=tt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:xa(e)&&((l=e.scale)==null?void 0:l.type)===ot.UTC});return c?{signal:c}:void 0}if(t=v0({type:o,specifiedFormat:t,config:s,normalizeStack:r}),U(e)&&Ce(e.bin)){const c=H(e,{expr:i,binSuffix:"end"});return{signal:nc(a,c,t,n,s)}}else return t||vo(e)==="quantitative"?{signal:`${BR(a,t)}`}:{signal:`isValid(${a}) ? ${a} : ""+${a}`}}
16function IR(e,t,n){return U(e)?n?`${H(e,{expr:t,suffix:"end"})}-${H(e,{expr:t,suffix:"start"})}`:H(e,{expr:t}):MQ(e)}function Qn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:a}){if(a??(a=IR(e,i,r)),a!=="datum.value"&&U(e)&&Ce(e.bin)){const o=H(e,{expr:i,binSuffix:"end"});return{signal:nc(a,o,t,n,s)}}return{signal:LR(n,a,t)}}function PR(e,t,n,i,r,s){var a;if(!(Y(i)&&sa(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&vo(e)==="quantitative"&&(r.normalizedNumberFormatType&&xo(e)&&e.stack==="normalize"||r.numberFormatType))){if(xo(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return v0({type:"quantitative",config:r,normalizeStack:!0});if(wo(e)){const o=U(e)?(a=tt(e.timeUnit))==null?void 0:a.unit:void 0;return o===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:PQ({specifiedFormat:n,timeUnit:o,config:r,omitTimeFormatConfig:s})}return v0({type:t,specifiedFormat:n,config:r})}}function zR(e,t,n){var i;if(e&&(Z(e)||e==="number"||e==="time"))return e;if(wo(t)&&n!=="time"&&n!=="utc")return U(t)&&((i=tt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function v0({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(Y(t))return t;if(e===ia)return i?n.normalizedNumberFormat:n.numberFormat}function PQ({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:yR(t)}:i?void 0:n.timeFormat)}function BR(e,t){return`format(${e}, "${t||""}")`}function l_(e,t,n,i){return sa(n)?LR(n,e,t):BR(e,(Y(t)?t:void 0)??i.numberFormat)}function nc(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return nc(e,t,r.numberFormat,r.numberFormatType,r);const s=l_(e,n,i,r),a=l_(t,n,i,r);return`${Gh(e,!1)} ? "null" : ${s} + "${IQ}" + ${a}`}function zQ({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=Y(n)?n:r,`${s?"utc":"time"}Format(${e}, '${n}')`):VJ(t,e,s)}const Kh="min",BQ={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 c_(e){return K(BQ,e)}function jQ(e){return z(e,"encoding")}function ar(e){return e&&(e.op==="count"||z(e,"field"))}function jR(e){return e&&N(e)}function ic(e){return z(e,"row")||z(e,"column")}function Qv(e){return z(e,"header")}function Jh(e){return z(e,"facet")}function UQ(e){return z(e,"param")}function qQ(e){return!Y(e)&&z(e,"repeat")}function f_(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Zv(e){return z(e,"sort")}function rs({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(re(e)&&e.bandPosition!==void 0)return e.bandPosition;if(U(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return Ni("timeUnitBandPosition",n,i);if(Ce(s))return .5}}function UR({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:a}){var l,c,f;const o=an(e),u=we(a?"size":o,i,r,{vgChannel:o});if(u!==void 0)return u;if(U(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:Ni("timeUnitBandSize",i,r)};if(Ce(h)&&!nt(s))return{band:1}}if(cl(i.type))return s?nt(s)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function qR(e,t,n,i){return Ce(e.bin)||e.timeUnit&&Bt(e)&&e.type==="temporal"?rs({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function WR(e){return z(e,"sort")&&!z(e,"field")}function rc(e){return z(e,"condition")}function Qh(e){const t=e==null?void 0:e.condition;return!!t&&!N(t)&&U(t)}function sc(e){const t=e==null?void 0:e.condition;return!!t&&!N(t)&&re(t)}function WQ(e){const t=e==null?void 0:e.condition;return!!t&&(N(t)||si(t))}function U(e){return z(e,"field")||(e==null?void 0:e.aggregate)==="count"}function vo(e){return e==null?void 0:e.type}function Hi(e){return z(e,"datum")}function Ur(e){return Bt(e)&&!yd(e)||md(e)}function d_(e){return Bt(e)&&e.type==="quantitative"&&!e.bin||md(e)}function md(e){return Hi(e)&&pe(e.datum)}function re(e){return U(e)||Hi(e)}function Bt(e){return e&&(z(e,"field")||e.aggregate==="count")&&z(e,"type")}function si(e){return z(e,"value")}function xa(e){return z(e,"scale")||z(e,"sort")}function xo(e){return z(e,"axis")||z(e,"stack")||z(e,"impute")}function GR(e){return z(e,"legend")}function HR(e){return z(e,"format")||z(e,"formatType")}function GQ(e){return Jt(e,["legend","axis","header","scale"])}function HQ(e){return z(e,"op")}function H(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(XQ(e))n=MT("count");else{let a;if(!t.nofn)if(HQ(e))a=e.op;else{const{bin:o,aggregate:u,timeUnit:l}=e;Ce(o)?(a=YT(o),r=(t.binSuffix??"")+(t.suffix??"")):u?ys(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):fr(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):a=String(u):l&&!va(l)&&(a=XJ(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?Bo(n):t.expr?RT(n,t.expr)+s:In(n)+s}function yd(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return U(e)&&!!e.bin;case"temporal":return!1}throw new Error(sR(e.type))}function VQ(e){var t;return xa(e)&&bo((t=e.scale)==null?void 0:t.type)}function XQ(e){return e.aggregate==="count"}function YQ(e,t){var a;const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(Ce(i))return`${n} (binned)`;if(r&&!va(r)){const o=(a=tt(r))==null?void 0:a.unit;if(o)return`${n} (${Wh(o).join("-")})`}else if(s)return ys(s)?`${n} for max ${s.argmax}`:fr(s)?`${n} for min ${s.argmin}`:`${Kl(s)} of ${n}`;return n}function KQ(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(ys(t))return`${r} for argmax(${t.argmax})`;if(fr(t))return`${r} for argmin(${t.argmin})`;const s=i&&!va(i)?tt(i):void 0,a=t||(s==null?void 0:s.unit)||(s==null?void 0:s.maxbins)&&"timeunit"||Ce(n)&&"bin";return a?`${a.toUpperCase()}(${r})`:r}const VR=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return KQ(e);default:return YQ(e,t)}};let XR=VR;function YR(e){XR=e}function JQ(){YR(VR)}function Ka(e,t,{allowDisabling:n,includeDefault:i=!0}){var o;const r=(o=ex(e))==null?void 0:o.title;if(!U(e))return r??e.title;const s=e,a=i?tx(s,t):void 0;return n?ze(r,s.title,a):r??s.title??a}function ex(e){if(xo(e)&&e.axis)return e.axis;
vendor: 9,625 bytes, line 16
16if(GR(e)&&e.legend)return e.legend;if(Qv(e)&&e.header)return e.header}function tx(e,t){return XR(e,t)}function bd(e){if(HR(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=ex(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function QQ(e,t){var s;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(Zv(e)&&N(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!ys(n)&&!fr(n))return"quantitative";if(xa(e)&&((s=e.scale)!=null&&s.type))switch(y0[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ai(e){if(U(e))return e;if(Qh(e))return e.condition}function Xe(e){if(re(e))return e;if(sc(e))return e.condition}function KR(e,t,n,i={}){if(Y(e)||pe(e)||us(e)){const r=Y(e)?"string":pe(e)?"number":"boolean";return B(JK(t,r,e)),{value:e}}return re(e)?vd(e,t,n,i):sc(e)?{...e,condition:vd(e.condition,t,n,i)}:e}function vd(e,t,n,i){if(HR(e)){const{format:r,formatType:s,...a}=e;if(sa(s)&&!n.customFormatTypes)return B(r_(t)),vd(a,t,n,i)}else{const r=xo(e)?"axis":GR(e)?"legend":Qv(e)?"header":null;if(r&&e[r]){const{format:s,formatType:a,...o}=e[r];if(sa(a)&&!n.customFormatTypes)return B(r_(t)),vd({...e,[r]:o},t,n,i)}}return U(e)?nx(e,t,i):ZQ(e)}function ZQ(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=pe(n)?"quantitative":Y(n)?"nominal":ba(n)?"temporal":void 0,{...e,type:t}}function nx(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:a}=e,o={...e};if(!n&&i&&!Fv(i)&&!ys(i)&&!fr(i)&&(B(ZK(i)),delete o.aggregate),r&&(o.timeUnit=tt(r)),a&&(o.field=`${a}`),Ce(s)&&(o.bin=Zh(s,t)),rt(s)&&!Be(t)&&B(TJ(t)),Bt(o)){const{type:u}=o,l=nQ(u);u!==l&&(o.type=l),u!=="quantitative"&&jh(i)&&(B(QK(u,i)),o.type="quantitative")}else if(!qT(t)){const u=QQ(o,t);o.type=u}if(Bt(o)){const{compatible:u,warning:l}=eZ(o,t)||{};u===!1&&B(l)}if(Zv(o)&&Y(o.sort)){const{sort:u}=o;if(c_(u))return{...o,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&c_(l))return{...o,sort:{encoding:l,order:"descending"}}}if(Qv(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 Zh(e,t){return us(e)?{maxbins:YE(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:YE(t)}:e}const Ra={compatible:!0};function eZ(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 rr:case sr:case Mh:return yd(e)?Ra:{compatible:!1,warning:iJ(t)};case Re:case it:case ds:case jo:case rn:case Ui:case qi:case Jl:case Ql:case Lh:case ta:case Ih:case Ph:case ga:case Bn:case hi:case zh:return Ra;case pi:case Pn:case gi:case mi:return n!==ia?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Ra;case br:case hs:case gs:case ps:case yr:case mr:case pr:case di:case ji:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Ra;case sn:case ms:return!yd(e)&&!VQ(e)?{compatible:!1,warning:rJ(t)}:Ra;case po:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Ra}}function wo(e){const{formatType:t}=bd(e);return t==="time"||!t&&tZ(e)}function tZ(e){return e&&(e.type==="temporal"||U(e)&&!!e.timeUnit)}function eg(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=tt(t))==null?void 0:u.unit);let a=s||n==="temporal",o;return ec(e)?o=e.expr:Z(e)?o=e.signal:ba(e)?(a=!0,o=na(e)):(Y(e)||pe(e))&&a&&(o=`datetime(${_e(e)})`,qJ(s)&&(pe(e)&&e<1e4||Y(e)&&isNaN(Date.parse(e)))&&(o=na({[s]:e}))),o?i&&a?`time(${o})`:o:r?void 0:_e(e)}function JR(e,t){const{type:n}=e;return t.map(i=>{const r=U(e)&&!va(e.timeUnit)?e.timeUnit:void 0,s=eg(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ac(e,t){return Ce(e.bin)?Gi(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const h_={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 oc(e){return e==null?void 0:e.condition}const QR=["domain","grid","labels","ticks","title"],nZ={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"},ZR={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},iZ={...ZR,style:1,labelExpr:1,encoding:1};function g_(e){return K(iZ,e)}const rZ={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},eD=P(rZ);function xr(e){return z(e,"mark")}class tg{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return xr(t)?RQ(t.mark)===this.name:!1}}function qs(e,t){const n=e&&e[t];return n?N(n)?ho(n,i=>!!i.field):U(n)||Qh(n):!1}function tD(e,t){const n=e&&e[t];return n?N(n)?ho(n,i=>!!i.field):U(n)||Hi(n)||sc(n):!1}function nD(e,t){if(Be(t)){const n=e[t];if((U(n)||Hi(n))&&(ER(n.type)||U(n)&&n.timeUnit)){const i=Sv(t);return tD(e,i)}}return!1}function iD(e){return ho(iK,t=>{if(qs(e,t)){const n=e[t];if(N(n))return ho(n,i=>!!i.aggregate);{const i=ai(n);return i&&!!i.aggregate}}return!1})}function rD(e,t){const n=[],i=[],r=[],s=[],a={};return ix(e,(o,u)=>{if(U(o)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=o;if(c||d||f){const g=ex(o),p=g==null?void 0:g.title;let m=H(o,{forAs:!0});const y={...p?[]:{title:Ka(o,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(ys(c)?(b="argmax",m=H({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):fr(c)?(b="argmin",m=H({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),Bt(o)&&Ce(f)){if(i.push({bin:f,field:l,as:m}),n.push(H(o,{binSuffix:"end"})),ac(o,u)&&n.push(H(o,{binSuffix:"range"})),Be(u)){const b={field:`${m}_end`};a[`${u}2`]=b}y.bin="binned",qT(u)||(y.type=ia)}else if(d&&!va(d)){r.push({timeUnit:d,field:l,as:m});const b=Bt(o)&&o.type!==yo&&"time";b&&(u===Jl||u===ta?y.formatType=b:hK(u)?y.legend={formatType:b,...y.legend}:Be(u)&&(y.axis={formatType:b,...y.axis}
vendor: 4,289 bytes, line 16
16))}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 sZ(e,t,n){const i=pK(t,n);if(i){if(i==="binned"){const r=e[t===di?Re:it];return!!(U(r)&&U(e[t])&&rt(r.bin))}}else return!1;return!0}function aZ(e,t,n,i){const r={};for(const s of P(e))UT(s)||B(nJ(s));for(let s of lK){if(!e[s])continue;const a=e[s];if(Zl(s)){const o=uK(s),u=r[o];if(U(u)&&tQ(u.type)&&U(a)&&!u.timeUnit){B(KK(o));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(B(YK),s=Bn),!sZ(e,s,t)){B(qh(s,t));continue}if(s===yr&&t==="line"){const o=ai(e[s]);if(o!=null&&o.aggregate){B(tJ);continue}}if(s===rn&&(n?"fill"in e:"stroke"in e)){B(aR("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Ql||s===po&&!N(a)&&!si(a)||s===ta&&N(a)){if(a){if(s===po){const o=e[s];if(WR(o)){r[s]=o;continue}}r[s]=X(a).reduce((o,u)=>(U(u)?o.push(nx(u,s)):B(m0(u,s)),o),[])}}else{if(s===ta&&a===null)r[s]=null;else if(!U(a)&&!Hi(a)&&!si(a)&&!rc(a)&&!Z(a)){B(m0(a,s));continue}r[s]=KR(a,s,i)}}return r}function ng(e,t){const n={};for(const i of P(e)){const r=KR(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function oZ(e){const t=[];for(const n of P(e))if(qs(e,n)){const i=e[n],r=X(i);for(const s of r)U(s)?t.push(s):Qh(s)&&t.push(s.condition)}return t}function ix(e,t,n){if(e)for(const i of P(e)){const r=e[i];if(N(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function uZ(e,t,n,i){return e?P(e).reduce((r,s)=>{const a=e[s];return N(a)?a.reduce((o,u)=>t.call(i,o,u,s),r):t.call(i,r,a,s)},n):n}function sD(e,t){return P(t).reduce((n,i)=>{switch(i){case Re:case it:case Ih:case zh:case Ph:case di:case ji:case ds:case jo:case Bn:case mr:case hi:case pr:case gi:case pi:case mi:case Pn:case Jl:case sn:case ga:case ta:return n;case po:if(e==="line"||e==="trail")return n;case Ql:case Lh:{const r=t[i];if(N(r)||U(r))for(const s of X(r))s.aggregate||n.push(H(s,{}));return n}case yr:if(e==="trail")return n;case rn:case Ui:case qi:case br:case hs:case gs:case ms:case ps:{const r=ai(t[i]);return r&&!r.aggregate&&n.push(H(r,{})),n}}},[])}function lZ(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(N(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 N(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function x0(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 ${rx(t)}`:"";return{field:a+t.field,type:t.type,title:Z(o)?{signal:`${o}"${escape(u)}"`}:o+u}}),s=oZ(n).map(GQ);return{tooltip:[...r,...Ai(s,ce)]}}function rx(e){const{title:t,field:n}=e;return ze(t,n)}function sx(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=rx(n);return aD(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}:{}},...Y(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function aD(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)}`,...us(e[t])?{}:e[t]}}]:[]}function oD(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:Mc(s,n),continuousAxisChannelDef2:Mc(a,n),continuousAxisChannelDefError:Mc(o,n),continuousAxisChannelDefError2:Mc(u,n),continuousAxis:r}}function Mc(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&B(OJ(n,t)),i}else return e}function uD(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(Mi(n)&&n.orient)return n.orient;if(Ur(r)){if(Ur(s)){const a=U(r)&&r.aggregate,o=U(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 wo(s)&&!wo(r)?"horizontal":"vertical"}return"horizontal"}else{if(Ur(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const xd="boxplot",cZ=["box","median","outliers","rule","ticks"],fZ=new tg(xd,cD);function lD(e){return pe(e)?"tukey":e}
vendor: 17,277 bytes, line 16
16function cD(e,{config:t}){e={...e,encoding:ng(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...a}=e,o=Mi(n)?n:{type:n};r&&B(rR("boxplot"));const u=o.extent??t.boxplot.extent,l=we("size",o,t),c=o.invalid,f=lD(u),{bins:d,timeUnits:h,transform:g,continuousAxisChannelDef:p,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:_}=dZ(e,u,t),w=Bo(p.field),{color:S,size:A,...k}=v,F=fN=>sx(o,m,p,fN,t.boxplot),L=F(k),M=F(v),C=(V(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$=F({...k,...A?{size:A}:{},color:{condition:{test:`datum['lower_box_${p.field}'] >= datum['upper_box_${p.field}']`,...S||{value:C}}}}),T=x0([{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"}],p,v),I={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},W=f==="min-max"?T:x0([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,v),j=[...L({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:W}),...L({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:W}),...L({partName:"ticks",mark:I,positionPrefix:"lower_whisker",extraEncoding:W}),...L({partName:"ticks",mark:I,positionPrefix:"upper_whisker",extraEncoding:W})],J=[...f!=="tukey"?j:[],...M({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...$({partName:"median",mark:{type:"tick",invalid:c,...V(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...a,transform:(a.transform??[]).concat(g),layer:J};const ue=`datum["lower_box_${p.field}"]`,se=`datum["upper_box_${p.field}"]`,be=`(${se} - ${ue})`,Ue=`${ue} - ${u} * ${be}`,he=`${se} + ${u} * ${be}`,qt=`datum["${p.field}"]`,Yo={joinaggregate:fD(p.field),groupby:y},_a={transform:[{filter:`(${Ue} <= ${qt}) && (${qt} <= ${he})`},{aggregate:[{op:"min",field:p.field,as:`lower_whisker_${w}`},{op:"max",field:p.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${p.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${p.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:j},{tooltip:fc,...dc}=k,{scale:Ko,axis:cN}=p,Hx=rx(p),Vx=Jt(cN,["title"]),Xx=aD(o,"outliers",t.boxplot,{transform:[{filter:`(${qt} < ${Ue}) || (${qt} > ${he})`}],mark:"point",encoding:{[m]:{field:p.field,type:p.type,...Hx!==void 0?{title:Hx}:{},...Ko!==void 0?{scale:Ko}:{},...Ee(Vx)?{}:{axis:Vx}},...dc,...S?{color:S}:{},..._?{tooltip:_}:{}}})[0];let hc;const Yx=[...d,...h,Yo];return Xx?hc={transform:Yx,layer:[Xx,_a]}:(hc=_a,hc.transform.unshift(...Yx)),{...a,layer:[hc,{transform:g,layer:J}]}}function fD(e){const t=Bo(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function dZ(e,t,n){const i=uD(e,xd),{continuousAxisChannelDef:r,continuousAxis:s}=oD(e,i,xd),a=r.field,o=Bo(a),u=lD(t),l=[...fD(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:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:`iqr_${o}`},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:`upper_whisker_${o}`},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:`lower_whisker_${o}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:g}=lZ(d),{bins:p,timeUnits:m,aggregate:y,groupby:b,encoding:v}=rD(g,n),x=i==="vertical"?"horizontal":"vertical",E=i,_=[...p,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:p,timeUnits:m,transform:_,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:h}}const ax="errorbar",hZ=["ticks","rule"],gZ=new tg(ax,dD);function dD(e,{config:t}){e={...e,encoding:ng(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:a,markDef:o,outerSpec:u,tooltipEncoding:l}=hD(e,ax,t);delete s.size;const c=sx(o,r,i,s,t.errorbar),f=o.thickness,d=o.size,h={type:"tick",orient:a,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function pZ(e,t){const{encoding:n}=e;if(mZ(n))return{orient:uD(e,t),inputType:"raw"};const i=yZ(n),r=bZ(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(Ur(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(Ur(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(Ur(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(Ur(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 mZ(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 yZ(e){return re(e.x2)||re(e.y2)}function bZ(e){return re(e.xError)||re(e.xError2)||re(e.yError)||re(e.yError2)}function hD(e,t,n){const{mark:i,encoding:r,params:s,projection:a,...o}=e,u=Mi(i)?i:{type:i};s&&B(rR(t));const{orient:l,inputType:c}=pZ(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=oD(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=vZ(u,f,d,h,g,c,t,n),{[p]:x,[p==="x"?"x2":"y2"]:E,[p==="x"?"xError":"yError"]:_,[p==="x"?"xError2":"yError2"]:w,...S}=r,{bins:A,timeUnits:k,aggregate:F,groupby:L,encoding:M}=rD(S,n),C=[...F,...m],$=c!=="raw"?[]:L,T=x0(b,f,M,v);return{transform:[...o.transform??[],...A,...k,...C.length===0?[]:[{aggregate:C,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:M,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:o,tooltipEncoding:T}}function vZ(e,t,n,i,r,s,a,o){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":o.errorbar.center,g=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(g==="iqr")&&B(FJ(h,g,a)),g==="stderr"||g==="stdev")u=[{op:g,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Kl(h)},{fieldPrefix:"upper_",titlePrefix:p_(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:p_(h,g,"-")}],d=!0;else{let p,m,y;g==="ci"?(p="mean",m="ci0",y="ci1"):(p="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:p,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Ka({field:c,aggregate:y,type:"quantitative"},o,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Ka({field:c,aggregate:m,type:"quantitative"},o,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Ka({field:c,aggregate:p,type:"quantitative"},o,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&B($J(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:ea(ea(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function p_(e,t,n){return`${Kl(e)} ${n} ${t}`}const ox="errorband",xZ=["band","borders"],wZ=new tg(ox,gD);function gD(e,{config:t}){e={...e,encoding:ng(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:a,outerSpec:o,tooltipEncoding:u}=hD(e,ox,t),l=a,c=sx(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const g={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},h={...h,...g,aria:!1}):l.interpolate?B(a_("interpolate")):l.tension&&B(a_("tension")),{...o,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const pD={};function ux(e,t,n){const i=new tg(e,t);pD[e]={normalizer:i,parts:n}}function EZ(){return P(pD)}ux(xd,cD,cZ);ux(ax,dD,hZ);ux(ox,gD,xZ);const _Z=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],mD={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"},yD={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"},SZ=P(mD),AZ=P(yD),kZ={header:1,headerRow:1,headerColumn:1,headerFacet:1},bD=P(kZ),vD=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],CZ={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},$Z={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},oi="_vgsid_",FZ={point:{on:"click",fields:[oi],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 lx(e){return e==="legend"||!!(e!=null&&e.legend)}function Ep(e){return lx(e)&&V(e)}function cx(e){return!!(e!=null&&e.select)}function xD(e){const t=[];for(const n of e||[]){if(cx(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 OZ(e){return ig(e)||dx(e)||fx(e)}function fx(e){return z(e,"concat")}function ig(e){return z(e,"vconcat")}function dx(e){return z(e,"hconcat")}function wD({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Li(e){return z(e,"step")}function m_(e){return z(e,"view")||z(e,"width")||z(e,"height")}const y_=20,TZ={align:1,bounds:1,center:1,columns:1,spacing:1},RZ=P(TZ);function DZ(e,t,n){const i=n[t],r={},{spacing:s,columns:a}=i;s!==void 0&&(r.spacing=s),a!==void 0&&(Jh(e)&&!ic(e.facet)||fx(e))&&(r.columns=a),ig(e)&&(r.columns=1);for(const o of RZ)if(e[o]!==void 0)if(o==="spacing"){const u=e[o];r[o]=pe(u)?u:{row:u.row??s,column:u.column??s}}else r[o]=e[o];return r}function w0(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function E0(e,t){const n=wd(e,t);return Li(n)?n.step:ED}function wd(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ze(n,{step:e.step})}const ED=20,NZ={continuousWidth:200,continuousHeight:200,step:ED},MZ={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:NZ,mark:kQ,arc:{},area:{},bar:OQ,circle:{},geoshape:{},image:{},line:{},point:{},rect:Vv,rule:{color:"black"},square:{},text:{color:"black"},tick:TQ,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:oQ,projection:{},legend:CZ,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:FZ,style:{},title:{},facet:{spacing:y_},concat:{spacing:y_},normalizedNumberFormat:".0%"},Ki=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],b_={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},v_={blue:Ki[0],orange:Ki[1],red:Ki[2],teal:Ki[3],green:Ki[4],yellow:Ki[5],purple:Ki[6],pink:Ki[7],brown:Ki[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 LZ(e={}){return{signals:[{name:"color",value:V(e)?{...v_,...e}:v_}],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 IZ(e){return{signals:[{name:"fontSize",value:V(e)?{...b_,...e}:b_}],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 PZ(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function _D(e){const t=P(e||{}),n={};for(const i of t){const r=e[i];n[i]=oc(r)?JT(r):gn(r)}return n}function zZ(e){const t=P(e),n={};for(const i of t)n[i]=_D(e[i]);return n}const BZ=[...RR,...eD,...bD,"background","padding","legend","lineBreak","scale","style","title","view"];function SD(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,a=Fo({},ie(MZ),n?PZ(n):{},t?LZ(t):{},i?IZ(i):{},s||{});r&&Oo(a,"selection",r,!0);const o=Jt(a,BZ);for(const u of["background","lineBreak","padding"])a[u]&&(o[u]=gn(a[u]));for(const u of RR)a[u]&&(o[u]=st(a[u]));for(const u of eD)a[u]&&(o[u]=_D(a[u]));for(const u of bD)a[u]&&(o[u]=st(a[u]));
16if(a.legend&&(o.legend=st(a.legend)),a.scale){const{invalid:u,...l}=a.scale,c=st(u,{level:1});o.scale={...st(l),...P(c).length>0?{invalid:c}:{}}}return a.style&&(o.style=zZ(a.style)),a.title&&(o.title=st(a.title)),a.view&&(o.view=st(a.view)),o}const jZ=new Set(["view",...xQ]),UZ=["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"],qZ={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...AQ};function WZ(e){e=ie(e);for(const t of UZ)delete e[t];if(e.axis)for(const t in e.axis)oc(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of _Z)delete e.legend[t];if(e.mark){for(const t of u_)delete e.mark[t];e.mark.tooltip&&V(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(xD(e.params)),delete e.params);for(const t of jZ){for(const i of u_)delete e[t][i];const n=qZ[t];if(n)for(const i of n)delete e[t][i];HZ(e,t)}for(const t of EZ())delete e[t];GZ(e);for(const t in e)V(e[t])&&Ee(e[t])&&delete e[t];return Ee(e)?void 0:e}function GZ(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=KT(e.title);Ee(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ee(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ee(i)?delete e.title:e.title=i}function HZ(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};Ee(s)||(e.style[n??t]=s),delete e[t]}function rg(e){return z(e,"layer")}function VZ(e){return z(e,"repeat")}function XZ(e){return!N(e.repeat)&&z(e.repeat,"layer")}class hx{map(t,n){return Jh(t)?this.mapFacet(t,n):VZ(t)?this.mapRepeat(t,n):dx(t)?this.mapHConcat(t,n):ig(t)?this.mapVConcat(t,n):fx(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(rg(t))return this.mapLayer(t,n);if(xr(t))return this.mapUnit(t,n);throw new Error(Ov(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 YZ={zero:1,center:1,normalize:1};function KZ(e){return K(YZ,e)}const JZ=new Set([FR,Vh,Hh,gd,Yh,Gv,Hv,Xh,OR,Wv]),QZ=new Set([Vh,Hh,FR]);function Da(e){return U(e)&&vo(e)==="quantitative"&&!e.bin}function x_(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(U(a)&&U(o))if(Da(a)&&Da(o)){if(a.stack)return t;if(o.stack)return r;const u=U(a)&&!!a.aggregate,l=U(o)&&!!o.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Da(a))return t;if(Da(o))return r}else{if(Da(a))return s&&n==="vertical"?void 0:t;if(Da(o))return s&&n==="horizontal"?void 0:r}}function ZZ(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function AD(e,t){var p,m;const n=Mi(e)?e:{type:e},i=n.type;if(!JZ.has(i))return null;const r=x_(t,"x",n)||x_(t,"theta",n);if(!r)return null;const s=t[r],a=U(s)?H(s,{}):void 0,o=ZZ(r),u=[],l=new Set;if(t[o]){const y=t[o],b=U(y)?H(y,{}):void 0;b&&b!==a&&(u.push(o),l.add(b))}const c=o==="x"?"xOffset":"yOffset",f=t[c],d=U(f)?H(f,{}):void 0;d&&d!==a&&(u.push(c),l.add(d));const h=cK.reduce((y,b)=>{if(b!=="tooltip"&&qs(t,b)){const v=t[b];for(const x of X(v)){const E=ai(x);if(E.aggregate)continue;const _=H(E,{});(!_||!l.has(_))&&y.push({channel:b,fieldDef:E})}}return y},[]);let g;return s.stack!==void 0?us(s.stack)?g=s.stack?"zero":null:g=s.stack:QZ.has(i)&&(g="zero"),!g||!KZ(g)||iD(t)&&h.length===0?null:((p=s==null?void 0:s.scale)!=null&&p.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==ot.LINEAR&&s!=null&&s.stack&&B(AJ(s.scale.type)),re(t[Wi(r)])?(s.stack!==void 0&&B(SJ(r)),null):(U(s)&&s.aggregate&&!EK.has(s.aggregate)&&B(kJ(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:bs(i),stackBy:h,offset:g}))}function kD(e,t,n){const i=st(e),r=we("orient",i,n);if(i.orient=iee(i.type,t,r),r!==void 0&&r!==i.orient&&B(uJ(i.orient,r)),i.type==="bar"&&i.orient){const u=we("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:$Q[i.orient];for(const c of l)i[c]=u;
vendor: 5,585 bytes, line 16
16i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=we("opacity",i,n),a=we("fillOpacity",i,n);return s===void 0&&a===void 0&&(i.opacity=tee(i.type,t)),we("cursor",i,n)===void 0&&(i.cursor=eee(i,t,n)),i}function eee(e,t,n){return t.href||e.href||we("href",e,n)?"pointer":e.cursor}function tee(e,t){if(le([Yh,Wv,Gv,Hv],e)&&!iD(t))return .7}function nee(e,t,{graticule:n}){if(n)return!1;const i=Ni("filled",e,t),r=e.type;return ze(i,r!==Yh&&r!==Xh&&r!==gd)}function iee(e,t,n){switch(e){case Yh:case Gv:case Hv:case OR:case bQ:case yQ:return}const{x:i,y:r,x2:s,y2:a}=t;switch(e){case Vh:if(U(i)&&(rt(i.bin)||U(r)&&r.aggregate&&!i.aggregate))return"vertical";if(U(r)&&(rt(r.bin)||U(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||s){if(n)return n;if(!s)return(U(i)&&i.type===ia&&!Ce(i.bin)||md(i))&&U(r)&&rt(r.bin)?"horizontal":"vertical";if(!a)return(U(r)&&r.type===ia&&!Ce(r.bin)||md(r))&&U(i)&&rt(i.bin)?"vertical":"horizontal"}case gd:if(s&&!(U(i)&&rt(i.bin))&&a&&!(U(r)&&rt(r.bin)))return;case Hh:if(a)return U(r)&&rt(r.bin)?"horizontal":"vertical";if(s)return U(i)&&rt(i.bin)?"vertical":"horizontal";if(e===gd){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Xh:case Wv:{const o=d_(i),u=d_(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=Bt(i)&&i.type===yo,c=Bt(r)&&r.type===yo;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function ree(e){const{point:t,line:n,...i}=e;return P(i).length>1?i:i.type}function see(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Jt(e[t],["point","line"])});return e}function _p(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?V(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?V(t.point)?t.point:{}:void 0}function w_(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 aee{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(xr(t)){const{mark:i,encoding:r}=t,s=Mi(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!_p(s,n[s.type],r);case"area":return!!_p(s,n[s.type],r)||!!w_(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=ng(l,r),d=Mi(o)?o:{type:o},h=_p(d,r[d.type],f),g=d.type==="area"&&w_(d,r[d.type]),p=[{name:u,...s?{params:s}:{},mark:ree({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Jt(f,["shape"])}],m=AD(kD(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=Jt(y,["y2","x2"]),g&&p.push({...a?{projection:a}:{},mark:{type:"line",...fo(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),h&&p.push({...a?{projection:a}:{},mark:{type:"point",opacity:1,filled:!0,...fo(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:p},{...n,config:see(r)})}}function oee(e,t){return t?ic(e)?$D(e,t):CD(e,t):e}function Sp(e,t){return t?$D(e,t):e}function _0(e,t,n){const i=t[e];if(qQ(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};B(UK(i.repeat));return}return t}function CD(e,t){if(e=_0("field",e,t),e!==void 0){if(e===null)return null;if(Zv(e)&&ar(e.sort)){const n=_0("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function E_(e,t){if(U(e))return CD(e,t);{const n=_0("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function __(e,t){if(re(e)){const n=E_(e,t);if(n)return n;if(rc(e))return{condition:e.condition}}else{if(sc(e)){const n=E_(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function $D(e,t){const n={};for(const i in e)if(z(e,i)){const r=e[i];if(N(r))n[i]=r.map(s=>__(s,t)).filter(s=>s);else{const s=__(r,t);s!==void 0&&(n[i]=s)}}return n}class uee{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(xr(t)){const{encoding:n,mark:i}=t;if(i==="line"||Mi(i)&&i.type==="line")for(const r of oK){const s=pa(r),a=n[s];if(n[r]&&(U(a)&&!rt(a.bin)||Hi(a)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return B(oJ(!!r.x2,!!r.y2)),i({...t,mark:V(s)?{...s,type:"rule"}:"rule"},n)}}class lee extends hx{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[fZ,gZ,wZ,new aee,new uee]}map(t,n){if(xr(t)){const i=qs(t.encoding,rr),r=qs(t.encoding,sr),s=qs(t.encoding,Mh);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Sp(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 XZ(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},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${Te(f)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return g.name=h,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...a}=t;!N(i)&&t.columns&&(t=Jt(t,["columns"]),B(n_("repeat")));const o=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!N(i)&&i.row||[u?u.row:null],f=!N(i)&&i.column||[u?u.column:null],d=N(i)&&i||[u?u.repeat:null];
vendor: 4,776 bytes, line 16
16for(const g of d)for(const p of c)for(const m of f){const y={repeat:g,row:p,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(N(i)?`${Te(g)}`:(i.row?`row_${Te(p)}`:"")+(i.column?`column_${Te(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,o.push(Jt(v,["data"]))}const h=N(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...a,columns:h,concat:o}}mapFacet(t,n){const{facet:i}=t;return ic(i)&&t.columns&&(t=Jt(t,["columns"]),B(n_("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:a,config:o}=n,u=A_({parentProjection:a,projection:r}),l=S_({parentEncoding:s,encoding:Sp(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:h,...g}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Sp(a,n.repeater);return this.mapFacet({...g,...m,facet:p,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&&B(sJ([...i?[rr]:[],...r?[sr]:[]]));const a={},o={};for(const u of[rr,sr]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...g}=l;a[u]=g;for(const p of["align","center","spacing"])l[p]!==void 0&&(o[p]??(o[p]={}),o[p][u]=l[p])}}return{facetMapping:a,layout:o}}else{const{align:a,center:o,spacing:u,columns:l,...c}=s;return{facetMapping:oee(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:S_({parentEncoding:n,encoding:s,layer:!0}),parentProjection:A_({parentProjection:i,projection:a})};return super.mapLayer({...o,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function S_({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...P(e),...P(t)]);for(const s of r){const a=t[s],o=e[s];if(re(a)){const u={...o,...a};i[s]=u}else sc(a)?i[s]={...a,condition:{...o,...a.condition}}:a||a===null?i[s]=a:(n||si(o)||Z(o)||re(o)||N(o))&&(i[s]=o)}}else i=t;return!i||Ee(i)?void 0:i}function A_(e){const{parentProjection:t,projection:n}=e;return t&&n&&B(XK({parentProjection:t,projection:n})),n??t}function gx(e){return z(e,"filter")}function cee(e){return z(e,"stop")}function FD(e){return z(e,"lookup")}function fee(e){return z(e,"data")}function dee(e){return z(e,"param")}function hee(e){return z(e,"pivot")}function gee(e){return z(e,"density")}function pee(e){return z(e,"quantile")}function mee(e){return z(e,"regression")}function yee(e){return z(e,"loess")}function bee(e){return z(e,"sample")}function vee(e){return z(e,"window")}function xee(e){return z(e,"joinaggregate")}function wee(e){return z(e,"flatten")}function Eee(e){return z(e,"calculate")}function OD(e){return z(e,"bin")}function _ee(e){return z(e,"impute")}function See(e){return z(e,"timeUnit")}function Aee(e){return z(e,"aggregate")}function kee(e){return z(e,"stack")}function Cee(e){return z(e,"fold")}function $ee(e){return z(e,"extent")&&!z(e,"density")&&!z(e,"regression")}function Fee(e){return e.map(t=>gx(t)?{filter:Xa(t.filter,eQ)}:t)}class Oee extends hx{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=k_(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=k_(t,n),t.encoding){const i={};for(const[r,s]of ns(t.encoding))i[r]=TD(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:ns(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 ft(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:o,select:c,bind:u}})}:t}}function k_(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(gx(s))return{filter:S0(s,t)};if(OD(s)&&ma(s.bin))return{...s,bin:RD(s.bin)};if(FD(s)){const{selection:a,...o}=s.from;return a?{...s,from:{param:a,...o}}:s}return s});return{...i,transform:r}}return e}function TD(e,t){var i,r;const n=ie(e);if(U(n)&&ma(n.bin)&&(n.bin=RD(n.bin)),xa(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...a}=n.scale.domain;n.scale.domain={...a,...s?{param:s}:{}}}if(rc(n))if(N(n.condition))n.condition=n.condition.map(s=>{const{selection:a,param:o,test:u,...l}=s;return o?s:{...l,test:S0(s,t)}});else{const{selection:s,param:a,test:o,...u}=TD(n.condition,t);
vendor: 18,175 bytes, line 16
16n.condition=a?n.condition:{...u,test:S0(n.condition,t)}}return n}function RD(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function S0(e,t){const n=i=>Xa(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):Xa(e.test||e.filter,i=>i.selection?n(i.selection):i)}class A0 extends hx{map(t,n){const i=n.selections??[];if(t.params&&!xr(t)){const r=[];for(const s of t.params)cx(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)(Y(o)&&(o===t.name||r.includes(o))||N(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=A0.prototype[e];A0.prototype[e]=function(n,i){return t.call(this,n,Tee(n,i))}}function Tee(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function DD(e,t){t===void 0&&(t=SD(e.config));const n=Mee(e,t),{width:i,height:r}=e,s=Lee(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const Ree=new lee,Dee=new Oee,Nee=new A0;function Mee(e,t={}){const n={config:t};return Nee.map(Ree.map(Dee.map(e,n),n),n)}function C_(e){return Y(e)?{type:e}:e??{}}function Lee(e,t,n){let{width:i,height:r}=t;const s=xr(e)||rg(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"&&(B(QE("width")),i=void 0),r=="container"&&(B(QE("height")),r=void 0));const o={type:"pad",...a,...n?C_(n.autosize):{},...C_(e.autosize)};if(o.type==="fit"&&!s&&(B(TK),o.type="pad"),i=="container"&&!(o.type=="fit"||o.type=="fit-x")&&B(ZE("width")),r=="container"&&!(o.type=="fit"||o.type=="fit-y")&&B(ZE("height")),!mn(o,{type:"pad"}))return o}function Iee(e){return["fit","fit-x","fit-y"].includes(e)}function Pee(e){return e?`fit-${Bh(e)}`:"fit"}const zee=["background","padding"];function $_(e,t){const n={};for(const i of zee)e&&e[i]!==void 0&&(n[i]=gn(e[i]));return t&&(n.params=e.params),n}class wr{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new wr(ie(this.explicit),ie(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return ze(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 P(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Ei(e){return{explicit:!0,value:e}}function ln(e){return{explicit:!1,value:e}}function ND(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:sg(t,n,i,r)}}function sg(e,t,n,i){return e.explicit&&t.explicit&&B(yJ(n,i,e.value,t.value)),e}function ss(e,t,n,i,r=sg){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:mn(e.value,t.value)?e:r(e,t,n,i)}class Bee extends wr{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 Eo(e){return z(e,"url")}function fl(e){return z(e,"values")}function MD(e){return z(e,"name")&&!Eo(e)&&!fl(e)&&!Xr(e)}function Xr(e){return e&&(LD(e)||ID(e)||px(e))}function LD(e){return z(e,"sequence")}function ID(e){return z(e,"sphere")}function px(e){return z(e,"graticule")}var Ie;(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"})(Ie||(Ie={}));function PD({invalid:e,isPath:t}){switch(DR(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 jee(e){const{marks:t,scales:n}=PD(e);return t===n?Ie.Main:n==="include-invalid-values"?Ie.PreFilterInvalid:Ie.PostFilterInvalid}function zD(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=In(r.field),r}function aa(e,t=!0,n=Ct){if(N(e)){const i=e.map(r=>aa(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ba(e))return n(t?na(e):UJ(e));return t?n(_e(e)):e}function Uee(e,t){for(const n of ft(e.component.selection??{})){const i=n.name;let r=`${i}${as}, ${n.resolve==="global"?"true":`{unit: ${Ws(e)}}`}`;for(const s of lg)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+bte,on:[{events:{signal:n.name+as},update:`modify(${q(n.name+oa)}, ${r})`}]})}return mx(t)}function qee(e,t){if(e.component.selection&&P(e.component.selection).length){const n=q(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:fs("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return mx(t)}function Wee(e,t){let n=!1;for(const i of ft(e.component.selection??{})){const r=i.name,s=q(r+oa);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:`${i3}(${s}, ${q(o)}${u}`})}n=!0;for(const o of lg)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"}]}),mx(t)}function Gee(e,t){const n=[...t],i=Ws(e,{escape:!1});for(const r of ft(e.component.selection??{})){const s={name:r.name+oa};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:oi}}]),r.init){const o=r.project.items.map(zD);s.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[oi]:aa(u,!1)[0]})):r.init.map(u=>({unit:i,fields:o,values:aa(u,!1)}))}n.filter(o=>o.name===r.name+oa).length||n.push(s)}return n}function BD(e,t){for(const n of ft(e.component.selection??{}))for(const i of lg)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Hee(e,t){for(const n of e.children)Ne(n)&&(t=BD(n,t));return t}function Vee(e,t,n,i){const r=u3(e,t.param,t);return{signal:ri(n.get("type"))&&N(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function mx(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class xe{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)){B(GK);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 Qt extends xe{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${NT()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function Ap(e){return e.as!==void 0}function F_(e){return`${e}_end`}class $i extends xe{clone(){return new $i(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(va(u)){if(Ne(n)){const{mark:c,markDef:f,config:d}=n,h=rs({fieldDef:s,markDef:f,config:d});(cl(c)||h)&&(l={timeUnit:tt(u),field:o})}}else l={as:H(s,{forAs:!0}),field:o,timeUnit:u};if(Ne(n)){const{mark:c,markDef:f,config:d}=n,h=rs({fieldDef:s,markDef:f,config:d});cl(c)&&Be(a)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[ce(l)]=l)}return r},{});return Ee(i)?null:new $i(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=tt(i),a={...r,timeUnit:s};return new $i(t,{[ce(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 ns(this.timeUnits)){const s=Ap(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(ft(this.timeUnits).map(t=>Ap(t)?t.as:F_(t.field)))}dependentFields(){return new Set(ft(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${ce(this.timeUnits)}`}assemble(){const t=[];for(const n of ft(this.timeUnits)){const{rectBandPosition:i}=n,r=tt(n.timeUnit);if(Ap(n)){const{field:s,as:a}=n,{unit:o,utc:u,...l}=r,c=[a,`${a}_end`];t.push({field:In(s),type:"timeunit",...o?{units:Wh(o)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...O_(c,i,r))}else if(n){const{field:s}=n,a=s.replaceAll("\\.","."),o=jD({timeUnit:r,field:a}),u=F_(a);t.push({type:"formula",expr:o,as:u}),t.push(...O_([a,u],i,r))}}return t}}const ag="offsetted_rect_start",og="offsetted_rect_end";function jD({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=pR(i),{part:a,step:o}=vR(s,e.step);return`${r?"utcOffset":"timeOffset"}('${a}', datum['${t}'], ${n?-o:o})`}function O_([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:T_([jD({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${ag}`},{type:"formula",expr:T_([r,s],n+.5),as:`${e}_${og}`}]}return[]}function T_([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const uc="_tuple_fields";class Xee{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Yee={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Xee),s={},a={},o=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=Te(`${i}_${m}`);for(let b=1;o.has(y);b++)y=Te(`${i}_${m}_${b}`);return o.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?X(n.value):null;let{fields:d,encodings:h}=V(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(V(g))for(const p of P(g))aK(p)?(h||(h=[])).push(p):l==="interval"?(B(jK),h=c.encodings):(d??(d=[])).push(p)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const g of h??[]){const p=e.fieldDef(g);if(p){let m=p.field;if(p.aggregate){B(RK(g,p.aggregate));continue}else if(!m){B(t_(g));continue}if(p.timeUnit&&!va(p.timeUnit)){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};a[ce(y)]=y}if(!s[m]){const y=l==="interval"&&Gi(g)&&ri(e.getScaleComponent(g).get("type"))?"R":p.bin?"R-RE":"E",b={field:m,channel:g,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===oi,BT(g)?(b.geoChannel=g,b.channel=zT(g),r.hasChannel[b.channel]=s[m]):r.hasChannel[g]=s[m]}}else B(t_(g))}for(const g of d??[]){if(r.hasField[g])continue;const p={type:"E",field:g,index:r.items.length};p.signals={...u(p,"data")},r.items.push(p),r.hasField[g]=p,r.hasSelectionId=r.hasSelectionId||g===oi}f&&(t.init=f.map(g=>r.items.map(p=>V(g)?g[p.geoChannel||p.channel]!==void 0?g[p.geoChannel||p.channel]:g[p.field]:g))),Ee(a)||(r.timeUnit=new $i(null,a))},signals:(e,t,n)=>{const i=t.name+uc;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(zD)})}},or={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(!Gi(r))continue;const s=e.getScaleComponent(r),a=s?s.get("type"):void 0;if(a=="sequential"&&B(LK),!s||!ri(a)){B(MK);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||R_(e)||i.length===0)return n;const r=n.find(a=>a.name===t.name);let s=r.update;if(s.includes(i3))r.update=`{${i.map(a=>`${q(In(a.field))}: ${a.signals.data}`).join(", ")}}`;else{for(const a of i){const o=`${q(In(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&&!R_(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function k0(e,t){return`domain(${q(e.scaleName(t))})`}function R_(e){return e.parent&&Vo(e.parent)&&!e.parent.parent}const Ja="_brush",UD="_scale_trigger",du="geo_interval_init_tick",qD="_init",Kee="_center",Jee={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...V(n.select)?n.select:{}};r.fields=[oi],r.encodings||(r.encodings=n.value?P(n.value):[pi,gi]),n.select={type:"interval",...r}}if(t.translate&&!or.defined(t)){const r=`!event.item || event.item.mark.name !== ${q(t.name+Ja)}`;for(const s of t.events){if(!s.between){B(`${s} is not an ordered event stream for interval selections.`);continue}const a=X((i=s.between[0]).filter??(i.filter=[]));a.includes(r)||a.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+as,s=ft(t.project.hasChannel).filter(o=>o.channel===Re||o.channel===it),a=t.init?t.init[0]:null;if(n.push(...s.reduce((o,u)=>o.concat(Qee(e,t,u,a&&a[u.index])),[])),e.hasProjection){const o=q(e.projectionName()),u=e.projectionName()+Kee,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?a&&a[l.index]:`${u}[0]`,g=c?a&&a[c.index]:`${u}[1]`,p=E=>e.getSizeSignalRef(E).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":p("width")}, ${d?d+"[1]":p("height")}]]`;a&&(n.unshift({name:i+qD,init:`[scale(${o}, [${l?h[0]:h}, ${c?g[0]:g}]), scale(${o}, [${l?h[1]:h}, ${c?g[1]:g}])]`}),(!l||!c)&&(n.find(_=>_.name===u)||n.unshift({name:u,update:`invert(${o}, [${p("width")}/2, ${p("height")}/2])`})));const y=`intersect(${m}, {markname: ${q(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Ws(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...a?[{signal:du}]:[]],update:v}]})}else{if(!or.defined(t)){const l=i+UD,c=s.map(f=>{const d=f.channel,{data:h,visual:g}=f.signals,p=q(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=ri(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${p}, ${g})[0] === ${y}${h}[0] && ${y}invert(${p}, ${g})[1] === ${y}${h}[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: ${Ws(e)}, fields: ${i+uc}, values`;return n.concat({name:r,...a?{init:`{${u}: ${aa(a)}}`}:{},...o.length?{on:[{events:[{signal:o.join(" || ")}],update:`${o.join(" && ")} ? {${u}: [${o}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ne(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===du).length||n.unshift({name:du,value:null,on:[{events:"timer{1}",update:`${du} === null ? {} : ${du}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,a=r==null?void 0:r.signals.visual,o=s==null?void 0:s.signals.visual,u=`data(${q(t.name+oa)})`;if(or.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 P(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Ws(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=P(h).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:h[y]},{value:null}],m),{}),p=d??(t.translate?"move":null);return[{name:`${i+Ja}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Ja,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function Qee(e,t,n,i){const r=!e.hasProjection,s=n.channel,a=n.signals.visual,o=q(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${o}, ${d})`,l=e.getSizeSignalRef(s===Re?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${a}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=or.defined(t),g=e.getScaleComponent(s),p=g?g.get("type"):void 0,m=i?{init:aa(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+UD},update:ri(p)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:a,...m,on:f},{name:d,...i?{init:aa(i)}:{},on:[{events:{signal:a},update:`${a}
16[0] === ${a}[1] ? null : invert(${o}, ${a})`}]}]}else{const d=s===Re?0:1,h=t.name+qD,g=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:a,...g,on:f}]}}const Zee={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+uc,s=t.project,a="(item().isVoronoi ? datum.datum : datum)",o=ft(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Ja):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${o?` && ${o}`:""}`;let l=`unit: ${Ws(e)}, `;if(t.project.hasSelectionId)l+=`${oi}: ${a}[${q(oi)}]`;else{const f=s.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${a}[${q(e.vgField(d.channel,{}))}], ${a}[${q(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${a}[${q(d.field)}]`}).join(", ");l+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+as,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function qo({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=rc(t)&&t.condition;let a=[];s&&(a=X(s).map(l=>{const c=r(l);if(UQ(l)){const{param:f,empty:d}=l;return{test:o3(e,{param:f,empty:d}),...c}}else return{test:Sd(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 yx(e,t="text"){const n=e.encoding[t];return qo({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>ug(i,e.config),invalidValueRef:void 0})}function ug(e,t,n="datum"){if(e){if(si(e))return Fe(e.value);if(re(e)){const{format:i,formatType:r}=bd(e);return Jv({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function WD(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,a=n.tooltip;if(N(a))return{tooltip:D_({tooltip:a},s,r,t)};{const o=t.reactiveGeom?"datum.datum":"datum";return qo({model:e,channelDef:a,vgChannel:"tooltip",mainRefFn:l=>{const c=ug(l,r,o);if(c)return c;if(l===null)return;let f=we("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),Y(f))return{value:f};if(V(f))return Z(f)?f:f.content==="encoding"?D_(n,s,r,t):{signal:o}},invalidValueRef:void 0})}}function GD(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=pa(f),h=Bt(c)?c:{...c,type:e[d].type},g=h.title||tx(h,r),p=X(g).join(", ").replaceAll(/"/g,'\\"');let m;if(Be(f)){const y=f==="x"?"x2":"y2",b=ai(e[y]);if(rt(h.bin)&&b){const v=H(h,{expr:a}),x=H(b,{expr:a}),{format:E,formatType:_}=bd(h);m=nc(v,x,E,_,r),s.add(y)}}if((Be(f)||f===Bn||f===hi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=bd(h);m=Jv({fieldOrDatumDef:h,format:y,formatType:b,expr:a,config:r,normalizeStack:!0}).signal}m??(m=ug(h,r,a).signal),o.push({channel:f,key:p,value:m})}ix(e,(c,f)=>{U(c)?u(c,f):Qh(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 D_(e,t,n,{reactiveGeom:i}={}){const r=GD(e,t,n,{reactiveGeom:i}),s=ns(r).map(([a,o])=>`"${a}": ${o}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function ete(e){const{markDef:t,config:n}=e,i=we("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...tte(e),...nte(e)}}function tte(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=we("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:K($K,t)?{}:{ariaRoleDescription:{value:t}}}function nte(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return qo({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>ug(u,e.config),invalidValueRef:void 0});const a=we("description",n,i);if(a!=null)return{description:Fe(a)};if(i.aria===!1)return{};const o=GD(t,r,i);if(!Ee(o))return{description:{signal:ns(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=we(e,i,s,{vgChannel:a,ignoreVgConfig:!rc(l)})),u!==void 0&&(o=Fe(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=MR({...c,scaleChannel:e,channelDef:l});
16return qo({model:t,channelDef:l,vgChannel:a??e,invalidValueRef:f,mainRefFn:h=>Kv({...c,channel:e,channelDef:h,stack:null,defaultRef:o})})}function HD(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,a=t.filled??we("filled",n,r),o=le(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=we(a===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[a===!0&&"color"]??o,l=we(a===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[a===!1&&"color"],c=a?"fill":"stroke",f={...u?{fill:Fe(u)}:{},...l?{stroke:Fe(l)}:{}};return n.color&&(a?n.fill:n.stroke)&&B(aR("property",{fill:"fill"in n,stroke:"stroke"in n})),{...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 ite(e){const{encoding:t,mark:n}=e,i=t.order;return!bs(n)&&si(i)?qo({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Fe(r.value),invalidValueRef:void 0}):{}}function _o({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:Kv({channel:s,channelDef:o,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Fe(a),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function Pt(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:a,stack:o}=t,u=r[e],l=r[Wi(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=_o({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),g=bx({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),p=!u&&Be(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:rte({channel:e,channelDef:u,channel2Def:l,markDef:s,config:a,scaleName:c,scale:f,stack:o,offset:d,defaultRef:g,bandPosition:h==="encoding"?0:void 0});return p?{[i||e]:p}:void 0}function rte(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:a}=e;if(re(n)&&r&&t===r.fieldChannel){if(U(n)){let o=n.bandPosition;if(o===void 0&&a.type==="text"&&(t==="radius"||t==="theta")&&(o=.5),o!==void 0)return pd({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:o,offset:s})}return Us(n,i,{suffix:"end"},{offset:s})}return Yv(e)}function bx({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:a}=e;return()=>{const o=pa(n),u=is(n),l=we(n,s,a,{vgChannel:u});if(l!==void 0)return Wu(n,l);switch(t){case"zeroOrMin":return N_({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:o,config:a});case"zeroOrMax":return N_({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:o,config:a});case"mid":return{...e[an(n)],mult:.5}}}}function N_({mainChannel:e,config:t,...n}){const i=NR(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 ste={left:"x",center:"xc",right:"x2"},ate={top:"y",middle:"yc",bottom:"y2"};function VD(e,t,n,i="middle"){if(e==="radius"||e==="theta")return is(e);const r=e==="x"?"align":"baseline",s=we(r,t,n);let a;return Z(s)?(B(aJ(r)),a=void 0):a=s,e==="x"?ste[a||(i==="top"?"left":"center")]:ate[a||i]}function Ed(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?XD(e,t,{defaultPos:n,defaultPos2:i}):Pt(e,t,{defaultPos:n})}function XD(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,a=Wi(e),o=an(e),u=ote(t,i,a),l=u[o]?VD(e,r,s):is(e);return{...Pt(e,t,{defaultPos:n,vgChannel:l}),...u}}function ote(e,t,n){const{encoding:i,mark:r,markDef:s,stack:a,config:o}=e,u=pa(n),l=an(n),c=is(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:g}=n in i||n in s?_o({channel:n,markDef:s,encoding:i,model:e}):_o({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=an(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=ute({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:o,scaleName:d,scale:h,stack:a,offset:g,defaultRef:void 0});return p!==void 0?{[c]:p}:Lc(n,s)||Lc(n,{[n]:p0(n,s,o.style),[l]:p0(l,s,o.style)})||Lc(n,o[r])||Lc(n,o.mark)||{[c]:bx({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function ute({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)?Us(t,s,{suffix:"start"},{offset:u}):Yv({channel:e,channelDef:n,scaleName:s,scale:a,stack:o,markDef:i,config:r,offset:u,defaultRef:l})}function Lc(e,t){const n=an(e),i=is(e);if(t[i]!==void 0)return{[i]:Wu(e,t[i])};if(t[e]!==void 0)return{[i]:Wu(e,t[e])};if(t[n]){const r=t[n];if(ra(r))B(eJ(n));else return{[n]:Wu(e,r)}}}function dr(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,a=Wi(t),o=an(t),u=i[t],l=i[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[o]??i.size??we("size",r,n,{vgChannel:o}),g=WT(t),p=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return U(u)&&(Ce(u.bin)||rt(u.bin)||u.timeUnit&&!l)&&!(h&&!ra(h))&&!i[g]&&!nt(f)?fte({fieldDef:u,fieldDef2:l,channel:t,model:e}):(re(u)&&nt(f)||p)&&!l?cte(u,t,e):XD(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function lte(e,t,n,i,r,s,a){if(ra(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=Ni("minBandSize",{type:a},i);return{signal:c?`max(${Jn(c)}, ${l})`:l}}else r.band!==1&&(B(cJ(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(Z(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(ya(u)&&pe(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=ze(u,a==="tick"?f:a==="bar"?l:c);if(Z(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(pe(d))return{signal:`${1-d} * ${e}`}}return{value:E0(i.view,e)-2}}function cte(e,t,n){var A,k;const{markDef:i,encoding:r,config:s,stack:a}=n,o=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=an(t),f=Wi(t),d=WT(t),h=n.scaleName(d),g=n.getScaleComponent(Sv(t)),p=i.type==="tick"||o==="horizontal"&&t==="y"||o==="vertical"&&t==="x";let m;(r.size||i.size)&&(p?m=ut("size",n,{vgChannel:c,defaultRef:Fe(i.size)}):B(gJ(i.type)));const y=!!m,b=UR({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(A=l||g)==null?void 0:A.get("type"),useVlSizeChannel:p});m=m||{[c]:lte(c,h||u,g||l,s,b,!!e,i.type)};const v=((k=l||g)==null?void 0:k.get("type"))==="band"&&ra(b)&&!y?"top":"middle",x=VD(t,i,s,v),E=x==="xc"||x==="yc",{offset:_,offsetType:w}=_o({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),S=Yv({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:a,offset:_,defaultRef:bx({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?w==="encoding"?0:.5:Z(b)?{signal:`(1-${b})/2`}:ra(b)?(1-b.band)/2:0});if(c)return{[x]:S,...m};{const F=is(f),L=m[c],M=_?{...L,offset:_}:L;return{[x]:S,[F]:N(S)?[S[0],{...S[1],offset:M}]:{...S,offset:M}}}}function M_(e,t,n,i,r,s,a){if(PT(e))return 0;const o=e==="x"||e==="y2",u=o?-t/2:t/2;if(Z(n)||Z(r)||Z(i)||s){const l=Jn(n),c=Jn(r),f=Jn(i),d=Jn(s),g=s?`
16(${a} < ${d} ? ${o?"":"-"}0.5 * (${d} - (${a})) : ${u})`:u,p=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${g})`:g;return{signal:p+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function fte({fieldDef:e,fieldDef2:t,channel:n,model:i}){var k;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=UR({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(k=i.component.axes[n])==null?void 0:k[0],h=(d==null?void 0:d.get("translate"))??.5,g=Be(n)?we("binSpacing",s,r)??0:0,p=Wi(n),m=is(n),y=is(p),b=Ni("minBandSize",s,r),{offset:v}=_o({channel:n,markDef:s,encoding:a,model:i,bandPosition:0}),{offset:x}=_o({channel:p,markDef:s,encoding:a,model:i,bandPosition:0}),E=LQ({fieldDef:e,scaleName:u}),_=M_(n,g,c,h,v,b,E),w=M_(p,g,c,h,x??v,b,E),S=Z(f)?{signal:`(1-${f.signal})/2`}:ra(f)?(1-f.band)/2:.5,A=rs({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(Ce(e.bin)||e.timeUnit){const F=e.timeUnit&&A!==.5;return{[y]:L_({fieldDef:e,scaleName:u,bandPosition:S,offset:w,useRectOffsetField:F}),[m]:L_({fieldDef:e,scaleName:u,bandPosition:Z(S)?{signal:`1-${S.signal}`}:1-S,offset:_,useRectOffsetField:F})}}else if(rt(e.bin)){const F=Us(e,u,{},{offset:w});if(U(t))return{[y]:F,[m]:Us(t,u,{},{offset:_})};if(ma(e.bin)&&e.bin.step)return{[y]:F,[m]:{signal:`scale("${u}", ${H(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}B(lR(p))}function L_({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return pd({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:ag,endSuffix:og}:{}})}const dte=new Set(["aria","width","height"]);function jn(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?HD(e):{};return{...hte(e.markDef,t),...I_("fill",n),...I_("stroke",i),...ut("opacity",e),...ut("fillOpacity",e),...ut("strokeOpacity",e),...ut("strokeWidth",e),...ut("strokeDash",e),...ite(e),...WD(e),...yx(e,"href"),...ete(e)}}function I_(e,t){return t?{[e]:t}:{}}function hte(e,t){return CK.reduce((n,i)=>(!dte.has(i)&&z(e,i)&&t[i]!=="ignore"&&(n[i]=Fe(e[i])),n),{})}function vx(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let a;if(!Gi(s)||!(a=e.getScaleType(s)))return;const o=jh(r.aggregate),u=Xv({scaleChannel:s,markDef:n,config:t,scaleType:a,isCountAggregate:o});if(DQ(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>Gh(s,!0)).join(" && ")}}}function P_(e,t){if(t!==void 0)return{[e]:Fe(t)}}const kp="voronoi",YD={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(kp)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(bs(s))return B(DK(s)),n;const a={name:e.getName(kp),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...WD(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(kp)&&(u=!0)}),u||n.splice(o+1,0,a),n}},KD={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!lx(e.bind),parse:(e,t,n)=>r3(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,a=t.init&&t.init[0],o=YD.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=Te(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...a?{init:aa(a[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${o}[${q(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+as),a=i+uc,o=r.items.map(l=>Te(`${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}},_d="_toggle",JD={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+_d,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>
vendor: 15,086 bytes, line 16
16{const n=t.name+as,i=t.name+_d;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Ws(e)}}, `)+`${i} ? ${n} : null`}},gte={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=Y(t.clear)?fs(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(KD.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===Te(`${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+as);i(r,"null"),JD.defined(t)&&(r=n.findIndex(s=>s.name===t.name+_d),i(r,"false"))}return n}},QD={defined:e=>{const t=e.resolve==="global"&&e.bind&&lx(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==oi;return t&&!n&&B(IK),t&&n},parse:(e,t,n)=>{const i=ie(n);if(i.select=Y(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},r3(t,i),V(n.select)&&(n.select.on||n.select.clear)){const a='event.item && indexof(event.item.mark.role, "legend") < 0';for(const o of t.events)o.filter=X(o.filter??[]),o.filter.includes(a)||o.filter.push(a)}const r=Ep(t.bind)?t.bind.legend:"click",s=Y(r)?fs(r,"view"):X(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Ep(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=`${Te(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+as),a=i+uc,o=r.items.filter(d=>d.hasLegend).map(d=>Te(`${i}_${Te(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+_d),f=Ep(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function pte(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of ft(e.component.selection??{})){const a=s.project.hasField[i]??s.project.hasChannel[t];if(a&&QD.defined(s)){const o=n.get("selections")??[];o.push(s.name),n.set("selections",o,!1),a.hasLegend=!0}}}const ZD="_translate_anchor",e3="_translate_delta",mte={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=or.defined(t),s=i+ZD,{x:a,y:o}=t.project.hasChannel;let u=fs(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Ja,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?k0(e,Re):`slice(${a.signals.visual})`}`:"")+(o!==void 0?`, extent_y: ${r?k0(e,it):`slice(${o.signals.visual})`}`:"")+"}"}]},{name:i+e3,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),a!==void 0&&z_(e,t,a,"width",n),o!==void 0&&z_(e,t,o,"height",n),n}};function z_(e,t,n,i,r){const s=t.name,a=s+ZD,o=s+e3,u=n.channel,l=or.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),g=d&&d.get("reverse"),p=l?u===Re?g?"":"-":g?"-":"":"",m=`${a}.extent_${u}`,y=`${p}${o}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:o},update:l?x:`clampRange(${x}, 0, ${f})`})}const t3="_zoom_anchor",n3="_zoom_delta",yte={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=or.defined(t),s=i+n3,{x:a,y:o}=t.project.hasChannel,u=q(e.scaleName(Re)),l=q(e.scaleName(it));let c=fs(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Ja,f))),n.push({name:i+t3,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&&B_(e,t,a,"width",n),o!==void 0&&B_(e,t,o,"height",n),n}};function B_(e,t,n,i,r){const s=t.name,a=n.channel,o=or.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?k0(e,a):u.name,h=s+n3,g=`${s}${t3}.${a}`,p=!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=`${p}(${d}, ${g}, ${h}${m})`;u.on.push({events:{signal:h},update:o?y:`clampRange(${y}, 0, ${l})`})}const oa="_store",as="_tuple",bte="_modify",i3="vlSelectionResolve",lg=[Zee,Jee,Yee,JD,KD,or,QD,gte,mte,yte,YD];function vte(e){let t=e.parent;for(;t&&!xn(t);)t=t.parent;return t}function Ws(e,{escape:t}={escape:!0}){let n=t?q(e.name):e.name;const i=vte(e);if(i){const{facet:r}=i;for(const s of On)r[s]&&(n+=` + '__facet_${s}_' + (facet[${q(i.vgField(s))}])`)}return n}function xx(e){return ft(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function r3(e,t){(Y(t.select)||!t.select.on)&&delete e.events,(Y(t.select)||!t.select.clear)&&delete e.clear,(Y(t.select)||!t.select.toggle)&&delete e.toggle}function C0(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...C0(e.object)),t.push(...C0(e.property))),t)}function s3(e){return e.object.type==="MemberExpression"?s3(e.object):e.object.name==="datum"}function a3(e){const t=Bb(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&s3(i)&&n.add(C0(i).slice(1).join("."))}),n}class Wo extends xe{clone(){return new Wo(null,this.model,ie(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Sd(this.model,this.filter,this),this._dependentFields=a3(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function xte(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=Te(r.name),a=r.select,o=Y(a)?a:a.type,u=V(a)?ie(a):{type:o},l=i[o];for(const d in l)d==="fields"||d==="encodings"||(d==="mark"&&(u.mark={...l.mark,...u.mark}),(u[d]===void 0||u[d]===!0)&&(u[d]=ie(l[d]??u[d])));const c=n[s]={...u,name:s,type:o,init:r.value,bind:r.bind,events:Y(u.on)?fs(u.on,"scope"):X(ie(u.on))},f=ie(r);for(const d of lg)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function o3(e,t,n,i="datum"){const r=Y(t)?t:t.param,s=Te(r),a=q(s+oa);let o;try{o=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(o.project.timeUnit){const d=n??e.component.data.raw,h=o.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=o.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=o.resolve==="global"?")":`, ${q(o.resolve)})`,c=`${u}${a}, ${i}${l}`,f=`length(data(${a}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function u3(e,t,n){const i=Te(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&&B(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${q(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,B((o.length?"Multiple ":"No ")+`matching ${q(r)} encoding found for selection ${q(n.param)}. Using "field": ${q(s)}.`)):s=o[0].field}return`${a.name}[${q(In(s))}]`}function wte(e,t){for(const[n,i]of ns(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Qt(new Wo(t,e,{param:n}),r,Ie.Lookup,e.component.data.outputNodeRefCounts)}}function Sd(e,t,n){return qu(t,i=>Y(i)?i:JJ(i)?o3(e,i,n):wR(i))}function Ete(e,t){if(e)return N(e)&&!Or(e)?e.map(n=>tx(n,t)).join(", "):e}function Cp(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 Ru(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:a,labelExpr:o,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const g=h,p=nZ[g],m=c[g];if(p&&p!==t&&p!=="both")delete c[g];else if(oc(m)){const{condition:y,...b}=m,v=X(y),x=h_[g];if(x){const{vgProp:E,part:_}=x,w=[...v.map(S=>{const{test:A,...k}=S;return{test:Sd(null,A),...k}}),b];Cp(c,_,E,w),delete c[g]}else if(x===null){const E={signal:v.map(_=>{const{test:w,...S}=_;return`${Sd(null,w)} ? ${JE(S)} : `}).join("")+JE(b)};c[g]=E}}else if(Z(m)){const y=h_[g];if(y){const{vgProp:b,part:v}=y;Cp(c,v,b,m),delete c[g]}}le(["labelAlign","labelBaseline"],g)&&c[g]===null&&delete c[g]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Ee(c.encode)&&delete c.encode}return{scale:a,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ze(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(o!==void 0){let g=o;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&Z(c.encode.labels.update.text)&&(g=ea(o,"datum.label",c.encode.labels.update.text.signal)),Cp(c,"labels","text",{signal:g})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const g of QR)e.hasAxisPart(g)||delete c.encode[g];Ee(c.encode)&&delete c.encode}const h=Ete(u,n);return{scale:a,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ze(l,0)}}}}function l3(e){const{axes:t}=e.component,n=[];for(const i of vr)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 _te(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Ru(r,"grid",t)),...i.map(r=>Ru(r,"grid",t)),...n.map(r=>Ru(r,"main",t)),...i.map(r=>Ru(r,"main",t))].filter(r=>r)}function j_(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([...P(a),...P(o)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${Jn(a[c])} : ${Jn(o[c])}`};return l}return t[r]})])}function Ste(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:AR(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",a=Z(n)?"axisOrient":`axis${Kl(n)}`,o=[...r,...r.map(l=>s+l.substr(4))],u=["axis",a,s];return{vlOnlyAxisConfig:j_(o,i,e,n),vgAxisConfig:j_(u,i,e,n),axisConfigStyle:Ate([...u,...o],i)}}function Ate(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=X(s);for(const a of s)n.push(t.style[a])}}return Object.assign.apply(null,n)}function $0(e,t,n,i={}){var s;const r=ZT(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const a of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[a])==null?void 0:s[e])!==void 0)return{configFrom:a,configValue:i[a][e]};return{}}const U_={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??kte(n,e),gridScale:({model:e,channel:t})=>Cte(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||f3(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||c3(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Fte(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Ote(t.type,n,U(t)&&!!t.timeUnit,U(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??Rte({fieldOrDatumDef:i,scaleType:r,size:a,values:n.values})},tickMinStep:Dte,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=d3(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",a=t.fieldDef(s);return tR(r?[f_(r)]:[],U(a)?[f_(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Nte(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Mte(n,t)};function kte(e,t){return!nt(e)&&U(t)&&!Ce(t==null?void 0:t.bin)&&!rt(t==null?void 0:t.bin)}function Cte(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function $te(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return Z(s)?s:ll(s);{const{configValue:a}=$0("labelAngle",i,t==null?void 0:t.style,r);return a!==void 0?ll(a):n===Re&&le([qv,Uv],e.type)&&!(U(e)&&e.timeUnit)?270:void 0}}function F0(e){return`(((${e.signal} % 360) + 360) % 360)`}function c3(e,t,n,i){if(e!==void 0)if(n==="x"){if(Z(e)){const r=F0(e),s=Z(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(Z(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(Z(e)){const r=F0(e),s=Z(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(Z(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 f3(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(Z(e)){const a=F0(e),o=Z(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(Z(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 Fte(e,t){if(t==="x"&&le(["quantitative","temporal"],e))return!0}function Ote(e,t,n,i){if(n&&!V(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Tte(e){return e==="x"?"bottom":"left"}function Rte({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;
vendor: 6,936 bytes, line 16
16if(!i&&!nt(t)&&t!=="log"){if(U(e)){if(Ce(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&le(["month","hours","day","quarter"],(r=tt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Dte({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(U(t)){const{timeUnit:n}=t;if(n){const i=bR(n);if(i)return{signal:i}}}}function d3(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 nR(s,a);if(s)return s;if(a)return a;if(s!==void 0)return s;if(a!==void 0)return a}function Nte(e,t){const n=e.values;if(N(n))return JR(t,n);if(Z(n))return n}function Mte(e,t){return e==="rect"&&yd(t)?1:0}class So extends xe{clone(){return new So(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=a3(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(xa(i)&&jR(i.sort)){const{field:s,timeUnit:a}=i,o=i.sort,u=o.map((l,c)=>`${wR({field:s,timeUnit:a,equal:l})} ? ${c} : `).join("")+o.length;t=new So(t,{calculate:u,as:Ao(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 ${ce(this.transform)}`}}function Ao(e,t,n){return H(e,{prefix:t,suffix:"sort_index",...n})}function cg(e,t){return le(["top","bottom"],t)?"column":le(["left","right"],t)||e==="row"?"row":"column"}function ko(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return ze((t||{})[e],r[e],n.header[e])}function fg(e,t,n,i){const r={};for(const s of e){const a=ko(s,t||{},n,i);a!==void 0&&(r[s]=a)}return r}const wx=["row","column"],Ex=["header","footer"];function Lte(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}=fg(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=cg(t,o),l=ll(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...g3(l,u),...h3(u,l,s),...p3(i,r,t,SZ,mD)}}}function h3(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=f3(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function g3(e,t){const n=c3(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Ite(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Ex)if(n[r])for(const s of n[r]){const a=zte(e,t,r,n,s);a!=null&&i.push(a)}return i}function Pte(e,t){const{sort:n}=e;return ar(n)?{field:H(n,{expr:"datum"}),order:n.order??"ascending"}:N(n)?{field:Ao(e,t,{expr:"datum"}),order:"ascending"}:{field:H(e,{expr:"datum"}),order:n??"ascending"}}function O0(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:a,labelOrient:o,labelExpr:u}=fg(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Jv({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=cg(t,o);return{text:{signal:u?ea(ea(u,"datum.label",l),"datum.value",H(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...g3(s,c),...h3(c,s,a),...p3(n,e,t,AZ,yD)}}function zte(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}=fg(["labelOrient"],a.header,o,t);(t==="row"&&!le(["top","bottom"],f)||t==="column"&&!le(["left","right"],f))&&(s=O0(a,t,o))}const u=xn(e)&&!ic(e.facet),l=r.axes,c=(l==null?void 0: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:Pte(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 Bte={column:{start:0,end:1},row:{start:1,end:0}};function jte(e,t){return Bte[t][e]}function Ute(e,t){const n={};for(const i of On){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:a}=fg(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),o=cg(i,a),u=jte(s,o);u!==void 0&&(n[o]=u)}}return Ee(n)?void 0:n}function p3(e,t,n,i,r){const s={};for(const a of i){if(!r[a])continue;const o=ko(a,t==null?void 0:t.header,e,n);o!==void 0&&(s[r[a]]=o)}return s}function _x(e){return[...Ic(e,"width"),...Ic(e,"height"),...Ic(e,"childWidth"),...Ic(e,"childHeight")]}function Ic(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(nt(a)&&ya(o)){const u=e.scaleName(n);return xn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[q_(u,o)]:[q_(u,o),{name:r,update:m3(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=w0(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 q_(e,t){const n=`${e}_step`;return Z(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function m3(e,t,n){const i=t.get("type"),r=t.get("padding"),s=ze(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a=i==="band"?a!==void 0?a:r:1,`bandspace(${n}, ${Jn(a)}, ${Jn(s)}) * ${e}_step`}function y3(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function b3(e,t){return P(e).reduce((n,i)=>({...n,...qo({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Fe(r.value),invalidValueRef:void 0})}),{})}function v3(e,t){if(xn(t))return e==="theta"?"independent":"shared";if(Vo(t))return"shared";if(Ox(t))return Be(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Sx(e,t){const n=e.scale[t],i=Be(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&B(vJ(t)),"independent"):e[i][t]||"shared"}const qte={...$Z,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},x3=P(qte);class Wte extends wr{}const W_={symbols:Gte,gradient:Hte,labels:Vte,entries:Xte};function Gte(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={...OK({},n,_Q),...HD(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,g=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,p=d===void 0?w3(o.opacity)??a.op
vendor: 5,354 bytes, line 16
16acity:void 0;if(f.fill){if(i==="fill"||c&&i===rn)delete f.fill;else if(z(f.fill,"field"))h?delete f.fill:(f.fill=Fe(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Fe(p??1));else if(N(f.fill)){const m=T0(o.fill??o.color)??a.fill??(c&&a.color);m&&(f.fill=Fe(m))}}if(f.stroke){if(i==="stroke"||!c&&i===rn)delete f.stroke;else if(z(f.stroke,"field")||g)delete f.stroke;else if(N(f.stroke)){const m=ze(T0(o.stroke||o.color),a.stroke,c?a.color:void 0);m&&(f.stroke={value:m})}}if(i!==br){const m=U(t)&&_3(n,r,t);m?f.opacity=[{test:m,...Fe(p??1)},Fe(u.legend.unselectedOpacity)]:p&&(f.opacity=Fe(p))}return f={...f,...e},Ee(f)?void 0:f}function Hte(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?w3(a.opacity)||s.opacity:void 0;return l&&(o.opacity=Fe(l)),o={...o,...e},Ee(o)?void 0:o}function Vte(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},a=n.config,o=U(t)?_3(n,r,t):void 0,u=o?[{test:o,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;sa(c)?f=Qn({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=Qn({fieldOrDatumDef:t,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):t.type==="temporal"&&a.timeFormatType&&U(t)&&t.timeUnit===void 0&&(f=Qn({fieldOrDatumDef:t,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ee(d)?void 0:d}function Xte(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function w3(e){return E3(e,(t,n)=>Math.max(t,n.value))}function T0(e){return E3(e,(t,n)=>ze(t,n.value))}function E3(e,t){if(WQ(e))return X(e.condition).reduce(t,e.value);if(si(e))return e.value}function _3(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=q(n.field);return i.map(s=>`(!length(data(${q(Te(s)+oa)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const G_={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return PR(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return zR(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??tne(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??nne(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Kte(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Ka(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Ya(n)&&ki(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Yte(t,e)};function Yte(e,t){const n=e.values;if(N(n))return JR(t,n);if(Z(n))return n}function Kte(e,t,n,i){if(t!=="shape"){const r=T0(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 Jte(e){const{legend:t}=e;return ze(t.type,Qte(e))}function Qte({channel:e,timeUnit:t,scaleType:n}){if(Ya(e)){if(le(["quarter","month","day"],t))return"symbol";if(ki(n))return"gradient"}return"symbol"}function Zte({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??ene(n,t)}function ene(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 tne({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:a,gradientVerticalMaxLength:o,gradientVerticalMinLength:u}=e;if(ki(r))return n==="horizontal"?i==="top"||i==="bottom"?H_(t,"width",a,s):a:H_(t,"height",u,o)}function H_(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function nne(e){if(le(["quantile","threshold","log","symlog"],e))return"greedy"}function S3(e){const t=Ne(e)?ine(e):one(e);return e.component.legends=t,t}function ine(e){const{encoding:t}=e,n={};for(const i of[rn,...vD]){const r=Xe(t[i]);!r||!e.getScaleComponent(i)||i===sn&&U(r)&&r.type===Uo||(n[i]=ane(e,i))}return n}function rne(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 sne(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function ane(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,a=s.legend,o=new Wte({},rne(e,t));pte(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=U(c)?(x=tt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=Jte({legend:n,channel:t,timeUnit:f,scaleType:l}
16),g=Zte({legend:n,legendType:h,orient:d,legendConfig:a}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:a,config:s,scaleType:l,orient:d,legendType:h,direction:g};for(const E of x3){if(h==="gradient"&&E.startsWith("symbol")||h==="symbol"&&E.startsWith("gradient"))continue;const _=E in G_?G_[E](p):n[E];if(_!==void 0){const w=sne(_,E,n,e.fieldDef(t));(w||s.legend[E]===void 0)&&o.set(E,_,w)}}const m=(n==null?void 0:n.encoding)??{},y=o.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:o,legendType:h};for(const E of["labels","legend","title","symbols","gradient","entries"]){const _=b3(m[E]??{},e),w=E in W_?W_[E](_,v):_;w!==void 0&&!Ee(w)&&(b[E]={...y!=null&&y.length&&U(c)?{name:`${Te(c.field)}_legend_${E}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return Ee(b)||o.set("encode",b,!!(n!=null&&n.encoding)),o}function one(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){S3(i);for(const r of P(i.component.legends))n.legend[r]=Sx(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=A3(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of P(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function A3(e,t){var s,a,o,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of x3){const c=ss(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return une(f,d);case"title":return iR(f,d);case"type":return r=!0,ln("symbol")}return sg(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((a=(s=e.implicit)==null?void 0:s.encode)!=null&&a.gradient&&dd(e.implicit,["encode","gradient"]),(u=(o=e.explicit)==null?void 0:o.encode)!=null&&u.gradient&&dd(e.explicit,["encode","gradient"])),e}function une(e,t){return t.value==="circle"?t:e}function lne(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 k3(e){const t=e.component.legends,n={};for(const r of P(t)){const s=e.getScaleComponent(r),a=_e(s.get("domains"));if(n[a])for(const o of n[a])A3(o,t[r])||n[a].push(t[r]);else n[a]=[t[r].clone()]}return ft(n).flat().map(r=>cne(r,e.config)).filter(r=>r!==void 0)}function cne(e,t){var a,o,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(a=s.encode)!=null&&a.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of vD)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(o=s.encode)==null?void 0:o.labels)!=null&&u.update&&Z(s.encode.labels.update.text)&&(l=ea(i,"datum.label",s.encode.labels.update.text.signal)),lne(s,"labels","text",{signal:l})}return s}}function fne(e){return Vo(e)||Ox(e)?dne(e):C3(e)}function dne(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),C3(e))}function C3(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=Z(o)?o.signal:`data('${e.lookupDataSource(o)}')`;return le(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 hne=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class $3 extends wr{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=Ne(e)?gne(e):yne(e)}function gne(e){if(e.hasProjection){const t=st(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?pne(e):void 0,s=new $3(e.projectionName(!0),{...st(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function pne(e){const t=[],{encoding:n}=e;for(const i of[[pi,gi],[Pn,mi]])(Xe(n[i[0]])||Xe(n[i[1]]))&&t.pu
vendor: 8,328 bytes, line 16
16sh({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(sn)&&e.typedFieldDef(sn).type===Uo&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ie.Main)),t}function mne(e,t){const n=yv(hne,r=>!!(!K(e.explicit,r)&&!K(t.explicit,r)||K(e.explicit,r)&&K(t.explicit,r)&&mn(e.get(r),t.get(r))));if(mn(e.size,t.size)){if(n)return e;if(mn(e.explicit,{}))return t;if(mn(t.explicit,{}))return e}return null}function yne(e){if(e.children.length===0)return;let t;for(const i of e.children)F3(i);const n=yv(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=mne(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 $3(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 bne(e,t,n,i){if(ac(t,n)){const r=Ne(e)?e.axis(n)??e.legend(n)??{}:{},s=H(t,{expr:"datum"}),a=H(t,{expr:"datum",binSuffix:"end"});return{formulaAs:H(t,{binSuffix:"range",forAs:!0}),formula:nc(s,a,r.format,r.formatType,i)}}return{}}function O3(e,t){return`${YT(e)}_${t}`}function vne(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Ax(e,t,n){const i=Zh(n,void 0)??{},r=O3(i,t);return e.getName(`${r}_bins`)}function xne(e){return"as"in e}function V_(e,t,n){let i,r;xne(e)?i=Y(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[H(e,{forAs:!0}),H(e,{binSuffix:"end",forAs:!0})];const s={...Zh(t,void 0)},a=O3(s,e.field),{signal:o,extentSignal:u}=vne(n,a);if(Uh(s.extent)){const c=s.extent;r=u3(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 xe{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(Bt(s)&&Ce(s.bin)){const{key:o,binComponent:u}=V_(s,s.bin,n);r[o]={...u,...r[o],...bne(n,s,a,n.config)}}return r},{});return Ee(i)?null:new Fi(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=V_(n,n.bin,i);return new Fi(t,{[r]:s})}merge(t,n){for(const i of P(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],ce)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(ft(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ft(this.bins).map(t=>t.field))}hash(){return`Bin ${ce(this.bins)}`}assemble(){return ft(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...a}=t.bin,o={type:"bin",field:In(t.field),as:i,signal:t.signal,...Uh(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...a};!s&&t.extentSignal&&(n.push({type:"extent",field:In(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:H({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function wne(e,t,n,i){var s;const r=Ne(i)?i.encoding[Wi(t)]:void 0;if(Bt(n)&&Ne(i)&&qR(n,r,i.markDef,i.config)){e.add(H(n,{})),e.add(H(n,{suffix:"end"}));const{mark:a,markDef:o,config:u}=i,l=rs({fieldDef:n,markDef:o,config:u});cl(a)&&l!==.5&&Be(t)&&(e.add(H(n,{suffix:ag})),e.add(H(n,{suffix:og}))),n.bin&&ac(n,t)&&e.add(H(n,{binSuffix:"range"}))}else if(BT(t)){const a=zT(t);e.add(i.getName(a))}else e.add(H(n));return xa(n)&&cQ((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function Ene(e,t){for(const n of P(t)){const i=t[n];for(const r of P(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class ei extends xe{clone(){return new ei(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([H(a,{forAs:!0})]);else{if(fr(u)||ys(u)){const c=fr(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([H({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([H(a,{forAs:!0})]);Gi(o)&&n.scaleDomain(o)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([H({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([H({field:l,aggregate:"max"},{forAs:!0})]))}else wne(s,o,a,n)}),s.size+P(r).length===0)?null:new ei(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||H(a,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[o]??(i[o]=new Set),s[u][o].add(l||H(a,{forAs:!0}))))}for(const a of n.groupby??[])r.add(a);return r.size+P(s).length===0?null:new ei(t,r,s)}merge(t){return TT(this.dimensions,t.dimensions)?(Ene(this.measures,t.measures),!0):(MJ("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...P(this.measures)])}producedFields(){const t=new Set;for(const n of P(this.measures))for(const i of P(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 ${ce({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of P(this.measures))for(const a of P(this.measures[s]))for(const o of this.measures[s][a])i.push(o),t.push(a),n.push(s==="*"?null:In(s));return{type:"aggregate",groupby:[...this.dimensions].map(In),ops:t,fields:n,as:i}}}class Go extends xe{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of On){const a=n.facet[s];if(a){const{bin:o,sort:u}=a;this[s]={name:n.getName(`${s}_domain`),fields:[H(a),...Ce(o)?[H(a,{binSuffix:"end"})]:[]],...ar(u)?{sortField:u}:N(u)?{sortIndexField:Ao(a,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of On)this[n]&&(t+=` ${n.charAt(0)}:${ce(this[n])}`);return t}get fields(){var n;const t=[];for(const i of On)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of On)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 vr){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(nt(r)&&ya(s)){const a=dg(this.childModel,n),o=Fx(a);o?t[n]=o:B(Tv(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=Kh,field:f}=u;s.push(f),a.push(c),o.push(H(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){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of wx){for(const c of Ex){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row: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: 12,108 bytes, line 16
16for(const o of[sr,rr])this[o]&&t.push(this.assembleRowColumnHeaderData(o,n,i));if(a){const o=this.assembleFacetHeaderData(i);o&&t.push(...o)}return t}}function X_(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function _ne(e,t){const n=xv(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=X_(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=X_(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return B(WK(t)),null}function Sne(e){const t={};return vf(e.filter,n=>{if(xR(n)){let i=null;Mv(n)?i=gn(n.equal):Iv(n)?i=gn(n.lte):Lv(n)?i=gn(n.lt):Pv(n)?i=gn(n.gt):zv(n)?i=gn(n.gte):Bv(n)?i=n.range[0]:jv(n)&&(i=(n.oneOf??n.in)[0]),i&&(ba(i)?t[n.field]="date":pe(i)?t[n.field]="number":Y(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Ane(e){const t={};function n(i){wo(i)?t[i.field]="date":i.type==="quantitative"&&wK(i.aggregate)?t[i.field]="number":go(i.field)>1?i.field in t||(t[i.field]="flatten"):xa(i)&&ar(i.sort)&&go(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ne(e)||xn(e))&&e.forEachFieldDef((i,r)=>{if(Bt(i))n(i);else{const s=pa(r),a=e.fieldDef(s);n({...i,type:a.type})}}),Ne(e)){const{mark:i,markDef:r,encoding:s}=e;if(bs(i)&&!e.encoding.order){const a=r.orient==="horizontal"?"y":"x",o=s[a];U(o)&&o.type==="quantitative"&&!(o.field in t)&&(t[o.field]="number")}}return t}function kne(e){const t={};if(Ne(e)&&e.component.selection)for(const n of P(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&go(r.field)>1&&(t[r.field]="flatten")}return t}class Et extends xe{clone(){return new Et(null,ie(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${ce(this._parse)}`}static makeExplicit(t,n,i){var a;let r={};const s=n.data;return!Xr(s)&&((a=s==null?void 0:s.format)!=null&&a.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const o of P(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]:B(i_(o,i[o],u.value)))}for(const o of P(n)){const u=r.get(o);u!==void 0&&(u===n[o]?delete n[o]:B(i_(o,n[o],u)))}const s=new wr(n,i);r.copyAll(s);const a={};for(const o of P(s.combine())){const u=s.get(o);u!==null&&(a[o]=u)}return P(a).length===0||r.parseNothing?null:new Et(t,a)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of P(this._parse)){const i=this._parse[n];go(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(P(this._parse))}dependentFields(){return new Set(P(this._parse))}assembleTransforms(t=!1){return P(this._parse).filter(n=>t?go(n)>1:!0).map(n=>{const i=_ne(n,this._parse[n]);return i?{type:"formula",expr:i,as:Bo(n)}:null}).filter(n=>n!==null)}}class os extends xe{clone(){return new os(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([oi])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:oi}}}class lc extends xe{clone(){return new lc(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${ce(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class cc extends xe{clone(){return new cc(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 ${ce(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class ua extends xe{constructor(t){super(null),t??(t={name:"source"});let n;if(Xr(t)||(n=t.format?{...Jt(t.format,["parse"])}:{}),fl(t))this._data={values:t.values};else if(Eo(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];le(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else ID(t)?this._data={values:[{type:"Sphere"}]}:(MD(t)||Xr(t))&&(this._data={});this._generator=Xr(t),t.name&&(this._name=t.name),n&&!Ee(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 Y_=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},Cne=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)},Du;function kx(e){return e instanceof ua||e instanceof lc||e instanceof cc}class Cx{constructor(){Du.set(this,void 0),Y_(this,Du,!1,"f")}setModified(){Y_(this,Du,!0,"f")}get modifiedFlag(){return Cne(this,Du,"f")}}Du=new WeakMap;class wa extends Cx{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 $x extends Cx{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class $ne extends $x{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 P(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Fne extends $x{constructor(t){super(),this.requiresSelectionId=t&&xx(t)}run(t){t instanceof os&&(this.requiresSelectionId&&(kx(t.parent)||t.parent instanceof ei||t.parent instanceof Et)||(this.setModified(),t.remove()))}}class One extends Cx{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof $i&&(i=t.producedFields(),bv(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 Tne extends $x{constructor(){super()}run(t){t instanceof Qt&&!t.isRequired()&&(this.setModified(),t.remove())}}class Rne extends wa{run(t){if(!kx(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Et)if(t instanceof Et)this.setModified(),t.merge(n);else{if(vv(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Dne extends wa{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Et);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 P(o))u in r?r[u]!==o[u]&&s.add(u):r[u]=o[u]}for(const a of s)delete r[a];if(!Ee(r)){this.setModified();const a=new Et(t,r);for(const o of n){if(o instanceof Et)for(const u of P(r))delete o.parse[u];t.removeChild(o),o.parent=a,o instanceof Et&&P(o.parse).length===0&&o.remove()}}}}}class Nne extends wa{run(t){t instanceof Qt||t.numChildren()>0||t instanceof Go||t instanceof ua||(this.setModified(),t.remove())}}class Mne extends wa{run(t){const n=t.children.filter(r=>r instanceof $i),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Lne extends wa{run(t){const n=t.children.filter(r=>r instanceof ei),i={};for(const r of n){const s=ce(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of P(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 Ine extends wa{constructor(t){super(),this.model=t}run(t){const n=!(kx(t)||t instanceof Wo||t instanceof Et||t instanceof os),i=[],r=[];for(const s of t.children)s instanceof Fi&&(n&&!vv(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 Pne extends wa{run(t){const n=[...t.children];if(!ho(n,a=>a instanceof Qt)||t.numChildren()<=1)return;const r=[];let s;for(const a of n)if(a instanceof Qt){let o=a;for(;o.numChildren()===1;){const[u]=o.children;if(u instanceof Qt)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 Ea extends xe{clone(){return new Ea(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??H(t)}hash(){return`JoinAggregateTransform ${ce(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 Co extends xe{clone(){return new Co(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=Gi(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:g}=c,p=Xv({scaleChannel:f,markDef:s,config:r,scaleType:h,isCountAggregate:jh(g)});p!=="show"&&p!=="always-valid"&&(l[c.field]=c)}return l},{});return P(u).length?new Co(t,u):null}dependentFields(){return new Set(P(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${ce(this.filter)}`}assemble(){const t=P(this.filter).reduce((n,i)=>{const r=this.filter[i],s=H(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${R0(s)}))`):r.type==="quantitative"&&n.push(R0(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function R0(e){return`isValid(${e}) && isFinite(+${e})`}function zne(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=H(i);return r&&t.push(r),t},[])}function Bne(e){return N(e)&&e.every(t=>Y(t))&&e.length>1}class ur extends xe{clone(){return new ur(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=[];if(n.sort!==void 0)for(const f of n.sort)o.push(f.field),u.push(ze(f.order,"ascending"));const l={field:o,order:u};let c;return Bne(s)?c=s:Y(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new ur(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(h=>{const g=r[h];return ai(g)}).filter(h=>!!h),c=zne(n),f=n.encoding.order;let d;if(N(f)||U(f))d=eR(f);
vendor: 20,048 bytes, line 16
16else{const h=WR(f)?f.sort:a==="y"?"descending":"ascending";d=c.reduce((g,p)=>(g.field.includes(p)||(g.field.push(p),g.order.push(h)),g),{field:[],order:[]})}return new ur(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 ${ce(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[H(r,{binSuffix:"mid"})]:[H(r,{}),H(r,{binSuffix:"end"})]:[H(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 h=H(c,{expr:"datum"}),g=H(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${R0(h)} ? ${f}*${h}+${1-f}*${g} : ${h}`,as:H(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:H(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 Ho extends xe{clone(){return new Ho(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??H(t)}hash(){return`WindowTransform ${ce(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=>Fv(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 jne(e){function t(n){if(!(n instanceof Go)){const i=n.clone();if(i instanceof Qt){const r=N0+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof ei||i instanceof ur||i instanceof Ho||i instanceof Ea)&&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 D0(e){if(e instanceof Go)if(e.numChildren()===1&&!(e.children[0]instanceof Qt)){const t=e.children[0];(t instanceof ei||t instanceof ur||t instanceof Ho||t instanceof Ea)&&t.addDimensions(e.fields),t.swapWithParent(),D0(e)}else{const t=e.model.component.data.main;T3(t);const n=jne(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(D0)}function T3(e){if(e instanceof Qt&&e.type===Ie.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Go||(t.swapWithParent(),T3(e))}}const N0="scale_",Pc=5;function M0(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!M0(t.children))return!1}return!0}function Un(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function K_(e,t,n){let i=e.sources,r=!1;return r=Un(new Tne,i)||r,r=Un(new Fne(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Un(new Nne,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Un(new Rne,i)||r,r=Un(new Ine(t),i)||r,r=Un(new One,i)||r,r=Un(new Dne,i)||r,r=Un(new Lne,i)||r,r=Un(new Mne,i)||r,r=Un(new $ne,i)||r,r=Un(new Pne,i)||r),e.sources=i,r}function Une(e,t){M0(e.sources);let n=0,i=0;for(let r=0;r<Pc&&K_(e,t,!0);r++)n++;e.sources.map(D0);for(let r=0;r<Pc&&K_(e,t,!1);r++)i++;M0(e.sources),Math.max(n,i)===Pc&&B(`Maximum optimization runs(${Pc}) reached.`)}class Je{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new Je(()=>t(n))}}function R3(e){Ne(e)?qne(e):Wne(e)}function qne(e){const t=e.component.scales;for(const n of P(t)){const i=Hne(e,n);if(t[n].setWithExplicit("domains",i),Xne(e,n),e.component.data.isFaceted){let s=e;for(;!xn(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const o of i.value)nr(o)&&(o.data=N0+o.data.replace(N0,""))}}}function Wne(e){for(const n of e.children)R3(n);const t=e.component.scales;for(const n of P(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=ss(i,a.getWithExplicit("domains"),"domains","scale",L0);const o=a.get("selectionExtent");r&&o&&r.param!==o.param&&B(BK),r=o}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Gne(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=J_(t,n);if(!r){B(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=J_(t,n);if(r)return"unaggregated"}return e}function Hne(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Gne(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)?ss(Ar(n,r,e,"x"),Ar(n,r,e,"x2"),"domain","scale",L0):Ar(n,r,e,"x2"):t==="y"&&Xe(i.y2)?Xe(i.y)?ss(Ar(n,r,e,"y"),Ar(n,r,e,"y2"),"domain","scale",L0):Ar(n,r,e,"y2"):Ar(n,r,e,t)}function Vne(e,t,n){return e.map(i=>({signal:`{data: ${eg(i,{timeUnit:n,type:t})}}`}))}function $p(e,t,n){var r;const i=(r=tt(n))==null?void 0:r.unit;return t==="temporal"||i?Vne(e,t,i):[e]}function Ar(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=jee({invalid:Ni("invalid",s,o),isPath:bs(a)});if(lQ(t)){const p=Ar(e,void 0,n,i),m=$p(t.unionWith,c,f);return Ei([...m,...p.value])}else{if(Z(t))return Ei([t]);if(t&&t!=="unaggregated"&&!CR(t))return Ei($p(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return ln([[0,1]]);const p=n.requestDataName(d);return ln([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const h=Gi(i)&&U(l)?Yne(n,i,e):void 0;if(Hi(l)){const p=$p([l.datum],c,f);return ln(p)}const g=l;if(t==="unaggregated"){const{field:p}=l;return ln([{data:n.requestDataName(d),field:H({field:p,aggregate:"min"})},{data:n.requestDataName(d),field:H({field:p,aggregate:"max"})}])}else if(Ce(g.bin)){if(nt(e))return ln(e==="bin-ordinal"?[]:[{data:ul(h)?n.requestDataName(d):n.requestDataName(Ie.Raw),field:n.vgField(i,ac(g,i)?{binSuffix:"range"}:{}),sort:h===!0||!V(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:p}=g;if(Ce(p)){const m=Ax(n,g.field,p);return ln([new Je(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return ln([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&le(["time","utc"],e)){const p=r[Wi(i)];if(qR(g,p,s,o)){const m=n.requestDataName(d),y=rs({fieldDef:g,fieldDef2:p,markDef:s,config:o}),b=cl(a)&&y!==.5&&Be(i);return ln([{data:m,field:n.vgField(i,b?{suffix:ag}:{})},{data:m,field:n.vgField(i,{suffix:b?og:"end"})}])}}return ln(h?[{data:ul(h)?n.requestDataName(d):n.requestDataName(Ie.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function Fp(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Kh),...i?{field:In(i)}:{},...r?{order:r}:{}}}function Xne(e,t){var o;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(o=e.fieldDef(t))==null?void 0:o.bin,s=CR(i)?i:void 0,a=ma(r)&&Uh(r.extent)?r.extent:void 0;(s||a)&&n.set("selectionExtent",s??a,!0)}function Yne(e,t,n){if(!nt(n))return;const i=e.fieldDef(t),r=i.sort;if(jR(r))return{op:"min",field:Ao(i,t),order:"ascending"};const{stack:s}=e,a=s?new Set([...s.groupbyFields,...s.stackBy.map(o=>o.fieldDef.field)]):void 0;if(ar(r)){const o=s&&!a.has(r.field);return Fp(r,o)}else if(jQ(r)){const{encoding:o,order:u}=r,l=e.fieldDef(o),{aggregate:c,field:f}=l,d=s&&!a.has(f);if(fr(c)||ys(c))return Fp({field:H(l),order:u},d);if(Fv(c)||!c)return Fp({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(le(["ascending",void 0],r))return!0}}function J_(e,t){const{aggregate:n,type:i}=e;return n?Y(n)&&!_K.has(n)?{valid:!1,reason:dJ(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:hJ(e)}:{valid:!0}:{valid:!1,reason:fJ(e)}}function L0(e,t,n,i){return e.explicit&&t.explicit&&B(bJ(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Kne(e){const t=Ai(e.map(a=>{if(nr(a)){const{sort:o,...u}=a;return u}return a}),ce),n=Ai(e.map(a=>{if(nr(a)){const o=a.sort;return o!==void 0&&!ul(o)&&("op"in o&&o.op==="count"&&delete o.field,o.order==="ascending"&&delete o.order),o}}).filter(a=>a!==void 0),ce);if(t.length===0)return;if(t.length===1){const a=e[0];if(nr(a)&&n.length>0){let o=n[0];if(n.length>1){B(s_);const u=n.filter(l=>V(l)&&"op"in l&&l.op!=="min");n.every(l=>V(l)&&"op"in l)&&u.length===1?o=u[0]:o=!0}else if(V(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=>ul(a)||!("op"in a)||Y(a.op)&&K(vK,a.op)?a:(B(xJ(a)),!0)),ce);let r;i.length===1?r=i[0]:i.length>1&&(B(s_),r=!0);const s=Ai(e.map(a=>nr(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 Fx(e){if(nr(e)&&Y(e.field))return e.field;if(SK(e)){let t;for(const n of e.fields)if(nr(n)&&Y(n.field)){if(!t)t=n.field;else if(t!==n.field)return B(wJ),t}return B(EJ),t}else if(AK(e)){B(_J);const t=e.fields[0];return Y(t)?t:void 0}}function dg(e,t){const i=e.component.scales[t].get("domains").map(r=>(nr(r)&&(r.data=e.lookupDataSource(r.data)),r));return Kne(i)}function D3(e){return Vo(e)||Ox(e)?e.children.reduce((t,n)=>t.concat(D3(n)),Q_(e)):Q_(e)}function Q_(e){return P(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=Jne(r.range,s,n,e),h=dg(e,n),g=o?Vee(e,o,i,h):null;return t.push({name:s,type:a,...h?{domain:h}:{},...g?{domainRaw:g}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function Jne(e,t,n,i){if(Be(n)){if(ya(e))return{step:{signal:`${t}_step`}}}else if(V(e)&&nr(e))return{...e,data:i.lookupDataSource(e.data)};return e}class N3 extends wr{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(le([ot.LOG,ot.TIME,ot.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&le([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(N(o)){const u=o[0],l=o[o.length-1];if(pe(u)&&pe(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 Qne=["range","scheme"];function Zne(e){const t=e.component.scales;for(const n of $v){const i=t[n];if(!i)continue;const r=eie(n,e);i.setWithExplicit("range",r)}}function Z_(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=an(t),a=e.getName(s);if(V(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(Ce(i)){const o=Ax(e,r,i);return new Je(()=>{const u=e.getSignalName(o),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(a)} / (${l})`})}}}function eie(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of Qne)if(n[f]!==void 0){const d=b0(s,f),h=$R(e,f);if(!d)B(oR(s,f,e));else if(h)B(h);else switch(f){case"range":{const g=n.range;if(N(g)){if(Be(e))return Ei(g.map(p=>{if(p==="width"||p==="height"){const m=t.getName(p),y=t.getSignalName.bind(t);return Je.fromName(y,m)}return p}))}else if(V(g))return Ei({data:t.requestDataName(Ie.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return Ei(g)}case"scheme":return Ei(tie(n[f]))}}const a=e===Re||e==="xOffset"?"width":"height",o=i[a];if(Li(o)){if(Be(e))if(nt(s)){const f=L3(o,t,e);if(f)return Ei({step:f})}else B(uR(a));else if(Zl(e)){const f=e===ds?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=I3(o,s);if(g)return Ei(g)}}}const{rangeMin:u,rangeMax:l}=n,c=nie(e,t);return(u!==void 0||l!==void 0)&&b0(s,"rangeMin")&&N(c)&&c.length===2?Ei([u??c[0],l??c[1]]):ln(c)}function tie(e){return uQ(e)?{scheme:e.name,...Jt(e,["name"])}:{scheme:e}}function M3(e,t,n,{center:i}={}){const r=an(e),s=t.getName(r),a=t.getSignalName.bind(t);return e===it&&ri(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 nie(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 Re:case it:{if(le(["point","band"],u)){const f=P3(e,n,i.view);if(Li(f))return{step:L3(f,t,e)}}return M3(e,t,u)}case ds:case jo:return iie(e,t,u);case yr:{const f=aie(r,i),d=oie(r,n,t,i);return bo(u)?sie(f,d,rie(u,i,l,e)):[f,d]}case Bn:return[0,Math.PI*2];case ga:return[0,360];case hi:return[0,new Je(()=>{const f=t.getSignalName(xn(t.parent)?"child_width":"width"),d=t.getSignalName(xn(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case ps:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case ms:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case sn:return"symbol";case rn:case Ui:case qi:return u==="ordinal"?a==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case br:case hs:case gs:return[i.scale.minOpacity,i.scale.maxOpacity]}}function L3(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Sv(n),a=i[s];if(wD({step:e,offsetIsDiscrete:re(a)&&ER(a.type)})==="offset"&&tD(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,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${FK(f)})`}}else return e.step}function I3(e,t){if(wD({step:e,offsetIsDiscrete:nt(t)})==="offset")return{step:e.step}}function iie(e,t,n){const i=e===ds?"x":"y",r=t.getScaleComponent(i);if(!r)return M3(i,t,n,{center:!0});const s=r.get("type"),a=t.scaleName(i),{markDef:o,config:u}=t;if(s==="band"){const l=P3(i,t.size,t.config.view);if(Li(l)){const c=I3(l,n);if(c)return c}return[0,{signal:`bandwidth('${a}')`}]}else{const l=t.encoding[i];if(U(l)&&l.timeUnit){const c=bR(l.timeUnit,g=>`scale('${a}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=rs({fieldDef:l,markDef:o,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const g=Z(f)?`${f.signal}/2`+h:`${f/2+d}`,p=Z(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${g} * (${c})`},{signal:`${p} * (${c})`}]}return[0,{signal:c}]}return FT(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function P3(e,t,n){const i=e===Re?"width":"height",r=t[i];return r||wd(n,i)}function rie(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&N(n)?n.length+1:(B(RJ(i)),3)}}function sie(e,t,n){const i=()=>{const r=Jn(t),s=Jn(e),a=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${a}, ${a})`};return Z(t)?new Je(i):{signal:i()}}function aie(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(qh("size",e))}const eS=.95;function oie(e,t,n,i){const r={x:Z_(n,"x"),y:Z_(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=tS(t,r,i.view);return pe(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=tS(t,r,i.view);return pe(s)?Math.pow(eS*s,2):new Je(()=>`pow(${eS} * ${s.signal}, 2)`)}}throw new Error(qh("size",e))}function tS(e,t,n){const i=Li(e.width)?e.width.step:E0(n,"width"),r=Li(e.height)?e.height.step:E0(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 z3(e,t){Ne(e)?uie(e,t):j3(e,t)}function uie(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:a}=e;for(const o of P(n)){const u=a[o],l=n[o],c=e.getScaleComponent(o),f=Xe(r[o]),d=u[t],h=c.get("type"),g=c.get("padding"),p=c.get("paddingInner"),m=b0(h,t),y=$R(o,t);if(d!==void 0&&(m?y&&B(y):B(oR(h,t,o))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ba(u[t])||v==="temporal"||b?l.set(t,{signal:eg(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=z(nS,t)?nS[t]({model:e,channel:o,fieldOrDatumDef:f,scaleType:h,scalePadding:g,scalePaddingInner:p,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:nD(r,o),hasSecondaryRangeChannel:!!r[Wi(o)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const nS={bins:({model:e,fieldOrDatumDef:t})=>U(t)?lie(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>cie(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>fie(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>die(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>hie(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>gie(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=U(e)?e.sort:void 0;return pie(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:a})=>mie(e,t,n,i,r,s.scale,a)};function B3(e){Ne(e)?Zne(e):j3(e,"range")}function j3(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?B3(i):z3(i,t);for(const i of P(n)){let r;for(const s of e.children){const a=s.component.scales[i];if(a){const o=a.getWithExplicit(t);r=ss(r,o,t,"scale",ND((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function lie(e,t){const n=t.bin;if(Ce(n)){const i=Ax(e,t.field,n);return new Je(()=>e.getSignalName(i))}else if(rt(n)&&ma(n)&&n.step!==void 0)return{step:n.step}}function cie(e,t){if(le([rn,Ui,qi],e)&&t!=="nominal")return"hcl"}function fie(e,t,n,i,r,s){var a;if(!((a=ai(s))!=null&&a.bin||N(n)||r!=null||i!=null||le([ot.TIME,ot.UTC],e)))return Be(t)?!0:void 0}function die(e,t,n,i,r,s){if(Be(e)){if(ki(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:a,orient:o}=r;if(a==="bar"&&!(U(i)&&(i.bin||i.timeUnit))&&(o==="vertical"&&e==="x"||o==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ot.POINT)return n.pointPadding}}function hie(e,t,n,i,r,s=!1){if(e===void 0){if(Be(t)){const{bandPaddingInner:a,barBandPaddingInner:o,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:ze(a,n==="bar"?o:n==="tick"?l:u)}
16else if(Zl(t)&&i===ot.BAND)return r.offsetBandPaddingInner}}function gie(e,t,n,i,r,s=!1){if(e===void 0){if(Be(t)){const{bandPaddingOuter:a,bandWithNestedOffsetPaddingOuter:o}=r;if(s)return o;if(n===ot.BAND)return ze(a,Z(i)?{signal:`${i.signal}/2`}:i/2)}else if(Zl(t)){if(n===ot.POINT)return .5;if(n===ot.BAND)return r.offsetBandPaddingOuter}}}function pie(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return ri(e)&&t==="descending"?Z(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(ri(e)&&t==="descending")return!0}function mie(e,t,n,i,r,s,a){if(!!n&&n!=="unaggregated"&&ri(r)){if(N(n)){const u=n[0],l=n[n.length-1];if(pe(u)&&u<=0&&pe(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!bo(r))return!0;if(!(U(t)&&t.bin)&&le([...vr,...fK],e)){const{orient:u,type:l}=i;return le(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:le(["bar","area"],l)&&!a?!0:s==null?void 0:s.zero}return!1}function yie(e,t,n,i,r=!1){const s=bie(t,n,i,r),{type:a}=e;return Gi(t)?a!==void 0?pQ(t,a)?U(n)&&!gQ(a,n.type)?(B(mJ(a,s)),s):a:(B(pJ(t,a,s)),s):s:null}function bie(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Ya(e)||vp(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&B(xp(e,"ordinal")),"ordinal";if(Be(e)||Zl(e)){if(le(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in Cv)return"band";const s=n[an(e)];return ra(s)||xo(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Ya(e)?"time":vp(e)==="discrete"?(B(xp(e,"temporal")),"ordinal"):U(t)&&t.timeUnit&&tt(t.timeUnit).utc?"utc":"time";case"quantitative":return Ya(e)?U(t)&&Ce(t.bin)?"bin-ordinal":"linear":vp(e)==="discrete"?(B(xp(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(sR(t.type))}function vie(e,{ignoreRange:t}={}){U3(e),R3(e);for(const n of hQ)z3(e,n);t||B3(e)}function U3(e){Ne(e)?e.component.scales=xie(e):e.component.scales=Eie(e)}function xie(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of $v){const a=Xe(t[s]);if(a&&n===TR&&s===sn&&a.type===Uo)continue;let o=a&&a.scale;if(a&&o!==null&&o!==!1){o??(o={});const u=nD(t,s),l=yie(o,s,a,i,u);r[s]=new N3(e.scaleName(`${s}`,!0),{value:l,explicit:o.type===l})}}return r}const wie=ND((e,t)=>o_(e)-o_(t));function Eie(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){U3(s);for(const a of P(s.component.scales))if((t=r.scale)[a]??(t[a]=v3(a,e)),r.scale[a]==="shared"){const o=i[a],u=s.component.scales[a].getWithExplicit("type");o?iQ(o.value,u.value)?i[a]=ss(o,u,"type","scale",wie):(r.scale[a]="independent",delete i[a]):i[a]=u}}for(const s of P(i)){const a=e.scaleName(s,!0),o=i[s];n[s]=new N3(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 Op{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 Ne(e){return(e==null?void 0:e.type)==="unit"}function xn(e){return(e==null?void 0:e.type)==="facet"}function Ox(e){return(e==null?void 0:e.type)==="concat"}function Vo(e){return(e==null?void 0:e.type)==="layer"}class Tx{constructor(t,n,i,r,s,a,o){this.type=n,this.parent=i,this.config=s,this.correctDataNames=u=>{var l,c,f;return(l=u.from)!=null&&l.data&&(u.from.data=this.lookupDataSource(u.from.data)),(f=(c=u.from)==null?void 0:c.facet)!=null&&f.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u},this.parent=i,this.config=s,this.view=st(o),this.name=t.name??r,this.title=Or(t.title)?{text:t.title}:t.title?st(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Op,this.projectionNameMap=i?i.projectionNameMap:new Op,this.signalNameMap=i?i.signalNameMap:new Op,this.data=t.data,this.description=t.description,this.transforms=Fee(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:DZ(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:Jh(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new wr,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?ie(a):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}
vendor: 22,423 bytes, line 16
16get 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(){vie(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(){S3(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of P(i)){const a=i[s];a!==void 0&&(r[s]=Fe(a))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Fe(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ee(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=Ute(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 On)t[i].title&&n.push(Lte(this,i));for(const i of wx)n=n.concat(Ite(this,i));return n}assembleAxes(){return _te(this.component.axes,this.config)}assembleLegends(){return k3(this)}assembleProjections(){return fne(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...KT(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return le(["unit","layer"],this.type)?le(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Ee(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||xn(this.parent)?D3(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 Te((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ie[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(xn(this.parent)){const n=y3(t),i=Bh(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),a=r.get("range");if(nt(s)&&ya(a)){const o=r.get("name"),u=dg(this,i),l=Fx(u);if(l){const c=H({aggregate:"distinct",field:l},{expr:"datum"});return{signal:m3(o,r,c)}}else return B(Tv(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(UT(t)&&Gi(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(NK(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class q3 extends Tx{vgField(t,n={}){const i=this.fieldDef(t);if(i)return H(i,n)}reduceFieldDef(t,n){return uZ(this.getMapping(),(i,r,s)=>{const a=ai(r);return a?t(i,a,s):i},n)}forEachFieldDef(t,n){ix(this.getMapping(),(i,r)=>{const s=ai(i);s&&t(s,r)},n)}}class hg extends xe{clone(){return new hg(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 ${ce(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class gg extends xe{clone(){return new gg(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 ${ce(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class pg extends xe{clone(){return new pg(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 ${ce(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class mg extends xe{clone(){return new mg(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 ${ce(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Qa extends xe{clone(){return new Qa(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[[pi,gi],[Pn,mi]]){const s=r.map(a=>{const o=Xe(n.encoding[a]);return U(o)?o.field:Hi(o)?{expr:`${o.datum}`}:si(o)?{expr:`${o.value}`}:void 0});(s[0]||s[1])&&(t=new Qa(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(sn)){const r=n.typedFieldDef(sn);r.type===Uo&&(t=new Qa(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(Y);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${ce(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 dl extends xe{clone(){return new dl(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[[pi,gi],[Pn,mi]]){const r=i.map(a=>{const o=Xe(n.encoding[a]);return U(o)?o.field:Hi(o)?{expr:`${o.datum}`}:si(o)?{expr:`${o.value}`}:void 0}),s=i[0]===Pn?"2":"";(r[0]||r[1])&&(t=new dl(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(Y))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${ce(this.fields)} ${ce(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Gs extends xe{clone(){return new Gs(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 Gs(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(U(r)&&U(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=sD(n.mark,i);return new Gs(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 ${ce(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:cee(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 yg extends xe{clone(){return new yg(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 ${ce(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class hl extends xe{clone(){return new hl(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(fee(a)){let u=H3(a.data,s);u||(u=new ua(a.data),s.push(u));const l=n.getName(`lookup_${r}`);o=new Qt(u,l,Ie.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=o}else if(dee(a)){const u=a.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Te(u),u)}catch{throw new Error(PK(u))}if(o=l.materialized,!o)throw new Error(zK(u))}return new hl(t,i,o.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?X(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${ce({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:X(this.transform.as)}:{}};else{let n=this.transform.as;Y(n)||(B(VK),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 bg extends xe{clone(){return new bg(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 ${ce(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class vg extends xe{clone(){return new vg(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 ${ce(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class xg extends xe{clone(){return new xg(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 ${ce(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 wg extends xe{clone(){return new wg(null,ie(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${ce(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function W3(e){let t=0;function n(i,r){if(i instanceof ua&&!i.isGenerator&&!Eo(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Et&&(i.parent instanceof ua&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Go){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 lc||i instanceof cc||i instanceof Co||i instanceof Wo||i instanceof So||i instanceof dl||i instanceof ei||i instanceof hl||i instanceof Ho||i instanceof Ea||i instanceof mg||i instanceof pg||i instanceof hg||i instanceof yg||i instanceof bg||i instanceof vg||i instanceof os||i instanceof wg||i instanceof xg||i instanceof gg)&&r.transform.push(i.assemble()),(i instanceof Fi||i instanceof $i||i instanceof Gs||i instanceof ur||i instanceof Qa)&&r.transform.push(...i.assemble()),i instanceof Qt&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Qt?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 Qt&&(!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 _ie(e){const t=[],n=W3(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Sie(e,t){const n=[],i=W3(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 Aie(e){return e==="top"||e==="left"||Z(e)?"header":"footer"}function kie(e){for(const t of On)Cie(e,t);iS(e,"x"),iS(e,"y")}function Cie(e,t){var a;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const o=n[t],u=ko("title",null,i,t);let l=Ka(o,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=N(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=ko("labelOrient",o.header,i,t),f=o.header!==null?ze((a=o.header)==null?void 0:a.labels,i.header.labels,!0):!1,d=le(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:o.header!==null?l:null,facetFieldDef:o,[d]:t==="facet"?[]:[G3(e,t,f)]}}}function G3(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 iS(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Sx(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=Aie(o.get("orient"));a[u]??(a[u]=[G3(e,s,!1)]);const l=Ru(o,"main",e.config,{header:!0});l&&a[u][0].axes.push(l),o.mainExtracted=!0}}}}function $ie(e){Rx(e),Ad(e,"width"),Ad(e,"height")}function Fie(e){Rx(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Ad(e,t),Ad(e,n)}function Rx(e){for(const t of e.children)t.parseLayoutSize()}function Ad(e,t){const n=y3(t),i=Bh(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]??v3(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=ss(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 Oie(e){const{size:t,component:n}=e;for(const i of vr){const r=an(i);if(t[r]){const s=t[r];n.layoutSize.set(r,Li(s)?"step":s,!0)}else{const s=Tie(e,r);n.layoutSize.set(r,s,!1)}}}function Tie(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(nt(s)){const o=wd(i.view,t);return ya(a)||Li(o)?"step":o}else return w0(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return w0(i.view,t);{const s=wd(i.view,t);return Li(s)?s.step:s}}}function I0(e,t,n){return H(t,{suffix:`by_${H(e)}`,...n})}class Gu extends q3{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=Ix(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ic(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=P(t),i={};for(const r of n){if(![rr,sr].includes(r)){B(qh(r,"facet"));break}const s=t[r];if(s.field===void 0){B(m0(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=nx(t,n);return i.header?i.header=st(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return z(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Eg(this),this.child.parseData()}parseLayoutSize(){Rx(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),kie(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 On)for(const i of Ex){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:a}=r;if(a){const o=ko("titleOrient",a.header,this.config,n);if(["right","bottom"].includes(o)){const u=cg(n,o);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&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 Gu))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Gu?{...this.channelHasField("column")?{encode:{update:{columns:{field:H(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof Gu){if(this.child.channelHasField("column")){const r=H(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of vr){const s=this.child.component.scales[r];if(s&&!s.merged){const a=s.get("type"),o=s.get("range");if(nt(a)&&ya(o)){const u=dg(this.child,r),l=Fx(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):B(Tv(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 On){const f=this.facet[c];if(f){u.push(H(f));const{bin:d,sort:h}=f;if(Ce(d)&&u.push(H(f,{binSuffix:"end"})),ar(h)){const{field:g,op:p=Kh}=h,m=I0(f,h);i&&r?(s.push(m),a.push("max"),o.push(m)):(s.push(g),a.push(p),o.push(m))}else if(N(h)){const g=Ao(f,c);s.push(g),a.push("max"),o.push(g)}}}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?ar(i.sort)?[I0(i,i.sort,{expr:"datum"})]:N(i.sort)?[Ao(i,t,{expr:"datum"})]:[H(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(ar(r)?r.order:!N(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return O0(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of wx)if(t[s]){const a=ko("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(a))return O0(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=_ie(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:On.map(u=>
16this.facetSortFields(u)).flat(),order:On.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(qee(this,[]))}]}getMapping(){return this.facet}}function Rie(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(ar(s.sort)){const{field:a,op:o=Kh}=s.sort;e=r=new Ea(e,{joinaggregate:[{op:o,field:a,as:I0(s,s.sort,{forAs:!0})}],groupby:[H(s)]})}return r}return null}function H3(e,t){var n,i,r,s;for(const a of t){const o=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=o.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=o.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(fl(e)&&fl(o)){if(mn(e.values,o.values))return a}else if(Eo(e)&&Eo(o)){if(e.url===o.url)return a}else if(MD(e)&&e.name===a.dataName)return a}}return null}function Die(e,t){if(e.data||!e.parent){if(e.data===null){const i=new ua({values:[]});return t.push(i),i}const n=H3(e.data,t);if(n)return Xr(e.data)||(n.data.format=OT({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new ua(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 Nie(e,t,n){let i=0;for(const r of t.transforms){let s,a;if(Eee(r))a=e=new So(e,r),s="derived";else if(gx(r)){const o=Sne(r);a=e=Et.makeWithAncestors(e,{},o,n)??e,e=new Wo(e,t,r.filter)}else if(OD(r))a=e=Fi.makeFromTransform(e,r,t),s="number";else if(See(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new Et(e,{[r.field]:s}),n.set(r.field,s,!1)),a=e=$i.makeFromTransform(e,r);else if(Aee(r))a=e=ei.makeFromTransform(e,r),s="number",xx(t)&&(e=new os(e));else if(FD(r))a=e=hl.make(e,t,r,i++),s="derived";else if(vee(r))a=e=new Ho(e,r),s="number";else if(xee(r))a=e=new Ea(e,r),s="number";else if(kee(r))a=e=ur.makeFromTransform(e,r),s="derived";else if(Cee(r))a=e=new mg(e,r),s="derived";else if($ee(r))a=e=new gg(e,r),s="derived";else if(wee(r))a=e=new pg(e,r),s="derived";else if(hee(r))a=e=new xg(e,r),s="derived";else if(bee(r))e=new wg(e,r);else if(_ee(r))a=e=Gs.makeFromTransform(e,r),s="derived";else if(gee(r))a=e=new hg(e,r),s="derived";else if(pee(r))a=e=new bg(e,r),s="derived";else if(mee(r))a=e=new vg(e,r),s="derived";else if(yee(r))a=e=new yg(e,r),s="derived";else{B(HK(r));continue}if(a&&s!==void 0)for(const o of a.producedFields()??[])n.set(o,s,!1)}return e}function Eg(e){var m;let t=Die(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,a=!(r&&(Xr(r)||Eo(r)||fl(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Bee;Xr(r)?(LD(r)?t=new cc(t,r.sequence):px(r)&&(t=new lc(t,r.graticule)),a.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(a.parseNothing=!0),t=Et.makeExplicit(t,e,a)??t,t=new os(t);const o=e.parent&&Vo(e.parent);(Ne(e)||xn(e))&&o&&(t=Fi.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Nie(t,e,a));const u=kne(e),l=Ane(e);t=Et.makeWithAncestors(t,{},{...u,...l},a)??t,Ne(e)&&(t=Qa.parseAll(t,e),t=dl.parseAll(t,e)),(Ne(e)||xn(e))&&(o||(t=Fi.makeFromEncoding(t,e)??t),t=$i.makeFromEncoding(t,e)??t,t=So.parseAllForSortIndex(t,e));const c=t=zc(Ie.Raw,e,t);if(Ne(e)){const y=ei.makeFromEncoding(t,e);y&&(t=y,xx(e)&&(t=new os(t))),t=Gs.makeFromEncoding(t,e)??t,t=ur.makeFromEncoding(t,e)??t}let f,d;if(Ne(e)){const{markDef:y,mark:b,config:v}=e,x=we("invalid",y,v),{marks:E,scales:_}=d=PD({invalid:x,isPath:bs(b)});E!==_&&_==="include-invalid-values"&&(f=t=zc(Ie.PreFilterInvalid,e,t)),E==="exclude-invalid-values"&&(t=Co.make(t,e,d)??t)}const h=t=zc(Ie.Main,e,t);let g;if(Ne(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Co.make(t,e,d)??t,g=t=zc(Ie.PostFilterInvalid,e,t))}Ne(e)&&wte(e,h);let p=null;if(xn(e)){const y=e.getName("facet");t=Rie(t,e.facet)??t,p=new Go(t,e,y,h.getSource()),n[y]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:p,ancestorParse:a,preFilterInvalid:f,postFilterInvalid:g}}
vendor: 4,986 bytes, line 16
16function zc(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),a=new Qt(n,s,e,r);return i[s]=a,a}class Mie extends Tx{constructor(t,n,i,r){var s,a,o,u;super(t,"concat",n,i,r,t.resolve),(((a=(s=t.resolve)==null?void 0:s.axis)==null?void 0:a.x)==="shared"||((u=(o=t.resolve)==null?void 0:o.axis)==null?void 0:u.y)==="shared")&&B(qK),this.children=this.getChildren(t).map((l,c)=>Ix(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=Eg(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 P(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return ig(t)?t.vconcat:dx(t)?t.hconcat:t.concat}parseLayoutSize(){Fie(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=_x(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 Lie(e){return e===!1||e===null}const Iie={disable:1,gridScale:1,scale:1,...ZR,labelExpr:1,encode:1},V3=P(Iie);class Dx extends wr{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Dx(ie(this.explicit),ie(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Lie(this.get(t))}hasOrientSignalRef(){return Z(this.explicit.orient)}}function Pie(e,t,n){const{encoding:i,config:r}=e,s=Xe(i[t])??Xe(i[Wi(t)]),a=e.axis(t)||{},{format:o,formatType:u}=a;if(sa(u))return{text:Qn({fieldOrDatumDef:s,field:"datum.value",format:o,formatType:u,config:r}),...n};if(o===void 0&&u===void 0&&r.customFormatTypes){if(vo(s)==="quantitative"){if(xo(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Qn({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Qn({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(vo(s)==="temporal"&&r.timeFormatType&&U(s)&&!s.timeUnit)return{text:Qn({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function zie(e){return vr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Hie(n,e)]),t),{})}const Bie={bottom:"top",top:"bottom",left:"right",right:"left"};function jie(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 P(r.component.axes))n.axis[s]=Sx(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=Uie(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of vr){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(!Z(o)){if(i[o]>0&&!u){const l=Bie[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 Uie(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]=qie(r,s)}}}else return t.map(n=>n.clone());return e}function qie(e,t){for(const n of V3){const i=ss(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return iR(r,s);case"gridScale":return{explicit:r.explicit,value:ze(r.value,s.value)}}return sg(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function Wie(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Z(n.labelAngle)?n.labelAngle:ll(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===d3(i,r))return!0}return e===n[t]}const Gie=new Set(["grid","translate","format","formatType","orient","labelExpr","t
16ickCount","position","tickMinStep"]);function Hie(e,t){var y,b;let n=t.axis(e);const i=new Dx,r=Xe(t.encoding[e]),{mark:s,config:a}=t,o=(n==null?void 0:n.orient)||((y=a[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=a.axis)==null?void 0:b.orient)||Tte(e),u=t.getScaleComponent(e).get("type"),l=Ste(e,u,o,t.config),c=n!==void 0?!n:$0("disable",a.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=$te(r,n,e,a.style,l),d=zR(n.formatType,r,u),h=PR(r,r.type,n.format,n.formatType,a,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:o,labelAngle:f,format:h,formatType:d,mark:s,config:a};for(const v of V3){const x=v in U_?U_[v](g):g_(v)?n[v]:void 0,E=x!==void 0,_=Wie(x,v,n,t,e);if(E&&_)i.set(v,x,_);else{const{configValue:w=void 0,configFrom:S=void 0}=g_(v)&&v!=="values"?$0(v,a.style,n.style,l):{},A=w!==void 0;E&&!A?i.set(v,x,_):(S!=="vgAxisConfig"||Gie.has(v)&&A||oc(w)||Z(w))&&i.set(v,w,!1)}}const p=n.encoding??{},m=QR.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const E=b3(p[x]??{},t),_=x==="labels"?Pie(t,e,E):E;return _!==void 0&&!Ee(_)&&(v[x]={update:_}),v},{});return Ee(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function Vie({encoding:e,size:t}){for(const n of vr){const i=an(n);Li(t[i])&&Ur(e[n])&&(delete t[i],B(uR(i)))}return t}const Xie={vgMark:"arc",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Pt("x",e,{defaultPos:"mid"}),...Pt("y",e,{defaultPos:"mid"}),...dr(e,"radius"),...dr(e,"theta")})},Yie={vgMark:"area",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Ed("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Ed("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...vx(e)})},Kie={vgMark:"rect",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...dr(e,"x"),...dr(e,"y")})},Jie={vgMark:"shape",encodeEntry:e=>({...jn(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&&U(n)&&n.type===Uo?{field:H(n,{expr:"datum"})}:{}}
vendor: 1,052 bytes, line 16
16]}},Qie={vgMark:"image",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...dr(e,"x"),...dr(e,"y"),...yx(e,"url")})},Zie={vgMark:"line",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Pt("x",e,{defaultPos:"mid"}),...Pt("y",e,{defaultPos:"mid"}),...ut("size",e,{vgChannel:"strokeWidth"}),...vx(e)})},ere={vgMark:"trail",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Pt("x",e,{defaultPos:"mid"}),...Pt("y",e,{defaultPos:"mid"}),...ut("size",e),...vx(e)})};function Nx(e,t){const{config:n}=e;return{...jn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Pt("x",e,{defaultPos:"mid"}),...Pt("y",e,{defaultPos:"mid"}),...ut("size",e),...ut("angle",e),...tre(e,n,t)}}function tre(e,t,n){return n?{shape:{value:n}}:ut("shape",e)}const nre={vgMark:"symbol",encodeEntry:e=>Nx(e)}
vendor: 7,186 bytes, line 16
16,ire={vgMark:"symbol",encodeEntry:e=>Nx(e,"circle")},rre={vgMark:"symbol",encodeEntry:e=>Nx(e,"square")},sre={vgMark:"rect",encodeEntry:e=>({...jn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...dr(e,"x"),...dr(e,"y")})},are={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...jn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ed("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Ed("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ut("size",e,{vgChannel:"strokeWidth"})}}},ore={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...jn(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Pt("x",e,{defaultPos:"mid"}),...Pt("y",e,{defaultPos:"mid"}),...yx(e),...ut("size",e,{vgChannel:"fontSize"}),...ut("angle",e),...P_("align",ure(e.markDef,n,t)),...P_("baseline",lre(e.markDef,n,t)),...Pt("radius",e,{defaultPos:null}),...Pt("theta",e,{defaultPos:null})}}};function ure(e,t,n){if(we("align",e,n)===void 0)return"center"}function lre(e,t,n){if(we("baseline",e,n)===void 0)return"middle"}const cre={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{...jn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...dr(e,r),...Pt(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[a]:Fe(we("thickness",n,t))}}},Bc={arc:Xie,area:Yie,bar:Kie,circle:ire,geoshape:Jie,image:Qie,line:Zie,point:nre,rect:sre,rule:are,square:rre,text:ore,tick:cre,trail:ere};function fre(e){if(le([Xh,Hh,vQ],e.mark)){const t=sD(e.mark,e.encoding);if(t.length>0)return dre(e,t)}else if(e.mark===Vh){const t=g0.some(n=>we(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return hre(e)}return Mx(e)}const rS="faceted_path_";function dre(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:rS+e.requestDataName(Ie.Main),data:e.requestDataName(Ie.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Mx(e,{fromPrefix:rS})}]}const sS="stack_group_";function hre(e){var l;const[t]=Mx(e,{fromPrefix:sS}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,a;e.stack.fieldChannel==="x"?(s={...fo(t.encode.update,["y","yc","y2","height",...g0]),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={...Jt(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...fo(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={...Jt(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of g0){const f=Ni(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=Fe(f)),f&&(t.encode.update[c]={value:0})}const o=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=H(f);d&&o.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&o.push(H(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=Ni(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Fe(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ie.Main),name:sS+e.requestDataName(Ie.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 gre(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,a=t.order;if(!(!N(a)&&si(a)&&d0(a.value)||!a&&d0(we("order",r,s)))){if((N(a)||U(a))&&!n)return eR(a,{expr:"datum"});if(bs(i)){const o=r.orient==="horizontal"?"y":"x",u=t[o];if(U(u))return{field:o}}}}function Mx(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,a=ze(i.clip,pre(e),mre(e)),o=QT(i),u=r.key,l=gre(e),c=yre(e),f=we("aria",i,s),d=Bc[n].postEncodingTransform?Bc[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Bc[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(Ie.Main)},encode:{update:Bc[n].encodeEntry(e)},...d?{transform:d}:{}}]}function pre(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function mre(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function yre(e){if(!e.component.selection)return null;const t=P(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=P(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class X3 extends q3{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,m_(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const a=Mi(t.mark)?{...t.mark}:{type:t.mark},o=a.type;a.filled===void 0&&(a.filled=nee(a,s,{graticule:t.data&&px(t.data)}));const u=this.encoding=aZ(t.encoding||{},o,a.filled,s);this.markDef=kD(a,u,s),this.size=Vie({encoding:u,size:m_(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=AD(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=>cx(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===TR,i=t&&nK.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 $v.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=st(t);return N(n)&&(r.domain=n.map(gn)),N(i)&&(r.range=i.map(gn)),r}initAxes(t){return vr.reduce((n,i)=>{const r=t[i];if(re(r)||i===Re&&re(t.x2)||i===it&&re(t.y2)){const s=re(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=P(t),i={};for(const r of n){const s=t[r];
vendor: 7,044 bytes, line 16
16i[r]=oc(s)?JT(s):gn(s)}return i}initLegends(t){return dK.reduce((n,i)=>{const r=Xe(t[i]);if(r&&gK(i)){const s=r.legend;n[i]=s&&st(s)}return n},{})}parseData(){this.component.data=Eg(this)}parseLayoutSize(){Oie(this)}parseSelections(){this.component.selection=xte(this,this.selection)}parseMarkGroup(){this.component.mark=fre(this)}parseAxesAndHeaders(){this.component.axes=zie(this)}assembleSelectionTopLevelSignals(t){return Wee(this,t)}assembleSignals(){return[...l3(this),...Uee(this,[])]}assembleSelectionData(t){return Gee(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return _x(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Vo(this.parent))&&(t=BD(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 qs(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ai(n)}typedFieldDef(t){const n=this.fieldDef(t);return Bt(n)?n:null}}class Lx extends Tx{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(rg(o))return new Lx(o,this,this.getName(`layer_${u}`),a,s);if(xr(o))return new X3(o,this,this.getName(`layer_${u}`),a,s);throw new Error(Ov(o))})}parseData(){this.component.data=Eg(this);for(const t of this.children)t.parseData()}parseLayoutSize(){$ie(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of P(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){jie(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),l3(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),_x(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of X(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Hee(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),k3(this))}}function Ix(e,t,n,i,r){if(Jh(e))return new Gu(e,t,n,r);if(rg(e))return new Lx(e,t,n,i,r);if(xr(e))return new X3(e,t,n,i,r);if(OZ(e))return new Mie(e,t,n,r);throw new Error(Ov(e))}function bre(e,t={}){t.logger&&DJ(t.logger),t.fieldTitle&&YR(t.fieldTitle);try{const n=SD(Fo(t.config,e.config)),i=DD(e,n),r=Ix(i,null,"",void 0,n);return r.parse(),Une(r.component.data,r),{spec:xre(r,vre(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&NJ(),t.fieldTitle&&JQ()}}function vre(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)):Y(t)&&(t={type:t}),r&&s&&Iee(t.type)){if(r==="step"&&s==="step")B(e_()),t.type="pad";else if(r==="step"||s==="step"){const a=r==="step"?"width":"height";B(e_(Bh(a)));const o=a==="width"?"height":"width";t.type=Pee(o)}}return{...P(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...$_(n,!1),...$_(e,!0)}}function xre(e,t,n={},i){const r=e.config?WZ(e.config):void 0,s=[].concat(e.assembleSelectionData([]),Sie(e.component.data,n)),a=e.assembleProjections(),o=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...o?{title:o}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:s,...a.length>0?{projections:a}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...xD(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const wre=KY.version,Ere=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:go,accessPathWithDatum:xv,compile:bre,contains:le,deepEqual:mn,deleteNestedProperty:dd,duplicate:ie,entries:ns,every:yv,fieldIntersection:vv,flatAccessWithDatum:RT,getFirstDefined:ze,hasIntersection:bv,hasProperty:z,hash:ce,internalField:MT,isBoolean:ul,isEmpty:Ee,isEqual:QY,isInternalField:LT,isNullOrFalse:d0,isNumeric:Nh,keys:P,logicalExpr:qu,mergeDeep:OT,never:FT,normalize:DD,normalizeAngle:ll,omit:Jt,pick:fo,prefixGenerator:h0,removePathFromField:Bo,replaceAll:ea,replacePathInField:In,resetIdCounter:eK,setEqual:TT,some:ho,stringify:_e,titleCase:Kl,unique:Ai,uniqueId:NT,vals:ft,varName:Te,version:wre},Symbol.toStringTag,{value:"Module"}));function Y3(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var _re="vega-themes",Sre="2.15.0",Are="Themes for stylized Vega and Vega-Lite visualizations.",kre=["vega","vega-lite","themes","style"],Cre="BSD-3-Clause",$re={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},Fre=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],Ore="build/vega-themes.js",Tre="build/vega-themes.module.js",Rre="build/vega-themes.min.js",Dre="build/vega-themes.min.js",Nre="build/vega-themes.module.d.ts",Mre={type:"git",url:"https://github.com/vega/vega-themes.git"},Lre=["src","build"],Ire={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},Pre={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-
16prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},zre={vega:"*","vega-lite":"*"},Bre={},jre={name:_re,version:Sre,description:Are,keywords:kre,license:Cre,author:$re,contributors:Fre,main:Ore,module:Tre,unpkg:Rre,jsdelivr:Dre,types:Nre,repository:Mre,files:Lre,scripts:Ire,devDependencies:Pre,peerDependencies:zre,dependencies:Bre};const Na="#fff",aS="#888",Ure={background:"#333",view:{stroke:aS},title:{color:Na,subtitleColor:Na},style:{"guide-label":{fill:Na},"guide-title":{fill:Na}},axis:{domainColor:Na,gridColor:aS,tickColor:Na}},_s="#4572a7",qre={background:"#fff",arc:{fill:_s},area:{fill:_s},line:{stroke:_s,strokeWidth:2},path:{stroke:_s},rect:{fill:_s},shape:{stroke:_s},symbol:{fill:_s,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"]}},Ss="#30a2da",Tp="#cbcbcb",Wre="#999",Gre="#333",oS="#f0f0f0",uS="#333",Hre={arc:{fill:Ss},area:{fill:Ss},axis:{domainColor:Tp,grid:!0,gridColor:Tp,gridWidth:1,labelColor:Wre,labelFontSize:10,titleColor:Gre,tickColor:Tp,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:oS,group:{fill:oS},legend:{labelColor:uS,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:uS,titleFontSize:14,titlePadding:10},line:{stroke:Ss,strokeWidth:2},path:{stroke:Ss,strokeWidth:.5},rect:{fill:Ss},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:Ss},bar:{binSpacing:2,fill:Ss,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},As="#000",Vre={group:{fill:"#e5e5e5"},arc:{fill:As},area:{fill:As},line:{stroke:As},path:{stroke:As},rect:{fill:As},shape:{stroke:As},symbol:{fill:As,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"]}},Xre=22,Yre="normal",lS="Benton Gothic, sans-serif",cS=11.5,Kre="normal",ks="#82c6df",Rp="Benton Gothic Bold, sans-serif",fS="normal",dS=13,hu={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Jre={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Rp,fontSize:Xre,fontWeight:Yre},arc:{fill:ks},area:{fill:ks},line:{stroke:ks,strokeWidth:2},path:{stroke:ks},rect:{fill:ks},shape:{stroke:ks},symbol:{fill:ks,size:30},axis:{labelFont:lS,labelFontSize:cS,labelFontWeight:Kre,titleFont:Rp,titleFontSize:dS,titleFontWeight:fS},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:lS,labelFontSize:cS,symbolType:"square",titleFont:Rp,titleFontSize:dS,titleFontWeight:fS},range:{category:hu["category-6"],diverging:hu["fireandice-6"],heatmap:hu["fire-7"],ordinal:hu["fire-7"],ramp:hu["fire-7"]}},Cs="#ab5787",jc="#979797",Qre={background:"#f9f9f9",arc:{fill:Cs},area:{fill:Cs},line:{stroke:Cs},path:{stroke:Cs},rect:{fill:Cs},shape:{stroke:Cs},symbol:{fill:Cs,size:30},axis:{domainColor:jc,domainWidth:.5,gridWidth:.2,labelColor:jc,tickColor:jc,tickWidth:.2,titleColor:jc},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"]}},$s="#3e5c69",Zre={background:"#fff",arc:{fill:$s},area:{fill:$s},line:{stroke:$s},path:{stroke:$s},rect:{fill:$s},shape:{stroke:$s},symbol:{fill:$s},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"]}},kn="#1696d2",hS="#000000",ese="#FFFFFF",Uc="Lato",Dp="Lato",tse="Lato",nse="#DEDDDD",ise=18,gu={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#e
16c008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},rse={background:ese,title:{anchor:"start",fontSize:ise,font:Uc},axisX:{domain:!0,domainColor:hS,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Dp,labelAngle:0,tickColor:hS,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Uc},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:nse,gridWidth:1,labelFontSize:12,labelFont:Dp,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Uc,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Dp,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Uc,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:gu["six-groups-cat-1"],diverging:gu["diverging-colors"],heatmap:gu["diverging-colors"],ordinal:gu["six-groups-seq"],ramp:gu["shades-blue"]},area:{fill:kn},rect:{fill:kn},line:{color:kn,stroke:kn,strokeWidth:5},trail:{color:kn,stroke:kn,strokeWidth:0,size:1},path:{stroke:kn,strokeWidth:.5},point:{filled:!0},text:{font:tse,color:kn,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:kn,stroke:null}},arc:{fill:kn},shape:{stroke:kn},symbol:{fill:kn,size:30}},Fs="#3366CC",gS="#ccc",qc="Arial, sans-serif",sse={arc:{fill:Fs},area:{fill:Fs},path:{stroke:Fs},rect:{fill:Fs},shape:{stroke:Fs},symbol:{stroke:Fs},circle:{fill:Fs},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:qc,fontSize:12},"guide-title":{font:qc,fontSize:12},"group-title":{font:qc,fontSize:12}},title:{font:qc,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:gS,tickColor:gS,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Px=e=>e*(1/3+1),pS=Px(9),mS=Px(10),yS=Px(12),pu="Segoe UI",bS="wf_standard-font, helvetica, arial, sans-serif",vS="#252423",mu="#605E5C",xS="transparent",ase="#C8C6C4",Wn="#118DFF",ose="#12239E",use="#E66C37",lse="#6B007B",cse="#E044A7",fse="#744EC2",dse="#D9B300",hse="#D64550",K3=Wn,J3="#DEEFFF",wS=[J3,K3],gse=[J3,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",K3],pse={view:{stroke:xS},background:xS,font:pu,header:{titleFont:bS,titleFontSize:yS,titleColor:vS,labelFont:pu,labelFontSize:mS,labelColor:mu},axis:{ticks:!1,grid:!1,domain:!1,labelColor:mu,labelFontSize:pS,titleFont:bS,titleColor:vS,titleFontSize:yS,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:ase,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Wn},line:{stroke:Wn,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:pu,fontSize:pS,fill:mu},arc:{fill:Wn},area:{fill:Wn,line:!0,opacity:.6},path:{stroke:Wn},rect:{fill:Wn},point:{fill:Wn,filled:!0,size:75},shape:{stroke:Wn},symbol:{fill:Wn,strokeWidth:1.5,size:50},legend:{titleFont:pu,titleFontWeight:"bold",titleColor:mu,labelFont:pu,labelFontSize:mS,labelColor:mu,symbolType:"circle",symbolSize:75},range:{category:[Wn,ose,use,lse,cse,fse,dse,hse],diverging:wS,heatmap:wS,ordinal:gse}},Np='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',mse='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',Mp=400,Wc={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"}},yse=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],bse=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function _g({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=Wc.gridBg[e],r=Wc.textPrimary[e],s=Wc.textSecondary[e],a=n==="dark"?yse:bse,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:mse,labelFontWeight:Mp,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:W
16c.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:Np,fill:s,fontWeight:Mp},"guide-title":{font:Np,fill:s,fontWeight:Mp}},range:{category:a,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const vse=_g({theme:"white",background:"#ffffff"}),xse=_g({theme:"g10",background:"#f4f4f4"}),wse=_g({theme:"g90",background:"#262626"}),Ese=_g({theme:"g100",background:"#161616"}),_se=jre.version,Sse=Object.freeze(Object.defineProperty({__proto__:null,carbong10:xse,carbong100:Ese,carbong90:wse,carbonwhite:vse,dark:Ure,excel:qre,fivethirtyeight:Hre,ggplot2:Vre,googlecharts:sse,latimes:Jre,powerbi:pse,quartz:Qre,urbaninstitute:rse,version:_se,vox:Zre},Symbol.toStringTag,{value:"Module"}));function Ase(e,t,n,i){if(N(e))return`[${e.map(r=>t(Y(r)?r:ES(r,n))).join(", ")}]`;if(V(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&&(V(c)&&(c=ES(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 kse(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 ES(e,t){return JSON.stringify(e,kse(t))}var Cse=`#vg-tooltip-element { 17 visibility: hidden; 18 padding: 8px; 19 position: fixed; 20 z-index: 1000; 21 font-family: sans-serif; 22 font-size: 11px; 23 border-radius: 3px; 24 box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); 25 /* The default theme is the light theme. */ 26 background-color: rgba(255, 255, 255, 0.95); 27 border: 1px solid #d9d9d9; 28 color: black; 29} 30#vg-tooltip-element.visible { 31 visibility: visible; 32} 33#vg-tooltip-element h2 { 34 margin-top: 0; 35 margin-bottom: 10px; 36 font-size: 13px; 37} 38#vg-tooltip-element table { 39 border-spacing: 0; 40} 41#vg-tooltip-element table tr { 42 border: none; 43} 44#vg-tooltip-element table tr td { 45 overflow: hidden; 46 text-overflow: ellipsis; 47 padding-top: 2px; 48 padding-bottom: 2px; 49} 50#vg-tooltip-element table tr td.key { 51 color: #808080; 52 max-width: 150px; 53 text-align: right; 54 padding-right: 4px; 55} 56#vg-tooltip-element table tr td.value { 57 display: block; 58 max-width: 300px; 59 max-height: 7em; 60 text-align: left; 61} 62#vg-tooltip-element.dark-theme { 63 background-color: rgba(32, 32, 32, 0.9); 64 border: 1px solid #f5f5f5; 65 color: white; 66} 67#vg-tooltip-element.dark-theme td.key { 68 color: #bfbfbf; 69} 70`;const Q3="vg-tooltip-element",$se={offsetX:10,offsetY:10,id:Q3,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Fse,maxDepth:2,formatTooltip:Ase,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Fse(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function Ose(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Cse.toString().replace(Q3,e)}function Z3(e,t,{offsetX:n,offsetY:i}){const r=eN({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(tN(r[a],t))return r[a];return r["top-left"]}function Tse(e,t,n,i,r){const{position:s,offsetX:a,offsetY:o}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=Rse(u,l,n),f=eN(c,i,a,o),d=Array.isArray(s)?s:[s];for(const h of d)if(tN(f[h],i)&&!Dse(t,f[h],i))return f[h];return Z3(t,i,r)}function Rse(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 eN(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,
vendor: 10,918 bytes, lines 70-79
70c=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 tN(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Dse(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 Nse{constructor(t){this.options={...$se,...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=Ose(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"?Tse(t,n,i,this.el.getBoundingClientRect(),this.options):Z3(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${a}px`,this.el.style.left=`${s}px`}}var Lp={};/*! 71 * https://github.com/Starcounter-Jack/JSON-Patch 72 * (c) 2017-2022 Joachim Wester 73 * MIT licensed 74 */var Mse=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)}}(),Lse=Object.prototype.hasOwnProperty;function P0(e,t){return Lse.call(e,t)}function z0(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)P0(e,r)&&i.push(r);return i}function yn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function B0(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 Ts(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function nN(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function j0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(j0(e[t]))return!0}else if(typeof e=="object"){for(var i=z0(e),r=i.length,s=0;s<r;s++)if(j0(e[i[s]]))return!0}}return!1}function _S(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(` 75`)}var iN=function(e){Mse(t,e);function t(n,i,r,s,a){var o=this.constructor,u=e.call(this,_S(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=_S(n,{name:i,index:r,operation:s,tree:a}),u}return t}(Error),Le=iN,Ise=yn,qa={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=kd(n,this.path);i&&(i=yn(i));var r=Hs(n,{op:"remove",path:this.from}).removed;return Hs(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=kd(n,this.from);return Hs(n,{op:"add",path:this.path,value:yn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:gl(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Pse={add:function(e,t,n){return B0(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:qa.move,copy:qa.copy,test:qa.test,_get:qa._get};function kd(e,t){if(t=="")return e;var n={op:"_get",path:t};return Hs(e,n),n.value}function Hs(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):Cd(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=kd(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=gl(e,t.value),a.test===!1)throw new Le("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 Le("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return a}}else{i||(e=yn(e));var o=t.path||"",u=o.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,g=void 0;for(typeof n=="function"?g=n:g=Cd;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=nN(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&g(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!B0(h))throw new Le("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);B0(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Le("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=Pse[t.op].call(t,l,h,e);if(a.test===!1)throw new Le("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return a}}else if(c>=f){var a=qa[t.op].call(t,l,h,e);if(a.test===!1)throw new Le("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return a}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Le("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function Sg(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Le("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=yn(e));for(var s=new Array(t.length),a=0,o=t.length;a<o;a++)s[a]=Hs(e,t[a],n,!0,r,a),e=s[a].newDocument;return s.newDocument=e,s}function zse(e,t,n){var i=Hs(e,t);if(i.test===!1)throw new Le("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Cd(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Le("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(qa[e.op]){if(typeof e.path!="string")throw new Le("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Le('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 Le("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 Le("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")&&j0(e.value))throw new Le("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 Le("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 Le("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=rN([a],n);if(o&&o.name==="OPERATION_PATH_UNRESOLVABLE")throw new Le("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Le("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function rN(e,t,n){try{if(!Array.isArray(e))throw new Le("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Sg(yn(t),yn(e),n||!0);else{n=n||Cd;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Le)return r;throw r}}function gl(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(!gl(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],!gl(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Bse=Object.freeze({__proto__:null,JsonPatchError:Le,_areEquals:gl,applyOperation:Hs,applyPatch:Sg,applyReducer:zse,deepClone:Ise,getValueByPointer:kd,validate:rN,validator:Cd});/*! 76 * https://github.com/Starcounter-Jack/JSON-Patch 77 * (c) 2017-2021 Joachim Wester 78 * MIT license 79 */var zx=new WeakMap,jse=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Use=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function qse(e){return zx.get(e)}function Wse(e,t){return e.observers.get(t)}function Gse(e,t){e.observers.delete(t.callback)}function Hse(e,t){t.unobserve()}function Vse(e,t){var n=[],i,r=qse(e);if(!r)r=new jse(e),zx.set(e,r);else{var s=Wse(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=yn(e),t){i.callback=t,i.next=null;var a=function(){U0(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(){U0(i),clearTimeout(i.next),Gse(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))}
79,r.observers.set(t,new Use(t,i)),i}function U0(e,t){t===void 0&&(t=!1);var n=zx.get(e.object);Bx(n.value,e.object,e.patches,"",t),e.patches.length&&Sg(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function Bx(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=z0(t),a=z0(e),o=!1,u=a.length-1;u>=0;u--){var l=a[u],c=e[l];if(P0(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)?Bx(c,f,n,i+"/"+Ts(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Ts(l),value:yn(c)}),n.push({op:"replace",path:i+"/"+Ts(l),value:yn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Ts(l),value:yn(c)}),n.push({op:"remove",path:i+"/"+Ts(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];!P0(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+Ts(l),value:yn(t[l])})}}}function Xse(e,t,n){n===void 0&&(n=!1);var i=[];return Bx(e,t,i,"",n),i}var Yse=Object.freeze({__proto__:null,compare:Xse,generate:U0,observe:Vse,unobserve:Hse});Object.assign({},Bse,Yse,{JsonPatchError:iN,deepClone:yn,escapePathComponent:Ts,unescapePathComponent:nN});function Kse(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ip,SS;function Jse(){if(SS)return Ip;SS=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 Ip=e,Ip}var Pp,AS;function jx(){if(AS)return Pp;AS=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Pp=i=>i?typeof i!="object"?e:i:t,Pp}var Gc={exports:{}},zp,kS;function Ux(){if(kS)return zp;kS=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return zp={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},zp}var Bp,CS;function Ag(){return CS||(CS=1,Bp=typeof process=="object"&&Lp&&Lp.NODE_DEBUG&&/\bsemver\b/i.test(Lp.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Bp}var $S;function qx(){return $S||($S=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=Ux(),s=Ag();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]],h=p=>{for(const[m,y]of d)p=p.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return p},g=(p,m,y)=>{const b=h(m),v=c++;s(p,v,m),l[p]=v,u[v]=m,a[v]=new RegExp(m,y?"g":void 0),o[v]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}
79\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Gc,Gc.exports)),Gc.exports}var jp,FS;function Qse(){if(FS)return jp;FS=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 jp={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},jp}var Up,OS;function Wx(){if(OS)return Up;OS=1;const e=Ag(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Ux(),{safeRe:i,t:r}=qx(),s=jx(),{compareIdentifiers:a}=Qse();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 h=+d;if(h>=0&&h<n)return h}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 h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),a(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}
vendor: 6,274 bytes, line 79
79default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Up=o,Up}var qp,TS;function Xo(){if(TS)return qp;TS=1;const e=Wx();return qp=(n,i,r)=>new e(n,r).compare(new e(i,r)),qp}var Wp,RS;function Zse(){if(RS)return Wp;RS=1;const e=Xo();return Wp=(n,i,r)=>e(n,i,r)===0,Wp}var Gp,DS;function eae(){if(DS)return Gp;DS=1;const e=Xo();return Gp=(n,i,r)=>e(n,i,r)!==0,Gp}var Hp,NS;function tae(){if(NS)return Hp;NS=1;const e=Xo();return Hp=(n,i,r)=>e(n,i,r)>0,Hp}var Vp,MS;function nae(){if(MS)return Vp;MS=1;const e=Xo();return Vp=(n,i,r)=>e(n,i,r)>=0,Vp}var Xp,LS;function iae(){if(LS)return Xp;LS=1;const e=Xo();return Xp=(n,i,r)=>e(n,i,r)<0,Xp}var Yp,IS;function rae(){if(IS)return Yp;IS=1;const e=Xo();return Yp=(n,i,r)=>e(n,i,r)<=0,Yp}var Kp,PS;function sae(){if(PS)return Kp;PS=1;const e=Zse(),t=eae(),n=tae(),i=nae(),r=iae(),s=rae();return Kp=(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}`)}},Kp}var Jp,zS;function aae(){if(zS)return Jp;zS=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(">")))}}Jp=t;const n=jx(),{safeRe:i,t:r}=qx(),s=sae(),a=Ag(),o=Wx(),u=sN();return Jp}var Qp,BS;function sN(){if(BS)return Qp;BS=1;const e=/\s+/g;class t{constructor($,T){if(T=r(T),$ instanceof t)return $.loose===!!T.loose&&$.includePrerelease===!!T.includePrerelease?$:new t($.raw,T);if($ instanceof s)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=$.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(W=>!p(W[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const W of this.set)if(W.length===1&&m(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){$>0&&(this.formatted+="||");const T=this.set[$];for(let I=0;I<T.length;I++)I>0&&(this.formatted+=" "),this.formatted+=T[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){const I=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+$,W=i.get(I);if(W)return W;const j=this.options.loose,J=j?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];$=$.replace(J,L(this.options.includePrerelease)),a("hyphen replace",$),$=$.replace(u[l.COMPARATORTRIM],c),a("comparator trim",$),$=$.replace(u[l.TILDETRIM],f),a("tilde trim",$),$=$.replace(u[l.CARETTRIM],d),a("caret trim",$);let ue=$.split(" ").map(he=>b(he,this.options)).join(" ").split(/\s+/).map(he=>F(he,this.options));j&&(ue=ue.filter(he=>(a("loose invalid filter",he,this.options),!!he.match(u[l.COMPARATORLOOSE])))),a("range list",ue);const se=new Map,be=ue.map(he=>new s(he,this.options));for(const he of be){if(p(he))return[he];se.set(he.value,he)}se.size>1&&se.has("")&&se.delete("");const Ue=[...se.values()];return i.set(I,Ue),Ue}intersects($,T){if(!($ instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>y(I,T)&&$.set.some(W=>y(W,T)&&I.every(j=>W.every(J=>j.intersects(J,T)))))}test($){if(!$)return!1;if(typeof $=="string")try{$=new o($,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(M(this.set[T],$,this.options))return!0;return!1}}Qp=t;const n=Jse(),i=new n,r=jx(),s=aae(),a=Ag(),o=Wx(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=qx(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=Ux(),p=C=>C.value==="<0.0.0-0",m=C=>C.value==="",y=(C,$)=>{let T=!0;const I=C.slice();let W=I.pop();for(;T&&I.length;)T=I.every(j=>W.intersects(j,$)),W=I.pop();return T},b=(C,$)=>(a("comp",C,$),C=_(C,$),a("caret",C),C=x(C,$),a("tildes",C),C=S(C,$),a("xrange",C),C=k(C,$),a("stars",C),C),v=C=>!C||C.toLowerCase()==="x"||C==="*",x=(C,$)=>C.trim().split(/\s+/).map(T=>E(T,$)).join(" "),E=(C,$)=>{const T=$.loose?u[l.TILDELOOSE]:u[l.TILDE];return C.replace(T,(I,W,j,J,ue)=>{a("tilde",C,I,W,j,J,ue);let se;return v(W)?se="":v(j)?se=`>=${W}.0.0 <${+W+1}.0.0-0`:v(J)?se=`>=${W}.${j}.0 <${W}.${+j+1}.0-0`:ue?(a("replaceTilde pr",ue),se=`>=${W}.${j}.${J}-${ue} <${W}.${+j+1}
79.0-0`):se=`>=${W}.${j}.${J} <${W}.${+j+1}.0-0`,a("tilde return",se),se})},_=(C,$)=>C.trim().split(/\s+/).map(T=>w(T,$)).join(" "),w=(C,$)=>{a("caret",C,$);const T=$.loose?u[l.CARETLOOSE]:u[l.CARET],I=$.includePrerelease?"-0":"";return C.replace(T,(W,j,J,ue,se)=>{a("caret",C,W,j,J,ue,se);let be;return v(j)?be="":v(J)?be=`>=${j}.0.0${I} <${+j+1}.0.0-0`:v(ue)?j==="0"?be=`>=${j}.${J}.0${I} <${j}.${+J+1}.0-0`:be=`>=${j}.${J}.0${I} <${+j+1}.0.0-0`:se?(a("replaceCaret pr",se),j==="0"?J==="0"?be=`>=${j}.${J}.${ue}-${se} <${j}.${J}.${+ue+1}-0`:be=`>=${j}.${J}.${ue}-${se} <${j}.${+J+1}.0-0`:be=`>=${j}.${J}.${ue}-${se} <${+j+1}.0.0-0`):(a("no pr"),j==="0"?J==="0"?be=`>=${j}.${J}.${ue}${I} <${j}.${J}.${+ue+1}-0`:be=`>=${j}.${J}.${ue}${I} <${j}.${+J+1}.0-0`:be=`>=${j}.${J}.${ue} <${+j+1}.0.0-0`),a("caret return",be),be})},S=(C,$)=>(a("replaceXRanges",C,$),C.split(/\s+/).map(T=>A(T,$)).join(" ")),A=(C,$)=>{C=C.trim();const T=$.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return C.replace(T,(I,W,j,J,ue,se)=>{a("xRange",C,I,W,j,J,ue,se);const be=v(j),Ue=be||v(J),he=Ue||v(ue),qt=he;return W==="="&&qt&&(W=""),se=$.includePrerelease?"-0":"",be?W===">"||W==="<"?I="<0.0.0-0":I="*":W&&qt?(Ue&&(J=0),ue=0,W===">"?(W=">=",Ue?(j=+j+1,J=0,ue=0):(J=+J+1,ue=0)):W==="<="&&(W="<",Ue?j=+j+1:J=+J+1),W==="<"&&(se="-0"),I=`${W+j}.${J}.${ue}${se}`):Ue?I=`>=${j}.0.0${se} <${+j+1}.0.0-0`:he&&(I=`>=${j}.${J}.0${se} <${j}.${+J+1}.0-0`),a("xRange return",I),I})},k=(C,$)=>(a("replaceStars",C,$),C.trim().replace(u[l.STAR],"")),F=(C,$)=>(a("replaceGTE0",C,$),C.trim().replace(u[$.includePrerelease?l.GTE0PRE:l.GTE0],"")),L=C=>($,T,I,W,j,J,ue,se,be,Ue,he,qt)=>(v(I)?T="":v(W)?T=`>=${I}.0.0${C?"-0":""}`:v(j)?T=`>=${I}.${W}.0${C?"-0":""}`:J?T=`>=${T}`:T=`>=${T}${C?"-0":""}`,v(be)?se="":v(Ue)?se=`<${+be+1}.0.0-0`:v(he)?se=`<${be}.${+Ue+1}.0-0`:qt?se=`<=${be}.${Ue}.${he}-${qt}`:C?se=`<${be}.${Ue}.${+he+1}-0`:se=`<=${se}`,`${T} ${se}`.trim()),M=(C,$,T)=>{for(let I=0;I<C.length;I++)if(!C[I].test($))return!1;if($.prerelease.length&&!T.includePrerelease){for(let I=0;I<C.length;I++)if(a(C[I].semver),C[I].semver!==s.ANY&&C[I].semver.prerelease.length>0){const W=C[I].semver;if(W.major===$.major&&W.minor===$.minor&&W.patch===$.patch)return!0}return!1}return!0};return Qp}var Zp,jS;function oae(){if(jS)return Zp;jS=1;const e=sN();return Zp=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Zp}var uae=oae(),aN=Kse(uae);function lae(e,t,n){const i=e.open(t),r=1e4,s=250,{origin:a}=new URL(t);let o=~~(r/s);function u(c){c.source===i&&(o=0,e.removeEventListener("message",u,!1))}e.addEventListener("message",u,!1);function l(){o<=0||(i.postMessage(n,a),setTimeout(l,s),o-=1)}setTimeout(l,s)}var cae=`.vega-embed { 80 position: relative; 81 display: inline-block; 82 box-sizing: border-box; 83} 84.vega-embed.has-actions { 85 padding-right: 38px; 86} 87.vega-embed details:not([open]) > :not(summary) { 88 display: none !important; 89} 90.vega-embed summary { 91 list-style: none; 92 position: absolute; 93 top: 0; 94 right: 0; 95 padding: 6px; 96 z-index: 1000; 97 background: white; 98 box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); 99 color: #1b1e23; 100 border: 1px solid #aaa; 101 border-radius: 999px; 102 opacity: 0.2; 103 transition: opacity 0.4s ease-in; 104 cursor: pointer; 105 line-height: 0px; 106} 107.vega-embed summary::-webkit-details-marker { 108 display: none; 109} 110.vega-embed summary:active { 111 box-shadow: #aaa 0px 0px 0px 1px inset; 112} 113.vega-embed summary svg { 114 width: 14px; 115 height: 14px; 116} 117.vega-embed details[open] summary { 118 opacity: 0.7; 119} 120.vega-embed:hover summary, .vega-embed:focus-within summary { 121 opacity: 1 !important; 122 transition: opacity 0.2s ease; 123} 124.vega-embed .vega-actions { 125 position: absolute; 126 z-index: 1001; 127 top: 35px; 128 right: -9px; 129 display: flex; 130 flex-direction: column; 131 padding-bottom: 8px; 132 padding-top: 8px; 133 border-radius: 4px; 134 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); 135 border: 1px solid #d9d9d9; 136 background: white; 137 animation-duration: 0.15s; 138 animation-name: scale-in; 139 animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); 140 text-align: left; 141} 142.vega-embed .vega-actions a { 143 padding: 8px 16px; 144 font-family: sans-serif; 145 font-size: 14px; 146 font-weight: 600; 147 white-space: nowrap; 148 color: #434a56; 149 text-decoration: none; 150} 151.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { 152 background-color: #f7f7f9; 153 color: black; 154} 155.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
156 content: ""; 157 display: inline-block; 158 position: absolute; 159} 160.vega-embed .vega-actions::before { 161 left: auto; 162 right: 14px; 163 top: -16px; 164 border: 8px solid rgba(0, 0, 0, 0); 165 border-bottom-color: #d9d9d9; 166} 167.vega-embed .vega-actions::after { 168 left: auto; 169 right: 15px; 170 top: -14px; 171 border: 7px solid rgba(0, 0, 0, 0); 172 border-bottom-color: #fff; 173} 174.vega-embed .chart-wrapper.fit-x { 175 width: 100%; 176} 177.vega-embed .chart-wrapper.fit-y { 178 height: 100%; 179} 180 181.vega-embed-wrapper { 182 max-width: 100%; 183 overflow: auto; 184 padding-right: 14px; 185} 186 187@keyframes scale-in { 188 from { 189 opacity: 0; 190 transform: scale(0.6); 191 } 192 to { 193 opacity: 1; 194 transform: scale(1); 195 } 196} 197`;function oN(e,...t){for(const n of t)fae(e,n);return e}function fae(e,t){for(const n of Object.keys(t))Oo(e,n,t[n],!0)}const xi=mY;let pl=Ere;const Hc=typeof window<"u"?window:void 0;var YS;pl===void 0&&((YS=Hc==null?void 0:Hc.vl)!=null&&YS.compile)&&(pl=Hc.vl);const dae={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},hae={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"},Nu={vega:"Vega","vega-lite":"Vega-Lite"},$d={vega:xi.version,"vega-lite":pl?pl.version:"not available"},gae={vega:e=>e,"vega-lite":(e,t)=>pl.compile(e,{config:t}).spec},pae=` 198<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"> 199 <circle r="2" cy="8" cx="2"></circle> 200 <circle r="2" cy="8" cx="8"></circle> 201 <circle r="2" cy="8" cx="14"></circle> 202</svg>`,mae="chart-wrapper";function yae(e){return typeof e=="function"}function US(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=`${Nu[i]} JSON Source`}function bae(e,t){if(e.$schema){const n=Y3(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Nu[n.library]}, but mode argument sets ${Nu[t]??t}.`);const i=n.library;return aN($d[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Nu[i]} ${n.version}, but the current version of ${Nu[i]} is v${$d[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 uN(e){return!!(e&&"load"in e)}function qS(e){return uN(e)?e:xi.loader(e)}function vae(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return Y(t.defaultStyle)&&(t.defaultStyle=!1),t}async function xae(e,t,n={}){let i,r;Y(t)?(r=qS(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=vae(i),a=s.loader;(!r||a)&&(r=qS(n.loader??a));const o=await WS(s,r),u=await WS(n,r),l={...oN(u,o),config:Fo(u.config??{},o.config??{})};return await Eae(e,i,l,r)}async function WS(e,t){const n=Y(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=Y(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function wae(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 Eae(e,t,n={},i){const r=n.theme?Fo(Sse[n.theme],n.config??{}):n.config,s=us(n.actions)?n.actions:oN({},dae,n.actions??{}),a={...hae,...n.i18n},o=n.renderer??"canvas",u=n.logLevel??xi.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:_,rootContainer:w}
202=wae(c);if(!_.getElementById(E)){const S=document.createElement("style");S.id=E,S.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?cae.toString():n.defaultStyle,w.appendChild(S)}}const f=bae(t,n.mode);let d=gae[f](t,r);if(f==="vega-lite"&&d.$schema){const E=Y3(d.$schema);aN($d.vega,`^${E.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${E.version}, but current version is v${$d.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const E=document.createElement("div");E.classList.add(mae),c.appendChild(E),h=E}const g=n.patch;if(g&&(d=g instanceof Function?g(d):Sg(d,g,!0,!1).newDocument),n.formatLocale&&xi.formatLocale(n.formatLocale),n.timeFormatLocale&&xi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const _=n.expressionFunctions[E];"fn"in _?xi.expressionFunction(E,_.fn,_.visitor):_ instanceof Function&&xi.expressionFunction(E,_)}const{ast:p}=n,m=xi.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||xi.View)(m,{loader:i,logLevel:u,renderer:o,...p?{expr:xi.expressionInterpreter??n.expr??kY}:{}});if(y.addSignalListener("autosize",(E,_)=>{const{type:w}=_;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:E,tooltip:_}=n,w=E&&!uN(E)?E==null?void 0:E.baseURL:void 0,S=yae(_)?_:new Nse({baseURL:w,..._===!0?{}:_}).call;y.tooltip(S)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:_}=typeof b=="boolean"?{}:b;y.hover(E,_)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=a.CLICK_TO_VIEW_ACTIONS,c.append(w),E=w;const S=document.createElement("summary");S.innerHTML=pae,w.append(S),v=A=>{w.contains(A.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const _=document.createElement("div");if(E.append(_),_.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const S=a[`${w.toUpperCase()}_ACTION`],A=document.createElement("a"),k=V(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;A.text=S,A.href="#",A.target="_blank",A.download=`${l}.${w}`,A.addEventListener("mousedown",async function(F){F.preventDefault();const L=await y.toImageURL(w,k);this.href=L}),_.append(A)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=a.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(S){US(Og(t),n.sourceHeader??"",n.sourceFooter??"",f),S.preventDefault()}),_.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=a.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(S){US(Og(d),n.sourceHeader??"",n.sourceFooter??"","vega"),S.preventDefault()}),_.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",S=document.createElement("a");S.text=a.EDITOR_ACTION,S.href="#",S.addEventListener("click",function(A){lae(window,w,{config:r,mode:g?"vega":f,renderer:o,spec:Og(g?d:t)}),A.preventDefault()}),_.append(S)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const _ae=new Set(["width","height"]);var em,GS;function Sae(){return GS||(GS=1,em=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var a=s[r];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),em}var Aae=Sae();const kae=T5(Aae);function Cae(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,ls().remove(()=>!0).insert(i)))}function tm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function HS(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function nm(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function $ae(e){return new Set(e.flatMap(t=>Object.keys(t)))}function Fae(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1}
202,i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...$ae([e,t])].filter(a=>a!=="width"&&a!=="height").some(a=>!(a in e)||!(a in t)||!kae(e[a],t[a]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function VS(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}var Oae=ui("<div></div>");function Tae(e,t){wl(t,!0);let n=G0(t,"view",15),i=$n(void 0),r=$n(fn({})),s=$n(void 0),a=$n(fn({})),o=$n(void 0);Jx(()=>{t.data,Qx(()=>{d()})}),Jx(()=>{ee(o),t.options,t.spec,t.signalListeners,Qx(()=>{if(ee(o)!==void 0){if(!tm(t.options,ee(r),_ae))u();else{const g=Fae(VS(t.spec,t.options),VS(ee(a),ee(r))),p=t.signalListeners,m=ee(s);if(g){if(g.isExpensive)u();else if(ee(i)!==void 0){const y=!tm(p,m);n(ee(i).view),g.width!==!1&&n().width(g.width),g.height!==!1&&n().height(g.height),y&&(m&&HS(n(),m),p&&nm(n(),p)),n().runAsync()}}else!tm(p,m)&&ee(i)!==void 0&&(n(ee(i).view),m&&HS(n(),m),p&&nm(n(),p),n().runAsync())}Xt(r,fn(t.options)),Xt(s,fn(t.signalListeners)),Xt(a,fn(t.spec))}})}),vN(()=>{l()});async function u(){if(ee(o)!==void 0){l();try{Xt(i,fn(await xae(ee(o),t.spec,t.options))),n(ee(i).view),t.signalListeners&&nm(n(),t.signalListeners)&&n().runAsync(),f(n())}catch(g){c(g)}}}function l(){ee(i)&&(ee(i).finalize(),Xt(i,void 0),n(void 0))}function c(g){var p;(p=t.onError)==null||p.call(t,g),console.warn(g)}function f(g){var p;d(),(p=t.onNewView)==null||p.call(t,g)}async function d(){t.data&&Object.keys(t.data).length>0&&ee(i)!==void 0&&(n(ee(i).view),Cae(n(),t.data),await n().resize().runAsync())}var h=Oae();k5(h,g=>Xt(o,g),()=>ee(o)),at(e,h),El()}function lN(e,t){let n=G0(t,"view",15);const i=Ht(()=>({...t.options,mode:"vega-lite"}));Tae(e,{get spec(){return t.spec},get data(){return t.data},get signalListeners(){return t.signalListeners},get options(){return ee(i)},get view(){return n()},set view(r){n(r)},get onNewView(){return t.onNewView},get onError(){return t.onError}})}function Rae(e,t){wl(t,!0);let n=800;function i(o){const u=[...o].map(c=>({...c,normalized_date:new Date(c.normalized_date)}));return{windowedcounts:u.filter(c=>c.era),oneoffs:u.filter(c=>[2009,2020,2024].includes(c["Academic Year"]))}}const r={$schema:"https://vega.github.io/schema/vega-lite/v5.json",title:`${t.db.filters.includes("brand = 'Tenure Track'")?"Tenure track":""} history jobs in North America, by time of year, on H-Net. Ben Schmidt.`,width:n*4/5,height:n*1/2,layer:[{data:{name:"windowedcounts"},mark:{type:"area",borders:!0},encoding:{x:{field:"normalized_date",type:"temporal",timeunit:"monthdate"},y:{title:"Jobs Listed",aggregate:"max",field:"cumulative"},color:{field:"era",type:"nominal"},y2:{aggregate:"min",field:"cumulative"}}},{data:{name:"oneoffs"},mark:{type:"line",strokeWidth:5,color:"black"},encoding:{x:{field:"normalized_date",type:"temporal",timeunit:"monthdate"},y:{field:"cumulative",type:"quantitative"},strokeDash:{field:"Academic Year",type:"nominal"}}}]};var s=Ef(),a=zs(s);wf(a,()=>t.db.windowedCounts,o=>{var u=e2("loading...");at(o,u)},(o,u)=>{var l=Ht(()=>i(ee(u)));lN(o,{spec:r,get data(){return ee(l)}})},(o,u)=>{var l=e2();xf(()=>W0(l,ee(u).message)),at(o,l)}),at(e,s),El()}var Dae=(e,t,n)=>{Xt(t,fn(ee(n).Region))},Nae=ui('<button type="button" class="cursor-pointer border p-2 rounded-xl hover:bg-gray-10"> </button>'),Mae=ui("<p>...</p>"),Lae=(e,t)=>Xt(t,null),Iae=ui('<!> <div class="flex justify-center w-full flex-col items-center w-[80vw]"><div>Limit to jobs studying a particular area</div> <div id="regionSelect" class="flex flex-row flex-wrap gap-2"><!></div> <button type="button" class="cursor-pointer border p-2 mt-2 rounded-xl w-full">All subfields</button></div>',1),Pae=ui('<div class="text-gray-600 w-[800px] h-[400px]">Loading...</div>');function zae(e,t){wl(t,!0);const n=Ht(()=>
202t.db.regionCounts);let i=$n(null),r=Ht(()=>t.db.annualCounts(!0)),s=Ht(async()=>(ee(i),ee(r).then(c=>({counts:c.counts.filter(f=>ee(i)===null?!0:f.Region===ee(i))}))));const o={mark:"line",width:800,height:800*1/2,layer:[{data:{name:"counts"},mark:{type:"bar",borders:!0},encoding:{x:{field:"ay",title:"Academic Year",type:"ordinal"},y:{aggregate:"sum",field:"count",title:"Jobs Listed",type:"quantitative"},color:{field:"era",type:"nominal"},opacity:{field:"comparable",type:"nominal"}}}]};var u=Ef(),l=zs(u);wf(l,()=>ee(s),c=>{var f=Pae();at(c,f)},(c,f)=>{var d=Iae(),h=zs(d);lN(h,{spec:o,get data(){return ee(f)}});var g=er(h,2),p=er(Rr(g),2),m=Rr(p);wf(m,()=>ee(n),b=>{var v=Mae();at(b,v)},(b,v)=>{var x=Ef(),E=zs(x);C5(E,17,()=>ee(v),$5,(_,w)=>{var S=Nae();S.__click=[Dae,i,w];var A=Rr(S,!0);Dr(S),xf(()=>{h2(S,"underline",ee(w).Region===ee(i)),W0(A,ee(w).Region)}),at(_,S)}),at(b,x)}),Dr(p);var y=er(p,2);y.__click=[Lae,i],Dr(g),xf(()=>h2(y,"underline",ee(i)===null)),at(c,d)}),at(e,u),El()}yN(["click"]);var Bae=ui(`<div class="checkboxes flex flex-row flex-wrap"><div class="filter-option svelte-1v4gb1k"><input type="checkbox" id="tt-only" class="svelte-1v4gb1k"> <label for="tt-only">Show only tenure track jobs</label></div> <div class="filter-option svelte-1v4gb1k"><input type="checkbox" id="history-only" class="svelte-1v4gb1k"> <label for="history-only">Show only specifically history jobs (not political science, etc.)</label></div> <div class="filter-option svelte-1v4gb1k"><input type="checkbox" id="na-only" class="svelte-1v4gb1k"> <label for="na-only">Show only jobs in North America (H-net is not widely used outside the US and Canada)</label></div></div> <div class="mt-12 mb-8"><h2>Annual patterns</h2> Here's the overall patterns of job postings by year.</div> <!> <div class="mt-12 mb-8"><h2>Seasonal patterns</h2> Looking at the patterns by posting date, we can get an idea of how good or bad the job market is 203 going well ahead of the end of the year.</div> <!>`,1);function jae(e,t){wl(t,!0);const n=G0(t,"db",7);var i=Bae(),r=zs(i),s=Rr(r),a=Rr(s);Cg(a),kg(2),Dr(s);var o=er(s,2),u=Rr(o);Cg(u),kg(2),Dr(o);var l=er(o,2),c=Rr(l);Cg(c),kg(2),Dr(l),Dr(r);var f=er(r,4);zae(f,{get db(){return n()}});var d=er(f,4);Rae(d,{get db(){return n()}}),Fg(a,()=>n().tt_only,h=>n().tt_only=h),Fg(u,()=>n().history,h=>n().history=h),Fg(c,()=>n().america_only,h=>n().america_only=h),at(e,i),El()}const Uae=""+new URL("../assets/duckdb-browser-mvp.worker.CM-L3bpJ.js",import.meta.url).href,qae=""+new URL("../assets/duckdb-eh.DrTJ_0hP.wasm",import.meta.url).href,Wae=""+new URL("../assets/duckdb-browser-eh.worker.D6ypKDsm.js",import.meta.url).href;async function Gae(){const e=await F5(()=>import("../chunks/duckdb-browser.B-A5n9Vx.js"),__vite__mapDeps([0,1,2]),import.meta.url),t={mvp:{mainModule:bN,mainWorker:Uae},eh:{mainModule:qae,mainWorker:Wae}},n=await e.selectBundle(t),i=new Worker(n.mainWorker),r=new e.ConsoleLogger,s=new e.AsyncDuckDB(r,i);return await s.instantiate(n.mainModule,n.pthreadWorker),s}const Vc={tt_only:"brand = 'Tenure Track'",ntt_only:"brand != 'Tenure Track'",history:"History = TRUE",america_only:'"North America" = TRUE'};var ml,yl,bl,vl,xl,Fd,Od,Td,Rd,Dd,Nd,Md,Ld;const Gx=class Gx{constructor(){gc(this,"dbPromise");gc(this,"db",null);gc(this,"_connection",null);Wt(this,ml,$n(null));Wt(this,yl,$n(!0));Wt(this,bl,$n(!1));Wt(this,vl,$n(!0));Wt(this,xl,$n(!0));Wt(this,Fd,Ht(()=>this.tt_only));Wt(this,Od,Ht(()=>{const t=[];return this.tt_only&&t.push(Vc.tt_only),this.ntt_only&&t.push(Vc.ntt_only),this.history&&t.push(Vc.history),this.america_only&&t.push(Vc.america_only),t}));Wt(this,Td,Ht(async()=>{const t=await this.dbPromise,n=await this.conn(),i=await fetch("/nc_hnet.parquet");return await t.registerFileBuffer("buffer.parquet",new Uint8Array(await i.arrayBuffer())),await n.query("CREATE TABLE tb AS SELECT * FROM 'buffer.parquet'"),await n.query(` 204 UPDATE tb SET history = false WHERE "Primary Category" LIKE '%Art%' 205 `),{}}));Wt(this,Rd,Ht(async()=>{await this.baseTable;const t=await this.conn();let n=`CREATE OR REPLACE TABLE filtered AS 206 SELECT * FROM tb`;return this.filters.length>0&&(n+=" where "+this.filters.join(" AND ")),await t.query(n),await t.query("SELECT * FROM filtered LIMIT 10"),{}}));Wt(this,Dd,Ht(async()=>(await this.filtered,(await this.conn()).query('SELECT MAX(normalized_date)::STRING v FROM filtered WHERE "Academic Year" == 2024').then(n=>n.get(0).v))));Wt(this,Nd,Ht(async()=>{const t=await this.conn();return await t.query(`
207 CREATE TABLE year_groups ( 208 "Academic Year" INT, 209 era TEXT 210 ) 211 `),await t.query(` 212 INSERT INTO year_groups 213 VALUES 214 (2003, '2003-2008'), 215 (2004, '2003-2008'), 216 (2005, '2003-2008'), 217 (2006, '2003-2008'), 218 (2007, '2003-2008'), 219 (2008, '2003-2008'), 220 (2010, '2010-2013'), 221 (2011, '2010-2013'), 222 (2012, '2010-2013'), 223 (2013, '2010-2013'), 224 (2014, '2014-2024'), 225 (2015, '2014-2024'), 226 (2016, '2014-2024'), 227 (2017, '2014-2024'), 228 (2018, '2014-2024'), 229 (2019, '2014-2024'), 230 (2021, '2014-2024'), 231 (2022, '2014-2024'), 232 (2023, '2014-2024'), 233-- (2024, '2014-2024') 234 `),{}}));Wt(this,Md,Ht(async()=>{await this.filtered;const{year_groups:t}=this;await t;const n=await this.conn(),i=` 235 WITH 236 -- cross join to fill in empty dates 237 ay_tb AS (SELECT * FROM (SELECT DISTINCT(normalized_date) FROM tb) t1 CROSS JOIN (SELECT DISTINCT "academic year" FROM tb)), 238 -- get counts for each individual day. 239 annual AS (SELECT "Academic Year", "normalized_date", 240 (COUNT(*) FILTER (WHERE Position IS NOT NULL))::FLOAT count 241 FROM filtered FULL OUTER JOIN ay_tb USING (normalized_date, "academic year") WHERE "Academic Year" > 2004 GROUP BY ALL) 242 -- 243 SELECT "Academic Year", "normalized_date", 244 SUM(count) OVER ( 245 PARTITION BY "Academic Year" 246 ORDER BY "normalized_date" ASC 247 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW 248 ) cumulative, 249 era 250 FROM annual LEFT JOIN year_groups USING ("Academic Year") 251 WHERE ("Academic Year" < 2024 AND "Academic Year" > 2003) 252 OR (normalized_date < '${await this.max_date}') 253 `;return await n.query("select json_serialize_sql('SELECT foo.bar, 1') AS json"),n.query(i)}));Wt(this,Ld,Ht(async()=>{const{filtered:t}=this,n=await this.conn();return await t,n.query(` 254 SELECT "Region", 255 COUNT(*)::FLOAT count, comparable FROM filtered 256 GROUP BY ALL`)}));this.dbPromise=Gae()}get tb(){return ee(We(this,ml))}set tb(t){Xt(We(this,ml),fn(t))}get tt_only(){return ee(We(this,yl))}set tt_only(t){Xt(We(this,yl),fn(t))}get ntt_only(){return ee(We(this,bl))}set ntt_only(t){Xt(We(this,bl),fn(t))}get history(){return ee(We(this,vl))}set history(t){Xt(We(this,vl),fn(t))}get america_only(){return ee(We(this,xl))}set america_only(t){Xt(We(this,xl),fn(t))}get filtered_(){return ee(We(this,Fd))}get filters(){return ee(We(this,Od))}static async create(){const t=new Gx;return await t.dbPromise,t}async conn(){return this._connection?this._connection:(this.db||(this.db=await this.dbPromise),this._connection=await this.db.connect(),this._connection)}get baseTable(){return ee(We(this,Td))}get filtered(){return ee(We(this,Rd))}get max_date(){return ee(We(this,Dd))}get year_groups(){return ee(We(this,Nd))}get windowedCounts(){return ee(We(this,Md))}get regionCounts(){return ee(We(this,Ld))}async annualCounts(t=!1){const{filtered:n,year_groups:i}=this;await i,await n;const{max_date:r}=this,s=` 257 with comparabalizeda as ( 258 SELECT *, 259 normalized_date::string dstring, 260 '${await r}' AS dstring2, 261 FROM filtered WHERE "Academic Year" > 2003 262 ), 263 comparabalized AS ( 264 FROM comparabalizeda LEFT JOIN year_groups ON (year_groups."Academic Year" = comparabalizeda."Academic Year") 265 SELECT *, 266 year_groups."Academic Year" as ay1, 267 dstring < dstring2 AS comparable 268 ) 269 270 SELECT "Academic Year" ay, 271 COUNT(*)::INT count 272 , dstring < dstring2 AS comparable 273 , era 274 , ay1 275 ${t?', "Region"':""} 276 FROM comparabalized 277 WHERE "Academic Year" > 2003 278 GROUP BY ALL 279 `;return{counts:[...await(await this.conn()).query(s)]}}};ml=new WeakMap,yl=new WeakMap,bl=new WeakMap,vl=new WeakMap,xl=new WeakMap,Fd=new WeakMap,Od=new WeakMap,Td=new WeakMap,Rd=new WeakMap,Dd=new WeakMap,Nd=new WeakMap,Md=new WeakMap,Ld=new WeakMap;let q0=Gx;const XS={quireComponents:[],metadata:{title:"History Jobs",date:"2024-12-22T00:00:00.000Z"},custom:{},content:{tag:"doc",references:{},autoReferences:{},footnotes:{},children:[{tag:"para",children:[{tag:"str",text:"I sporadically scrape the website"},{tag:"soft_break"},{tag:"str",text:"H-Net to watch the state of the academic job market in history. Job "},{tag:"soft_break"},{tag:"str",text:"ads from H-Net tend to be basically the same as those from the AHA"},{tag:"smart_punctuation",type:"right_single_quote",text:"'"},{tag:"str",text:"s"},{tag:"soft_break"},{tag:"str",text:"own job board, and are easy enough to use."}]},{tag:"para",children:[{tag:"str",text:"Some general principals for understanding this:"}]},{tag:"ordered_list",style:"1.",children:[{tag:"list_item",children:[{tag:"para",children:[{tag:"strong",children:[{tag:"str",text:"Things were better in the 2000s"}]},{tag:"str",text:". The financial crisis permanently"},{tag:"soft_break"},{tag:"str",text:"changed the market for history jobs."}]}]},{tag:"list_item",children:[{tag:"para",children:[{tag:"strong",children:[{tag:"str",text:"The period from 2010-2013 was better than what followed"}
279]},{tag:"str",text:"."}]}]}],start:1,tight:!0}]},footnotes:{},references:{},classes:[]};var Hae=ui('<div class="text-sm text-gray-600 m-4"> </div>'),Vae=ui("<p>Loading...</p>"),Xae=ui("<p>Loading...</p>"),Yae=ui("<p>Loading...</p>"),Kae=ui("<!> <!> <!>",1);function Joe(e,t){wl(t,!0),console.log({historyJobs:XS});let n=$n(null);xN(()=>{q0.create().then(u=>{Xt(n,fn(u))})});let i=Ht(()=>async()=>{if(ee(n)){console.log("getting last updated");const{baseTable:u}=ee(n);await u;const l=await ee(n).conn();console.log({conn:l});const c=await l.query('SELECT max("Posting Date")::string as max_date FROM tb');return console.log({max_date:c}),c.get(0).max_date.slice(0,10)}return"..."});var r=Kae(),s=zs(r);Zx(s,()=>ee(n),u=>{var l=Ef(),c=zs(l);wf(c,()=>ee(i)(),f=>{var d=Vae();at(f,d)},(f,d)=>{var h=Hae(),g=Rr(h);Dr(h),xf(()=>W0(g,`Data last updated: ${ee(d)??""}`)),at(f,h)}),at(u,l)},u=>{var l=Xae();at(u,l)});var a=er(s,2);O5(a,{quire:XS});var o=er(a,2);Zx(o,()=>ee(n),u=>{jae(u,{get db(){return ee(n)}})},u=>{var l=Yae();at(u,l)}),at(e,r),El()}export{Joe as component};
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.