@graphysdk/viz-engine 1.9.0-beta.1792575115573 → 1.9.0-beta.1792582784445

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1039,6 +1039,7 @@ var vt = (e, t) => {
1039
1039
  if (r.fit !== void 0 && !Zr.includes(r.fit)) return m(Se, e);
1040
1040
  if (r.alpha !== void 0 && (!x(r.alpha) || r.alpha < 0 || r.alpha > 1)) return m("an image alpha in [0, 1]", e);
1041
1041
  if (r.size !== void 0 && (!x(r.size) || r.size <= 0)) return m("an image size in pixels", e);
1042
+ if (r.aspectRatio !== void 0 && (!x(r.aspectRatio) || r.aspectRatio <= 0)) return m("an image aspect ratio above 0", e);
1042
1043
  const a = H(r.fallback, t);
1043
1044
  return a.status !== "accepted" ? a : {
1044
1045
  status: "accepted",
@@ -1047,6 +1048,7 @@ var vt = (e, t) => {
1047
1048
  ...r.fit === void 0 ? {} : { fit: r.fit },
1048
1049
  ...r.alpha === void 0 ? {} : { alpha: r.alpha },
1049
1050
  ...r.size === void 0 ? {} : { size: r.size },
1051
+ ...r.aspectRatio === void 0 ? {} : { aspectRatio: r.aspectRatio },
1050
1052
  fallback: a.value
1051
1053
  }
1052
1054
  };
@@ -0,0 +1 @@
1
+ let I=require("color2k"),v=require("date-fns"),at=require("lodash-es");var qn=1e6;function Ae(e){return String(Math.round(e*qn))}var nr=["diagonal","dots","crosshatch","lines"],ar=["tile","stretch"],ke=e=>typeof e=="object"&&e!==null&&"gradient"in e,De=e=>typeof e=="object"&&e!==null&&"pattern"in e,it=e=>typeof e=="object"&&e!==null&&"image"in e,ir=e=>typeof e!="object"?e:ke(e)?e.stops[0]?.color??"transparent":De(e)?e.color:e.fallback,Jn=e=>typeof e=="string"?e:JSON.stringify(e),_t="#FFFFFF",We="#1A1A1A",Zn=4.5,or=e=>{try{const t=re(e);return(0,I.getContrast)(t,_t)>(0,I.getContrast)(t,We)?_t:We}catch{return We}},Qn=(e,t)=>{try{const r=sr(void 0,t);return r===void 0||(0,I.getContrast)(r,re(e))>=Zn?e:or(r)}catch{return e}},sr=(e,t)=>{try{const r=re(t);if(e===void 0){const[,,,i]=(0,I.parseToRgba)(r);return i>=1?r:void 0}const n=re(e),[,,,a]=(0,I.parseToRgba)(n);return a>=1?n:(0,I.parseToRgba)(r)[3]<1?void 0:(0,I.mix)(r,(0,I.opacify)(n,1),a)}catch{return}},ea=e=>{try{return(0,I.opacify)(re(e),1)}catch{return}},lr=(e,t)=>{if(t>=1)return e;try{const[r,n,a,i]=(0,I.parseToRgba)(re(e));return`rgba(${r}, ${n}, ${a}, ${Math.max(0,i*t)})`}catch{return e}},ta=e=>ke(e)?e.stops.every(t=>ve(t.color)):De(e)?e.background!==void 0&&ve(e.color)&&ve(e.background):it(e)?ve(e.fallback):ve(e),ve=e=>{try{return(0,I.parseToRgba)(re(e))[3]>=1}catch{return!1}},re=e=>{const t=/^(rgb|hsl)a?\((.*)\)$/iu.exec(e.trim());if(t===null||t[1]===void 0||t[2]===void 0)return e;const r=t[2].split(/[\s,/]+/u).filter(u=>u!=="");if(r.length!==3&&r.length!==4)return e;const[n="",a,i,o]=r,s=[n.replace(/deg$/iu,""),a,i];if(o===void 0)return`${t[1]}(${s.join(", ")})`;const l=o.endsWith("%")?Number.parseFloat(o)/100:o;return`${t[1]}a(${[...s,l].join(", ")})`},Le=e=>e instanceof Date&&(0,v.isValid)(e),ra=e=>Le(e)||e===null,na=e=>typeof e=="string",M=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),aa=e=>M(e)||e===null,W=Math.PI*2,ia=8,oa=1e-9,sa=[0,Math.PI/2,Math.PI,W*3/4],ur=(e,t)=>Math.abs(t-e)>=W-oa,ne=e=>(e%W+W)%W,cr=(e,t,r)=>{if(ur(t,r))return!0;const n=ne(r-t);return ne(e-t)<=n},ot=(e,t)=>{const r=Math.abs(ne(e)-ne(t));return Math.min(r,W-r)},la=(e,t)=>{const r=ne(t-e);return r>Math.PI?r-W:r},ua=(e,t,r)=>e*W+t+r,dr=(e,t)=>({x:t*Math.sin(e),y:t*Math.cos(e)}),Z=(e,t)=>{const r=dr(e,t);return{x:.5+r.x/2,y:.5+r.y/2}},fr=(e,t,r,n)=>{const a=[Z(e,r),Z(e,n),Z(t,r),Z(t,n)],i=Math.max(r,n),o=sa.filter(l=>cr(l,e,t)).map(l=>Z(l,i)),s=[...a,...o];return{xMin:Math.min(...s.map(l=>l.x)),xMax:Math.max(...s.map(l=>l.x)),yMin:Math.min(...s.map(l=>l.y)),yMax:Math.max(...s.map(l=>l.y))}},hr=(e,t)=>({angle:ne(Math.atan2(e,t)),radius:Math.hypot(e,t)}),pr=(e,t)=>{const r=e.x-.5,n=e.y-.5;return{x:t>=1?r*2*t:r*2,y:t>=1?n*2:n*2/t}},ca=(e,t)=>{const{x:r,y:n}=pr(e,t);return hr(r,n)},yr="\0graphy\0_",b=e=>`${yr}${e}`,st={x:b("constantX")},da={bar:b("barSeriesLabel"),line:b("lineSeriesLabel")},lt={count:b("count"),mean:b("mean"),sum:b("sum"),summaryEstimate:b("summaryEstimate"),summaryLower:b("summaryLower"),summaryUpper:b("summaryUpper")},we={group:b("group")},y={x:b("x"),y:b("y"),xBand:b("xBand"),yBand:b("yBand"),xMin:b("xMin"),xMax:b("xMax"),yMin:b("yMin"),yMax:b("yMax"),yRaw:b("yRaw")},ut={role:b("stackRole")},oe={color:b("color"),size:b("size"),alpha:b("alpha"),strokeWidth:b("strokeWidth"),lineType:b("lineType")},Te={y:b("ruleY"),x:b("ruleX")},Js={...st,...lt,...we,...y,...ut,...oe,...Te},fa=new Set(Object.values(lt)),gr=e=>b(`scaled_${e}`),ha=e=>e.startsWith(yr),pa=e=>fa.has(e);function H(e){return e[y.x]??null}function U(e){return e[y.y]??null}function ya(e){return e[y.xBand]??e[y.x]??null}function ga(e){return e[y.yBand]??e[y.y]??null}function X(e){return e[y.xMin]??null}function $(e){return e[y.xMax]??null}function Y(e){return e[y.yMin]??null}function G(e){return e[y.yMax]??null}function mr(e){return e[y.yRaw]??null}function ma(e,t){return e[gr(t)]??null}var ba={xMin:0,xMax:1,yMin:0,yMax:1},br=(e,t)=>{const r=X(e)??H(e),n=$(e)??H(e),a=Y(e)??U(e),i=G(e)??U(e);return!M(r)||!M(n)||!M(a)||!M(i)?null:t.type!=="polar"?{xMin:r,xMax:n,yMin:a,yMax:i}:{...fr(r,n,a,i),space:"disk"}},ct=(e,t)=>{const r=(e.xMin+e.xMax)/2,n=(e.yMin+e.yMax)/2;switch(t){case"top":return{x:r,y:e.yMax};case"bottom":return{x:r,y:e.yMin};case"left":return{x:e.xMin,y:n};case"right":return{x:e.xMax,y:n};case"top-left":return{x:e.xMin,y:e.yMax};case"top-right":return{x:e.xMax,y:e.yMax};case"bottom-left":return{x:e.xMin,y:e.yMin};case"bottom-right":return{x:e.xMax,y:e.yMin};default:return{x:r,y:n}}},va=e=>ct(ba,e),Ie=e=>(Array.isArray(e)?e:[e]).map(t=>t instanceof Date?t.toISOString():String(t??"<null>")).join("\0"),Aa=(e,t)=>e===t?!0:Le(e)&&Le(t)?e.getTime()===t.getTime():!1,vr=e=>e===null?"null":e instanceof Date?`date:${e.getTime()}`:`${typeof e}:${e}`,Ta=e=>e.length>0;function j(e){return e!=null}function Ea(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Pa(e,t){const{numeric:r,categorical:n,temporal:a}=e.groupVariableNamesByType(),i=[...a,...n];return i.find(o=>o!==t)??i[0]??r[0]??""}function Oa(e,t){const{categorical:r,temporal:n}=e.groupVariableNamesByType(),a=[...r,...n];return t===""||a.includes(t)?a:[t,...a]}function Sa(e){const t=L(e.x);return t===null||t===st.x?"":t}function L(e){return j(e)?typeof e=="string"?e:"variable"in e?e.variable:null:null}function Pe(e){if(!(!j(e)||typeof e=="string")&&"value"in e)return e.value}function xa(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>Rt(e[r])===Rt(t[r]))}function Rt(e){const t=L(e);if(t!==null)return`variable:${t}`;const r=Pe(e);return r===void 0?"":`value:${vr(r)}`}var Ar=["stack","dodge","identity","fill"],Tr=["solid","dashed","dotted"],C={line:{solid:[],dashed:[4,2],dotted:[0,3]},rule:{solid:[],dashed:[2,3],dotted:[0,2]},gridLine:{solid:[],dashed:[2,3],dotted:[0,3]},panelBorder:{solid:[],dashed:[2,3],dotted:[1,3]},directLabel:{solid:[],dashed:[2,3],dotted:[1,3]},arrow:{solid:[],dashed:[1.5,3],dotted:[0,2]}},Ma=e=>Tr.includes(e);function de(e){return e==="stack"||e==="fill"}var Se="en-GB",dt=class extends Error{constructor(e){super(e.message,e.cause!==void 0?{cause:e.cause}:void 0),this.name=new.target.name,this.code=e.code,this.context=e.context,this.suggestion=e.suggestion}},ae=class extends dt{constructor(e){super(e),this.kind="user-input"}},R=class extends dt{constructor(e){super({...e,code:e.code??"INTERNAL_INVARIANT"}),this.kind="internal"}},ft=e=>e.type==="lookup",Er=e=>e.type==="text",he=e=>e.type==="date"||e.type==="datetime"||e.type==="year"||e.type==="month_year"||e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range"||e.type==="weekly_date_range_with_year"||e.type==="quarter"||e.type==="time",Pr=e=>e.type==="decimal"||e.type==="integer"||e.type==="percentage"||e.type==="duration"||e.type==="currency",_a=e=>e.type==="currency",Ra=e=>e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range",Or=e=>{if(ft(e))return Or(e.fallback);if(he(e))return"temporal";if(Pr(e))return"numeric";if(Er(e))return"categorical";throw new R({message:`No data type found for value format: ${e.type}`})},La=e=>ft(e)?e.fallback:e,Sr=class{constructor(){this.currentYear=new Date().getUTCFullYear(),this.previousDate=null,this.previousYear=null}incrementYearIfNeeded(e){this.previousYear===null?this.previousYear=e.getUTCFullYear():this.previousDate!==null&&(0,v.isBefore)(new Date(this.currentYear,e.getUTCMonth(),e.getUTCDate()),new Date(this.currentYear,this.previousDate.getUTCMonth(),this.previousDate.getUTCDate()))&&this.previousYear++;const t=new Date(e.getTime());return t.setUTCFullYear(this.previousYear),this.previousDate=t,t}},xr={k:1e3,m:1e6,b:1e9,t:1e12},ht=["k","m","b","t"],wa=new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${ht.join("|")})?$`,"i"),Ia=/^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/,ie=e=>e===null||e instanceof Date||Array.isArray(e)||typeof e=="boolean"?!1:typeof e=="string"?wa.test(e)&&!Number.isNaN(Number(e.replace(new RegExp(`[,${ht.join("")}]`,"gi"),""))):Number.isFinite(Number(e)),Mr=e=>ie(e)?!0:typeof e=="string"?Ia.test(e):!1,ka=/^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/,Da=/^\s*(1[89]\d{2}|2[01]\d{2})\s*$/,Ca=[[/\bJan\b/i,"January"],[/\bFeb\b/i,"February"],[/\bMar\b/i,"March"],[/\bApr\b/i,"April"],[/\bJun\b/i,"June"],[/\bJul\b/i,"July"],[/\bAug\b/i,"August"],[/\bSept?\b/i,"September"],[/\bOct\b/i,"October"],[/\bNov\b/i,"November"],[/\bDec\b/i,"December"]],ja={"en-US":"MDY","en-GB":"DMY","pt-PT":"DMY",ar:"DMY"},_r=["/","-","."," "],Lt=[["d","M","yy"],["d","MM","yy"],["d","MMMM","yy"],["dd","M","yy"],["dd","MM","yy"],["dd","MMMM","yy"],["do","MMMM","yy"],["d","M","yyyy"],["d","MM","yyyy"],["d","MMMM","yyyy"],["dd","M","yyyy"],["dd","MM","yyyy"],["dd","MMMM","yyyy"],["do","MMMM","yyyy"]],wt=[["M","d","yy"],["M","dd","yy"],["MM","d","yy"],["MM","dd","yy"],["MMMM","d","yy"],["MMMM","dd","yy"],["MMMM","do","yy"],["M","d","yyyy"],["M","dd","yyyy"],["MM","d","yyyy"],["MM","dd","yyyy"],["MMMM","d","yyyy"],["MMMM","dd","yyyy"],["MMMM","do","yyyy"]],It=[["yyyy","M","d"],["yyyy","M","dd"],["yyyy","MM","d"],["yyyy","MM","dd"],["yyyy","MMMM","d"],["yyyy","MMMM","dd"],["yyyy","MMMM","do"]],Rr=[["d","MMMM"],["dd","MMMM"],["do","MMMM"],["MMMM","d"],["MMMM","dd"],["MMMM","do"]],Na=[{dateFormat:"MMMM d, yyyy",type:"date"},{dateFormat:"MMMM dd, yyyy",type:"date"},{dateFormat:"MMMM do, yyyy",type:"date"},{dateFormat:"yyyy-MM",type:"month_year"}],Lr=1800,wr=2199,Ba=3,Va=6,Fa=5,Wa=1,Ua=28,Ya=/\s*[–—]\s*|\s-\s/,Ga=e=>typeof e=="number"?Number.isInteger(e)&&e>=Lr&&e<=wr:typeof e=="string"?Da.test(e):!1,Ir=(e,t)=>{const r=Oe(e);return!t&&ie(r)?Ha(r):typeof r=="string"?t?(0,v.isValid)((0,v.parse)(r,t,new Date)):!!kr(r)||Ce(r)&&(0,v.isValid)(new Date(r)):(0,v.isValid)(r)},Oe=e=>{if(typeof e!="string")return e;let t=e;for(const[r,n]of Ca)t=t.replace(r,n);return t},kr=(e,t=Se)=>{const r=Oe(e);return Ce(r)?{type:"datetime"}:Cr(t).find(n=>!he(n)||n.type==="month"&&r.length<Ba?!1:n.dateFormat&&(0,v.isValid)((0,v.parse)(r,n.dateFormat,new Date)))},Ce=e=>ka.test(e.trim()),Dr=e=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;if(typeof e!="string"||!Ce(e))return null;const t=new Date(e.trim());return(0,v.isValid)(t)?t:null},Ka=(e,t=Se)=>{const[r,n]=e.split(Ya);if(!r||!n)return;const a=Oe(r).trim(),i=Oe(n).trim();return za(t).find(o=>{if(!he(o)||!o.dateFormat)return!1;const s=(0,v.parse)(a,o.dateFormat,new Date),l=(0,v.parse)(i,o.dateFormat,new Date);if(!(0,v.isValid)(s)||!(0,v.isValid)(l))return!1;const u=new Sr,c=u.incrementYearIfNeeded(s),h=u.incrementYearIfNeeded(l),d=(0,v.differenceInDays)(h,c);return(0,v.isWithinInterval)(new Date(c.getFullYear(),Wa,Ua),{start:c,end:h})&&d===Fa?!0:d===Va})},Cr=e=>{const t={date:jr(e),year:[["yyyy"]],day_month:Rr,month_year:[["MMMM","yyyy"],["yyyy","MMMM"]],month:[["MMMM"]],quarter:[["QQQ","yyyy"],["yyyy","QQQ"]]};return[...Na,...Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>_r.map(i=>({dateFormat:a.join(i),type:r}))))]},jr=e=>ja[e]==="MDY"?[...wt,...Lt,...It]:[...Lt,...wt,...It],za=e=>{const t={weekly_date_range:Rr,weekly_date_range_with_year:jr(e)};return Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>_r.map(i=>({dateFormat:a.join(i),type:r}))))},Ha=e=>{const t=Number(e);if(!(0,at.isInteger)(t))return!1;const r=new Date(t),n=new Date(t*1e3),a=i=>(0,v.isValid)(i)&&i.getFullYear()>=Lr&&i.getFullYear()<=wr;return a(r)||a(n)},Nr={$:"usd","£":"gbp","€":"eur","¥":"jpy","₹":"inr","₱":"php",P:"php","₩":"krw","₪":"ils","₫":"vnd","₽":"rub","฿":"thb",R$:"brl",Rp:"idr",RM:"myr","₦":"ngn",zł:"pln","₺":"try",kr:"dkk",Fr:"chf",R:"zar","د.إ":"aed","﷼":"sar",Ch$:"clp",NT$:"twd",HK$:"hkd",S$:"sgd",A$:"aud",C$:"cad",NZ$:"nzd",MX$:"mxn"},Br=e=>{if(typeof e=="string"){const t=Vr(e);return t.length?ie(t):!1}return ie(e)},Xa=e=>{const t=Fr(e),r=t?Nr[t]:void 0;if(!r)throw new R({message:"Could not get currency ISO"});return r},Vr=e=>{const t=Fr(e);let r=e;if(t){const n=e.indexOf(t);n===0?r=e.slice(t.length):n===e.length-t.length?r=e.slice(0,e.length-t.length):e[0]==="-"&&n===1&&(r=`-${e.slice(t.length+1)}`)}return ie(r)?r.split(",").join(""):""},Fr=e=>Object.keys(Nr).sort((t,r)=>r.length-t.length).find(t=>e.includes(t)),Wr=e=>{const t=Object.entries(e);return!t.length||!t.some(([,r])=>!fe(r))},fe=e=>typeof e=="string"&&e.trim()===""||e===void 0||e===null||e==="-",$a=/\s*[–—]\s*|\s-\s/,Ur=(e,t,r)=>{if(fe(e))return null;switch(t.type){case"decimal":case"integer":case"duration":return Gr(e);case"percentage":return qa(e);case"currency":return Ja(e);case"datetime":case"date":case"year":case"month_year":case"month":case"day_month":case"quarter":case"time":return Yr(e,t.dateFormat,r);case"weekly_date_range":case"weekly_date_range_with_year":return Za(e,t.dateFormat,r);case"text":return Qa(e);case"lookup":throw new R({message:"Cannot parse: lookup value formats are produced by transforms, not raw input"});default:throw new R({message:`Unhandled value format: ${t.type}`})}},Yr=(e,t,r)=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;const n=Oe(String(e).trim());if(n.length===0)return null;const a=new Date;if(t){const o=(0,v.parse)(n,t,a);return(0,v.isValid)(o)?Ue(o):null}for(const o of Cr(r)){if(!he(o)||!o.dateFormat)continue;const s=(0,v.parse)(n,o.dateFormat,a);if((0,v.isValid)(s))return Ue(s)}const i=new Date(n);return Ir(i)?Ce(n)?i:Ue(i):null},Gr=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;let t=e.trim();if(!ie(t))return null;let r=1;for(const n of ht)if(new RegExp(`${n}$`,"i").test(t)){r=xr[n],t=t.slice(0,-1);break}return Number(t.split(",").join(""))*r},qa=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();if(!Mr(t))return null;const r=Number(t.replace(/%/g,"").replace(/,/g,""))/100;return Number.isNaN(r)?null:r},Ja=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();return Br(t)?Gr(Vr(t)):null},Za=(e,t,r)=>{const n=String(e).trim().split($a),[a,i]=[n[0]?.trim(),n[1]?.trim()];return!a||!i?null:Yr(a,t,r)},Qa=e=>String(e).trim(),Ue=e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),pt=(e,t,r)=>{if(t.type==="text"&&typeof e=="string")return e;const n=Ur(e,t,r);return n!==null||!he(t)?n:Dr(e)},ee=process.env.NODE_ENV!=="production",yt=["none","xs","sm","md","lg","xl","full"],ei={point:ti,line:ri,area:ni,bar:ai,rule:ii,tile:oi},Kr=e=>typeof e=="string"&&yt.includes(e);function se(e,t){return{type:"layer",id:t.id,geom:e,mapping:t.aes,stat:t.stat,params:t.params,position:t.position,yScaleType:t.yScaleType,transforms:t.transforms,interactive:t.interactive,attachTo:t.attachTo,tooltip:t.tooltip,dataLabels:t.dataLabels}}function ti(e={}){return se("point",e)}function ri(e={}){return se("line",e)}function ni(e={}){return se("area",e)}function ai(e={}){return se("bar",e)}function ii(e={}){return se("rule",e)}function oi(e={}){return se("tile",e)}var si=["topLeft","topRight","bottomRight","bottomLeft"],li=["dimmed","hovered"],zr=["normal","italic","oblique"],Hr=["none","uppercase","lowercase","capitalize"],Xr=["none","underline","line-through"],$r=["butt","round","square"],qr=["miter","round","bevel"],Jr=["normal","multiply","screen","overlay","darken","lighten"],Zr=["circle","square","diamond","triangle","cross","star","wye"],ui=["fill","overpaint","stroke","alpha","saturation","blur","brightness","contrast","cornerRadius","strokeWidth","maxWidth","dashArray","lineCap","lineJoin","strokeAlpha","fillAlpha","haloColor","haloAlpha","size","symbol","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","textDecoration","textOutlineColor","textOutlineWidth","textShadow","lineHeight","textScale","textColor","offset","gap","length","paddingInline","paddingBlock","padding","margin","shadow","blendMode"],kt=1,Dt=1e3,Ct="'none' or a shadow object { offsetX, offsetY, blur, color }",jt="a non-negative number of pixels, or an object of those per edge",ci="a non-empty color string, a { light, dark } pair, or a token(...) reference",di=["top","right","bottom","left"],_e="a color, a { gradient, stops } object, a { pattern, color } object, or an { image, fallback } object",Nt="a number of pixels, or { topLeft, topRight, bottomRight, bottomLeft } in pixels",xe=e=>typeof e=="object"&&e!==null&&typeof e.light=="string"&&typeof e.dark=="string",gt=e=>typeof e=="object"&&e!==null&&typeof e.token=="string",Qr=e=>typeof e=="string"?e.trim().length>0:xe(e)&&e.light.trim().length>0&&e.dark.trim().length>0;function f(e){return{token:e}}var $e=(e,t)=>{if(typeof e!="object"||e===null)return e;if(xe(e))return e[t];if(Array.isArray(e)){if(e.every(a=>typeof a=="number"))return e;const n=e.map(a=>$e(a,t));return n.every((a,i)=>a===e[i])?e:n}const r=Object.entries(e).map(([n,a])=>[n,$e(a,t)]);return r.every(([n,a])=>a===e[n])?e:Object.fromEntries(r)},E=e=>typeof e=="number"&&Number.isFinite(e),m=(e,t)=>({status:"rejected",expected:e,actual:t}),J=e=>{const t=`one of ${e.map(r=>`'${String(r)}'`).join(", ")}`;return r=>e.includes(r)?{status:"accepted",value:r}:m(t,r)},Q=(e,t)=>{if(typeof e=="string")return e.trim().length>0?{status:"accepted",value:e}:m("a non-empty color string",e);if(gt(e)){const r=t[e.token];return r===void 0?{status:"unknownToken",token:e.token}:Qr(r)?{status:"accepted",value:typeof r=="string"?r:{light:r.light,dark:r.dark}}:{status:"dropped"}}return xe(e)&&e.light.trim().length>0&&e.dark.trim().length>0?{status:"accepted",value:{light:e.light,dark:e.dark}}:m(ci,e)},en=(e,t)=>{if(typeof e!="object"||e===null||xe(e)||gt(e))return Q(e,t);const r=e;if(ke(r)){const n=r.gradient;if(n!=="linear"&&n!=="radial")return m(_e,e);if(!Array.isArray(r.stops)||r.stops.length<2)return m("a gradient with at least two stops",e);const a=[];for(const i of r.stops){if(!E(i.offset)||i.offset<0||i.offset>1)return m("a gradient stop offset in [0, 1]",e);const o=Q(i.color,t);if(o.status!=="accepted")return o;a.push({offset:i.offset,color:o.value})}return r.gradient==="radial"?{status:"accepted",value:{gradient:"radial",stops:a}}:r.angle!==void 0&&!E(r.angle)?m("a gradient angle in degrees",e):{status:"accepted",value:{gradient:"linear",...r.angle===void 0?{}:{angle:r.angle},stops:a}}}if(De(r)){if(!nr.includes(r.pattern))return m(_e,e);const n=Q(r.color,t);if(n.status!=="accepted")return n;const a={pattern:r.pattern,color:n.value};if(r.background!==void 0){const i=Q(r.background,t);if(i.status!=="accepted")return i;a.background=i.value}if(r.size!==void 0){if(!E(r.size)||r.size<=0)return m("a pattern size in pixels",e);a.size=r.size}return{status:"accepted",value:a}}if(it(r)){if(typeof r.image!="string"||!r.image.startsWith("data:image/"))return m("an image as a data:image URI",e);if(r.fit!==void 0&&!ar.includes(r.fit))return m(_e,e);if(r.alpha!==void 0&&(!E(r.alpha)||r.alpha<0||r.alpha>1))return m("an image alpha in [0, 1]",e);if(r.size!==void 0&&(!E(r.size)||r.size<=0))return m("an image size in pixels",e);if(r.aspectRatio!==void 0&&(!E(r.aspectRatio)||r.aspectRatio<=0))return m("an image aspect ratio above 0",e);const n=Q(r.fallback,t);return n.status!=="accepted"?n:{status:"accepted",value:{image:r.image,...r.fit===void 0?{}:{fit:r.fit},...r.alpha===void 0?{}:{alpha:r.alpha},...r.size===void 0?{}:{size:r.size},...r.aspectRatio===void 0?{}:{aspectRatio:r.aspectRatio},fallback:n.value}}}return m(_e,e)},fi=(e,t)=>{if(e==="none")return{status:"accepted",value:[]};const r=[];for(const n of Array.isArray(e)?e:[e]){const a=en(n,t);if(a.status!=="accepted")return a;r.push(a.value)}return{status:"accepted",value:r}},Bt=e=>{if(E(e)&&e>=0)return{status:"accepted",value:{top:e,right:e,bottom:e,left:e}};if(typeof e!="object"||e===null)return m(jt,e);const t=e,r={};for(const n of di){const a=t[n];if(a!==void 0){if(!E(a)||a<0)return m(jt,e);r[n]=a}}return{status:"accepted",value:r}},hi=e=>{if(E(e)&&e>=0)return{status:"accepted",value:e};if(typeof e!="object"||e===null)return m(Nt,e);const t=e,r={};for(const n of si){const a=t[n];if(!E(a)||a<0)return m(Nt,e);r[n]=a}return{status:"accepted",value:r}},pi={color:Q,paint:en,overpaint:fi,unitInterval:e=>E(e)&&e>=0&&e<=1?{status:"accepted",value:e}:m("a number in [0, 1]",e),pixels:e=>E(e)&&e>=0?{status:"accepted",value:e}:m("a non-negative number of pixels",e),geomRadius:e=>Kr(e)||E(e)&&e>=0?{status:"accepted",value:e}:m(`a number of pixels or one of ${yt.map(t=>`'${t}'`).join(", ")}`,e),dashArray:e=>Array.isArray(e)&&e.every(t=>E(t)&&t>=0)?{status:"accepted",value:[...e]}:m("an array of non-negative dash and gap lengths, in stroke widths",e),fontFamily:e=>typeof e=="string"&&e.trim().length>0?{status:"accepted",value:e}:m("a non-empty CSS font-family list",e),fontWeight:e=>E(e)&&e>=kt&&e<=Dt?{status:"accepted",value:e}:m(`a number in [${kt}, ${Dt}]`,e),multiplier:e=>E(e)&&e>=0?{status:"accepted",value:e}:m("a non-negative multiple, 1 being unchanged",e),shadow:(e,t)=>{if(e==="none")return{status:"accepted",value:e};if(typeof e!="object"||e===null)return m(Ct,e);const r=e;if(!E(r.offsetX)||!E(r.offsetY)||!E(r.blur)||r.blur<0)return m(Ct,e);const n=Q(r.color,t);return n.status!=="accepted"?n:{status:"accepted",value:{offsetX:r.offsetX,offsetY:r.offsetY,blur:r.blur,color:n.value}}},padding:Bt,margin:Bt,blendMode:J(Jr),signedPixels:e=>E(e)?{status:"accepted",value:e}:m("a number of pixels, negative allowed",e),fontStyle:J(zr),textTransform:J(Hr),textDecoration:J(Xr),lineCap:J($r),lineJoin:J(qr),pointSymbol:J(Zr),boxRadius:hi};var je=!0,yi=e=>{je=e},gi=()=>je,mi=()=>{let e=null;const t={hits:0,misses:0};return Object.assign((n,a)=>{if(!je)return ee&&(t.misses+=1),a();if(e&&rn(e.args,n))return ee&&(t.hits+=1),e.out;ee&&(t.misses+=1);const i=a();return e={args:n,out:i},i},{stats:t,reset:()=>{e=null}})},tn=()=>{const e=new WeakMap,t={hits:0,misses:0};return Object.assign((n,a,i)=>{if(!je)return ee&&(t.misses+=1),i();const o=e.get(n);if(o)for(let l=0;l<o.length;l+=1){const u=o[l];if(u&&rn(u.args,a))return ee&&(t.hits+=1),l>0&&(o.splice(l,1),o.unshift(u)),u.out}ee&&(t.misses+=1);const s=i();return o?(o.unshift({args:a,out:s}),o.length>16&&(o.length=16)):e.set(n,[{args:a,out:s}]),s},{stats:t})},bi=(...e)=>e.reduce((t,r)=>({hits:t.hits+r.hits,misses:t.misses+r.misses}),{hits:0,misses:0}),rn=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0},nn=class{constructor(){this.memo=tn(),this.singletonKey={}}get stats(){return this.memo.stats}compile(e){return this.memo(this.key(e),this.dependencies(e),()=>this.run(e))}key(e){return this.singletonKey}},Ne=(e,t)=>e>=0&&e<=1&&t>=0&&t<=1,vi=new Set(["min","max","scalar"]),Ai={x:{min:y.xMin,max:y.xMax},y:{min:y.yMin,max:y.yMax}};function Ti(e){const t=new Set;for(const r of e)r.role==="point"?t.add(r.axis):(r.role==="min"||r.role==="max")&&j(r.aes)&&t.add(r.aes);return[...t]}function Ei(e){const t=new Set;for(const r of e)r.role==="point"&&t.add(r.axis),j(r.aes)&&t.add(r.aes);return[...t]}function Pi(e,t,r){let n=e;for(const a of t){if(a.role!=="min"&&a.role!=="max"||!j(a.aes))continue;const i=Ai[a.axis][a.role];if(n.hasVariable(i))continue;const o=L(r[a.aes]);!j(o)||!n.hasVariable(o)||(n=n.addVariable(i,"numeric",n.getValues(o,{type:"numeric"})))}return n}var mt=(e,t)=>{const r=L(t.x);return!r||!["numeric","temporal"].includes(e.getType(r))?e:e.orderBy(r,"asc")},bt=(e,{coordSystem:t})=>{const r=H(e),n=U(e);return!M(r)||!M(n)?null:t.type==="polar"?Z(r,n):{x:r,y:n}},Oi=({positionRoles:e,categorySpanAxes:t,aesthetics:r})=>[...Ti(e),...t,...r.filter(n=>n.required).map(n=>n.name)],Si=({categorySpanAxes:e=[]})=>e.includes("x"),xi=["x","y"],an=new Set(["x","y","ySecondary"]),vt=new Set(["color","size","alpha","strokeWidth","lineType"]),on=e=>an.has(e),sn=e=>vt.has(e),Mi=e=>on(e)||sn(e);function At(e){return e==="secondary"?"ySecondary":"y"}function _i(e,t){return e==="y"?At(t):"x"}function Ri(e){return e==="ySecondary"?"y":e}var ln=(e,t)=>{if(j(t.group)){const a=L(t.group);if(a!==null)return[a]}const r=new Set([L(t.x),L(t.y)].filter(j)),n=new Set;for(const a of vt){const i=L(t[a]);j(i)&&(r.has(i)||e.hasVariable(i)&&e.getType(i)==="categorical"&&n.add(i))}return[...n]},Tt=(e,t)=>e.hasVariable(we.group)?e.getValues(we.group,{distinct:!0,skipNulls:!0}).length>1:ln(e,t).some(r=>e.getValues(r,{distinct:!0,skipNulls:!0}).length>1),Li=new Set(["count","sum","mean","median"]);function un(e,t){return Li.has(e)?"numeric":t}function cn(e,t,r,n){if(n!==void 0&&n.type!=="numeric"&&(e==="sum"||e==="mean"||e==="median"))throw new ae({code:"INCOMPATIBLE_TYPE",message:`'${e}' requires a numeric variable (got '${n.type}' for '${n.variableName}')`,context:{variableName:n.variableName,variableType:n.type}});const a=r?.length??t.length;if(e==="count")return a;if(e==="median"||e==="mode"){const s=[];for(let l=0;l<a;l++){const u=Ye(t,r,l);Ge(u)&&s.push(u)}return s.length===0?null:e==="median"?ki(s):Di(s)}if(e==="sum"||e==="mean"){let s=0,l=0;for(let u=0;u<a;u++){const c=Ye(t,r,u);Ge(c)&&(s++,l+=Number(c))}return s===0?null:e==="sum"?l:l/s}const i=e==="min"?-1:1;let o=null;for(let s=0;s<a;s++){const l=Ye(t,r,s);Ge(l)&&(o===null||wi(l,o)===i)&&(o=l)}return o}var Ye=(e,t,r)=>e[t?.[r]??r]??null,Ge=e=>e!==null&&!(typeof e=="number"&&Number.isNaN(e)),wi=(e,t)=>e===null||t===null?0:e<t?-1:e>t?1:0,Ii=e=>e instanceof Date?e.getTime():e??null;function ki(e){const t=e.map(Number).sort((i,o)=>i-o);if(t.length===1)return t[0]??0;const r=(t.length-1)/2,n=Math.floor(r),a=t[n]??0;return a+((t[n+1]??a)-a)*(r-n)}function Di(e){const t=new Map;for(const a of e){const i=Ii(a),o=t.get(i);o===void 0?t.set(i,{value:a,count:1}):o.count++}let r=null,n=0;for(const{value:a,count:i}of t.values())i>n&&(n=i,r=a);return r}var Ci=e=>e==null||typeof e=="number"&&Number.isNaN(e),ji=e=>e instanceof Date?e.getTime():e??null,qe=class z{constructor(t,r,n,a=null){this.rowShape=null,this.names=t,this.columns=r,this.rowCount=n,this.source=a}get columnCount(){return this.names.length}static from(t){const r=Object.entries(t);return new z(r.map(([n])=>n),new Map(r),r[0]?.[1].length??0)}columnNames(){return[...this.names]}hasColumn(t){return this.names.includes(t)}values(t){const r=this.columns.get(t);if(r!==void 0)return r;if(this.source===null||!this.names.includes(t))return;const n=this.source.table.values(t);if(n===void 0)return;const{indices:a}=this.source,i=new Array(a.length);for(let o=0;o<a.length;o++)i[o]=n[a[o]??0]??null;return this.columns.set(t,i),this.columns.size===this.names.length&&(this.source=null),i}assign(t,r){const n=this.gathered(),a=new Map(n.columns);a.set(t,r);const i=n.names.includes(t)?[...n.names]:[...n.names,t];return new z(i,a,n.names.length===0?r.length:n.rowCount)}select(t){const r=t.filter(a=>this.names.includes(a)),n=new Map;for(const a of r){const i=this.columns.get(a);i!==void 0&&n.set(a,i)}return new z(r,n,this.rowCount,this.source)}rename(t,r){const n=this.gathered(),a=new Map;for(const i of n.names){const o=n.columns.get(i);o!==void 0&&a.set(i===t?r:i,o)}return new z(n.names.map(i=>i===t?r:i),a,n.rowCount)}take(t){const r=this.source===null?{table:this,indices:t}:{table:this.source.table,indices:t.map(n=>this.source?.indices[n]??0)};return new z(this.names,new Map,t.length,r)}sortedIndices(t,r){const n=this.values(t);if(n===void 0)return Array.from({length:this.rowCount},(s,l)=>l);const a=[],i=[];for(let s=0;s<this.rowCount;s++)(Ci(n[s])?a:i).push(s);const o=r==="asc"?1:-1;return i.sort((s,l)=>{const u=n[s],c=n[l];return u<c?-o:u>c?o:0}),a.length===0?i:r==="asc"?[...a,...i]:[...i,...a]}partition(t){const r=t.map(i=>this.values(i)).filter(i=>i!==void 0),n=r.length===1?r[0]:void 0,a=new Map;if(n!==void 0){for(let i=0;i<this.rowCount;i++){const o=ji(n[i]),s=a.get(o);s===void 0?a.set(o,{key:Ie(n[i]??null),indices:[i]}):s.indices.push(i)}return[...a.values()]}for(let i=0;i<this.rowCount;i++){const o=Ie(r.map(l=>l[i])),s=a.get(o);s===void 0?a.set(o,{key:o,indices:[i]}):s.indices.push(i)}return[...a.values()]}fold(t,r,n){const a=this.names.filter(d=>!t.includes(d)),i=this.rowCount*t.length,o=a.map(d=>({name:d,source:this.values(d)??[],repeated:new Array(i)})),s=t.map(d=>this.values(d)??[]),l=new Array(i),u=new Array(i);let c=0;for(let d=0;d<this.rowCount;d++)for(let p=0;p<t.length;p++,c++){for(const g of o)g.repeated[c]=g.source[d]??null;l[c]=t[p]??"",u[c]=s[p]?.[d]??null}const h=new Map;for(const{name:d,repeated:p}of o)h.set(d,p);return h.set(r,l),h.set(n,u),new z([...a,r,n],h,i)}objectAt(t){const{names:r,arrays:n,template:a}=this.rowShape??this.resolveRowShape(),i={...a};for(let o=0;o<r.length;o++)i[r[o]??""]=n[o]?.[t]??null;return i}*[Symbol.iterator](){for(let t=0;t<this.rowCount;t++)yield this.objectAt(t)}resolveRowShape(){const t={};for(const r of this.names)t[r]=null;return this.rowShape={names:this.names,arrays:this.names.map(r=>this.values(r)??[]),template:t},this.rowShape}gathered(){if(this.source===null)return this;for(const t of this.names)this.values(t);return new z(this.names,new Map(this.columns),this.rowCount)}};var dn="value",Ee={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},Vt={eq:(e,t)=>e===t,neq:(e,t)=>e!==t,gt:(e,t)=>e!==null&&t!==null&&e>t,gte:(e,t)=>e!==null&&t!==null&&e>=t,lt:(e,t)=>e!==null&&t!==null&&e<t,lte:(e,t)=>e!==null&&t!==null&&e<=t},Ft=e=>e===null?null:e instanceof Date?e.getTime():new Date(e).getTime(),fn=(e,t)=>e==="count"?{type:"integer"}:t,hn=(e,t,r)=>{const n=e.values(t);if(n!==void 0)return n;if(r==="count")return new Array(e.rowCount);throw new R({message:`Variable '${t}' not defined`})},te=class _{constructor(t={}){const{table:r,variableMetadata:n}=this.parseVariableMap(t);this.table=r,this.variableMetadata=n}static fromTrusted(t,r){const n=Object.create(_.prototype);return n.table=t,n.variableMetadata=r,n}size(){return this.table.rowCount}getVariableNames(){return this.table.columnNames()}hasVariable(t){return this.table.hasColumn(t)}addVariable(t,r,n,a){if(this.table.columnCount>0&&n.length!==this.size())throw new R({message:`Variable '${t}' has ${n.length} values, expected ${this.size()}`});const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a)}},o=this.normalizeRawValues(r,n),s=this.table.assign(t,o);return _.fromTrusted(s,i)}addConstantVariable(t,r,n,a){const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a),constant:{value:n}}},[o=null]=this.normalizeRawValues(r,[n]),s=this.table.assign(t,new Array(this.size()).fill(o));return _.fromTrusted(s,i)}getConstant(t){return this.variableMetadata[t]?.constant}deriveVariable(t,r,n,a){const i=Array.from({length:this.size()},(o,s)=>n(this.table.objectAt(s)));return this.addVariable(t,r,i,a)}deriveVariableFrom(t,r,n,a,i){const o=this.hasVariable(t)?this.getValues(t).map(a):Array.from({length:this.size()},()=>a(null));return this.addVariable(r,n,o,i)}renameVariable(t,r){const n=this.variableMetadata[t];if(!n)throw new R({message:`Variable ${t} not defined`});const a=this.table.rename(t,r),{[t]:i,...o}=this.variableMetadata,s={...o,[r]:n};return _.fromTrusted(a,s)}selectVariables(...t){const r=this.table.select(t),n=Object.fromEntries(Object.entries(this.variableMetadata).filter(([a])=>t.includes(a)));return _.fromTrusted(r,n)}getType(t){const r=this.variableMetadata[t];if(!r)throw new R({message:`Variable ${t} not defined`});return r.type}getValueFormat(t){const r=this.variableMetadata[t];if(!r)throw new R({message:`Variable ${t} not defined`});return r.valueFormat}groupVariableNamesByType(){const t={numeric:[],categorical:[],temporal:[]};for(const[r,{type:n}]of Object.entries(this.variableMetadata))t[n].push(r);return t}getValues(t,r){if(!this.hasVariable(t))throw new R({message:`Variable '${t}' not defined`});const n=this.getType(t);if(r?.type!==void 0&&n!==r.type){if(this.size()===0)return[];throw new R({message:`Variable '${t}' has type '${n}', expected '${r.type}'`})}let a=this.table.values(t)??[];return r?.distinct&&(a=this.getDistinctValues(n,a)),r?.skipNulls&&(a=this.skipNulls(a)),a}filter(t,r,n){if(this.hasVariable(t)&&this.getType(t)==="temporal")return this.filterByTimestamp(t,r,n);const a=Vt[r],i=this.table.values(t)??[],o=[];for(let s=0;s<i.length;s++)a(i[s]??null,n)&&o.push(s);return _.fromTrusted(this.table.take(o),this.variableMetadata)}filterByMask(t){if(t.length!==this.size())throw new R({message:`Row mask length ${t.length} does not match dataset size ${this.size()}`});const r=[];for(let n=0;n<t.length;n++)t[n]===1&&r.push(n);return _.fromTrusted(this.table.take(r),this.variableMetadata)}take(t){return _.fromTrusted(this.table.take(t),this.variableMetadata)}orderBy(t,r="asc"){const n=this.table.take(this.table.sortedIndices(t,r));return _.fromTrusted(n,this.variableMetadata)}getAt(t){return t<0||t>=this.size()?null:this.table.objectAt(t)}getFirst(){return this.getAt(0)}getLast(){return this.getAt(this.size()-1)}findFirst(t){const r=this.size();for(let n=0;n<r;n++){const a=this.table.objectAt(n);if(t(a))return a}return null}findLast(t){for(let r=this.size()-1;r>=0;r--){const n=this.table.objectAt(r);if(t(n))return n}return null}groupBy(...t){return new Ni(t,this.table,this.variableMetadata)}rollup(t){const r=qe.from(Object.fromEntries(Object.entries(t).map(([a,{variableName:i,aggregation:o}])=>[a,[cn(o,hn(this.table,i,o),void 0,{type:this.variableMetadata[i]?.type??"numeric",variableName:i})]]))),n={};for(const[a,{variableName:i,aggregation:o}]of Object.entries(t)){const s=this.variableMetadata[i],l=s?.type??"numeric",u=s?.valueFormat??Ee[l];n[a]={type:un(o,l),valueFormat:fn(o,u)}}return _.fromTrusted(r,n)}reshapeFromWideToLong({keep:t,reshape:r,keyName:n="key",valueName:a=dn}={}){const{numeric:i,categorical:o,temporal:s}=this.groupVariableNamesByType(),l=t??[...o,...s],u=r??i.filter(d=>!l.includes(d));if(l.includes(n)||l.includes(a))throw new ae({code:"INVALID_DATA_SHAPE",message:`The variables to keep includes the variables '${n}' or '${a}' to create the key and value variables`});if(u.length===0){const d={};for(const p of l){const g=this.variableMetadata[p];g&&(d[p]={type:g.type,values:[],valueFormat:g.valueFormat})}return d[n]={type:"categorical",values:[],valueFormat:{type:"text"}},d[a]={type:"numeric",values:[],valueFormat:{type:"decimal"}},new _(d)}if(u.filter(d=>this.variableMetadata[d]?.type!=="numeric").length>0)throw new ae({code:"INVALID_DATA_SHAPE",message:"Only numeric variables can be reshaped"});const c=this.table.select([...l,...u]).fold(u,n,a),h={};for(const d of l){const p=this.variableMetadata[d];p&&(h[d]=p)}return h[n]={type:"categorical",valueFormat:{type:"text"}},h[a]={type:"numeric",valueFormat:Bi(this.variableMetadata,u,n)},_.fromTrusted(c,h)}print(){console.table(this.variableMetadata),console.table([...this.table])}[Symbol.iterator](){return this.table[Symbol.iterator]()}filterByTimestamp(t,r,n){const a=Vt[r],i=pt(n,this.getValueFormat(t),Se),o=Ft(i??n),s=this.getValues(t,{type:"temporal"}),l=[];for(let u=0;u<s.length;u++)a(Ft(s[u]??null),o)&&l.push(u);return _.fromTrusted(this.table.take(l),this.variableMetadata)}resolveAddedVariableFormat(t,r,n){if(n!==void 0)return n;const a=this.variableMetadata[t];return a?a.valueFormat:Ee[r]}parseVariableMap(t){const r={},n={};for(const[a,{type:i,values:o,valueFormat:s}]of Object.entries(t))r[a]=o,n[a]={type:i,valueFormat:s??Ee[i]};return{table:qe.from(r),variableMetadata:n}}normalizeRawValues(t,r){switch(t){case"numeric":return r.map(n=>typeof n!="number"||!Number.isFinite(n)?null:n);case"categorical":return r.map(n=>typeof n!="string"?null:n);case"temporal":return r.map(n=>!(n instanceof Date)||!(0,v.isValid)(n)?null:n);default:throw new R({message:`Cannot normalize raw value of unknown type: ${t}`})}}skipNulls(t){return t.filter(r=>r!==null)}getDistinctValues(t,r){const n=t==="temporal",a=new Set,i=[];for(const o of r){const s=n&&o instanceof Date?o.getTime():o;a.has(s)||(a.add(s),i.push(o))}return i}},Ni=class{constructor(e,t,r){this.groupedBy=e,this.table=t,this.variableMetadata=r}forEach(e){this.readPartitions().forEach(({key:t,indices:r},n)=>{e(te.fromTrusted(this.table.take(r),this.variableMetadata),t,n)})}rollup(e){const t=this.readPartitions(),r={};for(const a of this.groupedBy){const i=this.table.values(a)??[];r[a]=t.map(({indices:o})=>i[o[0]??0]??null)}const n=Object.fromEntries(this.groupedBy.map(a=>{const i=this.variableMetadata[a],o=i?.type??"categorical";return[a,{type:o,valueFormat:i?.valueFormat??Ee[o]}]}));for(const[a,{variableName:i,aggregation:o}]of Object.entries(e)){const s=hn(this.table,i,o),l=this.variableMetadata[i],u=l?.type??"numeric";r[a]=t.map(({indices:h})=>cn(o,s,h,{type:u,variableName:i}));const c=l?.valueFormat??Ee[u];n[a]={type:un(o,u),valueFormat:fn(o,c)}}return te.fromTrusted(qe.from(r),n)}readPartitions(){return this.partitions??=this.table.partition(this.groupedBy),this.partitions}};function Bi(e,t,r){const n=t.map(s=>e[s]?.valueFormat??{type:"decimal"}),[a,...i]=n;if(!a)return{type:"decimal"};for(const s of n)if(s.type==="lookup")throw new ae({code:"INVALID_DATA_SHAPE",message:"Cannot reshape: a source column has a lookup format and lookups cannot nest"});if(i.every(s=>(0,at.isEqual)(s,a))||a.type==="lookup")return a;const o={};for(const[s,l]of t.entries()){const u=Ie([l]),c=n[s];c&&c.type!=="lookup"&&(o[u]=c)}return{type:"lookup",byVariable:r,cases:o,fallback:a}}var Et=class{constructor(e){this.label=e,this.items=new Map}register(e,t){return this.items.set(e,t),this}get(e){if(!this.items.has(e)){const t=[...this.items.keys()].map(r=>`'${r}'`).join(", ");throw new ae({code:"UNKNOWN_REGISTERED_TYPE",message:`Unknown ${this.label}: '${e}' (available: ${t})`,context:{kind:this.label,requested:e,available:[...this.items.keys()]},suggestion:`Register a custom ${this.label} named '${e}' in the \`plugins\` array, or use one of: ${t}.`})}return this.items.get(e)}getAll(){return[...this.items.values()]}has(e){return this.items.has(e)}},Vi=(e,t)=>{const r=typeof e=="string"?e.trim():e;if(ie(r))return{type:"decimal"};const n=typeof r=="string"&&kr(r,t);if(n)return n;const a=typeof r=="string"&&Ka(r,t);return a||(Ir(e)?{type:"date"}:Mr(e)?{type:"percentage"}:Br(e)&&typeof e=="string"?{type:"currency",iso:Xa(e)}:{type:"text"})},Fi={type:"year",dateFormat:"yyyy"},Wi={type:"text"},pn=e=>{const t=e._metadata?.parsingLocale??"en-GB",r={},n=Ki(e),a=Yi(e),i=n.size>0;for(const[o,s]of e.columns.entries()){if(s._metadata?.hidden)continue;const l=n.get(s.key);if(fe(l)&&i)continue;const u=s.valueFormat??(fe(l)?Wi:o===a?Fi:Vi(l,t)),c=Or(u);r[s.key]=Gi(s.key,e.rows,u,c,t)}return new te(r)},Ui=class extends nn{dependencies(e){return[e]}run(e){return pn(e)}},Yi=e=>{if(e.columns.some(r=>r.valueFormat?.type==="year"))return-1;const t=zi(e.rows,5);return e.columns.findIndex(r=>{if(r.valueFormat)return!1;const n=t.map(a=>a[r.key]).filter(a=>!fe(a));return n.length>=2&&n.every(Ga)})},Gi=(e,t,r,n,a)=>({type:n,values:t.reduce((i,o)=>(Wr(o)||i.push(Ur(o[e],r,a)),i),[]),valueFormat:r}),Ki=e=>{const t=new Map,r=new Set(e.columns.map(n=>n.key));for(const n of e.rows){for(const a of r){const i=n[a];fe(i)||(t.set(a,i),r.delete(a))}if(r.size===0)break}return t},zi=(e,t)=>{const r=[];for(const n of e)if(Wr(n)||r.push(n),r.length===t)return r;return r},yn=["#B84737","#BA7420","#0B8666","#3D63A8","#DD9583","#E2BF6B","#95CBA6","#AABCE5"],Je={900:"#6E0500",800:"#881D11",700:"#A03522",600:"#B0523B",500:"#C06D56",400:"#CE8772",300:"#DBA28E",200:"#E7BDAC",100:"#F2D8CB",50:"#FCF4EA"},Hi=[Je[100],Je[900]],Xi=["#3D63A8","#e7e5e4","#B84737"],$i={dark:{1:[500],2:[600,400],3:[600,400,200],4:[600,500,300,100],5:[700,600,400,200,50],6:[600,500,400,300,200,100],7:[600,500,400,300,200,100,50],default:[700,600,500,400,300,200,100,50]},light:{1:[600],2:[700,500],3:[800,600,400],4:[800,600,400,300],5:[800,700,600,500,400],6:[800,700,600,500,400,300],7:[900,800,700,600,500,400,300],default:[900,800,700,600,500,400,300,200]}},qi=["cartesian","polar"],gn=["kind","edge","axis","role","position","part"],Ji=yn[0],mn=.4,Zi="sm",Qi=2,eo=8,to=12,ro=Object.freeze({light:"#F5F1E9",dark:"#1F1E1C"}),no="#ffffff",ao=1,io=24,oo={top:24,right:24,bottom:24,left:24},B={stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},T={fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",fontStyle:"fontStyle",letterSpacing:"signedPixels",textTransform:"textTransform",textDecoration:"textDecoration",textOutlineColor:"color",textOutlineWidth:"pixels",textShadow:"shadow",lineHeight:"multiplier",textColor:"color"},V={...T,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval"},so={offsetX:0,offsetY:2,blur:4,color:"rgba(14, 14, 52, 0.12)"},lo={offsetX:0,offsetY:4,blur:6,color:"rgba(14, 14, 52, 0.16)"},Ze=["where","state","layer"],bn={saturation:"multiplier",blur:"pixels",brightness:"multiplier",contrast:"multiplier",shadow:"shadow",blendMode:"blendMode"},vn={...bn,fill:"paint",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval",strokeAlpha:"unitInterval",cornerRadius:"geomRadius",overpaint:"overpaint"},uo=.3,co=10,fo=1,ho=24,po=8,x={label:{fontSize:11.5,fontWeight:500,lineHeight:1},dataLabelOutside:{fontSize:12.5,fontWeight:600,lineHeight:1},tooltipHeading:{fontSize:12.5,fontWeight:700,lineHeight:1.3},tooltipRow:{fontSize:12.5,fontWeight:500,lineHeight:1.43},heading:{fontSize:18,fontWeight:600,lineHeight:1.25},subtitle:{fontSize:15,fontWeight:500,lineHeight:1.47},caption:{fontSize:12,fontWeight:500,lineHeight:1.3},source:{fontSize:12,fontWeight:500,lineHeight:1.3},sourceLink:{fontSize:12,fontWeight:400,lineHeight:1.3}},Ke={stroke:f("gridLine"),strokeWidth:1},Wt={fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingBlock:8,paddingInline:10,shadow:{offsetX:0,offsetY:4,blur:12,color:"rgba(0, 0, 0, 0.18)"}},Ut={fill:f("textPrimary"),size:8,stroke:f("tooltipBackground"),strokeWidth:2,shadow:{offsetX:0,offsetY:1,blur:1.5,color:"rgba(14, 14, 52, 0.18)"}},Yt={fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingInline:7,paddingBlock:4,shadow:{offsetX:0,offsetY:2,blur:6,color:"rgba(0, 0, 0, 0.12)"}},ze={...B,length:"pixels"},le={...T,margin:"margin"},ue={...T,offset:"pixels",margin:"margin"},ce={gap:"pixels",margin:"margin"},He={stroke:"color",strokeAlpha:"unitInterval",strokeWidth:"pixels",dashArray:"dashArray",haloColor:"color",haloAlpha:"unitInterval",offset:"pixels",cornerRadius:"pixels"},Gt={fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",paddingInline:"pixels",paddingBlock:"pixels",shadow:"shadow",alpha:"unitInterval"},An=new Map;var yo=(e=Object.values(Be))=>{const t=[],r=[],n=[],a=i=>{if(i.rest!==void 0&&t.push({select:i.select,declarations:i.rest}),i.dimmed!==void 0&&r.push({select:i.select,declarations:i.dimmed,when:{state:"dimmed"}}),i.hovered!==void 0&&n.push({select:i.select,declarations:i.hovered,when:{state:"hovered"}}),i.children!==void 0)for(const o of Object.values(i.children))a(o)};for(const i of e)a(i);return[...t,...r,...n]},go=e=>{for(const t of e){Object.freeze(t.select);for(const r of Object.values(t.declarations))typeof r=="object"&&Object.freeze(r);Object.freeze(t.declarations),t.when!==void 0&&Object.freeze(t.when),Object.freeze(t)}return e},mo=e=>An.get(Tn(e)),Kt=(e,t)=>({x:{select:{target:e,axis:"x"},vocabulary:t},y:{select:{target:e,axis:"y"},vocabulary:t}}),zt=e=>({select:{target:"dataLabel",role:e},vocabulary:V,children:{inside:{select:{target:"dataLabel",role:e,position:"inside"},vocabulary:V,rest:{textColor:"#FFFFFF"}},outside:{select:{target:"dataLabel",role:e,position:"outside"},vocabulary:V,rest:{...x.dataLabelOutside}}}}),Be={geom:{select:{target:"geom"},vocabulary:vn,options:Ze,aesthetics:{fill:"color",stroke:"color",alpha:"alpha"},rest:{alpha:1,strokeAlpha:1,shadow:"none",blendMode:"normal"},dimmed:{alpha:mn},hovered:{shadow:so},acceptsUnknownKinds:!0},panelBorder:{select:{target:"panelBorder"},vocabulary:{...B,cornerRadius:"pixels"},rest:{...Ke,dashArray:C.panelBorder.dashed,cornerRadius:6},children:{top:{select:{target:"panelBorder",edge:"top"},vocabulary:B},right:{select:{target:"panelBorder",edge:"right"},vocabulary:B},bottom:{select:{target:"panelBorder",edge:"bottom"},vocabulary:B},left:{select:{target:"panelBorder",edge:"left"},vocabulary:B}}},gridLine:{select:{target:"gridLine"},vocabulary:B,children:{x:{select:{target:"gridLine",axis:"x"},vocabulary:B,rest:{...Ke,dashArray:C.gridLine.dashed,strokeWidth:0}},y:{select:{target:"gridLine",axis:"y"},vocabulary:B,rest:{...Ke,dashArray:C.gridLine.dashed}}}},tickLine:{select:{target:"tickLine"},vocabulary:ze,rest:{strokeWidth:0,length:0},children:{x:{select:{target:"tickLine",axis:"x"},vocabulary:ze},y:{select:{target:"tickLine",axis:"y"},vocabulary:ze}}},axisLabel:{select:{target:"axisLabel"},vocabulary:le,rest:{...x.label,textColor:f("textPrimary")},children:{...Kt("axisLabel",le),top:{select:{target:"axisLabel",edge:"top"},vocabulary:le,rest:{margin:{bottom:8}}},bottom:{select:{target:"axisLabel",edge:"bottom"},vocabulary:le,rest:{margin:{top:4,bottom:16}}},left:{select:{target:"axisLabel",edge:"left"},vocabulary:le},right:{select:{target:"axisLabel",edge:"right"},vocabulary:le}}},tickLabel:{select:{target:"tickLabel"},vocabulary:ue,rest:{...x.label,textColor:f("textSecondary"),offset:co,textOutlineColor:f("graphBackground"),textOutlineWidth:fo},children:{...Kt("tickLabel",ue),top:{select:{target:"tickLabel",edge:"top"},vocabulary:ue},bottom:{select:{target:"tickLabel",edge:"bottom"},vocabulary:ue},left:{select:{target:"tickLabel",edge:"left"},vocabulary:ue,rest:{offset:14}},right:{select:{target:"tickLabel",edge:"right"},vocabulary:ue,rest:{offset:14}}}},dataLabel:{select:{target:"dataLabel"},vocabulary:V,rest:{...x.label,textColor:f("textPrimary"),paddingInline:6,paddingBlock:2,cornerRadius:4},children:{aggregate:{select:{target:"dataLabel",role:"aggregate"},vocabulary:V,rest:{...x.dataLabelOutside}},observation:zt("observation"),category:zt("category")}},graph:{select:{target:"graph"},vocabulary:{fill:"paint",overpaint:"overpaint",stroke:"color",strokeWidth:"pixels",cornerRadius:"pixels",fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",lineHeight:"multiplier",textColor:"color",textScale:"multiplier",padding:"padding",blendMode:"blendMode",shadow:"shadow",alpha:"unitInterval"},rest:{fill:f("graphBackground"),strokeWidth:1,stroke:f("graphBorder"),cornerRadius:8,textScale:1,padding:24,blendMode:"normal"}},heading:{select:{target:"heading"},vocabulary:T,rest:{textColor:f("textPrimary")},partWildcard:!0,children:{h1:{select:{target:"heading",part:"h1"},vocabulary:T,rest:{...x.heading}},h2:{select:{target:"heading",part:"h2"},vocabulary:T,rest:{...x.subtitle}}}},caption:{select:{target:"caption"},vocabulary:T,rest:{...x.caption,textColor:f("textPrimary")}},source:{select:{target:"source"},vocabulary:T,rest:{...x.source,textColor:f("textSecondary")},children:{link:{select:{target:"source",part:"link"},vocabulary:T,rest:{...x.sourceLink,textColor:f("textSecondary")}}}},header:{select:{target:"header"},vocabulary:{margin:"margin"},rest:{margin:{bottom:10}}},footer:{select:{target:"footer"},vocabulary:{margin:"margin"},rest:{margin:{top:16}}},hoverGuide:{select:{target:"hoverGuide"},vocabulary:{stroke:"color",fill:"paint"},rest:{stroke:f("hoverGuideLine"),fill:f("hoverGuideFill")}},editOutline:{select:{target:"editOutline"},vocabulary:He,rest:{stroke:f("textPrimary"),strokeWidth:1.5,dashArray:[3.5,2.5],offset:3,cornerRadius:3},partWildcard:!0,children:{hover:{select:{target:"editOutline",part:"hover"},vocabulary:He,rest:{strokeAlpha:.4,haloAlpha:.5}},selected:{select:{target:"editOutline",part:"selected"},vocabulary:He,rest:{strokeAlpha:.85,haloAlpha:.9}}}},tooltip:{select:{target:"tooltip"},vocabulary:{...Gt,gap:"pixels"},rest:{...Wt,gap:4},children:{heading:{select:{target:"tooltip",part:"heading"},vocabulary:T,rest:{...x.tooltipHeading,textColor:f("textPrimary")}},label:{select:{target:"tooltip",part:"label"},vocabulary:T,rest:{...x.tooltipRow,textColor:f("textPrimary")}},value:{select:{target:"tooltip",part:"value"},vocabulary:T,rest:{...x.tooltipRow,textColor:f("textSecondary")}},primaryRow:{select:{target:"tooltip",part:"primaryRow"},vocabulary:{fill:"paint"},rest:{fill:f("tooltipPrimaryRow")}}}},headline:{select:{target:"headline"},vocabulary:ce,rest:{gap:ho,margin:{bottom:4}}},headlineItem:{select:{target:"headlineItem"},vocabulary:{gap:"pixels"},rest:{gap:2},children:{number:{select:{target:"headlineItem",part:"number"},vocabulary:T,rest:{fontSize:26,fontWeight:700,lineHeight:1.3,textColor:f("textPrimary")},children:{center:{select:{target:"headlineItem",part:"numberCenter"},vocabulary:T}}},caption:{select:{target:"headlineItem",part:"caption"},vocabulary:T,rest:{fontSize:12,textColor:f("textSecondary")}},label:{select:{target:"headlineItem",part:"label"},vocabulary:T,rest:{fontSize:12,textColor:f("textSecondary")}},swatch:{select:{target:"headlineItem",part:"swatch"},vocabulary:{size:"pixels"},rest:{size:12}},trend:{select:{target:"headlineItem",part:"trend"},vocabulary:T,rest:{fontSize:12,textColor:f("textSecondary")},children:{up:{select:{target:"headlineItem",part:"trendUp"},vocabulary:{textColor:"color"},rest:{textColor:f("trendPositive")}},down:{select:{target:"headlineItem",part:"trendDown"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNegative")}},flat:{select:{target:"headlineItem",part:"trendFlat"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNeutral")}}}}}},legend:{select:{target:"legend"},vocabulary:{...ce,focusStroke:"color"},rest:{gap:po,focusStroke:f("legendFocus")},children:{popover:{select:{target:"legend",part:"popover"},vocabulary:Gt,rest:Wt},top:{select:{target:"legend",edge:"top"},vocabulary:ce,rest:{margin:{bottom:8}}},bottom:{select:{target:"legend",edge:"bottom"},vocabulary:ce,rest:{margin:{top:16,bottom:10}}},left:{select:{target:"legend",edge:"left"},vocabulary:ce,rest:{margin:{right:10}}},right:{select:{target:"legend",edge:"right"},vocabulary:ce,rest:{margin:{left:10}}}}},legendItem:{select:{target:"legendItem"},vocabulary:{...T,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval",gap:"pixels"},rest:{...x.label,textColor:f("textSecondary"),strokeWidth:0,paddingInline:2,paddingBlock:4,gap:8},children:{swatch:{select:{target:"legendItem",part:"swatch"},vocabulary:{size:"pixels",strokeWidth:"pixels"},rest:{size:12,strokeWidth:2}}}},directLabel:{select:{target:"directLabel"},vocabulary:{...T,stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},rest:{fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),strokeWidth:1,dashArray:C.directLabel.dashed}},annotation:{select:{target:"annotation"},vocabulary:{fill:"paint",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval"},options:["annotation"],children:{shape:{select:{target:"annotation",kind:"shape"},vocabulary:{fill:"paint",alpha:"unitInterval",fillAlpha:"unitInterval",stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{fill:f("annotationShape"),alpha:1,fillAlpha:.25,strokeWidth:1}},arrow:{select:{target:"annotation",kind:"arrow"},vocabulary:{stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:4,dashArray:C.arrow.solid},children:{outline:{select:{target:"annotation",kind:"arrow",part:"outline"},vocabulary:{stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:{strokeWidth:0,shadow:"none"}}}},differenceArrow:{select:{target:"annotation",kind:"differenceArrow"},vocabulary:{stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:2},children:{label:{select:{target:"annotation",kind:"differenceArrow",part:"label"},vocabulary:V,options:["annotation"],rest:{...x.label,textColor:f("textPrimary"),fill:f("differenceLabelBackground"),strokeWidth:1,cornerRadius:4,paddingInline:6,paddingBlock:3}}}},text:{select:{target:"annotation",kind:"text"},vocabulary:{...V,fillAlpha:"unitInterval"},options:["annotation"],rest:{fill:"transparent",alpha:1,fillAlpha:1,strokeWidth:1.5,cornerRadius:9,paddingInline:6,paddingBlock:3,fontSize:15,fontWeight:500,lineHeight:1.25,textColor:f("textPrimary")}},image:{select:{target:"annotation",kind:"image"},vocabulary:{alpha:"unitInterval",cornerRadius:"boxRadius",shadow:"shadow"},options:["annotation"],rest:{alpha:1,cornerRadius:0}},pinnedNumber:{select:{target:"annotation",kind:"pinnedNumber"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Ut,children:{label:{select:{target:"annotation",kind:"pinnedNumber",part:"label"},vocabulary:V,options:["annotation"],rest:Yt}}},comment:{select:{target:"annotation",kind:"comment"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Ut,children:{label:{select:{target:"annotation",kind:"comment",part:"label"},vocabulary:V,options:["annotation"],rest:Yt}}}}}},Tn=e=>{let t=e.target;for(const r of gn){const n=e[r];n!==void 0&&(t+=`\0${r}:${n}`)}return t},En=e=>{if(An.set(Tn(e.select),e),e.children!==void 0)for(const t of Object.values(e.children))En(t)};for(const e of Object.values(Be))En(e);function bo(e){return e}var vo=e=>e.observation?.aesthetics??Be.geom.aesthetics,Pn=e=>e.observation?.sharedPaint===!1?{...e.observation.vocabulary}:{...vn,...e.observation?.vocabulary},Ao=(e,t)=>({select:{target:"geom",kind:e},vocabulary:Pn(t),aesthetics:vo(t),options:t.observation?.options??Ze,...Ht(t.observation),children:Object.fromEntries(Object.entries(t.parts??{}).map(([r,n])=>[r,{select:{target:"geom",kind:e,part:r},vocabulary:n.vocabulary,options:n.options??Ze,...n.aesthetics===void 0?{}:{aesthetics:n.aesthetics},...Ht(n)}]))}),Ht=e=>({...e?.rest===void 0?{}:{rest:e.rest},...e?.dimmed===void 0?{}:{dimmed:e.dimmed},...e?.hovered===void 0?{}:{hovered:e.hovered}}),q=class{constructor(){this.positionRoles=[],this.identityKey="x-group",this.defaultPosition="identity",this.defaultStat=null,this.supportedPositions=Ar,this.defaultInteractive=!0,this.defaultAttachTo="none",this.aesthetics=[],this.derivedVariables=[],this.highlightStrategy=null,this.categorySpanAxes=[],this.supportedCoordTypes=["cartesian","flip"],this.spatialKind="points",this.grid={},this.legend={},this.dataLabelCoordTypes=[],this.composite=!1,this.tooltip=[],this.summaries={}}resolveParams(e){return(0,at.merge)({},this.defaultParams,e.params)}},Xt=.5,pe=e=>({x:0,y:0,width:e.width,height:e.height}),Pt=e=>e==="panel-end"?"end":e==="panel-start"?"start":e,ye=({box:e,panel:t,orientation:r,placement:n,justify:a,align:i,offset:o,alignOffset:s,labelWidth:l,labelHeight:u})=>{const c=a==="panel-start"||a==="panel-end",h=(r.valueAxis==="x"?e.height:e.width)===0,d={anchor:Eo(a,r.valueDirectionSign),placement:c?"inside":n,offset:o},p={anchor:Po(i),placement:h?n:"inside",offset:h?s??o:0},g=c?t:e,A=r.valueAxis==="x"?g:e,P=r.valueAxis==="y"?g:e,N=r.valueAxis==="x"?d:p,k=r.valueAxis==="x"?p:d,w=qt(N,{min:A.x,max:A.x+A.width,halfExtent:l/2}),S=qt(k,{min:P.y,max:P.y+P.height,halfExtent:u/2});return{x:w,y:S,position:To(e,w,S,l,u)}},$t=(e,t,r,n)=>r-n>=e-Xt&&r+n<=t+Xt,To=(e,t,r,n,a)=>{if(e.width===0&&e.height===0)return"outside";const i=e.width===0||$t(e.x,e.x+e.width,t,n/2),o=e.height===0||$t(e.y,e.y+e.height,r,a/2);return i&&o?"inside":"outside"},Eo=(e,t)=>e==="center"?"center":(e==="end"||e==="panel-end")==(t===1)?"max":"min",Po=e=>e==="center"?"center":e==="start"?"min":"max",qt=({anchor:e,placement:t,offset:r},{min:n,max:a,halfExtent:i})=>{if(e==="center")return(n+a)/2;if(t==="inside"&&n===a)return n;const o=r+i;return e==="min"?t==="inside"?n+o:n-o:t==="inside"?a-o:a+o},Oo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=Mo(e.layer);for(const a of e.layer.data){const i=H(a),o=G(a)??U(a);if(i===null||o===null||!Ne(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),{box:c,orientation:h}=xo(o,Y(a),i,e.panelRect.width,e.panelRect.height),d=ye({box:c,panel:pe(e.panelRect),orientation:h,...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:d.x,y:d.y,text:s,width:l,height:u,rotated:!1,role:"observation",position:"outside"})}return{labels:t,droppedCount:0}},So=e=>e.position==="fill"?"fill":de(e.position)?"stack":"none",xo=(e,t,r,n,a)=>{const i=t??e,o=1-Math.max(e,i);return{box:{x:r*n,y:o*a,width:0,height:Math.abs(e-i)*a},orientation:{valueAxis:"y",valueDirectionSign:e>=i?-1:1}}},Mo=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:Tt(e.data,e.mapping)?Pt(r):r,align:n}},_o=class extends q{constructor(...e){super(...e),this.type="area",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{fill:"color",fillAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{fill:f("geom"),fillAlpha:uo,strokeWidth:2,dashArray:C.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"zero"},this.defaultPosition="stack",this.scaleConstraints={includeZero:!0},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={includeStackTotals:!0,supportsPerGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.resolvePercentageValueStrategy=So,this.composite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="filled-buckets",this.resolveAnchorPosition=bt,this.getDataLabelPlacements=t=>Oo(t)}resolveParams(e){const t=super.resolveParams(e);return t.missingValues==="gap"?{...t,missingValues:"zero"}:t}compile({data:e,mapping:t}){return e=mt(e,t),e.hasVariable(y.yMin)||(e=e.addConstantVariable(y.yMin,"numeric",0)),{data:e,mapping:{}}}},On=.7,Ro=.1,Lo=.03,wo=.05,Sn=e=>{const t=e[ut.role];return t??"solo"},Ot=(e,t,r)=>{const n={},a=i=>{const o=n[i];if(o!==void 0)return o;const{width:s,height:l}=e(t,i,r),u={width:s,height:l};return n[i]=u,u};return{get inside(){return a("inside")},get outside(){return a("outside")}}},Ve=(e,t,r=e.get("fill",t))=>{if(r===void 0)return;const n=e.get("alpha",t)*(e.get("fillAlpha",t)??1);return lr(ir(r),n)},xn={none:0,xs:2,sm:4,md:8,lg:12,xl:16},Mn=({cornerRadius:e,box:t})=>e==="full"?t===void 0?0:Math.min(t.width,t.height)/2:typeof e=="number"?Math.max(0,e):xn[e],_n=e=>{if(wn(e)){const{width:t,height:r}=e.bounds;return(e.mainAxis==="x"?t:r)/2}return Mn({cornerRadius:e.cornerRadius??"sm"})},Io=e=>{const t=_n(e);return wn(e)?e.mainAxis==="x"?{rx:t}:{ry:t}:{rx:t}},ko=e=>({outlineWidth:e*2,separatorWidth:e,insetOffset:e/2}),Qe=(e,t)=>St(e,{xMin:X(t),xMax:$(t),yMin:Y(t),yMax:G(t),y:U(t)}),St=(e,{xMin:t,xMax:r,yMin:n,yMax:a,y:i})=>{const o=a??i;if(t===null||r===null||n===null||o===null)return null;if(e==="x"){let u=1-o,c=o-n;return c<0&&(u+=c,c=-c),{x:t,y:u,width:r-t,height:c}}let s=t,l=r-t;return l<0&&(s+=l,l=-l),{x:s,y:1-o,width:l,height:o-n}},Rn=(e,t,r,n)=>{const a=new Map;for(const i of e.data){const o=r.get("maxWidth",i);if(o===void 0)continue;const s=Qe(t,i);if(s===null)continue;const l=et(t,s),u=a.get(l);(u===void 0||o<u)&&a.set(l,o)}return i=>{const o=Qe(t,i);return o===null?null:jo(t,o,a.get(et(t,o)),n)}},et=(e,t)=>e==="x"?`${Ae(t.x)}-${Ae(t.width)}`:`${Ae(t.y)}-${Ae(t.height)}`,Do=e=>{let t=1/0,r=1/0,n=-1/0,a=-1/0;for(const i of e)i.x<t&&(t=i.x),i.y<r&&(r=i.y),i.x+i.width>n&&(n=i.x+i.width),i.y+i.height>a&&(a=i.y+i.height);return{x:t,y:r,width:n-t,height:a-r}},Ln=(e,t,r)=>{const n=t.mainAxis==="x"?1:0,a=r[At(e.yScaleType)];if(!a||a.kind!=="position")return n;const i=a.map(0);if(!Number.isFinite(i))return n;const o=Math.min(1,Math.max(0,i));return t.mainAxis==="x"?1-o:o},Co=(e,t,r)=>{const n=Ln(e,t,r);return t.mainAxis==="x"?{x:0,y:n}:{x:n,y:0}},jo=(e,t,r,n)=>{if(r===void 0)return t;if(e==="x"){const i=r/n.width;return t.width>i?{...t,x:t.x+(t.width-i)/2,width:i}:t}const a=r/n.height;return t.height>a?{...t,y:t.y+(t.height-a)/2,height:a}:t},wn=e=>e.cornerRadius==="full",Re=6,No=.5,Bo=e=>{const t=[];let r=0;const n=de(e.layer.position),a=e.coordSystem.mainAxis==="y",i=Rn(e.layer,e.coordSystem.mainAxis,e.styleReaders,e.panelRect);if(e.layer.dataLabels.showDataLabels){const{entries:o,rotate:s}=Fo({layer:e.layer,panelRect:e.panelRect,readBarBounds:i,measureDataLabel:e.measureDataLabel,formatLabel:e.formatLabel,flipped:a});for(const l of o){const u=e.layer.dataLabels.position==="auto"?Uo({mainAxis:e.coordSystem.mainAxis,stacked:n,negative:l.negative,rotate:s,bounds:l.bounds,boxes:l.boxes,panelWidth:e.panelRect.width,panelHeight:e.panelRect.height,offset:e.layer.dataLabels.offset}):Go(e.layer.dataLabels,e.coordSystem.mainAxis,n,l,pe(e.panelRect));if(u===null){r+=1;continue}const c=l.boxes[u.position];t.push({layerId:e.layer.id,x:u.x,y:u.y,text:l.text,width:c.width,height:c.height,rotated:u.rotated,role:"observation",position:u.position,...u.position==="inside"?{backdropColor:Ve(e.styleReaders,l.observation)}:{}})}}if(e.layer.dataLabels.showCategoryLabels)for(const o of Ko(e,n,i))t.push(o);if(e.layer.dataLabels.showStackTotals){const o=$o({layer:e.layer,mainAxis:e.coordSystem.mainAxis,panelRect:e.panelRect,measureDataLabel:e.measureDataLabel,formatAbsolute:e.formatAbsolute});for(const s of o)t.push(s)}return{labels:t,droppedCount:r}},Vo=e=>e.position==="fill"?"fill":de(e.position)?"stack":"absoluteGrandTotal",Fo=({layer:e,panelRect:t,readBarBounds:r,measureDataLabel:n,formatLabel:a,flipped:i})=>{const o=[];let s=!1;const l=e.dataLabels.position==="auto",u=L(e.mapping.y);for(const c of e.data){const h=r(c);if(h===null)continue;const d=a(c);if(d==="")continue;const p=Ot(n,"observation",d),g=xt(h,t);l&&p.inside.width>g.width&&(s=!0);const A=u===null?null:c[u],P=M(A)&&A<0;o.push({negative:P,text:d,boxes:p,bounds:g,observation:c})}return{entries:o,rotate:!i&&s}},xt=(e,t)=>({x:e.x*t.width,y:e.y*t.height,width:e.width*t.width,height:e.height*t.height}),Wo=(e,t)=>e==="x"?t?"bottom":"top":t?"left":"right",tt=(e,t,r)=>r?{width:t,height:e}:{width:e,height:t},Uo=e=>e.stacked?zo({bounds:e.bounds,box:e.boxes.inside,rotated:e.rotate}):Xo({edge:Wo(e.mainAxis,e.negative),bounds:e.bounds,boxes:e.boxes,rotated:e.rotate,panelWidth:e.panelWidth,panelHeight:e.panelHeight,offset:e.offset}),In=(e,t)=>e==="x"?{valueAxis:"y",valueDirectionSign:t?1:-1}:{valueAxis:"x",valueDirectionSign:t?-1:1},Yo=e=>e==="panel-start"||e==="panel-end",Go=(e,t,r,n,a)=>{if(e.position==="auto")return null;const i=r&&e.position==="outside"?"inside":e.position,o=n.boxes[i],s=ye({box:n.bounds,panel:a,orientation:In(t,n.negative),placement:i,justify:e.justify,align:e.align,offset:e.offset,labelWidth:o.width,labelHeight:o.height});if(i==="inside"&&!Yo(e.justify)){const l=t==="y",u=l?n.bounds.width:n.bounds.height;return(l?o.width:o.height)>u+No?null:{x:s.x,y:s.y,rotated:!1,position:"inside"}}return{x:s.x,y:s.y,rotated:!1,position:s.position}},Ko=(e,t,r)=>{const n=[],{categoryPosition:a,categoryJustify:i,categoryAlign:o,categoryOffset:s}=e.layer.dataLabels,l=t&&a==="outside"?"inside":a,u=e.coordSystem.mainAxis,c=pe(e.panelRect),h=L(e.layer.mapping.y);for(const d of e.layer.data){const p=r(d);if(p===null)continue;const g=e.formatCategory(d);if(g===null||g==="")continue;const A=Ot(e.measureDataLabel,"category",g),P=A[l],N=xt(p,e.panelRect),k=h===null?null:d[h],w=M(k)&&k<0,S=ye({box:N,panel:c,orientation:In(u,w),placement:l,justify:i,align:o,offset:s,labelWidth:P.width,labelHeight:P.height}),O=A[S.position];n.push({layerId:e.layer.id,x:S.x,y:S.y,text:g,width:O.width,height:O.height,rotated:!1,role:"category",position:S.position})}return n},zo=({bounds:e,box:t,rotated:r})=>{const n=tt(t.width,t.height,r);return n.width>e.width||n.height>e.height?null:{x:e.x+e.width/2,y:e.y+e.height/2,rotated:r,position:"inside"}},Ho=(e,t,r,n)=>{switch(e){case"top":return{edgeCoord:t.y,outwardSign:-1,panelExtent:n};case"bottom":return{edgeCoord:t.y+t.height,outwardSign:1,panelExtent:n};case"left":return{edgeCoord:t.x,outwardSign:-1,panelExtent:r};case"right":return{edgeCoord:t.x+t.width,outwardSign:1,panelExtent:r}}},Xo=({edge:e,bounds:t,boxes:r,rotated:n,panelWidth:a,panelHeight:i,offset:o})=>{const s=e==="top"||e==="bottom",l=t.x+t.width/2,u=t.y+t.height/2,c=s?t.height:t.width,h=s?t.width:t.height,{edgeCoord:d,outwardSign:p,panelExtent:g}=Ho(e,t,a,i),A=tt(r.inside.width,r.inside.height,n),P=s?A.height:A.width,N=s?A.width:A.height,k=P+o<c,w=N<=h;if(s?k:k&&w){if(s&&!w)return null;if(n)return{x:l,y:u,rotated:!0,position:"inside"};const Me=d-p*(P/2+o);return{...s?{x:l,y:Me}:{x:Me,y:u},rotated:!1,position:"inside"}}const S=tt(r.outside.width,r.outside.height,n),O=(s?S.height:S.width)/2,D=d+p*(O+o);return D-O<0||D+O>g?null:{...s?{x:l,y:D}:{x:D,y:u},rotated:n,position:"outside"}},$o=({layer:e,mainAxis:t,panelRect:r,measureDataLabel:n,formatAbsolute:a})=>{const i=[],o=e.summary.stackTotals;if(o===void 0||o.length===0)return i;const s=t==="y";for(const l of o){const u=St(t,{...l.anchor,y:null});if(u===null)continue;const c=xt(u,r),h=a(l.total),{width:d,height:p}=n("aggregate","outside",h),g=l.anchor.direction==="positive";let A,P;s?(A=g?c.x+c.width+Re+d/2:c.x-Re-d/2,P=c.y+c.height/2):(A=c.x+c.width/2,P=g?c.y-Re-p/2:c.y+c.height+Re+p/2),i.push({layerId:e.id,x:A,y:P,text:h,width:d,height:p,rotated:!1,role:"aggregate",position:"outside"})}return i};function kn(e){return{startAngle:e[y.xMin],endAngle:e[y.xMax]}}function Dn(e){return{innerRadius:e[y.yMin],outerRadius:e[y.yMax]??e[y.y]}}var qo=" · ",F=2,Jo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{position:r,justify:n,align:a,offset:i,showCategoryLabels:o}=e.layer.dataLabels,s=e.coordSystem.bandAxis==="y",l=e.panelRect.width/2,u=e.panelRect.height/2,c=Math.min(e.panelRect.width,e.panelRect.height)/2,h=e.styleReaders;for(const d of e.layer.data){const{startAngle:p,endAngle:g}=kn(d),{innerRadius:A,outerRadius:P}=Dn(d);if(p===null||g===null||P===null)continue;const N=e.formatLabel(d);if(N==="")continue;const k=o?e.formatCategory(d):null,w=k===null?N:`${k}${qo}${N}`,S={startAngle:p,endAngle:g,midAngle:(p+g)/2,innerRadiusPx:(A??0)*c,outerRadiusPx:P*c};let O,D;if(r==="auto"){const ge=e.measureDataLabel("observation","inside",w),K={width:ge.width,height:ge.height},Fe=Qt({wedge:S,position:"inside",offset:i,labelWidth:K.width,labelHeight:K.height}),Hn=s||Qo({wedge:S,labelRadius:Fe.labelRadius,labelAngle:Fe.labelAngle,labelWidth:K.width,labelHeight:K.height});if(O=Fe,D=K,!Hn){const Mt=e.measureDataLabel("observation","outside",w),me={width:Mt.width,height:Mt.height},be=Qt({wedge:S,position:"outside",offset:i,labelWidth:me.width,labelHeight:me.height}),Xn=l+Math.sin(be.labelAngle)*be.labelRadius,$n=u-Math.cos(be.labelAngle)*be.labelRadius;ts({x:Xn,y:$n,labelWidth:me.width,labelHeight:me.height,panelRect:e.panelRect})&&(O=be,D=me)}}else{const ge=Ot(e.measureDataLabel,"observation",w),K=ge[r];O=rs({wedge:S,placement:r,justify:Pt(n),align:a,offset:i,labelWidth:K.width,labelHeight:K.height}),D=ge[O.position]}const Me=l+Math.sin(O.labelAngle)*O.labelRadius,zn=u-Math.cos(O.labelAngle)*O.labelRadius;t.push({layerId:e.layer.id,x:Me,y:zn,text:w,width:D.width,height:D.height,rotated:!1,role:"observation",position:O.position,...O.position==="inside"?{backdropColor:Ve(h,d)}:{}})}return{labels:t,droppedCount:0}},Zo=()=>"absoluteGrandTotal",rt=(e,t,r,n)=>{const a=Math.abs(e==="radial"?Math.sin(t):Math.cos(t)),i=Math.abs(e==="radial"?Math.cos(t):Math.sin(t));return a*(r/2)+i*(n/2)},Qo=({wedge:e,labelRadius:t,labelAngle:r,labelWidth:n,labelHeight:a})=>{if(t<=0)return!1;const i=Math.sin(r)*t,o=-Math.cos(r)*t,s={left:i-n/2,right:i+n/2,top:o-a/2,bottom:o+a/2},l=[[s.left,s.top],[s.right,s.top],[s.right,s.bottom],[s.left,s.bottom]],u=Math.hypot(Jt(0,s.left,s.right),Jt(0,s.top,s.bottom)),c=Math.max(...l.map(([d,p])=>Math.hypot(d,p)));if(u<e.innerRadiusPx-F||c>e.outerRadiusPx+F)return!1;const h=Math.abs(e.endAngle-e.startAngle)/2;return h>=Math.PI?!0:l.every(([d,p])=>{const g=Math.hypot(d,p);return g<=F?!0:ot(Math.atan2(d,-p),e.midAngle)<=h+F/g})?h<=Math.PI/2?!0:u<=F?!1:!Zt(e.startAngle,s)&&!Zt(e.endAngle,s):!1},es=(e,t,r)=>{if(t<=0||t<e.innerRadiusPx-F||t>e.outerRadiusPx+F)return!1;const n=Math.abs(e.endAngle-e.startAngle)/2;return ot(r,e.midAngle)<=n+F/t},Jt=(e,t,r)=>Math.min(r,Math.max(t,e)),Zt=(e,t)=>{const r=F,n=[[Math.sin(e),t.left+r,t.right-r],[-Math.cos(e),t.top+r,t.bottom-r]];let a=0,i=Number.POSITIVE_INFINITY;for(const[o,s,l]of n){if(s>l)return!1;if(Math.abs(o)<1e-9){if(s>0||l<0)return!1;continue}const u=s/o,c=l/o;a=Math.max(a,Math.min(u,c)),i=Math.min(i,Math.max(u,c))}return a<=i},ts=({x:e,y:t,labelWidth:r,labelHeight:n,panelRect:a})=>e-r/2>=0&&e+r/2<=a.width&&t-n/2>=0&&t+n/2<=a.height,Qt=({wedge:e,position:t,offset:r,labelWidth:n,labelHeight:a})=>t==="inside"?{labelRadius:(e.innerRadiusPx+e.outerRadiusPx)/2,labelAngle:e.midAngle,position:"inside"}:{labelRadius:e.outerRadiusPx+r+rt("radial",e.midAngle,n,a),labelAngle:e.midAngle,position:"outside"},rs=({wedge:e,placement:t,justify:r,align:n,offset:a,labelWidth:i,labelHeight:o})=>{const s=n==="start"?e.startAngle:n==="end"?e.endAngle:e.midAngle,l=a+rt("radial",s,i,o);let u;if(r==="center")u=(e.innerRadiusPx+e.outerRadiusPx)/2;else if(r==="end")u=t==="inside"?e.outerRadiusPx-l:e.outerRadiusPx+l;else if(t==="inside")u=e.innerRadiusPx+l;else{const h=e.innerRadiusPx-l;u=h>=0?h:e.innerRadiusPx+l}let c=s;if(n!=="center"&&u>0){const h=rt("tangential",s,i,o),d=Math.asin(Math.min(1,h/u));c=s+(n==="start"?1:-1)*d}return{labelRadius:u,labelAngle:c,position:es(e,u,c)?"inside":"outside"}},ns=class extends q{constructor(...e){super(...e),this.type="bar",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",maxWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:"sm",strokeWidth:1,stroke:f("geomBorder")},hovered:{stroke:f("hoverAffordance"),shadow:lo}}},this.defaultParams={},this.defaultPosition="dodge",this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"alpha"}],this.summaries={includeGrandTotal:!0,includeStackTotals:!0,supportsPerGroupHeadline:!0},this.grid={cartesian:{hideGridX:!0},flip:{hideGridX:!0}},this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenStackedVertical",directLabelSupport:{stack:!0,fill:!0}},this.scaleConstraints={requireMainAxisBands:!0,includeZero:!0},this.dataLabels={polar:{format:"percentage"}},this.dataLabelCoordTypes=["cartesian","flip","polar"],this.highlightStrategy="observation-rerender",this.supportedCoordTypes=["cartesian","polar","flip"],this.spatialKind="rects",this.resolveDataLabelDefaults=t=>de(t)?{justify:"center"}:{},this.resolveBandFraction=(t,r)=>nt(t,r.type),this.resolveAnchorPosition=(t,{coordSystem:r,position:n,purpose:a,align:i})=>{if(i!==void 0){const h=br(t,r);return h===null?null:ct(h,i)}if(r.type==="polar")return as(t);const o=de(n),s={solo:!o||Sn(t)==="solo",negative:o&&is(t),purpose:a};if(r.mainAxis==="x"){const h=X(t),d=$(t),p=er({lowerBound:Y(t),upperBound:G(t)??U(t),options:s});return h===null||d===null||p===null?null:{x:(h+d)/2,y:p}}const l=Y(t),u=G(t),c=er({lowerBound:X(t),upperBound:$(t)??H(t),options:s});return l===null||u===null||c===null?null:{x:c,y:(l+u)/2}},this.getDataLabelPlacements=t=>t.coordSystem.type==="polar"?Jo(t):Bo(t),this.resolvePercentageValueStrategy=(t,r)=>r==="polar"?Zo():Vo(t)}resolveParams(e){const{width:t,...r}=super.resolveParams(e),n=this.resolveWidthParam(t,e.diagnostics);return{...r,...n!==void 0&&{width:n}}}compile({data:e,mapping:t,params:r,coordType:n}){const a=nt(r,n);e=mt(e,t),e.hasVariable(y.yMin)||(e=e.addConstantVariable(y.yMin,"numeric",0));const i=a/2;return e=e.addConstantVariable(y.xMin,"numeric",-i).addConstantVariable(y.xMax,"numeric",i),{data:e,mapping:{}}}resolveWidthParam(e,t){if(e===void 0)return;const r=typeof e=="number"&&Number.isFinite(e)?e:null;if(r!==null&&r>0&&r<=1)return r;const n=r!==null&&r>1?1:void 0;return t?.addWarning({code:"INVALID_GEOM_PARAM",message:`Bar width must be a fraction in (0, 1], got ${String(e)}; falling back to ${n??"the default band"}.`,context:{geom:this.type,param:"width",expected:"0 < width <= 1",actual:r??String(e)},suggestion:"Set params.width to a fraction of the category band in (0, 1]."}),n}},nt=({width:e},t)=>e!==void 0?e:t==="polar"?1:On,as=e=>{const t=X(e),r=$(e),n=Y(e),a=G(e);return t===null||r===null||n===null||a===null?null:Z((t+r)/2,(n+a)/2)},is=e=>{const t=mr(e);return M(t)&&t<0},er=e=>{const{lowerBound:t,upperBound:r,options:n}=e,a=n.negative?t:r;if(a===null)return null;if(n.purpose==="value"||n.solo)return a;const i=n.negative?r:t;return i===null?null:(i+a)/2},os=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=ss(e.layer);for(const a of e.layer.data){const i=H(a),o=U(a);if(i===null||o===null||!Ne(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),c=ye({box:{x:i*e.panelRect.width,y:(1-o)*e.panelRect.height,width:0,height:0},panel:pe(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:c.x,y:c.y,text:s,width:l,height:u,rotated:!1,role:"observation",position:c.position})}return{labels:t,droppedCount:0}},ss=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:Tt(e.data,e.mapping)?Pt(r):r,align:n}},ls=class extends q{constructor(...e){super(...e),this.type="line",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{stroke:"color",strokeAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("geom"),strokeWidth:2,dashArray:C.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"gap"},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={supportsPerGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.composite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="buckets",this.resolveAnchorPosition=bt,this.getDataLabelPlacements=t=>os(t)}compile(e){return{data:mt(e.data,e.mapping),mapping:{}}}},us=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=cs(e.layer),a=n.justify==="panel-start"||n.justify==="panel-end",i=e.styleReaders;for(const o of e.layer.data){const s=H(o),l=U(o);if(s===null||l===null||!Ne(s,l))continue;const u=e.formatLabel(o);if(u==="")continue;const{width:c,height:h}=e.measureDataLabel("observation","outside",u),d=i.get("size",o)/2,p=ye({box:{x:s*e.panelRect.width,y:(1-l)*e.panelRect.height,width:0,height:0},panel:pe(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:a?r:r+d,alignOffset:r+d,labelWidth:c,labelHeight:h});t.push({layerId:e.layer.id,x:p.x,y:p.y,text:u,width:c,height:h,rotated:!1,role:"observation",position:p.position})}return{labels:t,droppedCount:0}},cs=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:r,align:n}},ds=class extends q{constructor(...e){super(...e),this.type="point",this.styleTarget={observation:{vocabulary:{size:"pixels",symbol:"pointSymbol",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",size:"size",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,size:8,symbol:"circle",stroke:f("hoverAffordance"),strokeWidth:1},hovered:{stroke:f("hoverAffordance")}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"size"},{kind:"visual",name:"alpha"}],this.summaries={supportsPerGroupHeadline:!0},this.highlightStrategy="overlay-anchor",this.dataLabelCoordTypes=["cartesian","flip"],this.resolveAnchorPosition=bt,this.resolveValueSource=(t,r)=>{if(r!=="label")return null;const n=L(t.size);return n!==null?{variable:n}:null},this.getDataLabelPlacements=t=>us(t)}compile({data:e}){return{data:e,mapping:{}}}},fs=class extends q{constructor(...e){super(...e),this.type="rule",this.styleTarget={observation:{vocabulary:{stroke:"color",strokeAlpha:"unitInterval",strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin",shadow:"shadow",blendMode:"blendMode"},sharedPaint:!1,dashPresets:C.rule,aesthetics:{stroke:"color",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("ruleLine"),strokeWidth:1,dashArray:C.rule.dashed}},parts:{label:{vocabulary:T,options:["layer"],rest:{fontSize:11.5,fontWeight:500,lineHeight:1}}}},this.defaultParams={labelPosition:"start"},this.defaultInteractive=!1,this.positionRoles=[{axis:"y",role:"scalar",valueKind:"value",aes:"y"},{axis:"x",role:"scalar",valueKind:"value",aes:"x"}],this.highlightStrategy=null,this.spatialKind="noop",this.validateMapping=({mapping:t,computedVariables:r})=>{const n=r.has("x")||M(Pe(t.x)),a=r.has("y")||M(Pe(t.y));return n&&a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires exactly one of 'x' or 'y', both were provided"}]:!n&&!a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires a numeric value on 'x' or 'y'"}]:[]}}compile({data:e,mapping:t}){const r=tr(t.y,e);if(r!==null)return{data:new te({[Te.y]:{type:"numeric",values:[r.value],valueFormat:r.sourceFormat}}),mapping:{y:Te.y,x:void 0}};const n=tr(t.x,e);return n!==null?{data:new te({[Te.x]:{type:"numeric",values:[n.value],valueFormat:n.sourceFormat}}),mapping:{x:Te.x,y:void 0}}:{data:new te,mapping:{x:void 0,y:void 0}}}},tr=(e,t)=>{const r=Pe(e);if(M(r))return{value:r,sourceFormat:void 0};const n=L(e);if(n===null||!pa(n)||!t.hasVariable(n))return null;const[a]=t.getValues(n);return M(a)?{value:a,sourceFormat:t.getValueFormat(n)}:null};function Cn(e){return e[oe.color]}function hs(e){return e[oe.alpha]}function ps(e){return e[oe.size]}function ys(e){return e[oe.strokeWidth]}function gs(e){return e[oe.lineType]}var jn=e=>{const t=X(e),r=$(e),n=Y(e),a=G(e);if(t===null||r===null||n===null||a===null)return null;const i=Math.min(t,r),o=Math.abs(r-t),s=Math.max(n,a),l=Math.abs(a-n);return{x:i,y:1-s,width:o,height:l}},Nn=e=>{const t=jn(e);if(!t)return null;const r=t.width*Lo,n=t.height*wo;return{x:t.x+r,y:t.y+n,width:t.width-r*2,height:t.height-n*2}},Bn=e=>!!Cn(e),Vn=e=>Bn(e)?Nn(e):null,rr=4,ms=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const r=e.styleReaders;for(const n of e.layer.data){const a=Vn(n);if(a===null)continue;const i=e.formatLabel(n);if(i==="")continue;const{width:o,height:s}=e.measureDataLabel("observation","inside",i),l=a.width*e.panelRect.width,u=a.height*e.panelRect.height;o+rr>l||s+rr>u||t.push({layerId:e.layer.id,x:(a.x+a.width/2)*e.panelRect.width,y:(a.y+a.height/2)*e.panelRect.height,text:i,width:o,height:s,rotated:!1,role:"observation",position:"inside",backdropColor:Ve(r,n)})}return{labels:t,droppedCount:0}},bs=e=>{const t=L(e.color);return t!==null?{variable:t}:null},vs=class extends q{constructor(...e){super(...e),this.type="tile",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:8,strokeWidth:0},hovered:{stroke:f("hoverAffordance"),strokeWidth:2}}},this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"x",role:"min",valueKind:"value"},{axis:"x",role:"max",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value"}],this.supportedPositions=["identity"],this.supportedCoordTypes=["cartesian"],this.aesthetics=[{kind:"visual",name:"color",required:!0}],this.scaleConstraints={requireMainAxisBands:!0,requireCrossAxisBands:!0,bandPadding:0,inferColorScale:!0},this.grid={cartesian:{hideGridX:!0,hideGridY:!0}},this.legend={suppressWhenSingleItem:!1},this.dataLabels={cartesian:{showDataLabels:!0}},this.dataLabelCoordTypes=["cartesian"],this.highlightStrategy="observation-rerender",this.spatialKind="cells",this.identityKey="x-y",this.tooltip=[{aes:"color"}],this.resolveValueSource=bs,this.resolveAnchorPosition=t=>{const r=X(t),n=$(t),a=Y(t),i=G(t);return r===null||n===null||a===null||i===null?null:{x:(r+n)/2,y:(a+i)/2}},this.getDataLabelPlacements=t=>ms(t)}compile({data:e}){return{data:e.addConstantVariable(y.xMin,"numeric",-.5).addConstantVariable(y.xMax,"numeric",.5).addConstantVariable(y.yMin,"numeric",-.5).addConstantVariable(y.yMax,"numeric",.5),mapping:{}}}},Fn=[new ns,new ds,new ls,new _o,new fs,new vs],As=class extends Et{constructor(){super("geom");for(const e of Fn)this.register(e.type,e)}},Wn=class{resolveComputedVariables(e,t){return this.computedVariables}compute(e){return this.computeStat(e)}},Ts=class{constructor(){this.transformType="aggregate"}apply(e,t){const{options:r}=t,n={};for(const a of r.operations)n[a.as]={variableName:a.variableName,aggregation:a.op};return e.groupBy(...r.groupby).rollup(n)}},Es={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},Ps=class{constructor(){this.transformType="constant"}apply(e,t){const{options:r}=t,n=pt(r.value,Es[r.type],Se);if(r.value!==null&&n===null)throw new ae({code:"INCOMPATIBLE_TYPE",message:`Constant '${r.variableName}' cannot be read as ${r.type}`,context:{variableName:r.variableName,variableType:r.type}});return e.addConstantVariable(r.variableName,r.type,n)}getIntroducedVariables(e){const{options:t}=e;return[t.variableName]}},Os=class{constructor(){this.transformType="filter"}apply(e,t){const{options:r}=t;return e.filter(r.variableName,r.operator,r.value)}},Ss=class{constructor(){this.transformType="reshape"}apply(e,t){const{options:r}=t;return e.reshapeFromWideToLong({keep:r.keep,reshape:r.reshape,keyName:r.keyName,valueName:r.valueName})}getIntroducedVariables(e){const{options:t}=e;return[t.keyName??"key"]}},xs=class{constructor(){this.transformType="sort"}apply(e,t){const{options:r}=t;return e.orderBy(r.variableName,r.direction??"asc")}},Ms=[new Ts,new Ps,new Os,new Ss,new xs],_s=class extends Et{constructor(){super("transform");for(const e of Ms)this.register(e.transformType,e)}};function Un(e){if("definition"in e)return e.definition;if(Yn(e)||Gn(e)||Kn(e))return e}function Rs(e){const t=[],r=[],n=[];for(const a of e){const i=Un(a);i&&(Yn(i)?(t.push(i),i.defaultStat!==null&&r.push(i.defaultStat)):Gn(i)?r.push(i):Kn(i)&&n.push(i))}return{geoms:t,stats:r,transforms:n,warnings:[...Xe("geom",t,a=>a.type),...Xe("stat",r,a=>a.type),...Xe("transform",n,a=>a.transformType),...Ls(t),...ws(t),...Is(t)]}}function Ls(e){const t=[];for(const r of e)r.spatialKind==="render-hit-test"&&(r.identityKey!=="x-group"&&r.identityKey!=="x-y"||t.push({code:"RENDER_HIT_TEST_IDENTITY",message:`The render-hit-test geom '${r.type}' uses the position-derived '${r.identityKey}' identity, which has no meaning for render-owned geometry; its hover lookup will be empty.`,context:{kind:"geom",requested:r.type},suggestion:"Declare 'identityKey' as a column the geom owns (`{ variable: '<column>' }`) or 'index', so a hit-test result resolves to an observation."}));return t}function ws(e){const t=[];for(const r of e)r.spatialKind!=="cells"||!r.supportedCoordTypes.includes("polar")||t.push({code:"SPATIAL_KIND_COORD_UNSUPPORTED",message:`The geom '${r.type}' declares polar support, but its 'cells' hit-test shape has no polar projection; its observations will not respond to hover under polar coords.`,context:{kind:"geom",requested:r.type},suggestion:"Drop 'polar' from 'supportedCoordTypes', or declare 'rects' as the spatial kind so a bandless polar layer hit-tests as an enclosure."});return t}function Is(e){return e.filter(t=>t.categorySpanAxes.some(r=>r!=="x")).map(t=>({code:"UNSUPPORTED_CATEGORY_SPAN_AXIS",message:`The geom '${t.type}' spans categories on 'y', which is not supported yet; 'y' is read as a position.`,context:{kind:"geom",requested:t.type},suggestion:"Declare 'categorySpanAxes' as ['x'], and use coord.flip() to run the categories vertically."}))}function Xe(e,t,r){const n=new Map;for(const i of t){const o=r(i),s=n.get(o);s?s.add(i):n.set(o,new Set([i]))}const a=[];for(const[i,o]of n)o.size<2||a.push({code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple plugins register the ${e} '${i}' (${o.size} definitions); the last in the array wins.`,context:{kind:e,requested:i},suggestion:`Remove the duplicate ${e} plugin(s) named '${i}', or rename them so each registers a distinct ${e}.`});return a}var Yn=e=>e instanceof q,Gn=e=>e instanceof Wn,Kn=e=>"transformType"in e&&typeof e.apply=="function",ks=["rgb","lab","hcl","hsl"];function Ds(e,t={}){const r=t;return{type:"scale",scaledAesthetic:e,scaleType:"continuous",transform:t.transform,reverse:t.reverse,nice:t.nice,clamp:t.clamp,domainMin:t.domainMin??null,domainMax:t.domainMax??null,range:t.range,interpolate:r.interpolate,domainMid:r.domainMid??null,symmetric:r.symmetric}}function Cs(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"datetime",domainMin:t.domainMin??null,domainMax:t.domainMax??null,nice:t.nice,reverse:t.reverse,clamp:t.clamp}}function js(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"discrete",range:t.range,domain:t.domain??null,padding:t.padding,reverse:t.reverse}}function Ns(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"identity"}}function Bs(e,t){return{type:"scale",scaledAesthetic:e,scaleType:"inferred",options:t}}var Vs={labelCrossPosition:.5},Fs={kind:"rectangle",zOrder:"foreground"},Ws={zOrder:"foreground",fit:"contain"},Us={x:8,y:8,unit:"px"},Ys={align:"center"},Gs={startArrowheadStyle:"none",endArrowheadStyle:"line-arrow"},Ks={thin:2,medium:4,thick:8},zs=.5,Hs={strokeWidth:2,shadow:{offsetX:0,offsetY:1.15,blur:1.15,color:"rgba(0, 0, 0, 0.16)"}},Xs={small:{arrow:{strokeWidth:2},label:{fontSize:12,fontWeight:500,paddingInline:6,paddingBlock:3,strokeWidth:1}},medium:{arrow:{strokeWidth:3},label:{fontSize:16,fontWeight:500,paddingInline:8,paddingBlock:4,strokeWidth:1.5}},large:{arrow:{strokeWidth:5},label:{fontSize:20,fontWeight:600,paddingInline:10,paddingBlock:5,strokeWidth:2}}},$s={differenceArrow:"differenceArrows",shape:"shapes",arrow:"arrows",text:"textAnnotations",image:"images",sticker:"stickers",pinnedNumber:"pinnedNumbers",comment:"comments"},qs={differenceArrow(e){return{type:"annotation",kind:"differenceArrow",annotation:e}},shape(e){return{type:"annotation",kind:"shape",annotation:e}},arrow(e){return{type:"annotation",kind:"arrow",annotation:e}},text(e){return{type:"annotation",kind:"text",annotation:e}},image(e){return{type:"annotation",kind:"image",annotation:e}},sticker(e){return{type:"annotation",kind:"sticker",annotation:e}},pinnedNumber(e){return{type:"annotation",kind:"pinnedNumber",annotation:e}},comment(e){return{type:"annotation",kind:"comment",annotation:e}}};Object.defineProperty(exports,"ANNOTATION_BUCKETS",{enumerable:!0,get:function(){return $s}});Object.defineProperty(exports,"ARROW_DEFAULTS",{enumerable:!0,get:function(){return Gs}});Object.defineProperty(exports,"ARROW_STICKER_DECLARATIONS",{enumerable:!0,get:function(){return Hs}});Object.defineProperty(exports,"ARROW_STROKE_WIDTHS_PX",{enumerable:!0,get:function(){return Ks}});Object.defineProperty(exports,"AXIS_KEYS",{enumerable:!0,get:function(){return xi}});Object.defineProperty(exports,"BAR_GROUP_SCALE_PADDING_FRACTION",{enumerable:!0,get:function(){return Ro}});Object.defineProperty(exports,"BAR_WIDTH_FRACTION",{enumerable:!0,get:function(){return On}});Object.defineProperty(exports,"BORDER_RADIUS_PX",{enumerable:!0,get:function(){return xn}});Object.defineProperty(exports,"BORDER_RADIUS_TOKENS",{enumerable:!0,get:function(){return yt}});Object.defineProperty(exports,"BRICK_TONES",{enumerable:!0,get:function(){return Je}});Object.defineProperty(exports,"BRICK_TONES_BY_COUNT",{enumerable:!0,get:function(){return $i}});Object.defineProperty(exports,"BUILT_IN_GEOMS",{enumerable:!0,get:function(){return Fn}});Object.defineProperty(exports,"COLOR_INTERPOLATION_SPACES",{enumerable:!0,get:function(){return ks}});Object.defineProperty(exports,"CONSTANT_VARIABLES",{enumerable:!0,get:function(){return st}});Object.defineProperty(exports,"ChronologicalDateManager",{enumerable:!0,get:function(){return Sr}});Object.defineProperty(exports,"DASH_PRESETS",{enumerable:!0,get:function(){return C}});Object.defineProperty(exports,"DEFAULT_BAR_CORNER_RADIUS",{enumerable:!0,get:function(){return Zi}});Object.defineProperty(exports,"DEFAULT_COLOR_PALETTE",{enumerable:!0,get:function(){return yn}});Object.defineProperty(exports,"DEFAULT_DIMMED_ALPHA",{enumerable:!0,get:function(){return mn}});Object.defineProperty(exports,"DEFAULT_DIVERGING_RAMP",{enumerable:!0,get:function(){return Xi}});Object.defineProperty(exports,"DEFAULT_GEOM_COLOR",{enumerable:!0,get:function(){return Ji}});Object.defineProperty(exports,"DEFAULT_GRAPH_BACKGROUND",{enumerable:!0,get:function(){return ro}});Object.defineProperty(exports,"DEFAULT_GRAPH_BORDER_WIDTH_PX",{enumerable:!0,get:function(){return ao}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_EDGES_PX",{enumerable:!0,get:function(){return oo}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_PX",{enumerable:!0,get:function(){return io}});Object.defineProperty(exports,"DEFAULT_HEADLINE_SWATCH_SIZE_PX",{enumerable:!0,get:function(){return to}});Object.defineProperty(exports,"DEFAULT_HOVER_AFFORDANCE_COLOR",{enumerable:!0,get:function(){return no}});Object.defineProperty(exports,"DEFAULT_LOCALE",{enumerable:!0,get:function(){return Se}});Object.defineProperty(exports,"DEFAULT_POINT_SIZE_PX",{enumerable:!0,get:function(){return eo}});Object.defineProperty(exports,"DEFAULT_RESHAPE_VALUE_NAME",{enumerable:!0,get:function(){return dn}});Object.defineProperty(exports,"DEFAULT_SEQUENTIAL_RAMP",{enumerable:!0,get:function(){return Hi}});Object.defineProperty(exports,"DEFAULT_STROKE_WIDTH_PX",{enumerable:!0,get:function(){return Qi}});Object.defineProperty(exports,"DIFFERENCE_ARROW_DEFAULTS",{enumerable:!0,get:function(){return Vs}});Object.defineProperty(exports,"DIFFERENCE_ARROW_SIZE_DECLARATIONS",{enumerable:!0,get:function(){return Xs}});Object.defineProperty(exports,"DataCompiler",{enumerable:!0,get:function(){return Ui}});Object.defineProperty(exports,"Dataset",{enumerable:!0,get:function(){return te}});Object.defineProperty(exports,"GEOM_EFFECTS_VOCABULARY",{enumerable:!0,get:function(){return bn}});Object.defineProperty(exports,"GROUP_VARIABLES",{enumerable:!0,get:function(){return we}});Object.defineProperty(exports,"Geom",{enumerable:!0,get:function(){return q}});Object.defineProperty(exports,"GeomRegistry",{enumerable:!0,get:function(){return As}});Object.defineProperty(exports,"IMAGE_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return Ws}});Object.defineProperty(exports,"IS_DEV",{enumerable:!0,get:function(){return ee}});Object.defineProperty(exports,"InternalError",{enumerable:!0,get:function(){return R}});Object.defineProperty(exports,"LAYER_LABEL_VARIABLES",{enumerable:!0,get:function(){return da}});Object.defineProperty(exports,"LINE_TYPES",{enumerable:!0,get:function(){return Tr}});Object.defineProperty(exports,"POLAR_RIM_LABEL_GAP_PX",{enumerable:!0,get:function(){return ia}});Object.defineProperty(exports,"POSITION_ADJUSTMENTS",{enumerable:!0,get:function(){return Ar}});Object.defineProperty(exports,"POSITION_NUMERIC_ROLES",{enumerable:!0,get:function(){return vi}});Object.defineProperty(exports,"POSITION_VARIABLES",{enumerable:!0,get:function(){return y}});Object.defineProperty(exports,"Registry",{enumerable:!0,get:function(){return Et}});Object.defineProperty(exports,"SCALED_POSITION_AESTHETIC_KEYS",{enumerable:!0,get:function(){return an}});Object.defineProperty(exports,"SCALED_VISUAL_AESTHETIC_KEYS",{enumerable:!0,get:function(){return vt}});Object.defineProperty(exports,"SELECTION_PADDING_DEFAULT",{enumerable:!0,get:function(){return Us}});Object.defineProperty(exports,"SHAPE_DEFAULTS",{enumerable:!0,get:function(){return Fs}});Object.defineProperty(exports,"STACK_VARIABLES",{enumerable:!0,get:function(){return ut}});Object.defineProperty(exports,"STAT_VARIABLES",{enumerable:!0,get:function(){return lt}});Object.defineProperty(exports,"STYLE_BLEND_MODES",{enumerable:!0,get:function(){return Jr}});Object.defineProperty(exports,"STYLE_COORDS",{enumerable:!0,get:function(){return qi}});Object.defineProperty(exports,"STYLE_DOMAINS",{enumerable:!0,get:function(){return pi}});Object.defineProperty(exports,"STYLE_FONT_STYLES",{enumerable:!0,get:function(){return zr}});Object.defineProperty(exports,"STYLE_IMAGE_FITS",{enumerable:!0,get:function(){return ar}});Object.defineProperty(exports,"STYLE_LINE_CAPS",{enumerable:!0,get:function(){return $r}});Object.defineProperty(exports,"STYLE_LINE_JOINS",{enumerable:!0,get:function(){return qr}});Object.defineProperty(exports,"STYLE_PATTERN_PRESETS",{enumerable:!0,get:function(){return nr}});Object.defineProperty(exports,"STYLE_POINT_SYMBOLS",{enumerable:!0,get:function(){return Zr}});Object.defineProperty(exports,"STYLE_PROPERTY_NAMES",{enumerable:!0,get:function(){return ui}});Object.defineProperty(exports,"STYLE_SELECT_KEYS",{enumerable:!0,get:function(){return gn}});Object.defineProperty(exports,"STYLE_STATES",{enumerable:!0,get:function(){return li}});Object.defineProperty(exports,"STYLE_TARGETS",{enumerable:!0,get:function(){return Be}});Object.defineProperty(exports,"STYLE_TEXT_DECORATIONS",{enumerable:!0,get:function(){return Xr}});Object.defineProperty(exports,"STYLE_TEXT_TRANSFORMS",{enumerable:!0,get:function(){return Hr}});Object.defineProperty(exports,"SUFFIX_MULTIPLIERS",{enumerable:!0,get:function(){return xr}});Object.defineProperty(exports,"Stage",{enumerable:!0,get:function(){return nn}});Object.defineProperty(exports,"Stat",{enumerable:!0,get:function(){return Wn}});Object.defineProperty(exports,"TAU",{enumerable:!0,get:function(){return W}});Object.defineProperty(exports,"TEXT_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return Ys}});Object.defineProperty(exports,"TEXT_ANNOTATION_FADE_ALPHA",{enumerable:!0,get:function(){return zs}});Object.defineProperty(exports,"TransformRegistry",{enumerable:!0,get:function(){return _s}});Object.defineProperty(exports,"UserInputError",{enumerable:!0,get:function(){return ae}});Object.defineProperty(exports,"VISUAL_VARIABLES",{enumerable:!0,get:function(){return oe}});Object.defineProperty(exports,"VizError",{enumerable:!0,get:function(){return dt}});Object.defineProperty(exports,"alignToBoxPoint",{enumerable:!0,get:function(){return ct}});Object.defineProperty(exports,"alignUnitFractions",{enumerable:!0,get:function(){return va}});Object.defineProperty(exports,"annotation",{enumerable:!0,get:function(){return qs}});Object.defineProperty(exports,"areDataValuesEqual",{enumerable:!0,get:function(){return Aa}});Object.defineProperty(exports,"areMappingsEquivalent",{enumerable:!0,get:function(){return xa}});Object.defineProperty(exports,"buildBarRectBounds",{enumerable:!0,get:function(){return St}});Object.defineProperty(exports,"buildColumnKey",{enumerable:!0,get:function(){return et}});Object.defineProperty(exports,"buildLayerSpec",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"buildPanelAnchorBox",{enumerable:!0,get:function(){return pe}});Object.defineProperty(exports,"compositeColor",{enumerable:!0,get:function(){return sr}});Object.defineProperty(exports,"continuous",{enumerable:!0,get:function(){return Ds}});Object.defineProperty(exports,"createBarBoundsReader",{enumerable:!0,get:function(){return Rn}});Object.defineProperty(exports,"createGeomStyleNode",{enumerable:!0,get:function(){return Ao}});Object.defineProperty(exports,"createPerKeyMemo",{enumerable:!0,get:function(){return tn}});Object.defineProperty(exports,"createSingleSlotMemo",{enumerable:!0,get:function(){return mi}});Object.defineProperty(exports,"cursorToPiePlane",{enumerable:!0,get:function(){return pr}});Object.defineProperty(exports,"cursorToPolar",{enumerable:!0,get:function(){return ca}});Object.defineProperty(exports,"datetime",{enumerable:!0,get:function(){return Cs}});Object.defineProperty(exports,"defineGeomStyleTarget",{enumerable:!0,get:function(){return bo}});Object.defineProperty(exports,"deriveDeclaredAesthetics",{enumerable:!0,get:function(){return Ei}});Object.defineProperty(exports,"deriveGeomRequiredAesthetics",{enumerable:!0,get:function(){return Oi}});Object.defineProperty(exports,"discrete",{enumerable:!0,get:function(){return js}});Object.defineProperty(exports,"ensureReadableTextColor",{enumerable:!0,get:function(){return Qn}});Object.defineProperty(exports,"fillIntervalAesthetics",{enumerable:!0,get:function(){return Pi}});Object.defineProperty(exports,"findStyleTarget",{enumerable:!0,get:function(){return mo}});Object.defineProperty(exports,"freezeWalkedEntries",{enumerable:!0,get:function(){return go}});Object.defineProperty(exports,"geom",{enumerable:!0,get:function(){return ei}});Object.defineProperty(exports,"getAestheticFromScaleAestheticKey",{enumerable:!0,get:function(){return Ri}});Object.defineProperty(exports,"getAlpha",{enumerable:!0,get:function(){return hs}});Object.defineProperty(exports,"getAngleExtent",{enumerable:!0,get:function(){return kn}});Object.defineProperty(exports,"getBarRectBounds",{enumerable:!0,get:function(){return Qe}});Object.defineProperty(exports,"getBoundingRect",{enumerable:!0,get:function(){return Do}});Object.defineProperty(exports,"getColor",{enumerable:!0,get:function(){return Cn}});Object.defineProperty(exports,"getGroupVariables",{enumerable:!0,get:function(){return ln}});Object.defineProperty(exports,"getInsetTileRect",{enumerable:!0,get:function(){return Nn}});Object.defineProperty(exports,"getLineType",{enumerable:!0,get:function(){return gs}});Object.defineProperty(exports,"getPaintedTileRect",{enumerable:!0,get:function(){return Vn}});Object.defineProperty(exports,"getRadiusExtent",{enumerable:!0,get:function(){return Dn}});Object.defineProperty(exports,"getScaledAesthetic",{enumerable:!0,get:function(){return ma}});Object.defineProperty(exports,"getSize",{enumerable:!0,get:function(){return ps}});Object.defineProperty(exports,"getStableKey",{enumerable:!0,get:function(){return Ie}});Object.defineProperty(exports,"getStackRole",{enumerable:!0,get:function(){return Sn}});Object.defineProperty(exports,"getStrokeWidth",{enumerable:!0,get:function(){return ys}});Object.defineProperty(exports,"getTileRectBounds",{enumerable:!0,get:function(){return jn}});Object.defineProperty(exports,"getX",{enumerable:!0,get:function(){return H}});Object.defineProperty(exports,"getXBand",{enumerable:!0,get:function(){return ya}});Object.defineProperty(exports,"getXMax",{enumerable:!0,get:function(){return $}});Object.defineProperty(exports,"getXMin",{enumerable:!0,get:function(){return X}});Object.defineProperty(exports,"getY",{enumerable:!0,get:function(){return U}});Object.defineProperty(exports,"getYBand",{enumerable:!0,get:function(){return ga}});Object.defineProperty(exports,"getYMax",{enumerable:!0,get:function(){return G}});Object.defineProperty(exports,"getYMin",{enumerable:!0,get:function(){return Y}});Object.defineProperty(exports,"getYRaw",{enumerable:!0,get:function(){return mr}});Object.defineProperty(exports,"hasMultipleGroups",{enumerable:!0,get:function(){return Tt}});Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return Ns}});Object.defineProperty(exports,"inferXVariable",{enumerable:!0,get:function(){return Pa}});Object.defineProperty(exports,"inferred",{enumerable:!0,get:function(){return Bs}});Object.defineProperty(exports,"isAngleWithinArc",{enumerable:!0,get:function(){return cr}});Object.defineProperty(exports,"isBorderRadiusToken",{enumerable:!0,get:function(){return Kr}});Object.defineProperty(exports,"isCategoricalValueFormat",{enumerable:!0,get:function(){return Er}});Object.defineProperty(exports,"isCompilerCachingEnabled",{enumerable:!0,get:function(){return gi}});Object.defineProperty(exports,"isCurrencyValueFormat",{enumerable:!0,get:function(){return _a}});Object.defineProperty(exports,"isDateWithoutYearValueFormat",{enumerable:!0,get:function(){return Ra}});Object.defineProperty(exports,"isDefined",{enumerable:!0,get:function(){return j}});Object.defineProperty(exports,"isFullTurnSweep",{enumerable:!0,get:function(){return ur}});Object.defineProperty(exports,"isGradientPaint",{enumerable:!0,get:function(){return ke}});Object.defineProperty(exports,"isImagePaint",{enumerable:!0,get:function(){return it}});Object.defineProperty(exports,"isInternalVariable",{enumerable:!0,get:function(){return ha}});Object.defineProperty(exports,"isLightDarkColor",{enumerable:!0,get:function(){return xe}});Object.defineProperty(exports,"isLineType",{enumerable:!0,get:function(){return Ma}});Object.defineProperty(exports,"isLookupValueFormat",{enumerable:!0,get:function(){return ft}});Object.defineProperty(exports,"isNonEmptyArray",{enumerable:!0,get:function(){return Ta}});Object.defineProperty(exports,"isNumericDataValue",{enumerable:!0,get:function(){return aa}});Object.defineProperty(exports,"isNumericValueFormat",{enumerable:!0,get:function(){return Pr}});Object.defineProperty(exports,"isOpaquePaint",{enumerable:!0,get:function(){return ta}});Object.defineProperty(exports,"isPatternPaint",{enumerable:!0,get:function(){return De}});Object.defineProperty(exports,"isPlainObject",{enumerable:!0,get:function(){return Ea}});Object.defineProperty(exports,"isPointWithinPanel",{enumerable:!0,get:function(){return Ne}});Object.defineProperty(exports,"isPositionScale",{enumerable:!0,get:function(){return on}});Object.defineProperty(exports,"isScaledAestheticKey",{enumerable:!0,get:function(){return Mi}});Object.defineProperty(exports,"isStackedPosition",{enumerable:!0,get:function(){return de}});Object.defineProperty(exports,"isStrictCategoricalDataValue",{enumerable:!0,get:function(){return na}});Object.defineProperty(exports,"isStrictNumericDataValue",{enumerable:!0,get:function(){return M}});Object.defineProperty(exports,"isStrictTemporalDataValue",{enumerable:!0,get:function(){return Le}});Object.defineProperty(exports,"isStyleTokenRef",{enumerable:!0,get:function(){return gt}});Object.defineProperty(exports,"isTemporalDataValue",{enumerable:!0,get:function(){return ra}});Object.defineProperty(exports,"isTemporalValueFormat",{enumerable:!0,get:function(){return he}});Object.defineProperty(exports,"isTilePainted",{enumerable:!0,get:function(){return Bn}});Object.defineProperty(exports,"isUsableTokenValue",{enumerable:!0,get:function(){return Qr}});Object.defineProperty(exports,"isVisualScale",{enumerable:!0,get:function(){return sn}});Object.defineProperty(exports,"measureSignedAngularDelta",{enumerable:!0,get:function(){return la}});Object.defineProperty(exports,"normalizeAngle",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"paintKey",{enumerable:!0,get:function(){return Jn}});Object.defineProperty(exports,"parseAddressingValue",{enumerable:!0,get:function(){return pt}});Object.defineProperty(exports,"parseDataset",{enumerable:!0,get:function(){return pn}});Object.defineProperty(exports,"pickReadableTextColor",{enumerable:!0,get:function(){return or}});Object.defineProperty(exports,"polarSectorToInscribedSquare",{enumerable:!0,get:function(){return fr}});Object.defineProperty(exports,"polarToUnit",{enumerable:!0,get:function(){return dr}});Object.defineProperty(exports,"positionToAngle",{enumerable:!0,get:function(){return ua}});Object.defineProperty(exports,"prefixInternalVariable",{enumerable:!0,get:function(){return b}});Object.defineProperty(exports,"quantizeKey",{enumerable:!0,get:function(){return Ae}});Object.defineProperty(exports,"readBackdropColor",{enumerable:!0,get:function(){return Ve}});Object.defineProperty(exports,"readConstantValue",{enumerable:!0,get:function(){return Pe}});Object.defineProperty(exports,"readDataValueKey",{enumerable:!0,get:function(){return vr}});Object.defineProperty(exports,"readFoldKeepVariables",{enumerable:!0,get:function(){return Oa}});Object.defineProperty(exports,"readISOInstant",{enumerable:!0,get:function(){return Dr}});Object.defineProperty(exports,"readMainAxisVariable",{enumerable:!0,get:function(){return Sa}});Object.defineProperty(exports,"readObservationBox",{enumerable:!0,get:function(){return br}});Object.defineProperty(exports,"readObservationVocabulary",{enumerable:!0,get:function(){return Pn}});Object.defineProperty(exports,"readPlugins",{enumerable:!0,get:function(){return Rs}});Object.defineProperty(exports,"readVariableName",{enumerable:!0,get:function(){return L}});Object.defineProperty(exports,"removeAlpha",{enumerable:!0,get:function(){return ea}});Object.defineProperty(exports,"resolveAnchoredLabelCenter",{enumerable:!0,get:function(){return ye}});Object.defineProperty(exports,"resolveBarBandFraction",{enumerable:!0,get:function(){return nt}});Object.defineProperty(exports,"resolveBarBaseline",{enumerable:!0,get:function(){return Ln}});Object.defineProperty(exports,"resolveBarBorderTreatment",{enumerable:!0,get:function(){return ko}});Object.defineProperty(exports,"resolveBarCornerRadiiPx",{enumerable:!0,get:function(){return Io}});Object.defineProperty(exports,"resolveBarCornerRadiusPx",{enumerable:!0,get:function(){return _n}});Object.defineProperty(exports,"resolveBarPaintOrigin",{enumerable:!0,get:function(){return Co}});Object.defineProperty(exports,"resolveColorScheme",{enumerable:!0,get:function(){return $e}});Object.defineProperty(exports,"resolveDefinition",{enumerable:!0,get:function(){return Un}});Object.defineProperty(exports,"resolveGeomCornerRadiusPx",{enumerable:!0,get:function(){return Mn}});Object.defineProperty(exports,"resolvePositionScaleAesthetic",{enumerable:!0,get:function(){return _i}});Object.defineProperty(exports,"resolveScaledAestheticVariable",{enumerable:!0,get:function(){return gr}});Object.defineProperty(exports,"resolveYScaleAesthetic",{enumerable:!0,get:function(){return At}});Object.defineProperty(exports,"setCompilerCachingEnabled",{enumerable:!0,get:function(){return yi}});Object.defineProperty(exports,"spansCategoriesOnX",{enumerable:!0,get:function(){return Si}});Object.defineProperty(exports,"sumMemoStats",{enumerable:!0,get:function(){return bi}});Object.defineProperty(exports,"toExplicitValueFormat",{enumerable:!0,get:function(){return La}});Object.defineProperty(exports,"toPaintColor",{enumerable:!0,get:function(){return ir}});Object.defineProperty(exports,"token",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"unitToPolar",{enumerable:!0,get:function(){return hr}});Object.defineProperty(exports,"walkStyleTargets",{enumerable:!0,get:function(){return yo}});Object.defineProperty(exports,"withAlpha",{enumerable:!0,get:function(){return lr}});Object.defineProperty(exports,"wrappedAngularDistance",{enumerable:!0,get:function(){return ot}});