PageSourceSearch

https://recork.org/_app/immutable/chunks/DgYQHPtH.js

js recork.org collected 2026-09-25 21:07:23 UTC 255,594 bytes, 2 lines download raw bytes

1var id=Object.defineProperty;var da=e=>{throw TypeError(e)};var rd=(e,t,n)=>t in e?id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>rd(e,typeof t!="symbol"?t+"":t,n),pa=(e,t,n)=>t.has(e)||da("Cannot "+n);var ga=(e,t,n)=>(pa(e,t,"read from private field"),n?n.call(e):t.get(e)),ha=(e,t,n)=>t.has(e)?da("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Rr=(e,t,n,i)=>(pa(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);import{splitAccessPath as Ln,stringValue as R,mergeConfig as Nc,isObject as L,hasOwnProperty as Z,isNumber as V,isString as T,writeConfig as Tc,logger as sd,Warn as od,isArray as k,array as ee,parseSelector as Mn,isBoolean as Vi,identity as ad,parseExpression as cd,isFunction as ud}from"./BsAKizII.js";var ld="6.4.2",fd={version:ld};function _s(e){return v(e,"or")}function Cs(e){return v(e,"and")}function Fs(e){return v(e,"not")}function Ai(e,t){if(Fs(e))Ai(e.not,t);else if(Cs(e))for(const n of e.and)Ai(n,t);else if(_s(e))for(const n of e.or)Ai(n,t);else t(e)}function yn(e,t){return Fs(e)?{not:yn(e.not,t)}:Cs(e)?{and:e.and.map(n=>yn(n,t))}:_s(e)?{or:e.or.map(n=>yn(n,t))}:t(e)}const N=structuredClone;function dd(e){throw new Error(e)}function Qn(e,t){const n={};for(const i of t)Z(e,i)&&(n[i]=e[i]);return n}function Ne(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>U(e)).join(",")})`};function I(e){if(V(e))return e;const t=T(e)?e:U(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 ma(e){return e===!1||e===null}function z(e,t){return e.includes(t)}function Zn(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function Ac(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function pd(e,...t){for(const n of t)gd(e,n??{});return e}function gd(e,t){for(const n of b(t))Tc(e,n,t[n],!0)}function _e(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 t$(e,t){const n=b(e),i=b(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function hd(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Oc(e,t){for(const n of e)if(t.has(n))return!0;return!1}function ya(e){const t=new Set;for(const n of e){const r=Ln(n).map((o,a)=>a===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function Pc(e,t){return e===void 0||t===void 0?!0:Oc(ya(e),ya(t))}function B(e){return b(e).length===0}const b=Object.keys,re=Object.values,Vt=Object.entries;function Jn(e){return e===!0||e===!1}function Qr(e){return T(e)||V(e)||Jn(e)}function K(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Oi(e,t){return Fs(e)?`!(${Oi(e.not,t)})`:Cs(e)?`(${e.and.map(n=>Oi(n,t)).join(") && (")})`:_s(e)?`(${e.or.map(n=>Oi(n,t)).join(") || (")})`:t(e)}function Zr(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Zr(e[n],t)&&delete e[n],B(e)}function Xi(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Ic(e,t="datum"){const n=Ln(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(R).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function md(e,t="datum"){return`${t}[${R(Ln(e).join("."))}]`}function j(e){return`datum['${e.replaceAll("'","\\'")}']`}function yd(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function xd(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Le(e){return`${Ln(e).map(xd).join("\\.")}`}function wn(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function si(e){return`${Ln(e).join(".")}`}function ei(e){return e?Ln(e).length:0}function ne(...e){return e.find(t=>t!==void 0)}let Rc=42;function bd(e){const t=++Rc;return e?String(e)+t:t}function n$(){Rc=42}function Sd(e){return $d(e)?e:`__${e}`}function $d(e){return e.startsWith("__")}function Ii(e){if(e!==void 0)return(e%360+360)%360}function Ns(e){return V(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const xa=Object.getPrototypeOf(structuredClone({}));function Ce(e,t){if(e===t)return!0;
1if(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(!Ce(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(!Ce(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!==xa.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==xa.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(!Ce(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function U(e){const t=[];return function n(i){if(i!=null&&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 o=t.push(i)-1,a=Object.keys(i).sort();for(s="",r=0;r<a.length;r++){const c=a[r],u=n(i[c]);u&&(s&&(s+=","),s+=`${JSON.stringify(c)}:${u}`)}return t.splice(o,1),`{${s}}`}(e)}function v(e,t){return L(e)&&Z(e,t)&&e[t]!==void 0}const ft="row",dt="column",Yi="facet",X="x",ae="y",We="x2",nt="y2",It="xOffset",Dn="yOffset",Be="radius",bt="radius2",Ae="theta",St="theta2",He="latitude",qe="longitude",Ge="latitude2",Te="longitude2",Rt="time",xe="color",it="fill",rt="stroke",be="shape",$t="size",sn="angle",vt="opacity",zt="fillOpacity",Lt="strokeOpacity",Mt="strokeWidth",Dt="strokeDash",oi="text",En="order",ai="detail",Ki="key",Xt="tooltip",Qi="href",Zi="url",Ji="description",vd={x:1,y:1,x2:1,y2:1},zc={theta:1,theta2:1,radius:1,radius2:1};function Lc(e){return Z(zc,e)}const Ts={longitude:1,longitude2:1,latitude:1,latitude2:1};function Mc(e){switch(e){case He:return"y";case Ge:return"y2";case qe:return"x";case Te:return"x2"}}function Dc(e){return Z(Ts,e)}const wd=b(Ts),As={...vd,...zc,...Ts,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time: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 xn(e){return e===xe||e===it||e===rt}const jc={row:1,column:1,facet:1},Fe=b(jc),Os={...As,...jc},Ed=b(Os),{order:i$,detail:r$,tooltip:s$,...kd}=Os,{row:o$,column:a$,facet:c$,..._d}=kd;function Cd(e){return Z(_d,e)}function Uc(e){return Z(Os,e)}const Fd=[We,nt,Ge,Te,St,bt];function Wc(e){return on(e)!==e}function on(e){switch(e){case We:return X;case nt:return ae;case Ge:return He;case Te:return qe;case St:return Ae;case bt:return Be}return e}function Tt(e){if(Lc(e))switch(e){case Ae:return"startAngle";case St:return"endAngle";case Be:return"outerRadius";case bt:return"innerRadius"}return e}function st(e){switch(e){case X:return We;case ae:return nt;case He:return Ge;case qe:return Te;case Ae:return St;case Be:return bt}}function Se(e){switch(e){case X:case We:return"width";
1case ae:case nt:return"height"}}function Bc(e){switch(e){case X:return"xOffset";case ae:return"yOffset";case We:return"x2Offset";case nt:return"y2Offset";case Ae:return"thetaOffset";case Be:return"radiusOffset";case St:return"theta2Offset";case bt:return"radius2Offset"}}function Ps(e){switch(e){case X:return"xOffset";case ae:return"yOffset"}}function Nd(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Td=b(As),{x:u$,y:l$,x2:f$,y2:d$,xOffset:p$,yOffset:g$,latitude:h$,longitude:m$,latitude2:y$,longitude2:x$,theta:b$,theta2:S$,radius:$$,radius2:v$,...Is}=As,Ad=b(Is),Rs={x:1,y:1},wt=b(Rs);function te(e){return Z(Rs,e)}const zs={theta:1,radius:1},Od=b(zs);function er(e){return e==="width"?X:ae}const Hc={xOffset:1,yOffset:1};function ci(e){return Z(Hc,e)}const Pd={time:1};function zr(e){return e in Pd}const{text:w$,tooltip:E$,href:k$,url:_$,description:C$,detail:F$,key:N$,order:T$,...qc}=Is,Id=b(qc);function Rd(e){return Z(Is,e)}function zd(e){switch(e){case xe:case it:case rt:case $t:case be:case vt:case Mt:case Dt:return!0;case zt:case Lt:case sn:case Rt:return!1}}const Gc={...Rs,...zs,...Hc,...qc},Ls=b(Gc);function ot(e){return Z(Gc,e)}function Ld(e,t){return Dd(e)[t]}const Vc={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:A$,...Md}=Vc;function Dd(e){switch(e){case xe:case it:case rt:case Ji:case ai:case Ki:case Xt:case Qi:case En:case vt:case zt:case Lt:case Mt:case Yi:case ft:case dt:return Vc;case X:case ae:case It:case Dn:case He:case qe:case Rt:return Md;case We:case nt:case Ge:case Te:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case $t:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Dt:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case be:return{point:"always",geoshape:"always"};case oi:return{text:"always"};case sn:return{point:"always",square:"always",text:"always"};case Zi:return{image:"always"};case Ae:return{text:"always",arc:"always"};case Be:return{text:"always",arc:"always"};case St:case bt:return{arc:"always"}}}function Lr(e){switch(e){case X:case ae:case Ae:case Be:case It:case Dn:case $t:case sn:case Mt:case vt:case zt:case Lt:case Rt:case We:case nt:case St:case bt:return;case Yi:case ft:case dt:case be:case Dt:case oi:case Xt:case Qi:case Zi:case Ji:return"discrete";case xe:case it:case rt:return"flexible";case He:case qe:case Ge:case Te:case ai:case Ki:case En:return}}const jd={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},Ud={count:1,min:1,max:1};function mt(e){return v(e,"argmin")}function jt(e){return v(e,"argmax")}function Ms(e){return T(e)&&Z(jd,e)}const Wd=new Set(["count","valid","missing","distinct"]);function tr(e){return T(e)&&Wd.has(e)}function Bd(e){return T(e)&&z(["min","max"],e)}const Hd=new Set(["count","sum","distinct","valid","missing"]),qd=new Set(["mean","average","median","q1","q3","min","max"]);function Xc(e){return Vi(e)&&(e=pr(e,void 0)),`bin${b(e).map(t=>nr(e[t])?K(`_${t}_${Vt(e[t])}`):K(`_${t}_${e[t]}`)).join("")}`}function H(e){return e===!0||an(e)&&!e.binned}function ce(e){return e==="binned"||an(e)&&e.binned===!0}function an(e){return L(e)}function nr(e){return v(e,"param")}function ba(e){switch(e){case ft:case dt:case $t:case xe:case it:case rt:case Mt:case vt:case zt:case Lt:case be:return 6;case Dt:return 4;default:return 10}}function ui(e){return v(e,"expr")}function ue(e,{level:t}={level:0}){const n=b(e||{}),i={};for(const r of n)i[r]=t===0?Ee(e[r]):ue(e[r],{level:t-1});return i}function Yc(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:c,subtitleFont:u,subtitleFontSize:l,subt
1itleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:g,...h}=e,m={...h,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},S={...c?{subtitleColor:c}:{},...u?{subtitleFont:u}:{},...l?{subtitleFontSize:l}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...g?{subtitlePadding:g}:{}},_=Qn(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:_,nonMarkTitleProperties:y,subtitle:S}}function Ct(e){return T(e)||k(e)&&T(e[0])}function C(e){return v(e,"signal")}function cn(e){return v(e,"step")}function Kc(e){return k(e)?!1:v(e,"fields")&&!v(e,"data")}function Gd(e){return k(e)?!1:v(e,"fields")&&v(e,"data")}function lt(e){return k(e)?!1:v(e,"field")&&v(e,"data")}const Vd={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},Xd=b(Vd),Yd={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Jr=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],Kd=" – ";function Qc(e){const t=k(e.condition)?e.condition.map(Sa):Sa(e.condition);return{...Ee(e),condition:t}}function Ee(e){if(ui(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Sa(e){if(ui(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function q(e){if(ui(e)){const{expr:t,...n}=e;return{signal:t,...n}}return C(e)?e:e!==void 0?{value:e}:void 0}function Qd(e){return C(e)?e.signal:R(e)}function $a(e){return C(e)?e.signal:R(e.value)}function Ie(e){return C(e)?e.signal:e==null?null:R(e)}function Zd(e,t,n){for(const i of n){const r=Je(i,t.markDef,t.config);r!==void 0&&(e[i]=q(r))}return e}function Zc(e){return[].concat(e.type,e.style??[])}function M(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&v(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:Je(e,t,n,i)}function Je(e,t,n,{vgChannel:i}={}){const r=es(e,t,n.style);return ne(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}
vendor: 19,405 bytes, line 1
1function es(e,t,n){return Jc(e,Zc(t),n)}function Jc(e,t,n){t=ee(t);let i;for(const r of t){const s=n[r];v(s,e)&&(i=s[e])}return i}function eu(e,t){return ee(e).reduce((n,i)=>(n.field.push(E(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function tu(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Ce(r,i))return;n.push(i)}),n}function nu(e,t){return Ce(e,t)||!t?e:e?[...ee(e),...ee(t)].join(", "):t}function iu(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Ct(n)||C(n))&&(Ct(i)||C(i)))return{explicit:e.explicit,value:nu(n,i)};if(Ct(n)||C(n))return{explicit:e.explicit,value:n};if(Ct(i)||C(i))return{explicit:e.explicit,value:i};if(!Ct(n)&&!C(n)&&!Ct(i)&&!C(i))return{explicit:e.explicit,value:tu(n,i)};throw new Error("It should never reach here")}function Ds(e){return`Invalid specification ${U(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Jd='Autosize "fit" only works for single views and layered views.';function va(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function wa(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 Ea(e){return e?`Dropping "fit-${e}" because spec has discrete ${Se(e)}.`:'Dropping "fit" because spec has discrete size.'}function js(e){return`Unknown field for ${e}. Cannot calculate view size.`}function ka(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function ep(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function tp(e){return`The "nearest" transform is not supported for ${e} marks.`}function ru(e){return`Selection not supported for ${e} yet.`}function np(e){return`Cannot find a selection named "${e}".`}const ip="Scale bindings are currently only supported for scales with unbinned, continuous domains.",rp="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",sp="Legend bindings are only supported for selections over an individual field or encoding channel.";function op(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function ap(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const cp="The same selection must be used to override scale domains in a layered view.",up='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function lp(e){return`Unknown repeated value "${e}".`}function _a(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const fp="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",Us="Animation involving facet, layer, or concat is currently unsupported.";function dp(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${R(e)}.`}function pp(e,t,n,i){return`${e.length?"Multiple ":"No "}matching ${R(t)} encoding found for selection ${R(n.param)}. Using "field": ${R(i)}.`}const gp="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function hp(e){return`Unrecognized parse "${e}".`}function Ca(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const mp="Attempt to add the same child twice.";function yp(e){return`Ignoring an invalid transform: ${U(e)}.`}const xp='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 Fa(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function bp(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${U(t)} is overridden by a child projection ${U(n)}.`}const Sp="Arc marks uses theta channel rather than angle, replacing angle with theta.";function $p(e){return`${e}Offset dropped because ${e} is continuous`}function vp(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${U(n)}}.`}function su(e){return`Invalid field type "${e}".`}function wp(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Ep(e){return`Invalid aggregation operator "${e}".`}function ou(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 kp(e){return`Position range does not support relative band size for ${e}.`}function ts(e,t){return`Dropping ${U(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const _p="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function ir(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Cp(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Fp(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Np(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Tp(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Mr(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Ap(e){return`The ${e} for range marks cannot be an expression`}function Op(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 Pp(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Ip(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Rp(e){return`Cannot use the relative band size with ${e} scale.`}function zp(e){return`Using unaggregated domain with raw field has no effect (${U(e)}).`}function Lp(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Mp(e){return`Unaggregated domain is currently unsupported for log scale (${U(e)}).`}function Dp(e){return`Cannot apply size to non-oriented mark "${e}".`}function jp(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Up(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function au(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function cu(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Wp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${U(n)} and ${U(i)}). Using ${U(n)}.`}function Bp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${U(n)} and ${U(i)}). Using the union of the two domains.`}function Hp(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 qp(e){return`Dropping sort property ${U(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const Na="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Gp="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.",Vp="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.",Xp="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 Yp(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function Kp(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Qp(e){return`Stack is applied to a non-linear scale (${e}).`}function Zp(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Ri(e,t){return`Invalid ${e}: ${U(t)}.`}function Jp(e){return`Dropping day from datetime ${U(e)} as day cannot be combined with other units.`}function eg(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function tg(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function ng(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Ta(e){return`1D error band does not support ${e}.`}function uu(e){return`Channel ${e} is required for "binned" bin.`}function ig(e){return`Channel ${e} should not be used with "binned" bin.`}function rg(e){return`Domain for ${e} is required for threshold scale.`}const lu=sd(od);let Yt=lu;function sg(e){return Yt=e,Yt}function og(){return Yt=lu,Yt}function Ws(...e){Yt.error(...e)}function $(...e){Yt.warn(...e)}function ag(...e){Yt.debug(...e)}function un(e){if(e&&L(e)){for(const t of Hs)if(v(e,t))return!0}return!1}const fu=["january","february","march","april","may","june","july","august","september","october","november","december"],cg=fu.map(e=>e.substr(0,3)),du=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ug=du.map(e=>e.substr(0,3));function lg(e){if(Ns(e)&&(e=+e),V(e))return e>4&&$(Ri("quarter",e)),e-1;throw new Error(Ri("quarter",e))}function fg(e){if(Ns(e)&&(e=+e),V(e))return e-1;{const t=e.toLowerCase(),n=fu.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=cg.indexOf(i);if(r!==-1)return r;throw new Error(Ri("month",e))}}function dg(e){if(Ns(e)&&(e=+e),V(e))return e%7;{const t=e.toLowerCase(),n=du.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=ug.indexOf(i);if(r!==-1)return r;throw new Error(Ri("day",e))}}function Bs(e,t){const n=[];if(t&&e.day!==void 0&&b(e).length>1&&($(Jp(e)),e=N(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?fg(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?lg(e.quarter):e.quarter;n.push(V(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?dg(e.day):e.day;n.push(V(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 Kt(e){const n=Bs(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function pg(e){const n=Bs(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function gg(e){const t=Bs(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const pu={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Hs=b(pu);function hg(e){return Z(pu,e)}function ln(e){return L(e)?e.binned:gu(e)}function gu(e){return e==null?void 0:e.startsWith("binned")}function qs(e){return e.startsWith("utc")}function mg(e){return e.substring(3)}const yg={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function rr(e){return Hs.filter(t=>mu(e,t))}function hu(e){const t=rr(e);return t[t.length-1]}function mu(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 xg(e,t,{end:n}={end:!1}){const i=Ic(t),r=qs(e)?"utc":"";function s(c){return c==="quarter"?`(${r}quarter(${i})-1)`:`${r}${c}(${i})`}let o;const a={};for(const c of Hs)mu(e,c)&&(a[c]=s(c),o=c);return n&&(a[o]+="+1"),pg(a)}function yu(e){if(!e)return;const t=rr(e);return`timeUnitSpecifier(${U(t)}, ${U(yg)})`}function bg(e,t,n){if(!e)return;const i=yu(e);return`${n||qs(e)?"utc":"time"}Format(${t}, ${i})`}function oe(e){if(!e)return;let t;return T(e)?gu(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:L(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),qs(t.unit)&&(t.utc=!0,t.unit=mg(t.unit)),t}function Sg(e){const{utc:t,...n}=oe(e);return n.unit?(t?"utc":"")+b(n).map(i=>K(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):`${t?"utc":""}timeunit${b(n).map(i=>K(`_${i}_${n[i]}`)).join("")}`}function xu(e,t=n=>n){const n=oe(e),i=hu(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:o}=bu(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Kt(a))} - ${t(Kt(r))}`}}const $g={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function vg(e){return Z($g,e)}function bu(e,t=1){if(vg(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 wg(e){return v(e,"param")}function Gs(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Vs(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Xs(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Ys(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Ks(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Qs(e){if(e!=null&&e.field){if(k(e.range)&&e.range.length===2)return!0;if(C(e.range))return!0}return!1}function Zs(e){return!!(e!=null&&e.field)&&(k(e.oneOf)||k(e.in))}function Eg(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function Su(e){return Zs(e)||Gs(e)||Qs(e)||Vs(e)||Ys(e)||Xs(e)||Ks(e)}function Ve(e,t){return gr(e,{timeUnit:t,wrapTime:!0})}function kg(e,t){return e.map(n=>Ve(n,t))}function $u(e,t=!0){const{field:n}=e,i=oe(e.timeUnit),{unit:r,binned:s}=i||{},o=E(e,{expr:"datum"}),a=r?`time(${s?o:xg(r,n)})`:o;if(Gs(e))return`${a}===${Ve(e.equal,r)}`;if(Vs(e)){const c=e.lt;return`${a}<${Ve(c,r)}`}else if(Ys(e)){const c=e.gt;return`${a}>${Ve(c,r)}`}else if(Xs(e)){const c=e.lte;return`${a}<=${Ve(c,r)}`}else if(Ks(e)){const c=e.gte;return`${a}>=${Ve(c,r)}`}else{if(Zs(e))return`indexof([${kg(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Eg(e))return sr(a,e.valid);if(Qs(e)){const{range:c}=ue(e),u=C(c)?{signal:`${c.signal}[0]`}:c[0],l=C(c)?{signal:`${c.signal}[1]`}:c[1];if(u!==null&&l!==null&&t)return`inrange(${a}, [${Ve(u,r)}, ${Ve(l,r)}])`;const f=[];return u!==null&&f.push(`${a} >= ${Ve(u,r)}`),l!==null&&f.push(`${a} <= ${Ve(l,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${U(e)}`)}function sr(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function _g(e){return Su(e)&&e.timeUnit?{...e,timeUnit:oe(e.timeUnit)}:e}const li={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Cg(e){return e==="quantitative"||e==="temporal"}function Js(e){return e==="ordinal"||e==="nominal"}const Qt=li.quantitative,eo=li.ordinal,kn=li.temporal,to=li.nominal,jn=li.geojson;function Fg(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Qt:return"quantitative";case"t":case kn:return"temporal";case"o":case eo:return"ordinal";case"n":case to:return"nominal";case jn:return"geojson"}}const le={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},ns={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 Ng(e,t){const n=ns[e],i=ns[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Tg={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 Aa(e){return Tg[e]}const vu=new Set(["linear","log","pow","sqrt","symlog"]),wu=new Set([...vu,"time","utc"]);function Eu(e){return vu.has(e)}const ku=new Set(["quantile","quantize","threshold"]),Ag=new Set([...wu,...ku,"sequential","identity"]),Og=new Set(["ordinal","bin-ordinal","point","band"]);function J(e){return Og.has(e)}function Me(e){return Ag.has(e)}function Ye(e){return wu.has(e)}function _n(e){return ku.has(e)}const Pg={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Ig(e){return!T(e)&&v(e,"name")}function _u(e){return v(e,"param")}function Rg(e){return v(e,"unionWith")}function zg(e){return L(e)&&"field"in e}const Lg={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:O$,domain:P$,range:I$,rangeMax:R$,rangeMin:z$,scheme:L$,...Mg}=Lg,Dg=b(Mg);function is(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 Ye(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Ye(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 Ye(e);case"nice":return Ye(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Me(e)&&!z(["log","time","utc","threshold","quantile"],e)}}function Cu(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return xn(e)?void 0:Ip(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 jg(e,t){return z([eo,to],t)?e===void 0||J(e):t===kn?z([le.TIME,le.UTC,void 0],e):t===Qt?Eu(e)||_n(e)||e===void 0:!0}function Ug(e,t,n=!1){if(!ot(e))return!1;switch(e){case X:case ae:case It:case Dn:case Ae:case Be:return Ye(t)||t==="band"?!0:t==="point"?!n:!1;case Rt:return z(["linear","band"],t);case $t:case Mt:case vt:case zt:case Lt:case sn:return Ye(t)||_n(t)||z(["band","point","ordinal"],t);case xe:case it:case rt:return t!=="band";case Dt:case be:return t==="ordinal"||_n(t)}}function Wg(e){return L(e)&&"value"in e}const he={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"},Fu=he.arc,or=he.area,ar=he.bar,Bg=he.image,cr=he.line,ur=he.point,Hg=he.rect,zi=he.rule,Nu=he.text,no=he.tick,qg=he.trail,io=he.cir
1cle,ro=he.square,Tu=he.geoshape;function Ut(e){return["line","area","trail"].includes(e)}function ti(e){return["rect","bar","image","arc","tick"].includes(e)}const Gg=new Set(b(he));function et(e){return v(e,"type")}const Vg=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Xg=["fill","fillOpacity"],Yg=[...Vg,...Xg],Kg={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},Oa=b(Kg),Dr=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Qg={area:["line","point"],bar:Dr,rect:Dr,line:["point"],tick:["bandSize","thickness",...Dr]},Zg={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Jg={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},Au=b(Jg);function Zt(e){return v(e,"band")}const eh={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},th=5,so={binSpacing:0,continuousBandSize:th,minBandSize:.25,timeUnitBandPosition:.5},nh={...so,binSpacing:1},ih={...so,thickness:1};function rh(e){return et(e)?e.type:e}function Ou(e,{isPath:t}
1){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function oo({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,c;if(!i||!Me(i)||r)return"always-valid";const s=Ou(M("invalid",e,t),{isPath:Ut(e.type)});return((c=(a=t.scale)==null?void 0:a.invalid)==null?void 0:c[n])!==void 0?"show":s}function sh(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function Pu({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function Iu({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var l;const o=n==null?void 0:n.get("type"),a=je(t),c=tr(a==null?void 0:a.aggregate),u=oo({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:c});if(a&&u==="show"){const f=((l=s.scale.invalid)==null?void 0:l[e])??"zero-or-min";return{test:sr(E(a,{expr:"datum"}),!1),...oh(f,n,i)}}}function oh(e,t,n){if(Wg(e)){const{value:i}=e;return C(i)?{signal:i.signal}:{value:i}}return Pu({scale:t,scaleName:n,mode:"zeroOrMin"})}function ao(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=on(t),c=co(e),u=Iu({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return u!==void 0?[u,c]:c}function ah(e){const{datum:t}=e;return un(t)?Kt(t):`${U(t)}`}function Bt(e,t,n,i){const r={};if(t&&(r.scale=t),at(e)){const{datum:s}=e;un(s)?r.signal=Kt(s):C(s)?r.signal=s.signal:ui(s)?r.signal=s.expr:r.value=s}else r.field=E(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Li({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!C(o)&&0<o&&o<1?"datum":void 0,c=E(t,{expr:a,suffix:r}),u=n!==void 0?E(n,{expr:a}):E(t,{suffix:s,expr:a}),l={};if(o===0||o===1){l.scale=e;const f=o===0?c:u;l.field=f}else{const f=C(o)?`(1-${o.signal}) * ${c} + ${o.signal} * ${u}`:`${1-o} * ${c} + ${o} * ${u}`;l.signal=`scale("${e}", ${f})`}return i&&(l.offset=i),l}function ch({scaleName:e,fieldDef:t}){const n=E(t,{expr:"datum"}),i=E(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function co({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:c,defaultRef:u,bandPosition:l}){if(t){if(A(t)){const f=o==null?void 0:o.get("type");if(ge(t)){l??(l=At({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:p,type:g}=t;if(H(d)||l&&p&&g===kn)return a!=null&&a.impute?Bt(t,s,{binSuffix:"mid"},{offset:c}):l&&!J(f)?Li({scaleName:s,fieldOrDatumDef:t,bandPosition:l,offset:c}):Bt(t,s,hi(t,e)?{binSuffix:"range"}:{},{offset:c});if(ce(d)){if(w(n))return Li({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:l,offset:c});$(uu(e===X?We:nt))}}return Bt(t,s,J(f)?{binSuffix:"range"}:{},{offset:c,band:f==="band"?l??t.bandPosition??.5:void 0})}else if(De(t)){const f=t.value,d=c?{offset:c}:{};return{...Yn(e,f),...d}}}return ud(u)&&(u=u()),u&&{...u,...c?{offset:c}:{}}}function Yn(e,t){return z(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:z(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:q(t)}function Jt(e){return e&&e!=="number"&&e!=="time"}function Ru(e,t,n){return`${e}(${t}${n?`, ${U(n)}`:""})`}function uo({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var u;if(Jt(n))return Re({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const o=zu(e,i,r),a=Cn(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(a==="quantitative"){if(r&&s.normalizedNumberFormatType)return Re({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return Re({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(a==="temporal"&&s.timeFormatType&&w(e)&&e.timeUnit===void 0)return Re({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}function c(l){return w(l)?oe(l.timeUnit)||{}:{unit:void 0,utc:void 0}}if(Tn(e)){const{unit:l,utc:f}=c(e),d=lh({field:o,timeUnit:l,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:f||fn(e)&&((u=e.scale)==null?void 0:u.type)===le.UTC});return d?{signal:d}:void 0}if(t=rs({type:a,specifiedFormat:t,config:s,normalizeStack:r}
1),w(e)&&H(e.bin)){const l=E(e,{expr:i,binSuffix:"end"});return{signal:fi(o,l,t,n,s)}}else return t||Cn(e)==="quantitative"?{signal:`${Du(o,t)}`}:{signal:`isValid(${o}) ? ${o} : ""+${o}`}}function zu(e,t,n){return w(e)?n?`${E(e,{expr:t,suffix:"end"})}-${E(e,{expr:t,suffix:"start"})}`:E(e,{expr:t}):ah(e)}function Re({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}){if(o??(o=zu(e,i,r)),o!=="datum.value"&&w(e)&&H(e.bin)){const a=E(e,{expr:i,binSuffix:"end"});return{signal:fi(o,a,t,n,s)}}return{signal:Ru(n,o,t)}}function Lu(e,t,n,i,r,s){var o;if(!(T(i)&&Jt(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&Cn(e)==="quantitative"&&(r.normalizedNumberFormatType&&Fn(e)&&e.stack==="normalize"||r.numberFormatType))){if(Fn(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return rs({type:"quantitative",config:r,normalizeStack:!0});if(Tn(e)){const a=w(e)?(o=oe(e.timeUnit))==null?void 0:o.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:uh({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:s})}return rs({type:t,specifiedFormat:n,config:r})}}function Mu(e,t,n){var i;if(e&&(C(e)||e==="number"||e==="time"))return e;if(Tn(t)&&n!=="time"&&n!=="utc")return w(t)&&((i=oe(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function rs({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(T(t))return t;if(e===Qt)return i?n.normalizedNumberFormat:n.numberFormat}function uh({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:yu(t)}:i?void 0:n.timeFormat)}function Du(e,t){return`format(${e}, "${t||""}")`}function Pa(e,t,n,i){return Jt(n)?Ru(n,e,t):Du(e,(T(t)?t:void 0)??i.numberFormat)}function fi(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return fi(e,t,r.numberFormat,r.numberFormatType,r);const s=Pa(e,n,i,r),o=Pa(t,n,i,r);return`${sr(e,!1)} ? "null" : ${s} + "${Kd}" + ${o}`}function lh({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, ${U(n)})`:(n=T(n)?n:r,`${s?"utc":"time"}Format(${e}, ${U(n)})`):bg(t,e,s)}const lr="min",fh={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 Ia(e){return Z(fh,e)}function dh(e){return v(e,"encoding")}function pt(e){return e&&(e.op==="count"||v(e,"field"))}function ju(e){return e&&k(e)}function di(e){return v(e,"row")||v(e,"column")}function lo(e){return v(e,"header")}function fr(e){return v(e,"facet")}function ph(e){return v(e,"param")}function gh(e){return!T(e)&&v(e,"repeat")}function Ra(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function fo(e){return v(e,"sort")}function At({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(A(e)&&e.bandPosition!==void 0)return e.bandPosition;if(w(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return Je("timeUnitBandPosition",n,i);if(H(s))return .5}}function Uu({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:o}){var u,l,f;const a=Se(e),c=M(o?"size":a,i,r,{vgChannel:a});if(c!==void 0)return c;if(w(t)){const{timeUnit:d,bin:p}=t;if(d&&!n)return{band:Je("timeUnitBandSize",i,r)};if(H(p)&&!J(s))return{band:1}}if(ti(i.type))return s?J(s)?((u=r[i.type])==null?void 0:u.discreteBandSize)||{band:1}:(l=r[i.type])==null?void 0:l.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function Wu(e,t,n,i){return H(e.bin)||e.timeUnit&&ge(e)&&e.type==="temporal"?At({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function Bu(e){return v(e,"sort")&&!v(e,"field")}function pi(e){return v(e,"condition")}function dr(e){const t=e==null?void 0:e.condition;return!!t&&!k(t)&&w(t)}function gi(e){const t=e==null?void 0:e.condition;return!!t&&!k(t)&&A(t)}function hh(e){const t=e==null?void 0:e.condition;return!!t&&(k(t)||De(t))}function w(e){return v(e,"field")||(e==null?void 0:e.aggregate)==="count"}function Cn(e){return e==null?void 0:e.type}function at(e){return v(e,"datum")}function Ft(e){return ge(e)&&!Di(e)||Mi(e)}function za(e){return ge(e)&&e.type==="quantitative"&&!e.bin||Mi(e)}function Mi(e){return at(e)&&V(e.datum)}function A(e){return w(e)||at(e)}function ge(e){return e&&(v(e,"field")||e.aggregate==="count")&&v(e,"type")}function De(e){return v(e,"value")}function fn(e){return v(e,"scale")||v(e,"sort")}function Fn(e){return v(e,"axis")||v(e,"stack")||v(e,"impute")}function Hu(e){return v(e,"legend")}function qu(e){return v(e,"format")||v(e,"formatType")}function mh(e){return Ne(e,["legend","axis","header","scale"])}function yh(e){return v(e,"op")}function E(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(bh(e))n=Sd("count");else{let o;if(!t.nofn)if(yh(e))o=e.op;else{const{bin:a,aggregate:c,timeUnit:u}=e;H(a)?(o=Xc(a),r=(t.binSuffix??"")+(t.suffix??"")):c?jt(c)?(s=`["${n}"]`,n=`argmax_${c.argmax}`):mt(c)?(s=`["${n}"]`,n=`argmin_${c.argmin}`):o=String(c):u&&!ln(u)&&(o=Sg(u),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}o&&(n=n?`${o}_${n}`:o)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?si(n):t.expr?md(n,t.expr)+s:Le(n)+s}function Di(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return w(e)&&!!e.bin;case"temporal":return!1}throw new Error(su(e.type))}function xh(e){var t;return fn(e)&&_n((t=e.scale)==null?void 0:t.type)}function bh(e){return e.aggregate==="count"}function Sh(e,t){var o;const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(H(i))return`${n} (binned)`;if(r&&!ln(r)){const a=(o=oe(r))==null?void 0:o.unit;if(a)return`${n} (${rr(a).join("-")})`}else if(s)return jt(s)?`${n} for max ${s.argmax}`:mt(s)?`${n} for min ${s.argmin}`:`${Xi(s)} of ${n}`;return n}function $h(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(jt(t))return`${r} for argmax(${t.argmax})`;if(mt(t))return`${r} for argmin(${t.argmin})`;const s=i&&!ln(i)?oe(i):void 0,o=t||(s==null?void 0:s.unit)||(s==null?void 0:s.maxbins)&&"timeunit"||H(n)&&"bin";return o?`${o.toUpperCase()}(${r})`:r}const Gu=(e,t)=>
vendor: 10,058 bytes, line 1
1{switch(t.fieldTitle){case"plain":return e.field;case"functional":return $h(e);default:return Sh(e,t)}};let Vu=Gu;function Xu(e){Vu=e}function vh(){Xu(Gu)}function bn(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=po(e))==null?void 0:a.title;if(!w(e))return r??e.title;const s=e,o=i?go(s,t):void 0;return n?ne(r,s.title,o):r??s.title??o}function po(e){if(Fn(e)&&e.axis)return e.axis;if(Hu(e)&&e.legend)return e.legend;if(lo(e)&&e.header)return e.header}function go(e,t){return Vu(e,t)}function Nn(e){if(qu(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=po(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function wh(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(fo(e)&&k(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!jt(n)&&!mt(n))return"quantitative";if(fn(e)&&((s=e.scale)!=null&&s.type))switch(ns[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function je(e){if(w(e))return e;if(dr(e))return e.condition}function ie(e){if(A(e))return e;if(gi(e))return e.condition}function Yu(e,t,n,i={}){if(Qr(e)){const r=T(e)?"string":V(e)?"number":"boolean";return $(vp(t,r,e)),{value:e}}return A(e)?ji(e,t,n,i):gi(e)?{...e,condition:ji(e.condition,t,n,i)}:e}function ji(e,t,n,i){if(qu(e)){const{format:r,formatType:s,...o}=e;if(Jt(s)&&!n.customFormatTypes)return $(Fa(t)),ji(o,t,n,i)}else{const r=Fn(e)?"axis":Hu(e)?"legend":lo(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(Jt(o)&&!n.customFormatTypes)return $(Fa(t)),ji({...e,[r]:a},t,n,i)}}return w(e)?ho(e,t,i):Eh(e)}function Eh(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=V(n)?"quantitative":T(n)?"nominal":un(n)?"temporal":void 0,{...e,type:t}}function ho(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!Ms(i)&&!jt(i)&&!mt(i)&&($(Ep(i)),delete a.aggregate),r&&(a.timeUnit=oe(r)),o&&(a.field=`${o}`),H(s)&&(a.bin=pr(s,t)),ce(s)&&!te(t)&&$(ig(t)),ge(a)){const{type:c}=a,u=Fg(c);c!==u&&(a.type=u),c!=="quantitative"&&tr(i)&&($(wp(c,i)),a.type="quantitative")}else if(!Wc(t)){const c=wh(a,t);a.type=c}if(ge(a)){const{compatible:c,warning:u}=kh(a,t)||{};c===!1&&$(u)}if(fo(a)&&T(a.sort)){const{sort:c}=a;if(Ia(c))return{...a,sort:{encoding:c}};const u=c.substring(1);if(c.charAt(0)==="-"&&Ia(u))return{...a,sort:{encoding:u,order:"descending"}}}if(lo(a)){const{header:c}=a;if(c){const{orient:u,...l}=c;if(u)return{...a,header:{...l,labelOrient:c.labelOrient||u,titleOrient:c.titleOrient||u}}}}return a}function pr(e,t){return Vi(e)?{maxbins:ba(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:ba(t)}:e}const gn={compatible:!0};function kh(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 ft:case dt:case Yi:return Di(e)?gn:{compatible:!1,warning:Fp(t)};case X:case ae:case It:case Dn:case xe:case it:case rt:case oi:case ai:case Ki:case Xt:case Qi:case Zi:case sn:case Ae:case Be:case Ji:return gn;case qe:case Te:case He:case Ge:return n!==Qt?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:gn;case vt:case zt:case Lt:case Mt:case $t:case St:case bt:case We:case nt:case Rt:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:gn;case be:case Dt:return!Di(e)&&!xh(e)?{compatible:!1,warning:Np(t)}:gn;case En:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:gn}}function Tn(e){const{formatType:t}=Nn(e);return t==="time"||!t&&_h(e)}function _h(e){return e&&(e.type==="temporal"||w(e)&&!!e.timeUnit)}function gr(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var c;const s=t&&((c=oe(t))==null?void 0:c.unit);let o=s||n==="temporal",a;return ui(e)?a=e.expr:C(e)?a=e.signal:un(e)?(o=!0,a=Kt(e)):(T(e)||V(e))&&o&&(a=`datetime(${U(e)})`,hg(s)&&(V(e)&&e<1e4||T(e)&&isNaN(Date.parse(e)))&&(a=Kt({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:U(e)}function Ku(e,t){const{type:n}=e;return t.map(i=>{const r=w(e)&&!ln(e.timeUnit)?e.timeUnit:void 0,s=gr(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function hi(e,t){return H(e.bin)?ot(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const La={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 mi(e){return e==null?void 0:e.condition}const Qu=["domain","grid","labels","ticks","title"],Ch={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Zu={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},Fh={...Zu,style:1,labelExpr:1,encoding:1};function Ma(e){return Z(Fh,e)}const Nh={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},Ju=b(Nh);function Et(e){return v(e,"mark")}class hr{constructor(t,n){x(this,"name");x(this,"run");this.name=t,this.run=n}hasMatchingType(t){return Et(t)?rh(t.mark)===this.name:!1}}function Ht(e,t){const n=e==null?void 0:e[t];return n?k(n)?Zn(n,i=>!!i.field):w(n)||dr(n):!1}function el(e,t){const n=e==null?void 0:e[t];return n?k(n)?Zn(n,i=>!!i.field):w(n)||at(n)||gi(n):!1}function tl(e,t){if(te(t)){const n=e[t];if((w(n)||at(n))&&(Js(n.type)||w(n)&&n.timeUnit)){const i=Ps(t);return el(e,i)}}return!1}function nl(e){return Zn(Ed,t=>{if(Ht(e,t)){const n=e[t];if(k(n))return Zn(n,i=>!!i.aggregate);{const i=je(n);return i&&!!i.aggregate}}return!1})}function il(e,t){const n=[],i=[],r=[],s=[],o={};return mo(e,(a,c)=>{if(w(a)){const{field:u,aggregate:l,bin:f,timeUnit:d,...p}=a;if(l||d||f){const g=po(a),h=g==null?void 0:g.title;let m=E(a,{forAs:!0});const y={...h?[]:{title:bn(a,t,{allowDisabling:!0})},...p,field:m};if(l){let S;if(jt(l)?(S="argmax",m=E({op:"argmax",field:l.argmax},{forAs:!0}),y.field=`${m}.${u}`):mt(l)?(S="argmin",m=E({op:"argmin",field:l.argmin},{forAs:!0}),y.field=`${m}.${u}`):l!=="boxplot"&&l!=="errorbar"&&l!=="errorband"&&(S=l),S){const _={op:S,as:m};u&&(_.field=u),s.push(_)}}else if(n.push(m),ge(a)&&H(f)){if(i.push({bin:f,field:u,as:m}),n.push(E(a,{binSuffix:"end"})),hi(a,c)&&n.push(E(a,{binSuffix:"range"})),te(c)){const S={field:`${m}_end`};o[`${c}2`]=S}y.bin="binned",Wc(c)||(y.type=Qt)}else if(d&&!ln(d)){r.push({timeUnit:d,field:u,as:m});const S=ge(a)&&a.type!==kn&&"time";S&&(c===oi||c===Xt?y.formatType=S:Rd(c)?y.legend={formatType:S,...y.legend}:te(c)&&(y.axis={formatType:S,...y.axis}
vendor: 4,773 bytes, line 1
1))}o[c]=y}else n.push(u),o[c]=e[c]}else o[c]=e[c]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function Th(e,t,n){const i=Ld(t,n);if(i){if(i==="binned"){const r=e[t===We?X:ae];return!!(w(r)&&w(e[t])&&ce(r.bin))}}else return!1;return!0}function Ah(e,t,n,i){const r={};for(const s of b(e))Uc(s)||$(Cp(s));for(let s of Td){if(!e[s])continue;const o=e[s];if(ci(s)){const a=Nd(s),c=r[a];if(w(c)&&Cg(c.type)&&w(o)&&!c.timeUnit){$($p(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&($(Sp),s=Ae),!Th(e,s,t)){$(ir(s,t));continue}if(s===$t&&t==="line"){const a=je(e[s]);if(a!=null&&a.aggregate){$(_p);continue}}if(s===xe&&(n?"fill"in e:"stroke"in e)){$(ou("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===ai||s===En&&!k(o)&&!De(o)||s===Xt&&k(o)){if(o){if(s===En){const a=e[s];if(Bu(a)){r[s]=a;continue}}r[s]=ee(o).reduce((a,c)=>(w(c)?a.push(ho(c,s)):$(ts(c,s)),a),[])}}else{if(s===Xt&&o===null)r[s]=null;else if(!w(o)&&!at(o)&&!De(o)&&!pi(o)&&!C(o)){$(ts(o,s));continue}r[s]=Yu(o,s,i)}}return r}function mr(e,t){const n={};for(const i of b(e)){const r=Yu(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Oh(e){const t=[];for(const n of b(e))if(Ht(e,n)){const i=e[n],r=ee(i);for(const s of r)w(s)?t.push(s):dr(s)&&t.push(s.condition)}return t}function mo(e,t,n){if(e)for(const i of b(e)){const r=e[i];if(k(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Ph(e,t,n,i){return e?b(e).reduce((r,s)=>{const o=e[s];return k(o)?o.reduce((a,c)=>t.call(i,a,c,s),r):t.call(i,r,o,s)},n):n}function rl(e,t){return b(t).reduce((n,i)=>{switch(i){case X:case ae:case Qi:case Ji:case Zi:case We:case nt:case It:case Dn:case Ae:case St:case Be:case bt:case Rt:case He:case qe:case Ge:case Te:case oi:case be:case sn:case Xt:return n;case En:if(e==="line"||e==="trail")return n;case ai:case Ki:{const r=t[i];if(k(r)||w(r))for(const s of ee(r))s.aggregate||n.push(E(s,{}));return n}case $t:if(e==="trail")return n;case xe:case it:case rt:case vt:case zt:case Lt:case Dt:case Mt:{const r=je(t[i]);return r&&!r.aggregate&&n.push(E(r,{})),n}}},[])}function Ih(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(k(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 k(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function ss(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const c=i?` of ${yo(t)}`:"";return{field:o+t.field,type:t.type,title:C(a)?{signal:`${a}"${escape(c)}"`}:a+c}}),s=Oh(n).map(mh);return{tooltip:[...r,..._e(s,I)]}}function yo(e){const{title:t,field:n}=e;return ne(t,n)}function xo(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:c,positionPrefix:u,endPositionPrefix:l=void 0,extraEncoding:f={}})=>{const d=yo(n);return sl(e,a,r,{mark:c,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...T(l)?{[`${t}2`]:{field:`${l}_${n.field}`}}:{},...i,...f}})}}function sl(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...et(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Vi(e[t])?{}:e[t]}}]:[]}function ol(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],c=i[`${r}Error2`];return{continuousAxisChannelDef:ki(s,n),continuousAxisChannelDef2:ki(o,n),continuousAxisChannelDefError:ki(a,n),continuousAxisChannelDefError2:ki(c,n),continuousAxis:r}}function ki(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&$(ng(n,t)),i}else return e}function al(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(et(n)&&n.orient)return n.orient;if(Ft(r)){if(Ft(s)){const o=w(r)&&r.aggregate,a=w(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return Tn(s)&&!Tn(r)?"horizontal":"vertical"}return"horizontal"}else{if(Ft(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Ui="boxplot",Rh=["box","median","outliers","rule","ticks"],zh=new hr(Ui,ul);function cl(e){return V(e)?"tukey":e}function ul(e,{config:t}){e={...e,encoding:mr(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=et(n)?n:{type:n};r&&$(ru("boxplot"));const c=a.extent??t.boxplot.extent,u=M("size",a,t),l=a.invalid,f=cl(c),{bins:d,timeUnits:p,transform:g,continuousAxisChannelDef:h,continuousAxis:m,groupby:y,aggregate:S,encodingWithoutContinuousAxis:_,ticksOrient:O,boxOrient:F,customTooltipWithoutAggregatedField:P}=Lh(e,c,t),W=si(h.field),{color:Y,size:me,...$e}=_,ve=nd=>
vendor: 17,689 bytes, line 1
1xo(a,m,h,nd,t.boxplot),ct=ve($e),Wt=ve(_),Si=(L(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$i=ve({...$e,...me?{size:me}:{},color:{condition:{test:`${j(`lower_box_${h.field}`)} >= ${j(`upper_box_${h.field}`)}`,...Y||{value:Si}}}}),Gn=ss([{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"}],h,_),Zo={type:"tick",color:"black",opacity:1,orient:O,invalid:l,aria:!1},vi=f==="min-max"?Gn:ss([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],h,_),Jo=[...ct({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:vi}),...ct({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:vi}),...ct({partName:"ticks",mark:Zo,positionPrefix:"lower_whisker",extraEncoding:vi}),...ct({partName:"ticks",mark:Zo,positionPrefix:"upper_whisker",extraEncoding:vi})],ea=[...f!=="tukey"?Jo:[],...Wt({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:F,invalid:l,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:Gn}),...$i({partName:"median",mark:{type:"tick",invalid:l,...L(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:O,aria:!1},positionPrefix:"mid_box",extraEncoding:Gn})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(g),layer:ea};const ta=j(`lower_box_${h.field}`),na=j(`upper_box_${h.field}`),ia=`(${na} - ${ta})`,ra=`${ta} - ${c} * ${ia}`,sa=`${na} + ${c} * ${ia}`,wi=j(h.field),ed={joinaggregate:ll(h.field),groupby:y},oa={transform:[{filter:`(${ra} <= ${wi}) && (${wi} <= ${sa})`},{aggregate:[{op:"min",field:h.field,as:`lower_whisker_${W}`},{op:"max",field:h.field,as:`upper_whisker_${W}`},{op:"min",field:`lower_box_${h.field}`,as:`lower_box_${W}`},{op:"max",field:`upper_box_${h.field}`,as:`upper_box_${W}`},...S],groupby:y}],layer:Jo},{tooltip:ZS,...td}=$e,{scale:aa,axis:ca}=h,ua=yo(h),la=sl(a,"outliers",t.boxplot,{transform:[{filter:`(${wi} < ${ra}) || (${wi} > ${sa})`}],mark:"point",encoding:{[m]:{field:h.field,type:h.type,...ua!==void 0?{title:ua}:{},...aa!==void 0?{scale:aa}:{},...ca!==void 0?{axis:ca}:{}},...td,...Y?{color:Y}:{},...P?{tooltip:P}:{}}})[0];let Ei;const fa=[...d,...p,ed];return la?Ei={transform:fa,layer:[la,oa]}:(Ei=oa,Ei.transform.unshift(...fa)),{...o,layer:[Ei,{transform:g,layer:ea}]}}function ll(e){const t=si(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Lh(e,t,n){const i=al(e,Ui),{continuousAxisChannelDef:r,continuousAxis:s}=ol(e,i,Ui),o=r.field,a=si(o),c=cl(t),u=[...ll(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(c==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(c==="min-max"?"upper_whisker_":"max_")+a}],l=c==="min-max"||c==="tukey"?[]:[{calculate:`${j(`upper_box_${a}`)} - ${j(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${j(`upper_box_${a}`)} + ${j(`iqr_${a}`)} * ${t}, ${j(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${j(`lower_box_${a}`)} - ${j(`iqr_${a}`)} * ${t}, ${j(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:g}=Ih(d),{bins:h,timeUnits:m,aggregate:y,groupby:S,encoding:_}=il(g,n),O=i==="vertical"?"horizontal":"vertical",F=i,P=[...h,...m,{aggregate:[...y,...u],groupby:S},...l];return{bins:h,timeUnits:m,transform:P,groupby:S,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:_,ticksOrient:O,boxOrient:F,customTooltipWithoutAggregatedField:p}}const bo="errorbar",Mh=["ticks","rule"],Dh=new hr(bo,fl);function fl(e,{config:t}){e={...e,encoding:mr(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:c,tooltipEncoding:u}=dl(e,bo,t);delete s.size;const l=xo(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,p={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...l({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...l({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...l({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function jh(e,t){const{encoding:n}=e;if(Uh(n))return{orient:al(e,t),inputType:"raw"};const i=Wh(n),r=Bh(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,c=n.y2;if(A(a)&&A(c))throw new Error(`${t} cannot have both x2 and y2`);if(A(a)){if(Ft(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(A(c)){if(Ft(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,c=n.xError2,u=n.yError,l=n.yError2;if(A(c)&&!A(a))throw new Error(`${t} cannot have xError2 without xError`);if(A(l)&&!A(u))throw new Error(`${t} cannot have yError2 without yError`);if(A(a)&&A(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(A(a)){if(Ft(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(A(u)){if(Ft(o))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 Uh(e){return(A(e.x)||A(e.y))&&!A(e.x2)&&!A(e.y2)&&!A(e.xError)&&!A(e.xError2)&&!A(e.yError)&&!A(e.yError2)}function Wh(e){return A(e.x2)||A(e.y2)}function Bh(e){return A(e.xError)||A(e.xError2)||A(e.yError)||A(e.yError2)}function dl(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,c=et(i)?i:{type:i};s&&$(ru(t));const{orient:u,inputType:l}=jh(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:h}=ol(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:S,tooltipTitleWithFieldName:_}=Hh(c,f,d,p,g,l,t,n),{[h]:O,[h==="x"?"x2":"y2"]:F,[h==="x"?"xError":"yError"]:P,[h==="x"?"xError2":"yError2"]:W,...Y}=r,{bins:me,timeUnits:$e,aggregate:ve,groupby:ct,encoding:Wt}=il(Y,n),Si=[...ve,...m],$i=l!=="raw"?[]:ct,Gn=ss(S,f,Wt,_);return{transform:[...a.transform??[],...me,...$e,...Si.length===0?[]:[{aggregate:Si,groupby:$i}],...y],groupby:$i,continuousAxisChannelDef:f,continuousAxis:h,encodingWithoutContinuousAxis:Wt,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:c,outerSpec:a,tooltipEncoding:Gn}}function Hh(e,t,n,i,r,s,o,a){let c=[],u=[];const l=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,g=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!=(g==="iqr")&&$(tg(p,g,o)),g==="stderr"||g==="stdev")c=[{op:g,field:l,as:`extent_${l}`},{op:p,field:l,as:`center_${l}`}],u=[{calculate:`${j(`center_${l}`)} + ${j(`extent_${l}`)}`,as:`upper_${l}`},{calculate:`${j(`center_${l}`)} - ${j(`extent_${l}`)}`,as:`lower_${l}`}],f=[{fieldPrefix:"center_",titlePrefix:Xi(p)},{fieldPrefix:"upper_",titlePrefix:Da(p,g,"+")},{fieldPrefix:"lower_",titlePrefix:Da(p,g,"-")}],d=!0;else{let h,m,y;g==="ci"?(h="mean",m="ci0",y="ci1"):(h="median",m="q1",y="q3"),c=[{op:m,field:l,as:`lower_${l}`},{op:y,field:l,as:`upper_${l}`},{op:h,field:l,as:`center_${l}`}],f=[{fieldPrefix:"upper_",titlePrefix:bn({field:l,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:bn({field:l,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:bn({field:l,aggregate:h,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&$(eg(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:j(n.field),as:`upper_${l}`},{calculate:j(l),as:`lower_${l}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:`${j(l)} + ${j(i.field)}`,as:`upper_${l}`}],r?u.push({calculate:`${j(l)} + ${j(r.field)}`,as:`lower_${l}`}):u.push({calculate:`${j(l)} - ${j(i.field)}`,as:`lower_${l}`}));for(const p of u)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:wn(wn(p.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}function Da(e,t,n){return`${Xi(e)} ${n} ${t}`}const So="errorband",qh=["band","borders"],Gh=new hr(So,pl);function pl(e,{config:t}){e={...e,encoding:mr(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:c}=dl(e,So,t),u=o,l=xo(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const g={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},p={...p,...g,aria:!1}):u.interpolate?$(Ta("interpolate")):u.tension&&$(Ta("tension")),{...a,transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const gl={};function $o(e,t,n){const i=new hr(e,t);gl[e]={normalizer:i,parts:n}}function Vh(){return b(gl)}$o(Ui,ul,Rh);$o(bo,fl,Mh);$o(So,pl,qh);const Xh=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],hl={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"},ml={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"},Yh=b(hl),Kh=b(ml),Qh={header:1,headerRow:1,headerColumn:1,headerFacet:1},yl=b(Qh),xl=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Zh={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Jh={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},Ue="_vgsid_",em={point:{on:"click",fields:[Ue],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 vo(e){return e==="legend"||!!(e!=null&&e.legend)}function jr(e){return vo(e)&&L(e)}function wo(e){return!!(e!=null&&e.select)}function bl(e){const t=[];for(const n of e||[]){if(wo(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function tm(e){return yr(e)||ko(e)||Eo(e)}function Eo(e){return v(e,"concat")}function yr(e){return v(e,"vconcat")}function ko(e){return v(e,"hconcat")}function Sl({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function tt(e){return v(e,"step")}function ja(e){return v(e,"view")||v(e,"width")||v(e,"height")}const Ua=20,nm={align:1,bounds:1,center:1,columns:1,spacing:1},im=b(nm);function rm(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(fr(e)&&!di(e.facet)||Eo(e))&&(r.columns=o),yr(e)&&(r.columns=1);for(const a of im)if(e[a]!==void 0)if(a==="spacing"){const c=e[a];r[a]=V(c)?c:{row:c.row??s,column:c.column??s}}else r[a]=e[a];return r}function os(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function as(e,t){const n=Wi(e,t);return tt(n)?n.step:$l}function Wi(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ne(n,{step:e.step})}const $l=20,sm={continuousWidth:300,continuousHeight:300,step:$l},om={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:sm,mark:Zg,arc:{},area:{},bar:nh,circle:{},geoshape:{},image:{},line:{},point:{},rect:so,rule:{color:"black"},square:{},text:{color:"black"},tick:ih,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:Pg,projection:{},legend:Zh,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:em,style:{},title:{},facet:{spacing:Ua},concat:{spacing:Ua},normalizedNumberFormat:".0%"},ut=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Wa={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Ba={blue:ut[0],orange:ut[1],red:ut[2],teal:ut[3],green:ut[4],yellow:ut[5],purple:ut[6],pink:ut[7],brown:ut[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 am(e={}){return{signals:[{name:"color",value:L(e)?{...Ba,...e}:Ba}],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 cm(e){return{signals:[{name:"fontSize",value:L(e)?{...Wa,...e}:Wa}],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 um(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function vl(e){const t=b(e||{}),n={};for(const i of t){const r=e[i];n[i]=mi(r)?Qc(r):Ee(r)}return n}function lm(e){const t=b(e),n={};for(const i of t)n[i]=vl(e[i]);return n}const fm=[...Au,...Ju,...yl,"background","padding","legend","lineBreak","scale","style","title","view"];function wl(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Nc({},N(om),n?um(n):{},t?am(t):{},i?cm(i):{},s||{});r&&Tc(o,"selection",r,!0);const a=Ne(o,fm);for(const c of["background","lineBreak","padding"])o[c]&&(a[c]=Ee(o[c]));for(const c of Au)o[c]&&(a[c]=ue(o[c]));for(const c of Ju)o[c]&&(a[c]=vl(o[c]));for(const c of yl)o[c]&&(a[c]=ue(o[c]));if(o.legend&&(a.legend=ue(o.legend)),o.scale){const{invalid:c,...u}=o.scale,l=ue(c,{level:1});a.scale={...ue(u),...b(l).length>0?{invalid:l}:{}}}return o.style&&(a.style=lm(o.style)),o.title&&(a.title=ue(o.title)),o.view&&(a.view=ue(o.view)),a}const dm=new Set(["view",...Gg]),pm=["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"],gm={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Qg};function hm(e){e=N(e);for(const t of pm)delete e[t];if(e.axis)for(const t in e.axis)mi(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Xh)delete e.legend[t];
vendor: 9,767 bytes, line 1
1if(e.mark){for(const t of Oa)delete e.mark[t];e.mark.tooltip&&L(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(bl(e.params)),delete e.params);for(const t of dm){for(const i of Oa)delete e[t][i];const n=gm[t];if(n)for(const i of n)delete e[t][i];ym(e,t)}for(const t of Vh())delete e[t];mm(e);for(const t in e)L(e[t])&&B(e[t])&&delete e[t];return B(e)?void 0:e}function mm(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=Yc(e.title);B(t)||(e.style["group-title"]={...e.style["group-title"],...t}),B(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),B(i)?delete e.title:e.title=i}function ym(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};B(s)||(e.style[n??t]=s),delete e[t]}function xr(e){return v(e,"layer")}function xm(e){return v(e,"repeat")}function bm(e){return!k(e.repeat)&&v(e.repeat,"layer")}class _o{map(t,n){return fr(t)?this.mapFacet(t,n):xm(t)?this.mapRepeat(t,n):ko(t)?this.mapHConcat(t,n):yr(t)?this.mapVConcat(t,n):Eo(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(xr(t))return this.mapLayer(t,n);if(Et(t))return this.mapUnit(t,n);throw new Error(Ds(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 Sm={zero:1,center:1,normalize:1};function $m(e){return Z(Sm,e)}const vm=new Set([Fu,ar,or,zi,ur,io,ro,cr,Nu,no]),wm=new Set([ar,or,Fu]);function hn(e){return w(e)&&Cn(e)==="quantitative"&&!e.bin}function Ha(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(w(o)&&w(a))if(hn(o)&&hn(a)){if(o.stack)return t;if(a.stack)return r;const c=w(o)&&!!o.aggregate,u=w(a)&&!!a.aggregate;if(c!==u)return c?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(hn(o))return t;if(hn(a))return r}else{if(hn(o))return s&&n==="vertical"?void 0:t;if(hn(a))return s&&n==="horizontal"?void 0:r}}function Em(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function El(e,t){var h,m;const n=et(e)?e:{type:e},i=n.type;if(!vm.has(i))return null;const r=Ha(t,"x",n)||Ha(t,"theta",n);if(!r)return null;const s=t[r],o=w(s)?E(s,{}):void 0,a=Em(r),c=[],u=new Set;if(t[a]){const y=t[a],S=w(y)?E(y,{}):void 0;S&&S!==o&&(c.push(a),u.add(S))}const l=a==="x"?"xOffset":"yOffset",f=t[l],d=w(f)?E(f,{}):void 0;d&&d!==o&&(c.push(l),u.add(d));const p=Ad.reduce((y,S)=>{if(S!=="tooltip"&&Ht(t,S)){const _=t[S];for(const O of ee(_)){const F=je(O);if(F.aggregate)continue;const P=E(F,{});(!P||!u.has(P))&&y.push({channel:S,fieldDef:F})}}return y},[]);let g;return s.stack!==void 0?Vi(s.stack)?g=s.stack?"zero":null:g=s.stack:wm.has(i)&&(g="zero"),!g||!$m(g)||nl(t)&&p.length===0?null:((h=s==null?void 0:s.scale)!=null&&h.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==le.LINEAR&&s!=null&&s.stack&&$(Qp(s.scale.type)),A(t[st(r)])?(s.stack!==void 0&&$(Kp(r)),null):(w(s)&&s.aggregate&&!Hd.has(s.aggregate)&&$(Zp(s.aggregate)),{groupbyChannels:c,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Ut(i),stackBy:p,offset:g}))}function kl(e,t,n){const i=ue(e),r=M("orient",i,n);if(i.orient=Fm(i.type,t,r),r!==void 0&&r!==i.orient&&$(Pp(i.orient,r)),i.type==="bar"&&i.orient){const c=M("cornerRadiusEnd",i,n);if(c!==void 0){const u=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:eh[i.orient];for(const l of u)i[l]=c;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=M("opacity",i,n),o=M("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=_m(i.type,t)),M("cursor",i,n)===void 0&&(i.cursor=km(i,t,n)),i}function km(e,t,n){return t.href||e.href||M("href",e,n)?"pointer":e.cursor}const _l=.7;function _m(e,t){if(z([ur,no,io,ro],e)&&!nl(t))return _l}function Cm(e,t,{graticule:n}){if(n)return!1;const i=Je("filled",e,t),r=e.type;return ne(i,r!==ur&&r!==cr&&r!==zi)}function Fm(e,t,n){switch(e){case ur:case io:case ro:case Hg:case Bg:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case Nu:case ar:if(w(i)&&(ce(i.bin)||w(r)&&r.aggregate&&!i.aggregate))return"vertical";if(w(r)&&(ce(r.bin)||w(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(w(i)&&i.type===Qt&&!H(i.bin)||Mi(i))&&w(r)&&ce(r.bin)?"horizontal":"vertical";if(!o)return(w(r)&&r.type===Qt&&!H(r.bin)||Mi(r))&&w(i)&&ce(i.bin)?"vertical":"horizontal"}case zi:if(s&&!(w(i)&&ce(i.bin))&&o&&!(w(r)&&ce(r.bin)))return;case or:if(o)return w(r)&&ce(r.bin)?"horizontal":"vertical";if(s)return w(i)&&ce(i.bin)?"vertical":"horizontal";if(e===zi){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case cr:case no:{const a=za(i),c=za(r);if(n)return n;if(a&&!c)return e!=="tick"?"horizontal":"vertical";if(!a&&c)return e!=="tick"?"vertical":"horizontal";if(a&&c)return"vertical";{const u=ge(i)&&i.type===kn,l=ge(r)&&r.type===kn;if(u&&!l)return"vertical";if(!u&&l)return"horizontal"}return}}return"vertical"}function Nm(e){const{point:t,line:n,...i}=e;return b(i).length>1?i:i.type}function Tm(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Ne(e[t],["point","line"])});return e}function Ur(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?L(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?L(t.point)?t.point:{}:void 0}function qa(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 Am{constructor(){x(this,"name","path-overlay")}hasMatchingType(t,n){if(Et(t)){const{mark:i,encoding:r}=t,s=et(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!Ur(s,n[s.type],r);case"area":return!!Ur(s,n[s.type],r)||!!qa(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:c,encoding:u,...l}=t,f=mr(u,r),d=et(a)?a:{type:a},p=Ur(d,r[d.type],f),g=d.type==="area"&&qa(d,r[d.type]),h=[{name:c,...s?{params:s}:{},mark:Nm({...d.type==="area"&&M("opacity",d,r)==null&&M("fillOpacity",d,r)==null?{opacity:_l}:{},...d}),encoding:Ne(f,["shape"])}],m=El(kl(d,f,r),f);let y=f;if(m){const{fieldChannel:S,offset:_}=m;y={...f,[S]:{...f[S],..._?{stack:_}:{}}}}return y=Ne(y,["y2","x2"]),g&&h.push({...o?{projection:o}:{},mark:{type:"line",...Qn(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),p&&h.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Qn(d,["clip","tooltip"]),...p},encoding:y}),i({...l,layer:h},{...n,config:Tm(r)})}}function Om(e,t){return t?di(e)?Fl(e,t):Cl(e,t):e}function Wr(e,t){return t?Fl(e,t):e}function cs(e,t,n){const i=t[e];if(gh(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};$(lp(i.repeat));return}return t}function Cl(e,t){if(e=cs("field",e,t),e!==void 0){if(e===null)return null;if(fo(e)&&pt(e.sort)){const n=cs("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function Ga(e,t){if(w(e))return Cl(e,t);{const n=cs("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Va(e,t){if(A(e)){const n=Ga(e,t);if(n)return n;if(pi(e))return{condition:e.condition}}else{if(gi(e)){const n=Ga(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function Fl(e,t){const n={};for(const i in e)if(v(e,i)){const r=e[i];if(k(r))n[i]=r.map(s=>Va(s,t)).filter(s=>s);else{const s=Va(r,t);s!==void 0&&(n[i]=s)}}return n}class Pm{constructor(){x(this,"name","RuleForRangedLine")}hasMatchingType(t){if(Et(t)){const{encoding:n,mark:i}=t;if(i==="line"||et(i)&&i.type==="line")for(const r of Fd){const s=on(r),o=n[s];if(n[r]&&(w(o)&&!ce(o.bin)||at(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return $(Op(!!r.x2,!!r.y2)),i({...t,mark:L(s)?{...s,type:"rule"}:"rule"},n)}}class Im extends _o{constructor(){super(...arguments);x(this,"nonFacetUnitNormalizers",[zh,Dh,Gh,new Am,new Pm])}map(n,i){if(Et(n)){const r=Ht(n.encoding,ft),s=Ht(n.encoding,dt),o=Ht(n.encoding,Yi);if(r||s||o)return this.mapFacetedUnit(n,i)}return super.map(n,i)}mapUnit(n,i){const{parentEncoding:r,parentProjection:s}=i,o=Wr(n.encoding,i.repeater),a={...n,...n.name?{name:[i.repeaterPrefix,n.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(r||s)return this.mapUnitWithParentEncodingOrProjection(a,i);const c=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(a,i.config))return u.run(a,i,c);return a}mapRepeat(n,i){return bm(n)?this.mapLayerRepeat(n,i):this.mapNonLayerRepeat(n,i)}mapLayerRepeat(n,i){const{repeat:r,spec:s,...o}=n,{row:a,column:c,layer:u}=r,{repeater:l={},repeaterPrefix:f=""}=i;return a||c?this.mapRepeat({...n,repeat:{...a?{row:a}:{},...c?{column:c}:{}},spec:{repeat:{layer:u},spec:s}},i):{...o,layer:u.map(d=>{const p={...l,layer:d},g=`${(s.name?`${s.name}_`:"")+f}child__layer_${K(d)}`,h=this.mapLayerOrUnit(s,{...i,repeater:p,repeaterPrefix:g});return h.name=g,h})}}mapNonLayerRepeat(n,i){const{repeat:r,spec:s,data:o,...a}=n;!k(r)&&n.columns&&(n=Ne(n,["columns"]),$(_a("repeat")));const c=[],{repeater:u={},repeaterPrefix:l=""}=i,f=!k(r)&&r.row||[u?u.row:null],d=!k(r)&&r.column||[u?u.column:null],p=k(r)&&r||[u?u.repeat:null];for(const h of p)for(const m of f)for(const y of d){const S={repeat:h,row:m,column:y,layer:u.layer},_=`${(s.name?`${s.name}_`:"")+l}child__${k(r)?`${K(h)}`:(r.row?`row_${K(m)}`:"")+(r.column?`column_${K(y)}`:"")}`,O=this.map(s,{...i,repeater:S,repeaterPrefix:_});O.name=_,c.push(Ne(O,["data"]))}const g=k(r)?n.columns:r.column?r.column.length:1;return{data:s.data??o,align:"all",...a,columns:g,concat:c}}mapFacet(n,i){const{facet:r}=n;
vendor: 5,525 bytes, line 1
1return di(r)&&n.columns&&(n=Ne(n,["columns"]),$(_a("facet"))),super.mapFacet(n,i)}mapUnitWithParentEncodingOrProjection(n,i){const{encoding:r,projection:s}=n,{parentEncoding:o,parentProjection:a,config:c}=i,u=Ya({parentProjection:a,projection:s}),l=Xa({parentEncoding:o,encoding:Wr(r,i.repeater)});return this.mapUnit({...n,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:c})}mapFacetedUnit(n,i){const{row:r,column:s,facet:o,...a}=n.encoding,{mark:c,width:u,projection:l,height:f,view:d,params:p,encoding:g,...h}=n,{facetMapping:m,layout:y}=this.getFacetMappingAndLayout({row:r,column:s,facet:o},i),S=Wr(a,i.repeater);return this.mapFacet({...h,...y,facet:m,spec:{...u?{width:u}:{},...f?{height:f}:{},...d?{view:d}:{},...l?{projection:l}:{},mark:c,encoding:S,...p?{params:p}:{}}},i)}getFacetMappingAndLayout(n,i){const{row:r,column:s,facet:o}=n;if(r||s){o&&$(Tp([...r?[ft]:[],...s?[dt]:[]]));const a={},c={};for(const u of[ft,dt]){const l=n[u];if(l){const{align:f,center:d,spacing:p,columns:g,...h}=l;a[u]=h;for(const m of["align","center","spacing"])l[m]!==void 0&&(c[m]??(c[m]={}),c[m][u]=l[m])}}return{facetMapping:a,layout:c}}else{const{align:a,center:c,spacing:u,columns:l,...f}=o;return{facetMapping:Om(f,i.repeater),layout:{...a?{align:a}:{},...c?{center:c}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(n,{parentEncoding:i,parentProjection:r,...s}){const{encoding:o,projection:a,...c}=n,u={...s,parentEncoding:Xa({parentEncoding:i,encoding:o,layer:!0}),parentProjection:Ya({parentProjection:r,projection:a})};return super.mapLayer({...c,...n.name?{name:[u.repeaterPrefix,n.name].filter(l=>l).join("_")}:{}},u)}}function Xa({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...b(e),...b(t)]);for(const s of r){const o=t[s],a=e[s];if(A(o)){const c={...a,...o};i[s]=c}else gi(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||De(a)||C(a)||A(a)||k(a))&&(i[s]=a)}}else i=t;return!i||B(i)?void 0:i}function Ya(e){const{parentProjection:t,projection:n}=e;return t&&n&&$(bp({parentProjection:t,projection:n})),n??t}function Co(e){return v(e,"filter")}function Rm(e){return v(e,"stop")}function Nl(e){return v(e,"lookup")}function zm(e){return v(e,"data")}function Lm(e){return v(e,"param")}function Mm(e){return v(e,"pivot")}function Dm(e){return v(e,"density")}function jm(e){return v(e,"quantile")}function Um(e){return v(e,"regression")}function Wm(e){return v(e,"loess")}function Bm(e){return v(e,"sample")}function Hm(e){return v(e,"window")}function qm(e){return v(e,"joinaggregate")}function Gm(e){return v(e,"flatten")}function Vm(e){return v(e,"calculate")}function Tl(e){return v(e,"bin")}function Xm(e){return v(e,"impute")}function Ym(e){return v(e,"timeUnit")}function Km(e){return v(e,"aggregate")}function Qm(e){return v(e,"stack")}function Zm(e){return v(e,"fold")}function Jm(e){return v(e,"extent")&&!v(e,"density")&&!v(e,"regression")}function ey(e){return e.map(t=>Co(t)?{filter:yn(t.filter,_g)}:t)}class ty extends _o{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=Ka(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=Ka(t,n),t.encoding){const i={};for(const[r,s]of Vt(t.encoding))i[r]=Al(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Vt(i).map(([s,o])=>{const{init:a,bind:c,empty:u,...l}=o;l.type==="single"?(l.type="point",l.toggle=!1):l.type==="multi"&&(l.type="point"),n.emptySelections[s]=u!=="none";for(const f of re(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:l,bind:c}})}:t}}function Ka(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(Co(s))return{filter:us(s,t)};if(Tl(s)&&an(s.bin))return{...s,bin:Ol(s.bin)};if(Nl(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function Al(e,t){var i,r;const n=N(e);if(w(n)&&an(n.bin)&&(n.bin=Ol(n.bin)),fn(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(pi(n))if(k(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:c,...u}=s;return a?s:{...u,test:us(s,t)}});else{const{selection:s,param:o,test:a,...c}=Al(n.condition,t);n.condition=o?n.condition:{...c,test:us(n.condition,t)}}return n}function Ol(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function us(e,t){const n=i=>yn(i,r=>{var a;const s=t.emptySelections[r]??!0,o={param:r,empty:s};return(a=t.selectionPredicates)[r]??(a[r]=[]),t.selectionPredicates[r].push(o),o});return e.selection?n(e.selection):yn(e.test||e.filter,i=>i.selection?n(i.selection):i)}class ls extends _o{map(t,n){const i=n.selections??[];if(t.params&&!Et(t)){const r=[];for(const s of t.params)wo(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 o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(T(a)&&(a===t.name||r.includes(a))||k(a)&&a.map(c=>r.indexOf(c)).every((c,u,l)=>c!==-1&&(u===0||c>l[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=ls.prototype[e];ls.prototype[e]=function(n,i){return t.call(this,n,ny(n,i))}}function ny(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}
1:t}function iy(e,t){t===void 0&&(t=wl(e.config));const n=ay(e,t),{width:i,height:r}=e,s=cy(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const ry=new Im,sy=new ty,oy=new ls;function ay(e,t={}){const n={config:t};return oy.map(ry.map(sy.map(e,n),n),n)}function Qa(e){return T(e)?{type:e}:e??{}}function cy(e,t,n){let{width:i,height:r}=t;const s=Et(e)||xr(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&($(va("width")),i=void 0),r=="container"&&($(va("height")),r=void 0));const a={type:"pad",...o,...n?Qa(n.autosize):{},...Qa(e.autosize)};if(a.type==="fit"&&!s&&($(Jd),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&$(wa("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&$(wa("height")),!Ce(a,{type:"pad"}))return a}function uy(e){return["fit","fit-x","fit-y"].includes(e)}function ly(e){return e?`fit-${er(e)}`:"fit"}const fy=["background","padding"];function Za(e,t){const n={};for(const i of fy)e&&e[i]!==void 0&&(n[i]=Ee(e[i]));return t&&(n.params=e.params),n}class kt{constructor(t={},n={}){x(this,"explicit");x(this,"implicit");this.explicit=t,this.implicit=n}clone(){return new kt(N(this.explicit),N(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return ne(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of b(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Xe(e){return{explicit:!0,value:e}}function we(e){return{explicit:!1,value:e}}function Pl(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:br(t,n,i,r)}}function br(e,t,n,i){return e.explicit&&t.explicit&&$(Wp(n,i,e.value,t.value)),e}function Ot(e,t,n,i,r=br){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Ce(e.value,t.value)?e:r(e,t,n,i)}class dy extends kt{constructor(n={},i={},r=!1){super(n,i);x(this,"explicit");x(this,"implicit");x(this,"parseNothing");this.explicit=n,this.implicit=i,this.parseNothing=r}clone(){const n=super.clone();return n.parseNothing=this.parseNothing,n}}function An(e){return v(e,"url")}function ni(e){return v(e,"values")}function Il(e){return v(e,"name")&&!An(e)&&!ni(e)&&!Nt(e)}function Nt(e){return e&&(Rl(e)||zl(e)||Fo(e))}function Rl(e){return v(e,"sequence")}function zl(e){return v(e,"sphere")}function Fo(e){return v(e,"graticule")}var Q;(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"})(Q||(Q={}));function Ll({invalid:e,isPath:t}){switch(Ou(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 py(e){const{marks:t,scales:n}=Ll(e);return t===n?Q.Main:n==="include-invalid-values"?Q.PreFilterInvalid:Q.PostFilterInvalid}class D{constructor(t,n){x(this,"debugName");x(this,"_children",[]);x(this,"_parent",null);x(this,"_hash");this.debugName=n,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)){$(mp);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 ye extends D{constructor(n,i,r,s){super(n,i);x(this,"type");x(this,"refCounts");x(this,"_source");x(this,"_name");this.type=r,this.refCounts=s,this._source=this._name=i,this.refCounts&&
1!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const n=new this.constructor;return n.debugName=`clone_${this.debugName}`,n._source=this._source,n._name=`clone_${this._name}`,n.type=this.type,n.refCounts=this.refCounts,n.refCounts[n._name]=0,n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${bd()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(n){this._source=n}}function Br(e){return e.as!==void 0}function Ja(e){return`${e}_end`}class Ke extends D{constructor(n,i){super(n);x(this,"timeUnits");this.timeUnits=i}clone(){return new Ke(null,N(this.timeUnits))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{const{field:c,timeUnit:u}=o;if(u){let l;if(ln(u)){if(G(i)){const{mark:f,markDef:d,config:p}=i,g=At({fieldDef:o,markDef:d,config:p});(ti(f)||g)&&(l={timeUnit:oe(u),field:c})}}else l={as:E(o,{forAs:!0}),field:c,timeUnit:u};if(G(i)){const{mark:f,markDef:d,config:p}=i,g=At({fieldDef:o,markDef:d,config:p});ti(f)&&te(a)&&g!==.5&&(l.rectBandPosition=g)}l&&(s[I(l)]=l)}return s},{});return B(r)?null:new Ke(n,r)}static makeFromTransform(n,i){const{timeUnit:r,...s}={...i},o=oe(r),a={...s,timeUnit:o};return new Ke(n,{[I(a)]:a})}merge(n){this.timeUnits={...this.timeUnits};for(const i in n.timeUnits)this.timeUnits[i]||(this.timeUnits[i]=n.timeUnits[i]);for(const i of n.children)n.removeChild(i),i.parent=this;n.remove()}removeFormulas(n){const i={};for(const[r,s]of Vt(this.timeUnits)){const o=Br(s)?s.as:`${s.field}_end`;n.has(o)||(i[r]=s)}this.timeUnits=i}producedFields(){return new Set(re(this.timeUnits).map(n=>Br(n)?n.as:Ja(n.field)))}dependentFields(){return new Set(re(this.timeUnits).map(n=>n.field))}hash(){return`TimeUnit ${I(this.timeUnits)}`}assemble(){const n=[];for(const i of re(this.timeUnits)){const{rectBandPosition:r}=i,s=oe(i.timeUnit);if(Br(i)){const{field:o,as:a}=i,{unit:c,utc:u,...l}=s,f=[a,`${a}_end`];n.push({field:Le(o),type:"timeunit",...c?{units:rr(c)}:{},...u?{timezone:"utc"}:{},...l,as:f}),n.push(...ec(f,r,s))}else if(i){const{field:o}=i,a=yd(o),c=Ml({timeUnit:s,field:a}),u=Ja(a);n.push({type:"formula",expr:c,as:u}),n.push(...ec([a,u],r,s))}}return n}}const Sr="offsetted_rect_start",$r="offsetted_rect_end";function Ml({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=hu(i),{part:o,step:a}=bu(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${j(t)}, ${n?-a:a})`}function ec([e,t],n,i){if(n!==void 0&&n!==.5){const r=j(e),s=j(t);return[{type:"formula",expr:tc([Ml({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Sr}`},{type:"formula",expr:tc([r,s],n+.5),as:`${e}_${$r}`}]}return[]}function tc([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const yi="_tuple_fields";class gy{constructor(...t){x(this,"hasChannel");x(this,"hasField");x(this,"hasSelectionId");x(this,"timeUnit");x(this,"items");this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const hy={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new gy),s={},o={},a=new Set,c=(g,h)=>{const m=h==="visual"?g.channel:g.field;let y=K(`${i}_${m}`);for(let S=1;a.has(y);S++)y=K(`${i}_${m}_${S}`);return a.add(y),{[h]:y}},u=t.type,l=e.config.selection[u],f=n.value!==void 0?ee(n.value):null;let{fields:d,encodings:p}=L(n.select)?n.select:{};if(!d&&!p&&f){for(const g of f)if(L(g))for(const h of b(g))Cd(h)?(p||(p=[])).push(h):u==="interval"?($(up),p=l.encodings):(d??(d=[])).push(h)}!d&&!p&&(p=l.encodings,"fields"in l&&(d=l.fields));for(const g of p??[]){const h=e.fieldDef(g);if(h){let m=h.field;if(h.aggregate){$(ep(g,h.aggregate));continue}else if(!m){$(ka(g));continue}if(h.timeUnit&&!ln(h.timeUnit)){m=e.vgField(g);const y={timeUnit:h.timeUnit,as:m,field:h.field};o[I(y)]=y}if(!s[m]){const y=u==="interval"&&ot(g)&&Me(e.getScaleComponent(g).get("type"))?"R":h.bin?"R-RE":"E",S={field:m,channel:g,type:y,index:r.items.length};S.signals={...c(S,"data"),...c(S,"visual")},r.items.push(s[m]=S),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Ue,Dc(g)?(S.geoChannel=g,S.channel=Mc(g),r.hasChannel[S.channel]=s[m]):r.hasChannel[g]=s[m]}}else $(ka(g))}for(const g of d??[]){if(r.hasField[g])continue;const h={type:"E",field:g,index:r.items.length};h.signals={...c(h,"data")},r.items.push(h),r.hasField[g]=h,r.hasSelectionId=r.hasSelectionId||g===Ue}f&&(t.init=f.map(g=>r.items.map(h=>L(g)?g[h.geoChannel||h.channel]!==void 0?g[h.geoChannel||h.channel]:g[h.field]:g))),B(o)||(r.timeUnit=new Ke(null,o))},signals:(e,t,n)=>{const i=t.name+yi;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(Wl)})}},Dl="_curr",Pi="anim_value",mn="anim_clock",fs="eased_anim_clock",jl="min_extent",Ul="max_range_extent",Hr="last_tick_at",qr="is_playing",my=1/60*1e3,yy=(e,t)=>[{name:fs,update:mn},{name:`${e}_domain`,init:`domain('${t}')`},{name:jl,init:`extent(${e}_domain)[0]`},{name:Ul,init:`extent(range('${t}'))[1]`},{name:Pi,update:`invert('${t}', ${fs})`}],xy={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(Qe(t)&&(n=n.concat([{name:mn,init:"0",on:[{events:{type:"timer",throttle:my},update:`${qr} ? (${mn} + (now() - ${Hr}) > ${Ul} ? 0 : ${mn} + (now() - ${Hr})) : ${mn}`}]},{name:Hr,init:"now()",on:[{events:[{signal:mn},{signal:qr}],update:"now()"}]},{name:qr,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+yi,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=re(e.component.selection??{}).reduce((l,f)=>
1f.type==="interval"?l.concat(f.name+Sn):l,[]).map(l=>`indexof(item().mark.name, '${l}') < 0`).join(" && "),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${qt(e)}, `;if(t.project.hasSelectionId)u+=`${Ue}: ${o}[${R(Ue)}]`;else if(Qe(t))u+=`fields: ${r}, values: [${Pi} ? ${Pi} : ${jl}]`;else{const l=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${R(e.vgField(f.channel,{}))}], ${o}[${R(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${R(f.field)}]`}).join(", ");u+=`fields: ${r}, values: [${l}]`}if(Qe(t))return n.concat(yy(t.name,e.scaleName(Rt)),[{name:i+xt,on:[{events:[{signal:fs},{signal:Pi}],update:`{${u}}`,force:!0}]}]);{const l=t.events;return n.concat([{name:i+xt,on:l?[{events:l,update:`${c} ? {${u}} : null`,force:!0}]:[]}])}}};function Wl(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=Le(r.field),r}function en(e,t=!0,n=ad){if(k(e)){const i=e.map(r=>en(r,t,n));return t?`[${i.join(", ")}]`:i}else if(un(e))return n(t?Kt(e):gg(e));return t?n(U(e)):e}function by(e,t){for(const n of re(e.component.selection??{})){const i=n.name;let r=`${i}${xt}, ${n.resolve==="global"?"true":`{unit: ${qt(e)}}`}`;for(const s of vr)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+Gy,on:[{events:{signal:n.name+xt},update:`modify(${R(n.name+tn)}, ${r})`}]})}return No(t)}function Sy(e,t){if(e.component.selection&&b(e.component.selection).length){const n=R(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Mn("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return No(t)}function $y(e,t){let n=!1;for(const i of re(e.component.selection??{})){const r=i.name,s=R(r+tn);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,c=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${af}(${s}, ${R(a)}${c}`})}n=!0;for(const a of vr)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),No(t)}function vy(e,t){const n=[],i=[],r=qt(e,{escape:!1});for(const s of re(e.component.selection??{})){const o={name:s.name+tn};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Ue}}]),s.init){const c=s.project.items.map(Wl);o.values=s.project.hasSelectionId?s.init.map(u=>({unit:r,[Ue]:en(u,!1)[0]})):s.init.map(u=>({unit:r,fields:c,values:en(u,!1)}))}if([...n,...t].filter(c=>c.name===s.name+tn).length||n.push(o),Qe(s)&&t.length){const c=e.lookupDataSource(e.getDataName(Q.Main)),u=t.find(f=>f.name===c),l=u.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(l){u.transform=u.transform.filter(d=>d!==l);const f={name:u.name+Dl,source:u.name,transform:[l]};i.push(f)}}}return n.concat(t,i)}function Bl(e,t){for(const n of re(e.component.selection??{}))for(const i of vr)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function wy(e,t){for(const n of e.children)G(n)&&(t=Bl(n,t));return t}function Ey(e,t,n,i){const r=df(e,t.param,t);return{signal:Me(n.get("type"))&&k(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function No(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const gt={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(!ot(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&$(rp),!s||!Me(o)){$(ip);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||ps(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(af))r.update=`{${i.map(o=>`${R(Le(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${R(Le(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!ps(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);
vendor: 4,204 bytes, line 1
1r.push="outer",delete r.value,delete r.update}return n}};function ds(e,t){return`domain(${R(e.scaleName(t))})`}function ps(e){return e.parent&&qn(e.parent)&&(!e.parent.parent||ps(e.parent.parent))}const Sn="_brush",Hl="_scale_trigger",Vn="geo_interval_init_tick",ql="_init",ky="_center",_y={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...L(n.select)?n.select:{}};r.fields=[Ue],r.encodings||(r.encodings=n.value?b(n.value):[qe,He]),n.select={type:"interval",...r}}if(t.translate&&!gt.defined(t)){const r=`!event.item || event.item.mark.name !== ${R(t.name+Sn)}`;for(const s of t.events){if(!s.between){$(`${s} is not an ordered event stream for interval selections.`);continue}const o=ee((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+xt,s=re(t.project.hasChannel).filter(a=>a.channel===X||a.channel===ae),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,c)=>a.concat(Cy(e,t,c,o==null?void 0:o[c.index])),[])),e.hasProjection){const a=R(e.projectionName()),c=e.projectionName()+ky,{x:u,y:l}=t.project.hasChannel,f=u==null?void 0:u.signals.visual,d=l==null?void 0:l.signals.visual,p=u?o==null?void 0:o[u.index]:`${c}[0]`,g=l?o==null?void 0:o[l.index]:`${c}[1]`,h=F=>e.getSizeSignalRef(F).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:h("width")}, ${d?`${d}[1]`:h("height")}]]`;o&&(n.unshift({name:i+ql,init:`[scale(${a}, [${u?p[0]:p}, ${l?g[0]:g}]), scale(${a}, [${u?p[1]:p}, ${l?g[1]:g}])]`}),(!u||!l)&&(n.find(P=>P.name===c)||n.unshift({name:c,update:`invert(${a}, [${h("width")}/2, ${h("height")}/2])`})));const y=`intersect(${m}, {markname: ${R(e.getName("marks"))}}, unit.mark)`,S=`{unit: ${qt(e)}}`,_=`vlSelectionTuples(${y}, ${S})`,O=s.map(F=>F.signals.visual);return n.concat({name:r,on:[{events:[...O.length?[{signal:O.join(" || ")}]:[],...o?[{signal:Vn}]:[]],update:_}]})}else{if(!gt.defined(t)){const u=i+Hl,l=s.map(f=>{const d=f.channel,{data:p,visual:g}=f.signals,h=R(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Me(m)?"+":"";return`(!isArray(${p}) || (${y}invert(${h}, ${g})[0] === ${y}${p}[0] && ${y}invert(${h}, ${g})[1] === ${y}${p}[1]))`});l.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:`${l.join(" && ")} ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),c=`unit: ${qt(e)}, fields: ${i+yi}, values`;return n.concat({name:r,...o?{init:`{${c}: ${en(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${c}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(G(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Vn).length||n.unshift({name:Vn,value:null,on:[{events:"timer{1}",update:`${Vn} === null ? {} : ${Vn}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,c=`data(${R(t.name+tn)})`;if(gt.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of b(u))u[m]=[{test:`${c}.length && ${c}[0].unit === ${qt(e)}`,...u[m]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...p}=t.mark,g=b(p).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(S=>S).join(" && "),value:p[y]},{value:null}],m),{}),h=d??(t.translate?"move":null);return[{name:`${i+Sn}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:u}},...n,{name:i+Sn,type:"rect",clip:!0,encode:{enter:{...h?{cursor:{value:h}}:{},fill:{value:"transparent"}},update:{...u,...g}}}]}};function Cy(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=R(r?e.scaleName(s):e.projectionName()),c=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===X?"width":"height").signal,l=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${l}, ${l}]`},{events:p,update:`[${o}[0], clamp(${l}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,p=gt.defined(t),g=e.getScaleComponent(s),h=g?g.get("type"):void 0,m=i?{init:en(i,
1!0,c)}:{value:[]};return f.push({events:{signal:t.name+Hl},update:Me(h)?`[${c(`${d}[0]`)}, ${c(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:en(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===X?0:1,p=t.name+ql,g=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:o,...g,on:f}]}}function Un({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=pi(t)&&t.condition;let o=[];s&&(o=ee(s).map(u=>{const l=r(u);if(ph(u)){const{param:f,empty:d}=u;return{test:ff(e,{param:f,empty:d}),...l}}else return{test:qi(e,u.test),...l}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function To(e,t="text"){const n=e.encoding[t];return Un({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>Ao(i,e.config),invalidValueRef:void 0})}function Ao(e,t,n="datum"){if(e){if(De(e))return q(e.value);if(A(e)){const{format:i,formatType:r}=Nn(e);return uo({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function Gl(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(k(o))return{tooltip:nc({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Un({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:u=>{const l=Xl(u,r,a);if(l)return l;if(u===null)return;let f=M("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),T(f))return{value:f};if(L(f))return C(f)?f:f.content==="encoding"?nc(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function Vl(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function c(l,f){const d=on(f),p=ge(l)?l:{...l,type:e[d].type},g=p.title||go(p,r),h=ee(g).join(", ").replaceAll(/"/g,'\\"');let m;if(te(f)){const y=f==="x"?"x2":"y2",S=je(e[y]);if(ce(p.bin)&&S){const _=E(p,{expr:o}),O=E(S,{expr:o}),{format:F,formatType:P}=Nn(p);m=fi(_,O,F,P,r),s.add(y)}}if((te(f)||f===Ae||f===Be)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:S}=Nn(p);m=uo({fieldOrDatumDef:p,format:y,formatType:S,expr:o,config:r,normalizeStack:!0}).signal}m??(m=Xl(p,r,o).signal),a.push({channel:f,key:h,value:m})}mo(e,(l,f)=>{w(l)?c(l,f):dr(l)&&c(l.condition,f)});const u={};for(const{channel:l,key:f,value:d}of a)!s.has(l)&&!u[f]&&(u[f]=d);return u}function nc(e,t,n,{reactiveGeom:i}={}){const r=Vl(e,t,n,{reactiveGeom:i}),s=Vt(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function Xl(e,t,n="datum"){if(w(e)&&Js(e.type)&&!Nn(e).format&&!Nn(e).formatType){const i=`${n}["${e.field}"]`;return{signal:`isValid(${i}) ? isArray(${i}) ? join(${i}, '\\n') : ${i} : ""+${i}`}}return Ao(e,t,n)}function Fy(e){const{markDef:t,config:n}=e,i=M("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Ny(e),...Ty(e)}}function Ny(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=M("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:Z(Yd,t)?{}:{ariaRoleDescription:{value:t}}}function Ty(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Un({model:e,channelDef:s,vgChannel:"description",mainRefFn:c=>Ao(c,e.config),invalidValueRef:void 0});const o=M("description",n,i);if(o!=null)return{description:q(o)};if(i.aria===!1)return{};const a=Vl(t,r,i);if(!B(a))return{description:{signal:Vt(a).filter(([c])=>!c.startsWith("_")).map(([c,u])=>[c,u.replaceAll("\\n"," ")]).map(([c,u],l)=>`"${l>0?"; ":""}${c}: " + (${u})`).join(" + ")}}}function fe(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:c}=n;const u=r[e];a===void 0&&(c??(c=M(e,i,s,{vgChannel:o,ignoreVgConfig:!pi(u)})),c!==void 0&&(a=q(c)));const l={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=Iu({...l,scaleChannel:e,channelDef:u});return Un({model:t,channelDef:u,vgChannel:o??e,invalidValueRef:f,mainRefFn:p=>co({...l,channel:e,channelDef:p,stack:null,defaultRef:a})})}function Yl(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??M("filled",n,r),a=z(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,c=M(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=M(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],l=o?"fill":"stroke",f={...c?{fill:q(c)}:{},...u?{stroke:q(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&$(ou("property",{fill:"fill"in n,stroke:"stroke"in n}
1)),{...f,...fe("color",e,{vgChannel:l,defaultValue:o?c:u}),...fe("fill",e,{defaultValue:i.fill?c:void 0}),...fe("stroke",e,{defaultValue:i.stroke?u:void 0})}}function Ay(e){const{encoding:t,mark:n}=e,i=t.order;return!Ut(n)&&De(i)?Un({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>q(r.value),invalidValueRef:void 0}):{}}function On({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:co({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:q(o),bandPosition:r})};const c=t[s];return c?{offsetType:"visual",offset:c}:{}}function pe(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,c=r[e],u=r[st(e)],l=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=On({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),g=Oo({model:t,defaultPos:n,channel:e,scaleName:l,scale:f}),h=!c&&te(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Oy({channel:e,channelDef:c,channel2Def:u,markDef:s,config:o,scaleName:l,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:p==="encoding"?0:void 0});return h?{[i||e]:h}:void 0}function Oy(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(A(n)&&r&&t===r.fieldChannel){if(w(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Li({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Bt(n,i,{suffix:"end"},{offset:s})}return ao(e)}function Oo({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=on(n),c=Tt(n),u=M(n,s,o,{vgChannel:c});if(u!==void 0)return Yn(n,u);switch(t){case"zeroOrMin":return ic({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return ic({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[Se(n)],mult:.5}}}}function ic({mainChannel:e,config:t,...n}){const i=Pu(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/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 Py={left:"x",center:"xc",right:"x2"},Iy={top:"y",middle:"yc",bottom:"y2"};function Kl(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Tt(e);const r=e==="x"?"align":"baseline",s=M(r,t,n);let o;return C(s)?($(Ap(r)),o=void 0):o=s,e==="x"?Py[o||(i==="top"?"left":"center")]:Iy[o||i]}function Bi(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Ql(e,t,{defaultPos:n,defaultPos2:i}):pe(e,t,{defaultPos:n})}function Ql(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=st(e),a=Se(e),c=Ry(t,i,o),u=c[a]?Kl(e,r,s):Tt(e);return{...pe(e,t,{defaultPos:n,vgChannel:u}),...c}}function Ry(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,c=on(n),u=Se(n),l=Tt(n),f=i[c],d=e.scaleName(c),p=e.getScaleComponent(c),{offset:g}=n in i||n in s?On({channel:n,markDef:s,encoding:i,model:e}):On({channel:c,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=Se(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[l]:{field:e.getName(n)}}}const h=zy({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:p,stack:o,offset:g,defaultRef:void 0});return h!==void 0?{[l]:h}:_i(n,s)||_i(n,{[n]:es(n,s,a.style),[u]:es(u,s,a.style)})||_i(n,a[r])||_i(n,a.mark)||{[l]:Oo({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function zy({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:c,defaultRef:u}){return A(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Bt(t,s,{suffix:"start"},{offset:c}):ao({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:c,defaultRef:u})}function _i(e,t){const n=Se(e),i=Tt(e);if(t[i]!==void 0)return{[i]:Yn(e,t[i])};if(t[e]!==void 0)return{[i]:Yn(e,t[e])};if(t[n]){const r=t[n];if(Zt(r))$(kp(n));else return{[n]:Yn(e,r)}}}function yt(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=st(t),a=Se(t),c=i[t],u=i[o],l=e.getScaleComponent(t),f=l?l.get("type"):void 0,d=r.orient,p=i[a]??i.size??M("size",r,n,{vgChannel:a}),g=Bc(t),h=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return w(c)&&(H(c.bin)||ce(c.bin)||c.timeUnit&&!u)&&!(p&&!Zt(p))&&!i[g]&&!J(f)?Dy({fieldDef:c,fieldDef2:u,channel:t,model:e}):(A(c)&&J(f)||h)&&!u?My(c,t,e):Ql(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Ly(e,t,n,i,r,s,o){if(Zt(r))if(n){const c=n.get("type");if(c==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const l=Je("minBandSize",{type:o},i);return{signal:l?`max(${Ie(l)}, ${u})`:u}}else r.band!==1&&($(Rp(c)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(C(r))return r;if(r)return{value:r}}if(n){const c=n.get("range");if(cn(c)&&V(c.step))return{value:c.step-2}}if(!s){const{bandPaddingInner:c,barBandPaddingInner:u,rectBandPaddingInner:l,tickBandPaddingInner:f}=i.scale,d=ne(c,o==="tick"?f:o==="bar"?u:l);if(C(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(V(d))return{signal:`${1-d} * ${e}`}}return{value:as(i.view,e)-2}}function My(e,t,n){var me,$e;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,c=n.scaleName(t),u=n.getScaleComponent(t),l=Se(t),f=st(t),d=Bc(t),p=n.scaleName(d),g=n.getScaleComponent(Ps(t)),h=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(h?m=fe("size",n,{vgChannel:l,defaultRef:q(i.size)}):$(Dp(i.type)));const y=!!m,S=Uu({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(me=u||g)==null?void 0:me.get("type"),useVlSizeChannel:h});
1m=m||{[l]:Ly(l,p||c,g||u,s,S,!!e,i.type)};const _=(($e=u||g)==null?void 0:$e.get("type"))==="band"&&Zt(S)&&!y?"top":"middle",O=Kl(t,i,s,_),F=O==="xc"||O==="yc",{offset:P,offsetType:W}=On({channel:t,markDef:i,encoding:r,model:n,bandPosition:F?.5:0}),Y=ao({channel:t,channelDef:e,markDef:i,config:s,scaleName:c,scale:u,stack:o,offset:P,defaultRef:Oo({model:n,defaultPos:"mid",channel:t,scaleName:c,scale:u}),bandPosition:F?W==="encoding"?0:.5:C(S)?{signal:`(1-${S})/2`}:Zt(S)?(1-S.band)/2:0});if(l)return{[O]:Y,...m};{const ve=Tt(f),ct=m[l],Wt=P?{...ct,offset:P}:ct;return{[O]:Y,[ve]:k(Y)?[Y[0],{...Y[1],offset:Wt}]:{...Y,offset:Wt}}}}function rc(e,t,n,i,r,s,o){if(Lc(e))return 0;const a=e==="x"||e==="y2",c=a?-t/2:t/2;if(C(n)||C(r)||C(i)||s){const u=Ie(n),l=Ie(r),f=Ie(i),d=Ie(s),g=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${c})`:c,h=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=l?`(${l} + ${g})`:g;return{signal:h+m+y}}else return r=r||0,i+(n?-r-c:+r+c)}function Dy({fieldDef:e,fieldDef2:t,channel:n,model:i}){var $e;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),c=i.scaleName(n),u=a?a.get("type"):void 0,l=a.get("reverse"),f=Uu({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=($e=i.component.axes[n])==null?void 0:$e[0],p=(d==null?void 0:d.get("translate"))??.5,g=te(n)?M("binSpacing",s,r)??0:0,h=st(n),m=Tt(n),y=Tt(h),S=Je("minBandSize",s,r),{offset:_}=On({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:O}=On({channel:h,markDef:s,encoding:o,model:i,bandPosition:0}),F=ch({fieldDef:e,scaleName:c}),P=rc(n,g,l,p,_,S,F),W=rc(h,g,l,p,O??_,S,F),Y=C(f)?{signal:`(1-${f.signal})/2`}:Zt(f)?(1-f.band)/2:.5,me=At({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(H(e.bin)||e.timeUnit){const ve=e.timeUnit&&me!==.5;return{[y]:sc({fieldDef:e,scaleName:c,bandPosition:Y,offset:W,useRectOffsetField:ve}),[m]:sc({fieldDef:e,scaleName:c,bandPosition:C(Y)?{signal:`1-${Y.signal}`}:1-Y,offset:P,useRectOffsetField:ve})}}else if(ce(e.bin)){const ve=Bt(e,c,{},{offset:W});if(w(t))return{[y]:ve,[m]:Bt(t,c,{},{offset:P})};if(an(e.bin)&&e.bin.step)return{[y]:ve,[m]:{signal:`scale("${c}", ${E(e,{expr:"datum"})} + ${e.bin.step})`,offset:P}}}$(uu(h))}function sc({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Li({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Sr,endSuffix:$r}:{}})}const jy=new Set(["aria","width","height"]);function Oe(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?Yl(e):{};return{...Uy(e.markDef,t),...oc("fill",n),...oc("stroke",i),...fe("opacity",e),...fe("fillOpacity",e),...fe("strokeOpacity",e),...fe("strokeWidth",e),...fe("strokeDash",e),...Ay(e),...Gl(e),...To(e,"href"),...Fy(e)}}function oc(e,t){return t?{[e]:t}:{}}function Uy(e,t){return Xd.reduce((n,i)=>(!jy.has(i)&&v(e,i)&&t[i]!=="ignore"&&(n[i]=q(e[i])),n),{})}function Po(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var u;let o;if(!ot(s)||!(o=e.getScaleType(s)))return;const a=tr(r.aggregate),c=oo({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(sh(c)){const l=e.vgField(s,{expr:"datum",binSuffix:(u=e.stack)!=null&&u.impute?"mid":void 0});l&&i.add(l)}}),i.size>0)return{defined:{signal:[...i].map(s=>sr(s,!0)).join(" && ")}}}function ac(e,t){if(t!==void 0)return{[e]:q(t)}}const Gr="voronoi",Zl={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Gr)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Ut(s))return $(tp(s)),n;const o={name:e.getName(Gr),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Gl(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,c=!1;return n.forEach((u,l)=>{const f=u.name??"";f===e.component.mark[0].name?a=l:f.includes(Gr)&&(c=!0)}),c||n.splice(a+1,0,o),n}},Jl={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!vo(e.bind),parse:(e,t,n)=>cf(t,n),topLevelSignals:(e,t,n)=>{var c;const i=t.name,r=t.project,s=t.bind,o=(c=t.init)==null?void 0:c[0],a=Zl.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";
vendor: 4,184 bytes, line 1
1return r.items.forEach((u,l)=>{const f=K(`${i}_${u.field}`);n.filter(p=>p.name===f).length||n.unshift({name:f,...o?{init:en(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${R(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(u=>u.name===i+xt),o=i+yi,a=r.items.map(u=>K(`${i}_${u.field}`)),c=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Hi="_toggle",ef={defined:e=>e.type==="point"&&!Qe(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Hi,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+xt,i=t.name+Hi;return`${i} ? null : ${n}, ${t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${qt(e)}}, `}${i} ? ${n} : null`}},Wy={defined:e=>e.clear!==void 0&&e.clear!==!1&&!Qe(e),parse:(e,t)=>{t.clear&&(t.clear=T(t.clear)?Mn(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(Jl.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===K(`${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(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+xt);i(r,"null"),ef.defined(t)&&(r=n.findIndex(s=>s.name===t.name+Hi),i(r,"false"))}return n}},tf={defined:e=>{const t=e.resolve==="global"&&e.bind&&vo(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Ue;return t&&!n&&$(sp),t&&n},parse:(e,t,n)=>{const i=N(n);if(i.select=T(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},cf(t,i),L(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=ee(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=jr(t.bind)?t.bind.legend:"click",s=T(r)?Mn(r,"view"):ee(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=jr(t.bind)&&t.bind.legend,s=o=>a=>{const c=N(a);return c.markname=o,c};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${K(o.field)}_legend`,c=`${i}_${a}`;if(n.filter(l=>l.name===c).length===0){const l=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:c,...t.init?{}:{value:null},on:[{events:l,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${c}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+xt),o=i+yi,a=r.items.filter(d=>d.hasLegend).map(d=>K(`${i}_${K(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const l=n.find(d=>d.name===i+Hi),f=jr(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:f}):l.on[0].events=f),n}};function By(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of re(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&tf.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const nf="_translate_anchor",rf="_translate_delta",Hy={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+nf,{x:o,y:a}=t.project.hasChannel;let c=Mn(t.translate,"scope");return r||(c=c.map(u=>(u.between[0].markname=i+Sn,u))),n.push({name:s,value:{},on:[{events:c.map(u=>u.between[0]),update:`{x: x(unit), y: y(unit)${o!==void 0?`, extent_x: ${r?ds(e,X):`slice(${o.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${r?ds(e,ae):`slice(${a.signals.visual})`}`:""}}`}]},{name:i+rf,value:{},on:[{events:c,update:`{x: ${s}
1.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&cc(e,t,o,"width",n),a!==void 0&&cc(e,t,a,"height",n),n}};function cc(e,t,n,i,r){const s=t.name,o=s+nf,a=s+rf,c=n.channel,u=gt.defined(t),l=r.find(F=>F.name===n.signals[u?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(c),p=d==null?void 0:d.get("type"),g=d==null?void 0:d.get("reverse"),h=u?c===X?g?"":"-":g?"-":"":"",m=`${o}.extent_${c}`,y=`${h}${a}.${c} / ${u?`${f}`:`span(${m})`}`,S=!u||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",_=u?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",O=`${S}(${m}, ${y}${_})`;l.on.push({events:{signal:a},update:u?O:`clampRange(${O}, 0, ${f})`})}const sf="_zoom_anchor",of="_zoom_delta",qy={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+of,{x:o,y:a}=t.project.hasChannel,c=R(e.scaleName(X)),u=R(e.scaleName(ae));let l=Mn(t.zoom,"scope");return r||(l=l.map(f=>(f.markname=i+Sn,f))),n.push({name:i+sf,on:[{events:l,update:r?`{${[c?`x: invert(${c}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&uc(e,t,o,"width",n),a!==void 0&&uc(e,t,a,"height",n),n}};function uc(e,t,n,i,r){const s=t.name,o=n.channel,a=gt.defined(t),c=r.find(S=>S.name===n.signals[a?"data":"visual"]),u=e.getSizeSignalRef(i).signal,l=e.getScaleComponent(o),f=l==null?void 0:l.get("type"),d=a?ds(e,o):c.name,p=s+of,g=`${s}${sf}.${o}`,h=!a||!l?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${l.get("exponent")??1}`:f==="symlog"?`, ${l.get("constant")??1}`:"":"",y=`${h}(${d}, ${g}, ${p}${m})`;c.on.push({events:{signal:p},update:a?y:`clampRange(${y}, 0, ${u})`})}const tn="_store",xt="_tuple",Gy="_modify",af="vlSelectionResolve",vr=[xy,_y,hy,ef,Jl,gt,tf,Wy,Hy,qy,Zl];function Vy(e){let t=e.parent;for(;t&&!ke(t);)t=t.parent;return t}function qt(e,{escape:t}={escape:!0}){let n=t?R(e.name):e.name;const i=Vy(e);if(i){const{facet:r}=i;for(const s of Fe)r[s]&&(n+=` + '__facet_${s}_' + (facet[${R(i.vgField(s))}])`)}return n}function Io(e){return re(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function cf(e,t){(T(t.select)||!t.select.on)&&delete e.events,(T(t.select)||!t.select.clear)&&delete e.clear,(T(t.select)||!t.select.toggle)&&delete e.toggle}function Qe(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}function gs(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...gs(e.object)),t.push(...gs(e.property))),t)}function uf(e){return e.object.type==="MemberExpression"?uf(e.object):e.object.name==="datum"}function lf(e){const t=cd(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&uf(i)&&n.add(gs(i).slice(1).join("."))}),n}class Wn extends D{constructor(n,i,r){super(n);x(this,"model");x(this,"filter");x(this,"expr");x(this,"_dependentFields");this.model=i,this.filter=r,this.expr=qi(this.model,this.filter,this),this._dependentFields=lf(this.expr)}clone(){return new Wn(null,this.model,N(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Xy(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=K(s.name),a=s.select,c=T(a)?a:a.type,u=L(a)?N(a):{type:c},l=i[c];for(const p in l)p==="fields"||p==="encodings"||(p==="mark"&&(u.mark={...l.mark,...u.mark}),(u[p]===void 0||u[p]===!0)&&(u[p]=N(l[p]??u[p])));const f=n[o]={...u,name:o,type:c,init:s.value,bind:s.bind,events:T(u.on)?Mn(u.on,"scope"):ee(N(u.on))};if(Qe(f)&&(r++,r>1)){delete n[o];continue}const d=N(s);for(const p of vr)p.defined(f)&&p.parse&&p.parse(e,f,d)}return r>1&&$(fp),n}function ff(e,t,n,i="datum"){const r=T(t)?t:t.param,s=K(r),o=R(s+tn);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,p=a.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const c=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${R(a.resolve)})`,l=`${c}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${l}`:`!${f} || ${l}`}function df(e,t,n){const i=K(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&$(dp(s));else if(r&&!s){const a=o.project.items.filter(c=>c.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,$(pp(a,r,n,s))):s=a[0].field}return`${o.name}[${R(Le(s))}]`}function Yy(e,t){for(const[n,i]of Vt(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new ye(new Wn(t,e,{param:n}),r,Q.Lookup,e.component.data.outputNodeRefCounts)}}
vendor: 4,557 bytes, line 1
1function qi(e,t,n){return Oi(t,i=>T(i)?i:wg(i)?ff(e,i,n):$u(i))}function Ky(e,t){if(e)return k(e)&&!Ct(e)?e.map(n=>go(n,t)).join(", "):e}function Vr(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 Xn(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:c,zindex:u,...l}=e.combine();if(!r){for(const p in l){const g=p,h=Ch[g],m=l[g];if(h&&h!==t&&h!=="both")delete l[g];else if(mi(m)){const{condition:y,...S}=m,_=ee(y),O=La[g];if(O){const{vgProp:F,part:P}=O,W=[..._.map(Y=>{const{test:me,...$e}=Y;return{test:qi(null,me),...$e}}),S];Vr(l,P,F,W),delete l[g]}else if(O===null){const F={signal:_.map(P=>{const{test:W,...Y}=P;return`${qi(null,W)} ? ${$a(Y)} : `}).join("")+$a(S)};l[g]=F}}else if(C(m)){const y=La[g];if(y){const{vgProp:S,part:_}=y;Vr(l,_,S,m),delete l[g]}}z(["labelAlign","labelBaseline"],g)&&l[g]===null&&delete l[g]}if(t==="grid"){if(!l.grid)return;if(l.encode){const{grid:p}=l.encode;l.encode={...p?{grid:p}:{}},B(l.encode)&&delete l.encode}return{scale:o,orient:s,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ne(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let g=a;(d=(f=l.encode)==null?void 0:f.labels)!=null&&d.update&&C(l.encode.labels.update.text)&&(g=wn(a,"datum.label",l.encode.labels.update.text.signal)),Vr(l,"labels","text",{signal:g})}if(l.labelAlign===null&&delete l.labelAlign,l.encode){for(const g of Qu)e.hasAxisPart(g)||delete l.encode[g];B(l.encode)&&delete l.encode}const p=Ky(c,n);return{scale:o,orient:s,grid:!1,...p?{title:p}:{},...l,...n.aria===!1?{aria:!1}:{},zindex:ne(u,0)}}}}function pf(e){const{axes:t}=e.component,n=[];for(const i of wt)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Qy(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Xn(r,"grid",t)),...i.map(r=>Xn(r,"grid",t)),...n.map(r=>Xn(r,"main",t)),...i.map(r=>Xn(r,"main",t))].filter(r=>r)}function lc(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},c=new Set([...b(o),...b(a)]),u={};for(const l of c.values())u[l]={signal:`${i.signal} === "${s}" ? ${Ie(o[l])} : ${Ie(a[l])}`};return u}return t[r]})])}function Zy(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:Eu(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=C(n)?"axisOrient":`axis${Xi(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],c=["axis",o,s];return{vlOnlyAxisConfig:lc(a,i,e,n),vgAxisConfig:lc(c,i,e,n),axisConfigStyle:Jy([...c,...a],i)}}function Jy(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=ee(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function hs(e,t,n,i={}){var s;const r=Jc(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const fc={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??ex(n,e),gridScale:({model:e,channel:t})=>tx(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||hf(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||gf(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??ix(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??rx(t.type,n,w(t)&&!!t.timeUnit,w(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,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??ox({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??ax({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=mf(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return tu(r?[Ra(r)]:[],w(o)?[Ra(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>cx(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??ux(n,t)};
1function ex(e,t){return!J(e)&&w(t)&&!H(t==null?void 0:t.bin)&&!ce(t==null?void 0:t.bin)}function tx(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function nx(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return C(s)?s:Ii(s);{const{configValue:o}=hs("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Ii(o):n===X&&z([to,eo],e.type)&&!(w(e)&&e.timeUnit)?270:void 0}}function ms(e){return`(((${e.signal} % 360) + 360) % 360)`}function gf(e,t,n,i){if(e!==void 0)if(n==="x"){if(C(e)){const r=ms(e),s=C(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(C(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(C(e)){const r=ms(e),s=C(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(C(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 hf(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(C(e)){const o=ms(e),a=C(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${o} + 90)`:o} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${o} && ${o} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(C(t)){const o=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${o} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function ix(e,t){if(t==="x"&&z(["quantitative","temporal"],e))return!0}function rx(e,t,n,i){if(n&&!L(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function sx(e){return e==="x"?"bottom":"left"}function ox({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!J(t)&&t!=="log"){if(w(e)){if(H(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&z(["month","hours","day","quarter"],(r=oe(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function ax({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(w(t)){const{timeUnit:n}=t;if(n){const i=xu(n);if(i)return{signal:i}}}}function mf(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;if(s&&o)return nu(s,o);if(s)return s;if(o)return o;if(s!==void 0)return s;if(o!==void 0)return o}function cx(e,t){const n=e.values;if(k(n))return Ku(t,n);if(C(n))return n}function ux(e,t){return e==="rect"&&Di(t)?1:0}class Pn extends D{constructor(n,i){super(n);x(this,"transform");x(this,"_dependentFields");this.transform=i,this._dependentFields=lf(this.transform.calculate)}clone(){return new Pn(null,N(this.transform))}static parseAllForSortIndex(n,i){return i.forEachFieldDef((r,s)=>{if(fn(r)&&ju(r.sort)){const{field:o,timeUnit:a}=r,c=r.sort,u=c.map((l,f)=>`${$u({field:o,timeUnit:a,equal:l})} ? ${f} : `).join("")+c.length;n=new Pn(n,{calculate:u,as:In(r,s,{forAs:!0})})}}),n}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 ${I(this.transform)}`}}function In(e,t,n){return E(e,{prefix:t,suffix:"sort_index",...n})}function wr(e,t){return z(["top","bottom"],t)?"column":z(["left","right"],t)||e==="row"?"row":"column"}function Rn(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return ne((t||{})[e],r[e],n.header[e])}function Er(e,t,n,i){const r={};for(const s of e){const o=Rn(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const Ro=["row","column"],zo=["header","footer"];function lx(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:o,titleOrient:a}=Er(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),c=wr(t,a),u=Ii(o);return{name:`${t}-title`,type:"group",role:`${c}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...xf(u,c),...yf(c,u,s),...bf(i,r,t,Yh,hl)}}}function yf(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=hf(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function xf(e,t){const n=gf(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}
vendor: 6,385 bytes, line 1
1:{}}function fx(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of zo)if(n[r])for(const s of n[r]){const o=px(e,t,r,n,s);o!=null&&i.push(o)}return i}function dx(e,t){const{sort:n}=e;return pt(n)?{field:E(n,{expr:"datum"}),order:n.order??"ascending"}:k(n)?{field:In(e,t,{expr:"datum"}),order:"ascending"}:{field:E(e,{expr:"datum"}),order:n??"ascending"}}function ys(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:c}=Er(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=uo({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,l=wr(t,a);return{text:{signal:c?wn(wn(c,"datum.label",u),"datum.value",E(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...xf(s,l),...yf(l,s,o),...bf(n,e,t,Kh,ml)}}function px(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=Er(["labelOrient"],o.header,a,t);(t==="row"&&!z(["top","bottom"],f)||t==="column"&&!z(["left","right"],f))&&(s=ys(o,t,a))}const c=ke(e)&&!di(e.facet),u=r.axes,l=(u==null?void 0:u.length)>0;if(s||l){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:dx(o,t)}:{},...l&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...l?{axes:u}:{}}}}return null}const gx={column:{start:0,end:1},row:{start:1,end:0}};function hx(e,t){return gx[t][e]}function mx(e,t){const n={};for(const i of Fe){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=Er(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=wr(i,o),c=hx(s,a);c!==void 0&&(n[a]=c)}}return B(n)?void 0:n}function bf(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Rn(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function Lo(e){return[...Ci(e,"width"),...Ci(e,"height"),...Ci(e,"childWidth"),...Ci(e,"childHeight")]}function Ci(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(i==null||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(J(o)&&cn(a)){const c=e.scaleName(n);return ke(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[dc(c,a)]:[dc(c,a),{name:r,update:Sf(c,s,`domain('${c}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=os(e.config.view,s?"width":"height"),c=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:c,on:[{update:c,events:"window:resize"}]}]}else return[{name:r,value:i}]}function dc(e,t){const n=`${e}_step`;return C(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function Sf(e,t,n){const i=t.get("type"),r=t.get("padding"),s=ne(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Ie(o)}, ${Ie(s)}) * ${e}_step`}function $f(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function vf(e,t){return b(e).reduce((n,i)=>({...n,...Un({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>q(r.value),invalidValueRef:void 0})}),{})}function wf(e,t){if(ke(t))return e==="theta"?"independent":"shared";if(qn(t))return"shared";if(Ho(t))return te(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Mo(e,t){const n=e.scale[t],i=te(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&$(Hp(t)),"independent"):e[i][t]||"shared"}const yx={...Jh,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Ef=b(yx);class xx extends kt{}const pc={symbols:bx,gradient:Sx,labels:$x,entries:vx};function bx(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:c,mark:u}=n,l=o.filled&&u!=="trail";let f={...Zd({},n,Yg),...Yl(n,{filled:l})};const d=r.get("symbolOpacity")??c.legend.symbolOpacity,p=r.get("symbolFillColor")??c.legend.symbolFillColor,g=r.get("symbolStrokeColor")??c.legend.symbolStrokeColor,h=d===void 0?kf(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||l&&i===xe)delete f.fill;else if(v(f.fill,"field"))p?delete f.fill:(f.fill=q(c.legend.symbolBaseFillColor??"black"),f.fillOpacity=q(h??1));else if(k(f.fill)){const m=xs(a.fill??a.color)??o.fill??(l&&o.color);m&&(f.fill=q(m))}}if(f.stroke){if(i==="stroke"||!l&&i===xe)delete f.stroke;else if(v(f.stroke,"field")||g)delete f.stroke;else if(k(f.stroke)){const m=ne(xs(a.stroke||a.color),o.stroke,l?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==vt){const m=w(t)&&Cf(n,r,t);m?f.opacity=[{test:m,...q(h??1)},q(c.legend.unselectedOpacity)]:h&&(f.opacity=q(h))}return f={...f,...e},B(f)?void 0:f}function Sx(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const u=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?kf(o.opacity)||s.opacity:void 0;return u&&(a.opacity=q(u)),a={...a,...e},B(a)?void 0:a}function $x(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=w(t)?Cf(n,r,t):void 0,c=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:l}=s;let f;Jt(l)?f=Re({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:l,config:o}):u===void 0&&l===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Re({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&w(t)&&t.timeUnit===void 0&&(f=Re({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...c?{opacity:c}:{},...f?{text:f}:{},...e};return B(d)?void 0:d}function vx(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function kf(e){return _f(e,(t,n)=>Math.max(t,n.value))}function xs(e){return _f(e,(t,n)=>ne(t,n.value))}function _f(e,t){if(hh(e))return ee(e.condition).reduce(t,e.value);if(De(e))return e.value}function Cf(e,t,n){const i=t.get("selections");
1if(!(i!=null&&i.length))return;const r=R(n.field);return i.map(s=>`(!length(data(${R(K(s)+tn)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const gc={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Lu(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return Mu(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Nx(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Tx(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Ex(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>bn(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(xn(n)&&Ye(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>wx(t,e)};function wx(e,t){const n=e.values;if(k(n))return Ku(t,n);if(C(n))return n}function Ex(e,t,n,i){if(t!=="shape"){const r=xs(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 kx(e){const{legend:t}=e;return ne(t.type,_x(e))}function _x({channel:e,timeUnit:t,scaleType:n}){if(xn(e)){if(z(["quarter","month","day"],t))return"symbol";if(Ye(n))return"gradient"}return"symbol"}function Cx({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Fx(n,t)}function Fx(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 Nx({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:c}=e;if(Ye(r))return n==="horizontal"?i==="top"||i==="bottom"?hc(t,"width",o,s):o:hc(t,"height",c,a)}function hc(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Tx(e){if(z(["quantile","threshold","log","symlog"],e))return"greedy"}function Ff(e){const t=G(e)?Ax(e):Rx(e);return e.component.legends=t,t}function Ax(e){const{encoding:t}=e,n={};for(const i of[xe,...xl]){const r=ie(t[i]);!r||!e.getScaleComponent(i)||i===be&&w(r)&&r.type===jn||(n[i]=Ix(e,i))}return n}function Ox(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 Px(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 Ix(e,t){var O;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new xx({},Ox(e,t));By(e,t,a);const c=n!==void 0?!n:o.disable;if(a.set("disable",c,n!==void 0),c)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),l=ie(r[t]),f=w(l)?(O=oe(l.timeUnit))==null?void 0:O.unit:void 0,d=n.orient||s.legend.orient||"right",p=kx({legend:n,channel:t,timeUnit:f,scaleType:u}),g=Cx({legend:n,legendType:p,orient:d,legendConfig:o}),h={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:l,legendConfig:o,config:s,scaleType:u,orient:d,legendType:p,direction:g};for(const F of Ef){if(p==="gradient"&&F.startsWith("symbol")||p==="symbol"&&F.startsWith("gradient"))continue;const P=F in gc?gc[F](h):n[F];if(P!==void 0){const W=Px(P,F,n,e.fieldDef(t));(W||s.legend[F]===void 0)&&a.set(F,P,W)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),S={},_={fieldOrDatumDef:l,model:e,channel:t,legendCmpt:a,legendType:p};for(const F of["labels","legend","title","symbols","gradient","entries"]){const P=vf(m[F]??{},e),W=F in pc?pc[F](P,_):P;W!==void 0&&!B(W)&&(S[F]={...y!=null&&y.length&&w(l)?{name:`${K(l.field)}_legend_${F}`}:{},...y!=null&&y.length?{interactive:!0}:{},update:y!=null&&y.length?{...W,cursor:{value:"pointer"}}:W})}return B(S)||a.set("encode",S,!!(n!=null&&n.encoding)),a}function Rx(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Ff(i);for(const r of b(i.component.legends))n.legend[r]=Mo(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=Nf(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of b(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function Nf(e,t){var s,o,a,c;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 u of Ef){const l=Ot(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return zx(f,d);case"title":return iu(f,d);case"type":return r=!0,we("symbol")}return br(f,d,u,"legend")});e.setWithExplicit(u,l)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&Zr(e.implicit,["encode","gradient"]),(c=(a=e.explicit)==null?void 0:a.encode)!=null&&c.gradient&&Zr(e.explicit,["encode","gradient"])),e}function zx(e,t){return t.value==="circle"?t:e}function Lx(e,t,n,i){if(hi(t,n)){const r=G(e)?e.axis(n)??e.legend(n)??{}:{},s=E(t,{expr:"datum"}),o=E(t,{expr:"datum",binSuffix:"end"});return{formulaAs:E(t,{binSuffix:"range",forAs:!0}),formula:fi(s,o,r.format,r.formatType,i)}}return{}}function Tf(e,t){return`${Xc(e)}_${t}`}function Mx(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}
vendor: 6,760 bytes, line 1
1function Do(e,t,n){const i=pr(n,void 0)??{},r=Tf(i,t);return e.getName(`${r}_bins`)}function Dx(e){return"as"in e}function mc(e,t,n){let i,r;Dx(e)?i=T(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[E(e,{forAs:!0}),E(e,{binSuffix:"end",forAs:!0})];const s={...pr(t,void 0)},o=Tf(s,e.field),{signal:a,extentSignal:c}=Mx(n,o);if(nr(s.extent)){const l=s.extent;r=df(n,l.param,l),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class Ze extends D{constructor(n,i){super(n);x(this,"bins");this.bins=i}clone(){return new Ze(null,N(this.bins))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{if(ge(o)&&H(o.bin)){const{key:c,binComponent:u}=mc(o,o.bin,i);s[c]={...u,...s[c],...Lx(i,o,a,i.config)}}return s},{});return B(r)?null:new Ze(n,r)}static makeFromTransform(n,i,r){const{key:s,binComponent:o}=mc(i,i.bin,r);return new Ze(n,{[s]:o})}merge(n,i){for(const r of b(n.bins))r in this.bins?(i(n.bins[r].signal,this.bins[r].signal),this.bins[r].as=_e([...this.bins[r].as,...n.bins[r].as],I)):this.bins[r]=n.bins[r];for(const r of n.children)n.removeChild(r),r.parent=this;n.remove()}producedFields(){return new Set(re(this.bins).map(n=>n.as).flat(2))}dependentFields(){return new Set(re(this.bins).map(n=>n.field))}hash(){return`Bin ${I(this.bins)}`}assemble(){return re(this.bins).flatMap(n=>{const i=[],[r,...s]=n.as,{extent:o,...a}=n.bin,c={type:"bin",field:Le(n.field),as:r,signal:n.signal,...nr(o)?{extent:null}:{extent:o},...n.span?{span:{signal:`span(${n.span})`}}:{},...a};!o&&n.extentSignal&&(i.push({type:"extent",field:Le(n.field),signal:n.extentSignal}),c.extent={signal:n.extentSignal}),i.push(c);for(const u of s)for(let l=0;l<2;l++)i.push({type:"formula",expr:E({field:r[l]},{expr:"datum"}),as:u[l]});return n.formula&&i.push({type:"formula",expr:n.formula,as:n.formulaAs}),i})}}function jx(e,t,n,i){var s;const r=G(i)?i.encoding[st(t)]:void 0;if(ge(n)&&G(i)&&Wu(n,r,i.markDef,i.config)){e.add(E(n,{})),e.add(E(n,{suffix:"end"}));const{mark:o,markDef:a,config:c}=i,u=At({fieldDef:n,markDef:a,config:c});ti(o)&&u!==.5&&te(t)&&(e.add(E(n,{suffix:Sr})),e.add(E(n,{suffix:$r}))),n.bin&&hi(n,t)&&e.add(E(n,{binSuffix:"range"}))}else if(Dc(t)){const o=Mc(t);e.add(i.getName(o))}else e.add(E(n));return fn(n)&&zg((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function Ux(e,t){for(const n of b(t)){const i=t[n];for(const r of b(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class ze extends D{constructor(n,i,r){super(n);x(this,"dimensions");x(this,"measures");this.dimensions=i,this.measures=r}clone(){return new ze(null,new Set(this.dimensions),N(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(n,i){let r=!1;i.forEachFieldDef(a=>{a.aggregate&&(r=!0)});const s={},o=new Set;return!r||(i.forEachFieldDef((a,c)=>{const{aggregate:u,field:l}=a;if(u)if(u==="count")s["*"]??(s["*"]={}),s["*"].count=new Set([E(a,{forAs:!0})]);else{if(mt(u)||jt(u)){const f=mt(u)?"argmin":"argmax",d=u[f];s[d]??(s[d]={}),s[d][f]=new Set([E({op:f,field:d},{forAs:!0})])}else s[l]??(s[l]={}),s[l][u]=new Set([E(a,{forAs:!0})]);ot(c)&&i.scaleDomain(c)==="unaggregated"&&(s[l]??(s[l]={}),s[l].min=new Set([E({field:l,aggregate:"min"},{forAs:!0})]),s[l].max=new Set([E({field:l,aggregate:"max"},{forAs:!0})]))}else jx(o,c,a,i)}),o.size+b(s).length===0)?null:new ze(n,o,s)}static makeFromTransform(n,i){var o;const r=new Set,s={};for(const a of i.aggregate){const{op:c,field:u,as:l}=a;c&&(c==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||E(a,{forAs:!0})])):(s[u]??(s[u]={}),(o=s[u])[c]??(o[c]=new Set),s[u][c].add(l||E(a,{forAs:!0}))))}for(const a of i.groupby??[])r.add(a);return r.size+b(s).length===0?null:new ze(n,r,s)}merge(n){return hd(this.dimensions,n.dimensions)?(Ux(this.measures,n.measures),!0):(ag("different dimensions, cannot merge"),!1)}addDimensions(n){n.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...b(this.measures)])}producedFields(){const n=new Set;for(const i of b(this.measures))for(const r of b(this.measures[i])){const s=this.measures[i][r];s.size===0?n.add(`${r}_${i}`):s.forEach(n.add,n)}return n}hash(){return`Aggregate ${I({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const n=[],i=[],r=[];for(const o of b(this.measures))for(const a of b(this.measures[o]))for(const c of this.measures[o][a])r.push(c),n.push(a),i.push(o==="*"?null:Le(o));return{type:"aggregate",groupby:[...this.dimensions].map(Le),ops:n,fields:i,as:r}}}class Bn extends D{constructor(n,i,r,s){super(n);x(this,"model");x(this,"name");x(this,"data");x(this,"column");x(this,"row");x(this,"facet");x(this,"childModel");this.model=i,this.name=r,this.data=s;for(const o of Fe){const a=i.facet[o];if(a){const{bin:c,sort:u}=a;this[o]={name:i.getName(`${o}_domain`),fields:[E(a),...H(c)?[E(a,{binSuffix:"end"})]:[]],...pt(u)?{sortField:u}:k(u)?{sortIndexField:In(a,o)}:{}}}}this.childModel=i.child}hash(){let n="Facet";for(const i of Fe)this[i]&&(n+=` ${i.charAt(0)}:${I(this[i])}`);return n}get fields(){var i;const n=[];for(const r of Fe)(i=this[r])!=null&&i.fields&&n.push(...this[r].fields);return n}dependentFields(){const n=new Set(this.fields);for(const i of Fe)this[i]&&(this[i].sortField&&n.add(this[i].sortField.field),this[i].sortIndexField&&n.add(this[i].sortIndexField));return n}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const n={};for(const i of wt){const r=this.childModel.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(J(s)&&cn(o)){const a=rn(this.childModel,i),c=Bo(a);c?n[i]=c:$(js(i))}}}return n}assembleRowColumnHeaderData(n,i,r){const s={row:"y",column:"x",facet:void 0}[n],o=[],a=[],c=[];s&&r&&r[s]&&(i?(o.push(`distinct_${r[s]}`),a.push("max")):(o.push(r[s]),a.push("distinct")),c.push(`distinct_${r[s]}`));const{sortField:u,sortIndexField:l}=this[n];if(u){const{op:f=lr,field:d}=u;o.push(d),a.push(f),c.push(E(u,{forAs:!0}))}else l&&(o.push(l),a.push("max"),c.push(l));return{name:this[n].name,source:i??this.data,transform:[{type:"aggregate",groupby:this[n].fields,...o.length?{fields:o,ops:a,as:c}:{}}]}}assembleFacetHeaderData(n){var u,l;const{columns:i}=this.model.layout,{layoutHeaders:r}=this.model.component,s=[],o={};for(const f of Ro){for(const d of zo){const p=((u=r[f])==null?void 0:u[d])??[];for(const g of p)if(((l=g.axes)==null?void 0:l.length)>0){o[f]=!0;break}}if(o[f]){const d=`length(data("${this.facet.name}"))`,p=f==="row"?i?{signal:`ceil(${d} / ${i})`}:1:i?{signal:`min(${d}, ${i})`}:{signal:d};s.push({name:`${this.facet.name}_${f}`,transform:[{type:"sequence",start:0,stop:p}]})}}const{row:a,column:c}
vendor: 9,470 bytes, line 1
1=o;return(a||c)&&s.unshift(this.assembleRowColumnHeaderData("facet",null,n)),s}assemble(){const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep(),{column:s,row:o,facet:a}=this;if(s&&o&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const c=[].concat(r.x??[],r.y??[]),u=c.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:c,ops:u}]})}for(const c of[dt,ft])this[c]&&n.push(this.assembleRowColumnHeaderData(c,i,r));if(a){const c=this.assembleFacetHeaderData(r);c&&n.push(...c)}return n}}function yc(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Wx(e,t){const n=Ic(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=yc(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=yc(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return $(hp(t)),null}function Bx(e){const t={};return Ai(e.filter,n=>{if(Su(n)){let i=null;Gs(n)?i=Ee(n.equal):Xs(n)?i=Ee(n.lte):Vs(n)?i=Ee(n.lt):Ys(n)?i=Ee(n.gt):Ks(n)?i=Ee(n.gte):Qs(n)?i=n.range[0]:Zs(n)&&(i=(n.oneOf??n.in)[0]),i&&(un(i)?t[n.field]="date":V(i)?t[n.field]="number":T(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Hx(e){const t={};function n(i){Tn(i)?t[i.field]="date":i.type==="quantitative"&&Bd(i.aggregate)?t[i.field]="number":ei(i.field)>1?i.field in t||(t[i.field]="flatten"):fn(i)&&pt(i.sort)&&ei(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((G(e)||ke(e))&&e.forEachFieldDef((i,r)=>{if(ge(i))n(i);else{const s=on(r),o=e.fieldDef(s);n({...i,type:o.type})}}),G(e)){const{mark:i,markDef:r,encoding:s}=e;if(Ut(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];w(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function qx(e){const t={};if(G(e)&&e.component.selection)for(const n of b(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&ei(r.field)>1&&(t[r.field]="flatten")}return t}class de extends D{constructor(n,i){super(n);x(this,"_parse");this._parse=i}clone(){return new de(null,N(this._parse))}hash(){return`Parse ${I(this._parse)}`}static makeExplicit(n,i,r){var a;let s={};const o=i.data;return!Nt(o)&&((a=o==null?void 0:o.format)!=null&&a.parse)&&(s=o.format.parse),this.makeWithAncestors(n,s,{},r)}static makeWithAncestors(n,i,r,s){for(const c of b(r)){const u=s.getWithExplicit(c);u.value!==void 0&&(u.explicit||u.value===r[c]||u.value==="derived"||r[c]==="flatten"?delete r[c]:$(Ca(c,r[c],u.value)))}for(const c of b(i)){const u=s.get(c);u!==void 0&&(u===i[c]?delete i[c]:$(Ca(c,i[c],u)))}const o=new kt(i,r);s.copyAll(o);const a={};for(const c of b(o.combine())){const u=o.get(c);u!==null&&(a[c]=u)}return b(a).length===0||s.parseNothing?null:new de(n,a)}get parse(){return this._parse}merge(n){this._parse={...this._parse,...n.parse},n.remove()}assembleFormatParse(){const n={};for(const i of b(this._parse)){const r=this._parse[i];ei(i)===1&&(n[i]=r)}return n}producedFields(){return new Set(b(this._parse))}dependentFields(){return new Set(b(this._parse))}assembleTransforms(n=!1){return b(this._parse).filter(i=>n?ei(i)>1:!0).map(i=>{const r=Wx(i,this._parse[i]);return r?{type:"formula",expr:r,as:si(i)}:null}).filter(i=>i!==null)}}class Pt extends D{clone(){return new Pt(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Ue])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ue}}}class xi extends D{constructor(n,i){super(n);x(this,"params");this.params=i}clone(){return new xi(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${I(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class bi extends D{constructor(n,i){super(n);x(this,"params");this.params=i}clone(){return new bi(null,this.params)}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${I(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class nn extends D{constructor(n){super(null);x(this,"_data");x(this,"_name");x(this,"_generator");n??(n={name:"source"});let i;if(Nt(n)||(i=n.format?{...Ne(n.format,["parse"])}:{}),ni(n))this._data={values:n.values};else if(An(n)){if(this._data={url:n.url},!i.type){let r=/(?:\.([^.]+))?$/.exec(n.url)[1];z(["json","csv","tsv","dsv","topojson"],r)||(r="json"),i.type=r}}else zl(n)?this._data={values:[{type:"Sphere"}]}:(Il(n)||Nt(n))&&(this._data={});this._generator=Nt(n),n.name&&(this._name=n.name),i&&!B(i)&&(this._data.format=i)}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(n){this._name=n}set parent(n){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:[]}}}function jo(e){return e instanceof nn||e instanceof xi||e instanceof bi}var vn;class Uo{constructor(){ha(this,vn);Rr(this,vn,!1)}setModified(){Rr(this,vn,!0)}get modifiedFlag(){return ga(this,vn)}}vn=new WeakMap;class dn extends Uo{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 Wo extends Uo{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Gx extends Wo{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of b(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Vx extends Wo{constructor(n){super();x(this,"requiresSelectionId");this.requiresSelectionId=n&&Io(n)}run(n){n instanceof Pt&&(this.requiresSelectionId&&(jo(n.parent)||n.parent instanceof ze||n.parent instanceof de)||(this.setModified(),n.remove()))}}class Xx extends Uo{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Ke&&(i=t.producedFields(),Oc(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 Yx extends Wo{constructor(){super()}run(t){t instanceof ye&&!t.isRequired()&&(this.setModified(),t.remove())}}class Kx extends dn{run(t){if(!jo(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof de)if(t instanceof de)this.setModified(),t.merge(n);else{if(Pc(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Qx extends dn{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof de);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const c of b(a))c in r?r[c]!==a[c]&&s.add(c):r[c]=a[c]}for(const o of s)delete r[o];if(!B(r)){this.setModified();const o=new de(t,r);for(const a of n){if(a instanceof de)for(const c of b(r))delete a.parse[c];t.removeChild(a),a.parent=o,a instanceof de&&b(a.parse).length===0&&a.remove()}}}}}class Zx extends dn{run(t){t instanceof ye||t.numChildren()>0||t instanceof Bn||t instanceof nn||(this.setModified(),t.remove())}}class Jx extends dn{run(t){const n=t.children.filter(r=>r instanceof Ke),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class eb extends dn{run(t){const n=t.children.filter(r=>r instanceof ze),i={};for(const r of n){const s=I(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of b(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class tb extends dn{constructor(n){super();x(this,"model");this.model=n}run(n){const i=!(jo(n)||n instanceof Wn||n instanceof de||n instanceof Pt),r=[],s=[];for(const o of n.children)o instanceof Ze&&(i&&!Pc(n.producedFields(),o.dependentFields())?r.push(o):s.push(o));if(r.length>0){const o=r.pop();for(const a of r)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),n instanceof Ze?n.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(s.length>1){const o=s.pop();for(const a of s)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}}class nb extends dn{run(t){const n=[...t.children];if(!Zn(n,o=>o instanceof ye)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof ye){let a=o;for(;a.numChildren()===1;){const[c]=a.children;if(c instanceof ye)a=c;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class pn extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i}clone(){return new pn(null,N(this.transform))}addDimensions(n){this.transform.groupby=_e(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;
1return this.transform.groupby&&this.transform.groupby.forEach(n.add,n),this.transform.joinaggregate.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(n){return n.as??E(n)}hash(){return`JoinAggregateTransform ${I(this.transform)}`}assemble(){const n=[],i=[],r=[];for(const o of this.transform.joinaggregate)i.push(o.op),r.push(this.getDefaultName(o)),n.push(o.field===void 0?null:o.field);const s=this.transform.groupby;return{type:"joinaggregate",as:r,ops:i,fields:n,...s!==void 0?{groupby:s}:{}}}}class zn extends D{constructor(n,i){super(n);x(this,"filter");this.filter=i}clone(){return new zn(null,{...this.filter})}static make(n,i,r){const{config:s,markDef:o}=i,{marks:a,scales:c}=r;if(a==="include-invalid-values"&&c==="include-invalid-values")return null;const u=i.reduceFieldDef((l,f,d)=>{const p=ot(d)&&i.getScaleComponent(d);if(p){const g=p.get("type"),{aggregate:h}=f,m=oo({scaleChannel:d,markDef:o,config:s,scaleType:g,isCountAggregate:tr(h)});m!=="show"&&m!=="always-valid"&&(l[f.field]=f)}return l},{});return b(u).length?new zn(n,u):null}dependentFields(){return new Set(b(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${I(this.filter)}`}assemble(){const n=b(this.filter).reduce((i,r)=>{const s=this.filter[r],o=E(s,{expr:"datum"});return s!==null&&(s.type==="temporal"?i.push(`(isDate(${o}) || (${bs(o)}))`):s.type==="quantitative"&&i.push(bs(o))),i},[]);return n.length>0?{type:"filter",expr:n.join(" && ")}:null}}function bs(e){return`isValid(${e}) && isFinite(+${e})`}function ib(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=E(i);return r&&t.push(r),t},[])}function rb(e){return k(e)&&e.every(t=>T(t))&&e.length>1}class ht extends D{constructor(n,i){super(n);x(this,"_stack");this._stack=i}clone(){return new ht(null,N(this._stack))}static makeFromTransform(n,i){const{stack:r,groupby:s,as:o,offset:a="zero"}=i,c=[],u=[];if(i.sort!==void 0)for(const d of i.sort)c.push(d.field),u.push(ne(d.order,"ascending"));const l={field:c,order:u};let f;return rb(o)?f=o:T(o)?f=[o,`${o}_end`]:f=[`${i.stack}_start`,`${i.stack}_end`],new ht(n,{dimensionFieldDefs:[],stackField:r,groupby:s,offset:a,sort:l,facetby:[],as:f})}static makeFromEncoding(n,i){const r=i.stack,{encoding:s}=i;if(!r)return null;const{groupbyChannels:o,fieldChannel:a,offset:c,impute:u}=r,l=o.map(g=>{const h=s[g];return je(h)}).filter(g=>!!g),f=ib(i),d=i.encoding.order;let p;if(k(d)||w(d))p=eu(d);
vendor: 6,907 bytes, line 1
1else{const g=Bu(d)?d.sort:a==="y"?"descending":"ascending";p=f.reduce((h,m)=>(h.field.includes(m)||(h.field.push(m),h.order.push(g)),h),{field:[],order:[]})}return new ht(n,{dimensionFieldDefs:l,stackField:i.vgField(a),facetby:[],stackby:f,sort:p,offset:c,impute:u,as:[i.vgField(a,{suffix:"start",forAs:!0}),i.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(n){this._stack.facetby.push(...n)}dependentFields(){const n=new Set;return n.add(this._stack.stackField),this.getGroupbyFields().forEach(n.add,n),this._stack.facetby.forEach(n.add,n),this._stack.sort.field.forEach(n.add,n),n}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${I(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:n,impute:i,groupby:r}=this._stack;return n.length>0?n.map(s=>s.bin?i?[E(s,{binSuffix:"mid"})]:[E(s,{}),E(s,{binSuffix:"end"})]:[E(s)]).flat():r??[]}assemble(){const n=[],{facetby:i,dimensionFieldDefs:r,stackField:s,stackby:o,sort:a,offset:c,impute:u,as:l}=this._stack;if(u)for(const f of r){const{bandPosition:d=.5,bin:p}=f;if(p){const g=E(f,{expr:"datum"}),h=E(f,{expr:"datum",binSuffix:"end"});n.push({type:"formula",expr:`${bs(g)} ? ${d}*${g}+${1-d}*${h} : ${g}`,as:E(f,{binSuffix:"mid",forAs:!0})})}n.push({type:"impute",field:s,groupby:[...o,...i],key:E(f,{binSuffix:"mid"}),method:"value",value:0})}return n.push({type:"stack",groupby:[...this.getGroupbyFields(),...i],field:s,sort:a,as:l,offset:c}),n}}class Hn extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i}clone(){return new Hn(null,N(this.transform))}addDimensions(n){this.transform.groupby=_e(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;return(this.transform.groupby??[]).forEach(n.add,n),(this.transform.sort??[]).forEach(i=>n.add(i.field)),this.transform.window.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(n){return n.as??E(n)}hash(){return`WindowTransform ${I(this.transform)}`}assemble(){const n=[],i=[],r=[],s=[];for(const d of this.transform.window)i.push(d.op),r.push(this.getDefaultName(d)),s.push(d.param===void 0?null:d.param),n.push(d.field===void 0?null:d.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&i.every(d=>Ms(d)))return{type:"joinaggregate",as:r,ops:i,fields:n,...a!==void 0?{groupby:a}:{}};const c=[],u=[];if(this.transform.sort!==void 0)for(const d of this.transform.sort)c.push(d.field),u.push(d.order??"ascending");const l={field:c,order:u},f=this.transform.ignorePeers;return{type:"window",params:s,as:r,ops:i,fields:n,sort:l,...f!==void 0?{ignorePeers:f}:{},...a!==void 0?{groupby:a}:{},...o!==void 0?{frame:o}:{}}}}function sb(e){function t(n){if(!(n instanceof Bn)){const i=n.clone();if(i instanceof ye){const r=$s+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof ze||i instanceof ht||i instanceof Hn||i instanceof pn)&&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 Ss(e){if(e instanceof Bn)if(e.numChildren()===1&&!(e.children[0]instanceof ye)){const t=e.children[0];(t instanceof ze||t instanceof ht||t instanceof Hn||t instanceof pn)&&t.addDimensions(e.fields),t.swapWithParent(),Ss(e)}else{const t=e.model.component.data.main;Af(t);const n=sb(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Ss)}function Af(e){if(e instanceof ye&&e.type===Q.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Bn||(t.swapWithParent(),Af(e))}}const $s="scale_",Fi=5;function vs(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!vs(t.children))return!1}return!0}function Pe(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function xc(e,t,n){let i=e.sources,r=!1;return r=Pe(new Yx,i)||r,r=Pe(new Vx(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Pe(new Zx,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Pe(new Kx,i)||r,r=Pe(new tb(t),i)||r,r=Pe(new Xx,i)||r,r=Pe(new Qx,i)||r,r=Pe(new eb,i)||r,r=Pe(new Jx,i)||r,r=Pe(new Gx,i)||r,r=Pe(new nb,i)||r),e.sources=i,r}function ob(e,t){vs(e.sources);let n=0,i=0;for(let r=0;r<Fi&&xc(e,t,!0);r++)n++;e.sources.map(Ss);for(let r=0;r<Fi&&xc(e,t,!1);r++)i++;vs(e.sources),Math.max(n,i)===Fi&&$(`Maximum optimization runs(${Fi}) reached.`)}class se{constructor(t){x(this,"signal");Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new se(()=>t(n))}}function Of(e){G(e)?ab(e):cb(e)}function ab(e){const t=e.component.scales;for(const n of b(t)){const i=lb(e,n);if(t[n].setWithExplicit("domains",i),db(e,n),e.component.data.isFaceted){let s=e;for(;!ke(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)lt(a)&&(a.data=$s+a.data.replace($s,""))}}}function cb(e){for(const n of e.children)Of(n);const t=e.component.scales;for(const n of b(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=Ot(i,o.getWithExplicit("domains"),"domains","scale",ws);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&$(cp),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function ub(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=bc(t,n);if(!r){$(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=bc(t,n);if(r)return"unaggregated"}return e}function lb(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=ub(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"&&ie(i.x2)?ie(i.x)?Ot(_t(n,r,e,"x"),_t(n,r,e,"x2"),"domain","scale",ws):_t(n,r,e,"x2"):t==="y"&&ie(i.y2)?ie(i.y)?Ot(_t(n,r,e,"y"),_t(n,r,e,"y2"),"domain","scale",ws):_t(n,r,e,"y2"):_t(n,r,e,t)}function fb(e,t,n){return e.map(i=>({signal:`{data: ${gr(i,{timeUnit:n,type:t})}}`}))}function Xr(e,t,n){var r;const i=(r=oe(n))==null?void 0:r.unit;return t==="temporal"||i?fb(e,t,i):[e]}function _t(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:c}=n,u=ie(r[i]),{type:l}=u,f=u.timeUnit,d=py({invalid:Je("invalid",s,a),isPath:Ut(o)});if(Rg(t)){const h=_t(e,void 0,n,i),m=Xr(t.unionWith,l,f);return Xe([...m,...h.value])}else{if(C(t))return Xe([t]);if(t&&t!=="unaggregated"&&!_u(t))return Xe(Xr(t,l,f))}if(c&&i===c.fieldChannel){if(c.offset==="normalize")return we([[0,1]]);const h=n.requestDataName(d);return we([{data:h,field:n.vgField(i,{suffix:"start"})},{data:h,field:n.vgField(i,{suffix:"end"})}])}const p=ot(i)&&w(u)?pb(n,i,e):void 0;if(at(u)){const h=Xr([u.datum],l,f);return we(h)}const g=u;if(t==="unaggregated"){const{field:h}=u;return we([{data:n.requestDataName(d),field:E({field:h,aggregate:"min"})},{data:n.requestDataName(d),field:E({field:h,aggregate:"max"})}])}
1else if(H(g.bin)){if(J(e))return we(e==="bin-ordinal"?[]:[{data:Jn(p)?n.requestDataName(d):n.requestDataName(Q.Raw),field:n.vgField(i,hi(g,i)?{binSuffix:"range"}:{}),sort:p===!0||!L(p)?{field:n.vgField(i,{}),op:"min"}:p}]);{const{bin:h}=g;if(H(h)){const m=Do(n,g.field,h);return we([new se(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return we([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&z(["time","utc"],e)){const h=r[st(i)];if(Wu(g,h,s,a)){const m=n.requestDataName(d),y=At({fieldDef:g,fieldDef2:h,markDef:s,config:a}),S=ti(o)&&y!==.5&&te(i);return we([{data:m,field:n.vgField(i,S?{suffix:Sr}:{})},{data:m,field:n.vgField(i,{suffix:S?$r:"end"})}])}}return we(p?[{data:Jn(p)?n.requestDataName(d):n.requestDataName(Q.Raw),field:n.vgField(i),sort:p}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function Yr(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":lr),...i?{field:Le(i)}:{},...r?{order:r}:{}}}function db(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=_u(i)?i:void 0,o=an(r)&&nr(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function pb(e,t,n){if(!J(n))return;const i=e.fieldDef(t),r=i.sort;if(ju(r))return{op:"min",field:In(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(pt(r)){const a=s&&!o.has(r.field);return Yr(r,a)}else if(dh(r)){const{encoding:a,order:c}=r,u=e.fieldDef(a),{aggregate:l,field:f}=u,d=s&&!o.has(f);if(mt(l)||jt(l))return Yr({field:E(u),order:c},d);if(Ms(l)||!l)return Yr({op:l,field:f,order:c},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(z(["ascending",void 0],r))return!0}}function bc(e,t){const{aggregate:n,type:i}=e;return n?T(n)&&!qd.has(n)?{valid:!1,reason:Lp(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Mp(e)}:{valid:!0}:{valid:!1,reason:zp(e)}}function ws(e,t,n,i){return e.explicit&&t.explicit&&$(Bp(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function gb(e){const t=_e(e.map(o=>{if(lt(o)){const{sort:a,...c}=o;return c}return o}),I),n=_e(e.map(o=>{if(lt(o)){const a=o.sort;return a!==void 0&&!Jn(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),I);if(t.length===0)return;if(t.length===1){const o=e[0];if(lt(o)&&n.length>0){let a=n[0];if(n.length>1){$(Na);const c=n.filter(u=>L(u)&&"op"in u&&u.op!=="min");n.every(u=>L(u)&&"op"in u)&&c.length===1?a=c[0]:a=!0}else if(L(a)&&"field"in a){const c=a.field;o.field===c&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=_e(n.map(o=>Jn(o)||!("op"in o)||T(o.op)&&Z(Ud,o.op)?o:($(qp(o)),!0)),I);let r;i.length===1?r=i[0]:i.length>1&&($(Na),r=!0);const s=_e(e.map(o=>lt(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function Bo(e){if(lt(e)&&T(e.field))return e.field;if(Kc(e)){let t;for(const n of e.fields)if(lt(n)&&T(n.field)){if(!t)t=n.field;else if(t!==n.field)return $(Gp),t}return $(Vp),t}else if(Gd(e)){$(Xp);const t=e.fields[0];return T(t)?t:void 0}}function rn(e,t){const i=e.component.scales[t].get("domains").map(r=>(lt(r)&&(r.data=e.lookupDataSource(r.data)),r));return gb(i)}function hb(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 Pf(e,t){if(G(e)){const i=e.fieldDef(t);if(i!=null&&i.field)return i.field}const n=(e.children??[]).map(i=>Pf(i,t)).filter(i=>!!i);if(n.length>0){const i=_e(n,I);return i.length===1?i[0]:void 0}}function mb(e,t,n){if(t===n)return!0;const i=e.getScaleType(t),r=e.getScaleType(n);if(!i||!r)return!1;const s=J(i),o=J(r);return s===o}function yb(e,t){return e?`field:${e}`:`channel:${String(t)}`}function xb(e){if(k(e)){const t=e.filter(Qr);return t.length>0?t:null}if(Kc(e)){const t=[];if(t.push(...e.fields.flatMap(n=>k(n)?n.filter(Qr):[])),t.length>0)return _e(t,I)}return null}function Es(e,t){try{const n=rn(e,t);return xb(n)}catch{return null}}function bb(e,t,n){const i=Es(e,t),r=Es(e,n);return i&&r?_e([...i,...r],I):null}function Sc(e,t,n){if(t&&t.length>0){const i=e.getWithExplicit("values");i!=null&&i.explicit||(n&&$(n),e.set("values",t,!1))}}function Sb(e,t,n){const i=e.getScaleComponent(t),r=e.getScaleComponent(n);if(!i||!r)return!1;const s=i.getWithExplicit("domains"),o=r.getWithExplicit("domains");if(!(s!=null&&s.explicit&&(o!=null&&o.explicit)))return!1;const a=rn(e,t),c=rn(e,n);return I(a)===I(c)}function If(e){const t=e.component.legends,n={};for(const r of b(t)){const s=Pf(e,r),o=yb(s,r);if(!n[o]){n[o]=[{channel:r,cmpt:t[r].clone()}];continue}let a=!1;for(const c of n[o]){if(!mb(e,c.channel,r))continue;if(Nf(c.cmpt,t[r])){const l=e.getScaleType(c.channel),f=e.getScaleType(r);l&&f&&J(l)&&J(f)&&(Sb(e,c.channel,r)?Sc(c.cmpt,Es(e,c.channel)):Sc(c.cmpt,bb(e,c.channel,r),Yp(c.channel,r))),a=!0;break}}a||n[o].push({channel:r,cmpt:t[r].clone()})}return re(n).flat().map(r=>$b(r.cmpt,e.config)).filter(r=>r!==void 0)}function $b(e,t){var o,a,c;const{disable:n,labelExpr:i,selections:r,...s}
1=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const u=s.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!s.stroke&&(u.stroke={value:"transparent"});for(const l of xl)s[l]&&delete u[l]}if(s.title||delete s.title,i!==void 0){let u=i;(c=(a=s.encode)==null?void 0:a.labels)!=null&&c.update&&C(s.encode.labels.update.text)&&(u=wn(i,"datum.label",s.encode.labels.update.text.signal)),hb(s,"labels","text",{signal:u})}return s}}function vb(e){return qn(e)||Ho(e)?wb(e):Rf(e)}function wb(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),Rf(e))}function Rf(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(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const c=C(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return z(o,c)||o.push(c),o},[]);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 Eb=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class zf extends kt{constructor(n,i,r,s){super({...i},{name:n});x(this,"specifiedProjection");x(this,"size");x(this,"data");x(this,"merged",!1);this.specifiedProjection=i,this.size=r,this.data=s}get isFit(){return!!this.data}}function Lf(e){e.component.projection=G(e)?kb(e):Fb(e)}function kb(e){if(e.hasProjection){const t=ue(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?_b(e):void 0,s=new zf(e.projectionName(!0),{...ue(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function _b(e){const t=[],{encoding:n}=e;for(const i of[[qe,He],[Te,Ge]])(ie(n[i[0]])||ie(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(be)&&e.typedFieldDef(be).type===jn&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Q.Main)),t}function Cb(e,t){const n=Ac(Eb,r=>!!(!Z(e.explicit,r)&&!Z(t.explicit,r)||Z(e.explicit,r)&&Z(t.explicit,r)&&Ce(e.get(r),t.get(r))));if(Ce(e.size,t.size)){if(n)return e;if(Ce(e.explicit,{}))return t;if(Ce(t.explicit,{}))return e}return null}function Fb(e){if(e.children.length===0)return;let t;for(const i of e.children)Lf(i);const n=Ac(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=Cb(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 zf(i,t.specifiedProjection,t.size,N(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function Mf(e){return qn(e)||Ho(e)?e.children.reduce((t,n)=>t.concat(Mf(n)),$c(e)):$c(e)}function $c(e){return b(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:c,range:u,reverse:l,...f}=r,d=Nb(r.range,s,n,e),p=rn(e,n),g=a?Ey(e,a,i,p):null;return t.push({name:s,type:o,...p?{domain:p}:{},...g?{domainRaw:g}:{},range:d,...l!==void 0?{reverse:l}:{},...f}),t},[])}function Nb(e,t,n,i){if(te(n)){if(cn(e))return{step:{signal:`${t}_step`}}}else if(L(e)&&lt(e))return{...e,data:i.lookupDataSource(e.data)};return e}class Df extends kt{constructor(n,i){super({},{name:n});x(this,"merged",!1);this.setWithExplicit("type",i)}domainHasZero(){const n=this.get("type");if(z([le.LOG,le.TIME,le.UTC],n))return"definitely-not";const i=this.get("zero");if(i===!0||i===void 0&&z([le.LINEAR,le.SQRT,le.POW],n))return"definitely";const r=this.get("domains");if(r.length>0){let s=!1,o=!1,a=!1;for(const c of r){if(k(c)){const u=c[0],l=c[c.length-1];if(V(u)&&V(l))if(u<=0&&l>=0){s=!0;continue}else{o=!0;continue}}a=!0}if(s)return"definitely";if(o&&!a)return"definitely-not"}return"maybe"}}const Tb=["range","scheme"];function Ab(e){const t=e.component.scales;for(const n of Ls){const i=t[n];if(!i)continue;const r=Ob(n,e);i.setWithExplicit("range",r)}}function vc(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=Se(t),o=e.getName(s);if(L(i)&&i.binned&&i.step!==void 0)return new se(()=>
vendor: 4,180 bytes, line 1
1{const a=e.scaleName(t),c=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${c})`});if(H(i)){const a=Do(e,r,i);return new se(()=>{const c=e.getSignalName(a),u=`(${c}.stop - ${c}.start) / ${c}.step`;return`${e.getSignalName(o)} / (${u})`})}}}function Ob(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of Tb)if(n[f]!==void 0){const d=is(s,f),p=Cu(e,f);if(!d)$(au(s,f,e));else if(p)$(p);else switch(f){case"range":{const g=n.range;if(k(g)){if(te(e))return Xe(g.map(h=>{if(h==="width"||h==="height"){const m=t.getName(h),y=t.getSignalName.bind(t);return se.fromName(y,m)}return h}))}else if(L(g))return Xe({data:t.requestDataName(Q.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return Xe(g)}case"scheme":return Xe(Pb(n[f]))}}const o=e===X||e==="xOffset"?"width":"height",a=i[o];if(tt(a)){if(te(e))if(J(s)){const f=Uf(a,t,e);if(f)return Xe({step:f})}else $(cu(o));else if(ci(e)){const f=e===It?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=Wf(a,s);if(g)return Xe(g)}}}const{rangeMin:c,rangeMax:u}=n,l=Ib(e,t);return(c!==void 0||u!==void 0)&&is(s,"rangeMin")&&k(l)&&l.length===2?Xe([c??l[0],u??l[1]]):we(l)}function Pb(e){return Ig(e)?{scheme:e.name,...Ne(e,["name"])}:{scheme:e}}function jf(e,t,n,{center:i}={}){const r=Se(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===ae&&Me(n)?i?[se.fromName(a=>`${o(a)}/2`,s),se.fromName(a=>`-${o(a)}/2`,s)]:[se.fromName(o,s),0]:i?[se.fromName(a=>`-${o(a)}/2`,s),se.fromName(a=>`${o(a)}/2`,s)]:[0,se.fromName(o,s)]}function Ib(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=ie(s[e]),c=t.getScaleComponent(e).get("type"),{domain:u,domainMid:l}=t.specifiedScales[e];switch(e){case X:case ae:{if(z(["point","band"],c)){const f=Bf(e,n,i.view);if(tt(f))return{step:Uf(f,t,e)}}return jf(e,t,c)}case It:case Dn:return Rb(e,t,c);case $t:{const f=Mb(r,i),d=Db(r,n,t,i);return _n(c)?Lb(f,d,zb(c,i,u,e)):[f,d]}case Ae:return[0,Math.PI*2];case sn:return[0,360];case Be:return[0,new se(()=>{const f=t.getSignalName(ke(t.parent)?"child_width":"width"),d=t.getSignalName(ke(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Rt:return{step:1e3/i.scale.framesPerSecond};case Mt:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Dt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case be:return"symbol";case xe:case it:case rt:return c==="ordinal"?o==="nominal"?"category":"ordinal":l!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case vt:case zt:case Lt:return[i.scale.minOpacity,i.scale.maxOpacity]}}function Uf(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Ps(n),o=i[s];if(Sl({step:e,offsetIsDiscrete:A(o)&&Js(o.type)})==="offset"&&el(i,s)){const c=t.getScaleComponent(s);let l=`domain('${t.scaleName(s)}').length`;if(c.get("type")==="band"){const d=c.get("paddingInner")??c.get("padding")??0,p=c.get("paddingOuter")??c.get("padding")??0;l=`bandspace(${l}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${l} / (1-${Qd(f)})`}}else return e.step}function Wf(e,t){if(Sl({step:e,offsetIsDiscrete:J(t)})==="offset")return{step:e.step}}function Rb(e,t,n){const i=e===It?"x":"y",r=t.getScaleComponent(i);if(!r)return jf(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:c}=t;if(s==="band"){const u=Bf(i,t.size,t.config.view);if(tt(u)){const l=Wf(u,n);if(l)return l}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(w(u)&&u.timeUnit){const l=xu(u.timeUnit,g=>`scale('${o}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=At({fieldDef:u,markDef:a,config:c})-.5,p=d!==0?` + ${d}`:"";if(f){const g=C(f)?`${f.signal}/2${p}`:`${f/2+d}`,h=C(f)?`(1 - ${f.signal}/2)${p}`:`${1-f/2+d}`;return[{signal:`${g} * (${l})`},{signal:`${h} * (${l})`}]}return[0,{signal:l}]}return dd(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function Bf(e,t,n){const i=e===X?"width":"height",r=t[i];return r!==void 0?r:Wi(n,i)}function zb(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&k(n)?n.length+1:($(rg(i)),3)}}
vendor: 4,122 bytes, line 1
1function Lb(e,t,n){const i=()=>{const r=Ie(t),s=Ie(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return C(t)?new se(i):{signal:i()}}function Mb(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(ir("size",e))}const wc=.95;function Db(e,t,n,i){const r={x:vc(n,"x"),y:vc(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=Ec(t,r,i.view);return V(s)?s-1:new se(()=>`${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=Ec(t,r,i.view);return V(s)?Math.pow(wc*s,2):new se(()=>`pow(${wc} * ${s.signal}, 2)`)}}throw new Error(ir("size",e))}function Ec(e,t,n){const i=tt(e.width)?e.width.step:as(n,"width"),r=tt(e.height)?e.height.step:as(n,"height");return t.x||t.y?new se(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function Hf(e,t){G(e)?jb(e,t):Gf(e,t)}function jb(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of b(n)){const c=o[a],u=n[a],l=e.getScaleComponent(a),f=ie(r[a]),d=c[t],p=l.get("type"),g=l.get("padding"),h=l.get("paddingInner"),m=is(p,t),y=Cu(a,t);if(d!==void 0&&(m?y&&$(y):$(au(p,t,a))),m&&y===void 0)if(d!==void 0){const S=f.timeUnit,_=f.type;switch(t){case"domainMax":case"domainMin":un(c[t])||_==="temporal"||S?u.set(t,{signal:gr(c[t],{type:_,timeUnit:S})},!0):u.set(t,c[t],!0);break;default:u.copyKeyFromObject(t,c)}}else{const S=v(kc,t)?kc[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:p,scalePadding:g,scalePaddingInner:h,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:s,config:i,hasNestedOffsetScale:tl(r,a),hasSecondaryRangeChannel:!!r[st(a)]}):i.scale[t];S!==void 0&&u.set(t,S,!1)}}}const kc={bins:({model:e,fieldOrDatumDef:t})=>w(t)?Ub(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Wb(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>Bb(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Hb(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>qb(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>Gb(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=w(e)?e.sort:void 0;return Vb(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>Xb(e,t,n,i,r,s.scale,o)};function qf(e){G(e)?Ab(e):Gf(e,"range")}function Gf(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?qf(i):Hf(i,t);for(const i of b(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=Ot(r,a,t,"scale",Pl((c,u)=>{switch(t){case"range":return c.step&&u.step?c.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Ub(e,t){const n=t.bin;if(H(n)){const i=Do(e,t.field,n);return new se(()=>e.getSignalName(i))}else if(ce(n)&&an(n)&&n.step!==void 0)return{step:n.step}}function Wb(e,t){if(z([xe,it,rt],e)&&t!=="nominal")return"hcl"}function Bb(e,t,n,i,r,s){var o;if(!((o=je(s))!=null&&o.bin||k(n)||r!=null||i!=null||z([le.TIME,le.UTC],e)))return te(t)?!0:void 0}function Hb(e,t,n,i,r,s){if(te(e)){if(Ye(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(w(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===le.POINT)return n.pointPadding}}function qb(e,t,n,i,r,s=!1){if(e===void 0){if(te(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:c,tickBandPaddingInner:u,bandWithNestedOffsetPaddingInner:l}=r;return s?l:ne(o,n==="bar"?a:n==="tick"?u:c)}
1else if(ci(t)&&i===le.BAND)return r.offsetBandPaddingInner}}function Gb(e,t,n,i,r,s=!1){if(e===void 0){if(te(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===le.BAND)return ne(o,C(i)?{signal:`${i.signal}/2`}:i/2)}else if(ci(t)){if(n===le.POINT)return .5;if(n===le.BAND)return r.offsetBandPaddingOuter}}}function Vb(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Me(e)&&t==="descending"?C(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Me(e)&&t==="descending")return!0}function Xb(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Me(r)){if(k(n)){const c=n[0],u=n[n.length-1];if(V(c)&&c<=0&&V(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!_n(r))return!0;if(!(w(t)&&t.bin)&&z([...wt,...Od],e)){const{orient:c,type:u}=i;return z(["bar","area","line","trail"],u)&&(c==="horizontal"&&e==="y"||c==="vertical"&&e==="x")?!1:z(["bar","area"],u)&&!o?!0:s==null?void 0:s.zero}return!1}function Yb(e,t,n,i,r=!1){const s=Kb(t,n,i,r),{type:o}=e;return ot(t)?o!==void 0?Ug(t,o)?w(n)&&!jg(o,n.type)?($(Up(o,s)),s):o:($(jp(t,o,s)),s):s:null}function Kb(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(xn(e)||Lr(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&$(Mr(e,"ordinal")),"ordinal";if(zr(e))return"band";if(te(e)||ci(e)){if(z(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in zs)return"band";const s=n[Se(e)];return Zt(s)||Fn(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return xn(e)?"time":Lr(e)==="discrete"?($(Mr(e,"temporal")),"ordinal"):w(t)&&t.timeUnit&&oe(t.timeUnit).utc?"utc":zr(e)?"band":"time";case"quantitative":return xn(e)?w(t)&&H(t.bin)?"bin-ordinal":"linear":Lr(e)==="discrete"?($(Mr(e,"quantitative")),"ordinal"):zr(e)?"band":"linear";case"geojson":return}throw new Error(su(t.type))}function Qb(e,{ignoreRange:t}={}){Vf(e),Of(e);for(const n of Dg)Hf(e,n);t||qf(e)}function Vf(e){G(e)?e.component.scales=Zb(e):e.component.scales=eS(e)}function Zb(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of Ls){const o=ie(t[s]);if(o&&n===Tu&&s===be&&o.type===jn)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const c=tl(t,s),u=Yb(a,s,o,i,c);r[s]=new Df(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const Jb=Pl((e,t)=>Aa(e)-Aa(t));function eS(e){var r;const t=e.component.scales={},n={},i=e.component.resolve;for(const s of e.children){Vf(s);for(const o of b(s.component.scales))if((r=i.scale)[o]??(r[o]=wf(o,e)),i.scale[o]==="shared"){const a=n[o],c=s.component.scales[o].getWithExplicit("type");a?Ng(a.value,c.value)?n[o]=Ot(a,c,"type","scale",Jb):(i.scale[o]="independent",delete n[o]):n[o]=c}}for(const s of b(n)){const o=e.scaleName(s,!0),a=n[s];t[s]=new Df(o,a);for(const c of e.children){const u=c.component.scales[s];u&&(c.renameScale(u.get("name"),o),u.merged=!0)}}return t}class Kr{constructor(){x(this,"nameMap");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 G(e){return(e==null?void 0:e.type)==="unit"}function ke(e){return(e==null?void 0:e.type)==="facet"}function Ho(e){return(e==null?void 0:e.type)==="concat"}function qn(e){return(e==null?void 0:e.type)==="layer"}class qo{constructor(t,n,i,r,s,o,a){x(this,"type");x(this,"parent");x(this,"config");x(this,"name");x(this,"size");x(this,"title");x(this,"description");x(this,"data");x(this,"transforms");x(this,"layout");x(this,"scaleNameMap");x(this,"projectionNameMap");x(this,"signalNameMap");x(this,"component");x(this,"view");this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=ue(a),this.name=t.name??r,this.title=Ct(t.title)?{text:t.title}:t.title?ue(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Kr,this.projectionNameMap=i?i.projectionNameMap:new Kr,this.signalNameMap=i?i.signalNameMap:new Kr,this.data=t.data,this.description=t.description,this.transforms=ey(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:rm(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:fr(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new kt,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?N(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}
vendor: 5,134 bytes, line 1
1get 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(){Qb(this)}parseProjection(){Lf(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Ff(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of b(i)){const o=i[s];o!==void 0&&(r[s]=q(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=q(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:B(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=mx(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 Fe)t[i].title&&n.push(lx(this,i));for(const i of Ro)n=n.concat(fx(this,i));return n}assembleAxes(){return Qy(this.component.axes,this.config)}assembleLegends(){return If(this)}assembleProjections(){return vb(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...Yc(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return z(["unit","layer"],this.type)?z(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),B(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||ke(this.parent)?Mf(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return K((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Q[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(ke(this.parent)){const n=$f(t),i=er(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(J(s)&&cn(o)){const a=r.get("name"),c=rn(this,i),u=Bo(c);if(u){const l=E({aggregate:"distinct",field:u},{expr:"datum"});return{signal:Sf(a,r,l)}}else return $(js(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(Uc(t)&&ot(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(np(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 Xf extends qo{vgField(t,n={}){const i=this.fieldDef(t);if(i)return E(i,n)}reduceFieldDef(t,n){return Ph(this.getMapping(),(i,r,s)=>{const o=je(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){mo(this.getMapping(),(i,r)=>{const s=je(i);s&&t(s,r)},n)}}class kr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const s=this.transform.resolve??"shared";this.transform.resolve=s}clone(){return new kr(null,N(this.transform))}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${I(this.transform)}`}assemble(){const{density:n,...i}=this.transform,r={type:"kde",field:n,...i};return r.resolve=this.transform.resolve,r}}
vendor: 7,621 bytes, line 1
1class _r extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i)}clone(){return new _r(null,N(this.transform))}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${I(this.transform)}`}assemble(){const{extent:n,param:i}=this.transform;return{type:"extent",field:n,signal:i}}}class Cr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const{flatten:r,as:s=[]}=this.transform;this.transform.as=r.map((o,a)=>s[a]??o)}clone(){return new Cr(this.parent,N(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${I(this.transform)}`}assemble(){const{flatten:n,as:i}=this.transform;return{type:"flatten",fields:n,as:i}}}class Fr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}clone(){return new Fr(null,N(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${I(this.transform)}`}assemble(){const{fold:n,as:i}=this.transform;return{type:"fold",fields:n,as:i}}}class $n extends D{constructor(n,i,r,s){super(n);x(this,"fields");x(this,"geojson");x(this,"signal");this.fields=i,this.geojson=r,this.signal=s}clone(){return new $n(null,N(this.fields),this.geojson,this.signal)}static parseAll(n,i){if(i.component.projection&&!i.component.projection.isFit)return n;let r=0;for(const s of[[qe,He],[Te,Ge]]){const o=s.map(a=>{const c=ie(i.encoding[a]);return w(c)?c.field:at(c)?{expr:`${c.datum}`}:De(c)?{expr:`${c.value}`}:void 0});(o[0]||o[1])&&(n=new $n(n,o,null,i.getName(`geojson_${r++}`)))}if(i.channelHasField(be)){const s=i.typedFieldDef(be);s.type===jn&&(n=new $n(n,null,s.field,i.getName(`geojson_${r++}`)))}return n}dependentFields(){const n=(this.fields??[]).filter(T);return new Set([...this.geojson?[this.geojson]:[],...n])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${I(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 ii extends D{constructor(n,i,r,s){super(n);x(this,"projection");x(this,"fields");x(this,"as");this.projection=i,this.fields=r,this.as=s}clone(){return new ii(null,this.projection,N(this.fields),N(this.as))}static parseAll(n,i){if(!i.projectionName())return n;for(const r of[[qe,He],[Te,Ge]]){const s=r.map(a=>{const c=ie(i.encoding[a]);return w(c)?c.field:at(c)?{expr:`${c.datum}`}:De(c)?{expr:`${c.value}`}:void 0}),o=r[0]===Te?"2":"";(s[0]||s[1])&&(n=new ii(n,i.projectionName(),s,[i.getName(`x${o}`),i.getName(`y${o}`)]))}return n}dependentFields(){return new Set(this.fields.filter(T))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${I(this.fields)} ${I(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Gt extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i}clone(){return new Gt(null,N(this.transform))}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(n){const{start:i=0,stop:r,step:s}=n;return{signal:`sequence(${[i,r,...s?[s]:[]].join(",")})`}}static makeFromTransform(n,i){return new Gt(n,i)}static makeFromEncoding(n,i){const r=i.encoding,s=r.x,o=r.y;if(w(s)&&w(o)){const a=s.impute?s:o.impute?o:void 0;if(a===void 0)return;const c=s.impute?o:o.impute?s:void 0,{method:u,value:l,frame:f,keyvals:d}=a.impute,p=rl(i.mark,r);return new Gt(n,{impute:a.field,key:c.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...f?{frame:f}:{},...d!==void 0?{keyvals:d}:{},...p.length?{groupby:p}:{}})}return null}hash(){return`Impute ${I(this.transform)}`}assemble(){const{impute:n,key:i,keyvals:r,method:s,groupby:o,value:a,frame:c=[null,null]}=this.transform,u={type:"impute",field:n,key:i,...r?{keyvals:Rm(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!s||s==="value"?a:null};if(s&&s!=="value"){const l={type:"window",as:[`imputed_${n}_value`],ops:[s],fields:[n],frame:c,ignorePeers:!1,...o?{groupby:o}:{}},f={type:"formula",expr:`datum.${n} === null ? datum.imputed_${n}_value : datum.${n}`,as:n};return[u,l,f]}else return[u]}}class Nr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.loess]}clone(){return new Nr(null,N(this.transform))}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${I(this.transform)}`}assemble(){const{loess:n,on:i,...r}=this.transform;return{type:"loess",x:i,y:n,...r}}}class ri extends D{constructor(n,i,r){super(n);x(this,"transform");x(this,"secondary");this.transform=i,this.secondary=r}clone(){return new ri(null,N(this.transform),this.secondary)}static make(n,i,r,s){const o=i.component.data.sources,{from:a}=r;let c=null;if(zm(a)){let u=Qf(a.data,o);u||(u=new nn(a.data),o.push(u));const l=i.getName(`lookup_${s}`);c=new ye(u,l,Q.Lookup,i.component.data.outputNodeRefCounts),i.component.data.outputNodes[l]=c}else if(Lm(a)){const u=a.param;r={as:u,...r};let l;try{l=i.getSelectionComponent(K(u),u)}catch{throw new Error(op(u))}if(c=l.materialized,!c)throw new Error(ap(u))}return new ri(n,r,c.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?ee(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${I({transform:this.transform,secondary:this.secondary})}`}assemble(){let n;if(this.transform.from.fields)n={values:this.transform.from.fields,...this.transform.as?{as:ee(this.transform.as)}:{}};else{let i=this.transform.as;T(i)||($(xp),i="_lookup"),n={as:[i]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...n,...this.transform.default?{default:this.transform.default}:{}}}}class Tr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}clone(){return new Tr(null,N(this.transform))}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${I(this.transform)}`}assemble(){const{quantile:n,...i}=this.transform;return{type:"quantile",field:n,...i}}}class Ar extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i,this.transform=N(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.regression]}clone(){return new Ar(null,N(this.transform))}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${I(this.transform)}`}assemble(){const{regression:n,on:i,...r}=this.transform;return{type:"regression",x:i,y:n,...r}}}class Or extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i}clone(){return new Or(null,N(this.transform))}
vendor: 10,048 bytes, line 1
1addDimensions(n){this.transform.groupby=_e((this.transform.groupby??[]).concat(n),i=>i)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${I(this.transform)}`}assemble(){const{pivot:n,value:i,groupby:r,limit:s,op:o}=this.transform;return{type:"pivot",field:n,value:i,...s!==void 0?{limit:s}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class Pr extends D{constructor(n,i){super(n);x(this,"transform");this.transform=i}clone(){return new Pr(null,N(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${I(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Yf(e){let t=0;function n(i,r){if(i instanceof nn&&!i.isGenerator&&!An(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof de&&(i.parent instanceof nn&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Bn){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 xi||i instanceof bi||i instanceof zn||i instanceof Wn||i instanceof Pn||i instanceof ii||i instanceof ze||i instanceof ri||i instanceof Hn||i instanceof pn||i instanceof Fr||i instanceof Cr||i instanceof kr||i instanceof Nr||i instanceof Tr||i instanceof Ar||i instanceof Pt||i instanceof Pr||i instanceof Or||i instanceof _r)&&r.transform.push(i.assemble()),(i instanceof Ze||i instanceof Ke||i instanceof Gt||i instanceof ht||i instanceof $n)&&r.transform.push(...i.assemble()),i instanceof ye&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof ye?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 ye&&(!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 o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function tS(e){const t=[],n=Yf(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function nS(e,t){const n=[],i=Yf(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function iS(e){return e==="top"||e==="left"||C(e)?"header":"footer"}function rS(e){for(const t of Fe)sS(e,t);_c(e,"x"),_c(e,"y")}function sS(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],c=Rn("title",null,i,t);let u=bn(a,i,{allowDisabling:!0,includeDefault:c===void 0||!!c});r.component.layoutHeaders[t].title&&(u=k(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const l=Rn("labelOrient",a.header,i,t),f=a.header!==null?ne((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=z(["bottom","right"],l)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[Kf(e,t,f)]}}}function Kf(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 _c(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Mo(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const c=iS(a.get("orient"));o[c]??(o[c]=[Kf(e,s,!1)]);const u=Xn(a,"main",e.config,{header:!0});u&&o[c][0].axes.push(u),a.mainExtracted=!0}}}}function oS(e){Go(e),Gi(e,"width"),Gi(e,"height")}function aS(e){Go(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Gi(e,t),Gi(e,n)}function Go(e){for(const t of e.children)t.parseLayoutSize()}function Gi(e,t){const n=$f(t),i=er(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const c=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??wf(i,e);if(u==="independent"&&c.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==c.value){o=void 0;break}o=Ot(o,c,n,"")}else o=c}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function cS(e){const{size:t,component:n}=e;for(const i of wt){const r=Se(i);if(t[r]!=null&&t[r]!=null){const s=t[r];n.layoutSize.set(r,tt(s)?"step":s,!0)}else{const s=uS(e,r);n.layoutSize.set(r,s,!1)}}}function uS(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(J(s)){const a=Wi(i.view,t);return cn(o)||tt(a)?"step":a}else return os(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return os(i.view,t);{const s=Wi(i.view,t);return tt(s)?s.step:s}}}function ks(e,t,n){return E(t,{suffix:`by_${E(e)}`,...n})}class Kn extends Xf{constructor(n,i,r,s){super(n,"facet",i,r,s,n.resolve);x(this,"facet");x(this,"child");x(this,"children");this.child=Qo(n.spec,this,this.getName("child"),void 0,s),this.children=[this.child],this.facet=this.initFacet(n.facet)}initFacet(n){if(!di(n))return{facet:this.initFacetFieldDef(n,"facet")};const i=b(n),r={};for(const s of i){if(![ft,dt].includes(s)){$(ir(s,"facet"));break}const o=n[s];if(o.field===void 0){$(ts(o,s));break}r[s]=this.initFacetFieldDef(o,s)}return r}initFacetFieldDef(n,i){const r=ho(n,i);return r.header?r.header=ue(r.header):r.header===null&&(r.header=null),r}channelHasField(n){return v(this.facet,n)}fieldDef(n){return this.facet[n]}parseData(){this.component.data=Ir(this),this.child.parseData()}parseLayoutSize(){Go(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,re(this.component.selection).some(n=>Qe(n))&&Ws(Us)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),rS(this)}assembleSelectionTopLevelSignals(n){return this.child.assembleSelectionTopLevelSignals(n)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(n){return this.child.assembleSelectionData(n)}getHeaderLayoutMixins(){const n={};for(const i of Fe)for(const r of zo){const s=this.component.layoutHeaders[i],o=s[r],{facetFieldDef:a}=s;if(a){const c=Rn("titleOrient",a.header,this.config,i);if(["right","bottom"].includes(c)){const u=wr(i,c);n.titleAnchor??(n.titleAnchor={}),n.titleAnchor[u]="end"}}if(o!=null&&o[0]){const c=i==="row"?"height":"width",u=r==="header"?"headerBand":"footerBand";i!=="facet"&&!this.child.component.layoutSize.get(c)&&(n[u]??(n[u]={}),n[u][i]=.5),s.title&&(n.offset??(n.offset={}),n.offset[i==="row"?"rowTitle":"columnTitle"]=10)}}return n}assembleDefaultLayout(){const{column:n,row:i}=this.facet,r=n?this.columnDistinctSignal():i?1:void 0;let s="all";return(!i&&this.component.resolve.scale.x==="independent"||!n&&this.component.resolve.scale.y==="independent")&&(s="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:s}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Kn))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(n){return this.parent&&this.parent instanceof Kn?{...this.channelHasField("column")?{encode:{update:{columns:{field:E(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(n)}:super.assembleGroup(n)}getCardinalityAggregateForChild(){const n=[],i=[],r=[];if(this.child instanceof Kn){if(this.child.channelHasField("column")){const s=E(this.child.facet.column);n.push(s),i.push("distinct"),r.push(`distinct_${s}`)}}else for(const s of wt){const o=this.child.component.scales[s];if(o&&!o.merged){const a=o.get("type"),c=o.get("range");if(J(a)&&cn(c)){const u=rn(this.child,s),l=Bo(u);l?(n.push(l),i.push("distinct"),r.push(`distinct_${l}`)):$(js(s))}}}return{fields:n,ops:i,as:r}}assembleFacet(){const{name:n,data:i}=this.component.data.facetRoot,{row:r,column:s}=this.facet,{fields:o,ops:a,as:c}=this.getCardinalityAggregateForChild(),u=[];for(const f of Fe){const d=this.facet[f];if(d){u.push(E(d));const{bin:p,sort:g}=d;if(H(p)&&u.push(E(d,{binSuffix:"end"})),pt(g)){const{field:h,op:m=lr}=g,y=ks(d,g);r&&s?(o.push(y),a.push("max"),c.push(y)):(o.push(h),a.push(m),c.push(y))}else if(k(g)){const h=In(d,f);o.push(h),a.push("max"),c.push(h)}}}const l=!!r&&!!s;return{name:n,data:i,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:a,as:c}:{}}}:{}}}facetSortFields(n){const{facet:i}=this,r=i[n];return r?pt(r.sort)?[ks(r,r.sort,{expr:"datum"})]:k(r.sort)?[In(r,n,{expr:"datum"})]:[E(r,{expr:"datum"})]:[]}facetSortOrder(n){const{facet:i}=this,r=i[n];if(r){const{sort:s}=r;return[(pt(s)?s.order:!k(s)&&s)||"ascending"]}return[]}assembleLabelTitle(){var s;const{facet:n,config:i}=this;if(n.facet)return ys(n.facet,"facet",i);const r={row:["top","bottom"],column:["left","right"]};for(const o of Ro)if(n[o]){const a=Rn("labelOrient",(s=n[o])==null?void 0:s.header,i,o);if(r[o].includes(a))return ys(n[o],o,i)}}assembleMarks(){const{child:n}=this,i=this.component.data.facetRoot,r=tS(i),s=n.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||n.assembleTitle(),a=n.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:Fe.map(u=>
1this.facetSortFields(u)).flat(),order:Fe.map(u=>this.facetSortOrder(u)).flat()},...r.length>0?{data:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup(Sy(this,[]))}]}getMapping(){return this.facet}}function lS(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(pt(s.sort)){const{field:o,op:a=lr}=s.sort;e=r=new pn(e,{joinaggregate:[{op:a,field:o,as:ks(s,s.sort,{forAs:!0})}],groupby:[E(s)]})}return r}return null}function Qf(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const c=(n=e.format)==null?void 0:n.mesh,u=(i=a.format)==null?void 0:i.feature;if(c&&u)continue;const l=(r=e.format)==null?void 0:r.feature;if((l||u)&&l!==u)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((c||f)&&c!==f)){if(ni(e)&&ni(a)){if(Ce(e.values,a.values))return o}else if(An(e)&&An(a)){if(e.url===a.url)return o}else if(Il(e)&&e.name===o.dataName)return o}}return null}function fS(e,t){if(e.data||!e.parent){if(e.data===null){const i=new nn({values:[]});return t.push(i),i}const n=Qf(e.data,t);if(n)return Nt(e.data)||(n.data.format=pd({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new nn(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 dS(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Vm(r))o=e=new Pn(e,r),s="derived";else if(Co(r)){const a=Bx(r);o=e=de.makeWithAncestors(e,{},a,n)??e,e=new Wn(e,t,r.filter)}else if(Tl(r))o=e=Ze.makeFromTransform(e,r,t),s="number";else if(Ym(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new de(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Ke.makeFromTransform(e,r);else if(Km(r))o=e=ze.makeFromTransform(e,r),s="number",Io(t)&&(e=new Pt(e));else if(Nl(r))o=e=ri.make(e,t,r,i++),s="derived";else if(Hm(r))o=e=new Hn(e,r),s="number";else if(qm(r))o=e=new pn(e,r),s="number";else if(Qm(r))o=e=ht.makeFromTransform(e,r),s="derived";else if(Zm(r))o=e=new Fr(e,r),s="derived";else if(Jm(r))o=e=new _r(e,r),s="derived";else if(Gm(r))o=e=new Cr(e,r),s="derived";else if(Mm(r))o=e=new Or(e,r),s="derived";else if(Bm(r))e=new Pr(e,r);else if(Xm(r))o=e=Gt.makeFromTransform(e,r),s="derived";else if(Dm(r))o=e=new kr(e,r),s="derived";else if(jm(r))o=e=new Tr(e,r),s="derived";else if(Um(r))o=e=new Ar(e,r),s="derived";else if(Wm(r))o=e=new Nr(e,r),s="derived";else{$(yp(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Ir(e){var m;let t=fS(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(Nt(r)||An(r)||ni(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new dy;Nt(r)?(Rl(r)?t=new bi(t,r.sequence):Fo(r)&&(t=new xi(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=de.makeExplicit(t,e,o)??t,t=new Pt(t);const a=e.parent&&qn(e.parent);(G(e)||ke(e))&&a&&(t=Ze.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=dS(t,e,o));const c=qx(e),u=Hx(e);t=de.makeWithAncestors(t,{},{...c,...u},o)??t,G(e)&&(t=$n.parseAll(t,e),t=ii.parseAll(t,e)),(G(e)||ke(e))&&(a||(t=Ze.makeFromEncoding(t,e)??t),t=Ke.makeFromEncoding(t,e)??t,t=Pn.parseAllForSortIndex(t,e));const l=t=Ni(Q.Raw,e,t);if(G(e)){const y=ze.makeFromEncoding(t,e);y&&(t=y,Io(e)&&(t=new Pt(t))),t=Gt.makeFromEncoding(t,e)??t,t=ht.makeFromEncoding(t,e)??t}let f,d;if(G(e)){const{markDef:y,mark:S,config:_}=e,O=M("invalid",y,_),{marks:F,scales:P}=d=Ll({invalid:O,isPath:Ut(S)});F!==P&&P==="include-invalid-values"&&(f=t=Ni(Q.PreFilterInvalid,e,t)),F==="exclude-invalid-values"&&(t=zn.make(t,e,d)??t)}const p=t=Ni(Q.Main,e,t);let g;if(G(e)&&d){const{marks:y,scales:S}=d;y==="include-invalid-values"&&S==="exclude-invalid-values"&&(t=zn.make(t,e,d)??t,g=t=Ni(Q.PostFilterInvalid,e,t))}G(e)&&Yy(e,p);let h=null;if(ke(e)){const y=e.getName("facet");t=lS(t,e.facet)??t,h=new Bn(t,e,y,p.getSource()),n[y]=h}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:l,main:p,facetRoot:h,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:g}}function Ni(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new ye(n,s,e,r);return i[s]=o,o}class pS extends qo{constructor(n,i,r,s){var o,a,c,u;super(n,"concat",i,r,s,n.resolve);x(this,"children");(((a=(o=n.resolve)==null?void 0:o.axis)==null?void 0:a.x)==="shared"||((u=(c=n.resolve)==null?void 0:c.axis)==null?void 0:u.y)==="shared")&&$(gp),this.children=this.getChildren(n).map((l,f)=>Qo(l,this,this.getName(`concat_${f}`),void 0,s))}parseData(){this.component.data=Ir(this);for(const n of this.children)n.parseData()}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of b(n.component.selection))this.component.selection[i]=n.component.selection[i]}re(this.component.selection).some(n=>Qe(n))&&Ws(Us)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){for(const n of this.children)n.parseAxesAndHeaders()}getChildren(n){return yr(n)?n.vconcat:ko(n)?n.hconcat:n.concat}parseLayoutSize(){aS(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}
vendor: 6,328 bytes, line 1
1assembleSignals(){return this.children.forEach(n=>n.assembleSignals()),[]}assembleLayoutSignals(){const n=Lo(this);for(const i of this.children)n.push(...i.assembleLayoutSignals());return n}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleMarks(){return this.children.map(n=>{const i=n.assembleTitle(),r=n.assembleGroupStyle(),s=n.assembleGroupEncodeEntry(!1);return{type:"group",name:n.getName("group"),...i?{title:i}:{},...r?{style:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const n=this.layout.columns;return{...n!=null?{columns:n}:{},bounds:"full",align:"each"}}}function gS(e){return e===!1||e===null}const hS={disable:1,gridScale:1,scale:1,...Zu,labelExpr:1,encode:1},Zf=b(hS);class Vo extends kt{constructor(n={},i={},r=!1){super();x(this,"explicit");x(this,"implicit");x(this,"mainExtracted");this.explicit=n,this.implicit=i,this.mainExtracted=r}clone(){return new Vo(N(this.explicit),N(this.implicit),this.mainExtracted)}hasAxisPart(n){return n==="axis"?!0:n==="grid"||n==="title"?!!this.get(n):!gS(this.get(n))}hasOrientSignalRef(){return C(this.explicit.orient)}}function mS(e,t,n){const{encoding:i,config:r}=e,s=ie(i[t])??ie(i[st(t)]),o=e.axis(t)||{},{format:a,formatType:c}=o;if(Jt(c))return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:c,config:r}),...n};if(a===void 0&&c===void 0&&r.customFormatTypes){if(Cn(s)==="quantitative"){if(Fn(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(Cn(s)==="temporal"&&r.timeFormatType&&w(s)&&!s.timeUnit)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function yS(e){return wt.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[ES(n,e)]),t),{})}const xS={bottom:"top",top:"bottom",left:"right",right:"left"};function bS(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 b(r.component.axes))n.axis[s]=Mo(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=SS(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of wt){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 o of s.component.axes[r]){const{value:a,explicit:c}=o.getWithExplicit("orient");if(!C(a)){if(i[a]>0&&!c){const u=xS[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function SS(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 o=r.getWithExplicit("orient"),a=s.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;e[i]=$S(r,s)}}}else return t.map(n=>n.clone());return e}function $S(e,t){for(const n of Zf){const i=Ot(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return iu(r,s);case"gridScale":return{explicit:r.explicit,value:ne(r.value,s.value)}}return br(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function vS(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(C(n.labelAngle)?n.labelAngle:Ii(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===mf(i,r))return!0}return e===n[t]}const wS=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ES(e,t){var y,S;let n=t.axis(e);const i=new Vo,r=ie(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((S=o.axis)==null?void 0:S.orient)||sx(e),c=t.getScaleComponent(e).get("type"),u=Zy(e,c,a,t.config),l=n!==void 0?!n:hs("disable",o.style,n==null?void 0:n.style,u).configValue;if(i.set("disable",l,n!==void 0),l)return i;n=n||{};const f=nx(r,n,e,o.style,u),d=Mu(n.formatType,r,c),p=Lu(r,r.type,n.format,n.formatType,o,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:c,orient:a,labelAngle:f,format:p,formatType:d,mark:s,config:o};for(const _ of Zf){const O=_ in fc?fc[_](g):Ma(_)?n[_]:void 0,F=O!==void 0,P=vS(O,_,n,t,e);if(F&&P)i.set(_,O,P);else{const{configValue:W=void 0,configFrom:Y=void 0}=Ma(_)&&_!=="values"?hs(_,o.style,n.style,u):{},me=W!==void 0;F&&!me?i.set(_,O,P):(Y!=="vgAxisConfig"||wS.has(_)&&me||mi(W)||C(W))&&i.set(_,W,!1)}}const h=n.encoding??{},m=Qu.reduce((_,O)=>{if(!i.hasAxisPart(O))return _;const F=vf(h[O]??{},t),P=O==="labels"?mS(t,e,F):F;return P!==void 0&&!B(P)&&(_[O]={update:P}),_},{});return B(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function kS({encoding:e,size:t}){for(const n of wt){const i=Se(n);tt(t[i])&&Ft(e[n])&&(delete t[i],$(cu(i)))}return t}const _S={vgMark:"arc",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...pe("x",e,{defaultPos:"mid"}),...pe("y",e,{defaultPos:"mid"}),...yt(e,"radius"),...yt(e,"theta")})},CS={vgMark:"area",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Bi("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Bi("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Po(e)})},FS={vgMark:"rect",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...yt(e,"x"),...yt(e,"y")})},NS={vgMark:"shape",encodeEntry:e=>({...Oe(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&&w(n)&&n.type===jn?{field:E(n,{expr:"datum"})}:{}}
vendor: 4,136 bytes, line 1
1]}},TS={vgMark:"image",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...yt(e,"x"),...yt(e,"y"),...To(e,"url")})},AS={vgMark:"line",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...pe("x",e,{defaultPos:"mid"}),...pe("y",e,{defaultPos:"mid"}),...fe("size",e,{vgChannel:"strokeWidth"}),...Po(e)})},OS={vgMark:"trail",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...pe("x",e,{defaultPos:"mid"}),...pe("y",e,{defaultPos:"mid"}),...fe("size",e),...Po(e)})};function Xo(e,t){const{config:n}=e;return{...Oe(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...pe("x",e,{defaultPos:"mid"}),...pe("y",e,{defaultPos:"mid"}),...fe("size",e),...fe("angle",e),...PS(e,n,t)}}function PS(e,t,n){return n?{shape:{value:n}}:fe("shape",e)}const IS={vgMark:"symbol",encodeEntry:e=>Xo(e)},RS={vgMark:"symbol",encodeEntry:e=>Xo(e,"circle")},zS={vgMark:"symbol",encodeEntry:e=>Xo(e,"square")},LS={vgMark:"rect",encodeEntry:e=>({...Oe(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...yt(e,"x"),...yt(e,"y")})},MS={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Oe(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Bi("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Bi("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...fe("size",e,{vgChannel:"strokeWidth"})}}},DS={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Oe(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...pe("x",e,{defaultPos:"mid"}),...pe("y",e,{defaultPos:"mid"}),...To(e),...fe("size",e,{vgChannel:"fontSize"}),...fe("angle",e),...ac("align",jS(e.markDef,n,t)),...ac("baseline",US(e.markDef,n,t)),...pe("radius",e,{defaultPos:null}),...pe("theta",e,{defaultPos:null})}}};function jS(e,t,n){if(M("align",e,n)===void 0)return"center"}function US(e,t,n){if(M("baseline",e,n)===void 0)return"middle"}const WS={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...Oe(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...yt(e,r),...pe(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:q(M("thickness",n,t))}}},Ti={arc:_S,area:CS,bar:FS,circle:RS,geoshape:NS,image:TS,line:AS,point:IS,rect:LS,rule:MS,square:zS,text:DS,tick:WS,trail:OS};function BS(e){if(z([cr,or,qg],e.mark)){const t=rl(e.mark,e.encoding);if(t.length>0)return HS(e,t)}else if(e.mark===ar){const t=Jr.some(n=>M(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return qS(e)}return Yo(e)}const Cc="faceted_path_";function HS(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Cc+e.requestDataName(Q.Main),data:e.requestDataName(Q.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Yo(e,{fromPrefix:Cc})}]}const Fc="stack_group_";function qS(e){var u;const[t]=Yo(e,{fromPrefix:Fc}),n=e.scaleName(e.stack.fieldChannel),i=(l={})=>e.vgField(e.stack.fieldChannel,l),r=(l,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`${l}(${d.map(p=>`scale('${n}',${p})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Qn(t.encode.update,["y","yc","y2","height",...Jr]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Ne(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}
1):(s={...Qn(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Ne(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of Jr){const f=Je(l,e.markDef,e.config);t.encode.update[l]?(s[l]=t.encode.update[l],delete t.encode.update[l]):f&&(s[l]=q(f)),f&&(t.encode.update[l]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const l of e.stack.groupbyChannels){const f=e.fieldDef(l),d=E(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(E(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,f)=>{if(t.encode.update[f])return{...l,[f]:t.encode.update[f]};{const d=Je(f,e.markDef,e.config);return d!==void 0?{...l,[f]:q(d)}:l}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Q.Main),name:Fc+e.requestDataName(Q.Main),groupby:a,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:o},marks:[t]}]}]}function GS(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!k(o)&&De(o)&&ma(o.value)||!o&&ma(M("order",r,s)))){if((k(o)||w(o))&&!n)return eu(o,{expr:"datum"});if(Ut(i)){const a=r.orient==="horizontal"?"y":"x",c=t[a];if(w(c))return{field:a}}}}function Yo(e,t={fromPrefix:""}){var p;const{mark:n,markDef:i,encoding:r,config:s}=e,o=ne(i.clip,VS(e),XS(e)),a=Zc(i),c=r.key,u=GS(e),l=YS(e);l&&Object.values(e.component.selection).some(g=>g.type==="point"&&!g.bind&&g.on!=="pointerover")&&((p=e.markDef).cursor??(p.cursor="pointer"));const f=M("aria",i,s),d=Ti[n].postEncodingTransform?Ti[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Ti[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...c?{key:c.field}:{},...u?{sort:u}:{},...l||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Q.Main)},encode:{update:Ti[n].encodeEntry(e)},...d?{transform:d}:{}}]}function VS(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 XS(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function YS(e){if(!e.component.selection)return null;const t=b(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=b(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class Jf extends Xf{constructor(n,i,r,s={},o){super(n,"unit",i,r,o,void 0,ja(n)?n.view:void 0);x(this,"markDef");x(this,"encoding");x(this,"specifiedScales",{});x(this,"stack");x(this,"specifiedAxes",{});x(this,"specifiedLegends",{});x(this,"specifiedProjection",{});x(this,"selection",[]);x(this,"children",[]);x(this,"correctDataNames",n=>{var i,r,s;return(i=n.from)!=null&&i.data&&(n.from.data=this.lookupDataSource(n.from.data),"time"in this.encoding&&(n.from.data=n.from.data+Dl)),(s=(r=n.from)==null?void 0:r.facet)!=null&&s.data&&(n.from.facet.data=this.lookupDataSource(n.from.facet.data)),n});const a=et(n.mark)?{...n.mark}:{type:n.mark},c=a.type;a.filled===void 0&&(a.filled=Cm(a,o,{graticule:n.data&&Fo(n.data)}));const u=this.encoding=Ah(n.encoding||{},c,a.filled,o);this.markDef=kl(a,u,o),this.size=kS({encoding:u,size:ja(n)?{...s,...n.width!==void 0?{width:n.width}:{},...n.height!==void 0?{height:n.height}:{}}:s}),this.stack=El(this.markDef,u),this.specifiedScales=this.initScales(c,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=n.projection,this.selection=(n.params??[]).filter(l=>wo(l)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:n}=this,i=this.mark===Tu,r=n&&wd.some(s=>A(n[s]));return i||r}scaleDomain(n){const i=this.specifiedScales[n];return i?i.domain:void 0}axis(n){return this.specifiedAxes[n]}legend(n){return this.specifiedLegends[n]}initScales(n,i){return Ls.reduce((r,s)=>{const o=ie(i[s]);return o&&(r[s]=this.initScale(o.scale??{})),r},{})}initScale(n){const{domain:i,range:r}=n,s=ue(n);return k(i)&&(s.domain=i.map(Ee)),k(r)&&(s.range=r.map(Ee)),s}initAxes(n){return wt.reduce((i,r)=>{const s=n[r];if(A(s)||r===X&&A(n.x2)||r===ae&&A(n.y2)){const o=A(s)?s.axis:void 0;i[r]=o&&this.initAxis({...o})}return i},{})}initAxis(n){const i=b(n),r={};for(const s of i){const o=n[s];r[s]=mi(o)?Qc(o):Ee(o)}return r}initLegends(n){return Id.reduce((i,r)=>{const s=ie(n[r]);if(s&&zd(r)){const o=s.legend;i[r]=o&&ue(o)}return i},{})}alignStackOrderWithColorDomain(){var m;const{color:n,fill:i,order:r,xOffset:s,yOffset:o}=this.encoding,a=i||n,c=w(a)?a:void 0,u=c==null?void 0:c.field,l=c==null?void 0:c.scale,f=c==null?void 0:c.type,d=l==null?void 0:l.domain,p=s||o,g=w(p)?p:void 0,h=`_${u}_sort_index`;if(!r&&Array.isArray(d)&&typeof u=="string"&&f==="nominal")if(g&&!g.sort)g.sort=d;else{if(!this.stack)return;const y=`indexof(${R(d)}, datum['${u}'])`,S=((m=this.markDef)==null?void 0:m.orient)==="horizontal"?"ascending":"descending";this.transforms.push({calculate:y,as:h}),this.encoding.order={field:h,type:"quantitative",sort:S}}}parseData(){this.component.data=Ir(this)}parseLayoutSize(){cS(this)}parseSelections(){this.component.selection=Xy(this,this.selection)}parseMarkGroup(){this.component.mark=BS(this)}parseAxesAndHeaders(){this.component.axes=yS(this)}assembleSelectionTopLevelSignals(n){return $y(this,n)}assembleSignals(){return[...pf(this),...by(this,[])]}assembleSelectionData(n){return vy(this,n)}assembleLayout(){return null}assembleLayoutSignals(){return Lo(this)}assembleMarks(){let n=this.component.mark??[];return(!this.parent||!qn(this.parent))&&(n=Bl(this,n)),n.map(this.correctDataNames)}assembleGroupStyle(){const{style:n}=this.view||{};return n!==void 0?n:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(n){return Ht(this.encoding,n)}fieldDef(n){const i=this.encoding[n];return je(i)}typedFieldDef(n){const i=this.fieldDef(n);return ge(i)?i:null}}class Ko extends qo{constructor(n,i,r,s,o){super(n,"layer",i,r,o,n.resolve,n.view);x(this,"children");const a={...s,...n.width?{width:n.width}:{},...n.height?{height:n.height}:{}};this.children=n.layer.map((c,u)=>{if(xr(c))return new Ko(c,this,this.getName(`layer_${u}`),a,o);if(Et(c))return new Jf(c,this,this.getName(`layer_${u}`),a,o);throw new Error(Ds(c))})}parseData(){this.component.data=Ir(this);for(const n of this.children)n.parseData()}parseLayoutSize(){oS(this)}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of b(n.component.selection))this.component.selection[i]=n.component.selection[i]}re(this.component.selection).some(n=>Qe(n))&&Ws(Us)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){bS(this)}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}assembleSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleSignals()),pf(this))}assembleLayoutSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleLayoutSignals()),Lo(this))}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleGroupStyle(){const n=new Set;for(const r of this.children)for(const s of ee(r.assembleGroupStyle()))n.add(s);const i=Array.from(n);return i.length>1?i:i.length===1?i[0]:void 0}assembleTitle(){let n=super.assembleTitle();if(n)return n;for(const i of this.children)if(n=i.assembleTitle(),n)return n}assembleLayout(){return null}assembleMarks(){return wy(this,this.children.flatMap(n=>n.assembleMarks()))}assembleLegends(){return this.children.reduce((n,i)=>n.concat(i.assembleLegends()),If(this))}}function Qo(e,t,n,i,r){if(fr(e))return new Kn(e,t,n,r);if(xr(e))return new Ko(e,t,n,i,r);if(Et(e))return new Jf(e,t,n,i,r);if(tm(e))return new pS(e,t,n,r);throw new Error(Ds(e))}function M$(e,t={}){t.logger&&sg(t.logger),t.fieldTitle&&Xu(t.fieldTitle);try{const n=wl(Nc(t.config,e.config)),i=iy(e,n),r=Qo(i,null,"",void 0,n);return r.parse(),ob(r.component.data,r),{spec:QS(r,KS(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&og(),t.fieldTitle&&vh()}}function KS(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)):T(t)&&(t={type:t}),r&&s&&uy(t.type)){if(r==="step"&&s==="step")$(Ea()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";$(Ea(er(o)));const a=o==="width"?"height":"width";t.type=ly(a)}}return{...b(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Za(n,!1),...Za(e,!0)}}function QS(e,t,n={},i){const r=e.config?hm(e.config):void 0,s=nS(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),c=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(g=>(g.name==="width"||g.name==="height")&&g.value!==void 0?(t[g.name]=+g.value,!1):!0);const{params:d,...p}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...p,...c?{title:c}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...bl(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const D$=fd.version;export{ei as accessPathDepth,Ic as accessPathWithDatum,j as accessWithDatumToUnescapedPath,M$ as compile,z as contains,Ce as deepEqual,Zr as deleteNestedProperty,N as duplicate,Vt as entries,Ac as every,Pc as fieldIntersection,md as flatAccessWithDatum,ne as getFirstDefined,Oc as hasIntersection,v as hasProperty,I as hash,Sd as internalField,Jn as isBoolean,B as isEmpty,t$ as isEqual,$d as isInternalField,ma as isNullOrFalse,Ns as isNumeric,Qr as isPrimitive,b as keys,O
1i as logicalExpr,pd as mergeDeep,dd as never,iy as normalize,Ii as normalizeAngle,Ne as omit,Qn as pick,ya as prefixGenerator,si as removePathFromField,wn as replaceAll,Le as replacePathInField,n$ as resetIdCounter,hd as setEqual,Zn as some,U as stringify,Xi as titleCase,yd as unescapeSingleQuoteAndPathDot,_e as unique,bd as uniqueId,re as vals,K as varName,D$ as version};
2//# sourceMappingURL=DgYQHPtH.js.map

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.