streamlit-nightly 1.42.3.dev20250227__py2.py3-none-any.whl → 1.42.3.dev20250228__py2.py3-none-any.whl

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.
Files changed (81) hide show
  1. streamlit/elements/arrow.py +6 -5
  2. streamlit/elements/lib/column_types.py +101 -70
  3. streamlit/elements/widgets/button.py +13 -2
  4. streamlit/elements/widgets/data_editor.py +6 -5
  5. streamlit/elements/widgets/number_input.py +3 -2
  6. streamlit/elements/widgets/slider.py +11 -3
  7. streamlit/runtime/context.py +47 -2
  8. streamlit/static/index.html +1 -1
  9. streamlit/static/static/js/{FileDownload.esm.rdZtCw5-.js → FileDownload.esm.BjRCwIvW.js} +1 -1
  10. streamlit/static/static/js/{FileHelper.BztOEKJy.js → FileHelper.CGrcmoNK.js} +1 -1
  11. streamlit/static/static/js/{FormClearHelper.Drd1fMJc.js → FormClearHelper.CyjIZnZM.js} +1 -1
  12. streamlit/static/static/js/{Hooks.DWd0hyk4.js → Hooks.-DbiQ7Am.js} +1 -1
  13. streamlit/static/static/js/{InputInstructions.B7xrWTG0.js → InputInstructions.CV_L9pmm.js} +1 -1
  14. streamlit/static/static/js/{ProgressBar.CBgJiTH-.js → ProgressBar.BMUfDSdU.js} +1 -1
  15. streamlit/static/static/js/{RenderInPortalIfExists.US28tQOn.js → RenderInPortalIfExists.DBak2tzf.js} +1 -1
  16. streamlit/static/static/js/{Toolbar.CAOt-xaL.js → Toolbar.BpCHhFl7.js} +1 -1
  17. streamlit/static/static/js/{base-input.CauNaJqr.js → base-input.B4K7gn3m.js} +1 -1
  18. streamlit/static/static/js/{checkbox.ChzWCtre.js → checkbox.CAX7YHDZ.js} +1 -1
  19. streamlit/static/static/js/{createSuper.D_39RJB6.js → createSuper.D9gT0sOi.js} +1 -1
  20. streamlit/static/static/js/{data-grid-overlay-editor.rIelkOVS.js → data-grid-overlay-editor.gLdGVwGm.js} +1 -1
  21. streamlit/static/static/js/{downloader.Dz5I28nG.js → downloader.DcsU6eyn.js} +1 -1
  22. streamlit/static/static/js/{es6.DwnEjMMn.js → es6.dTL0Du7U.js} +2 -2
  23. streamlit/static/static/js/{iframeResizer.contentWindow.BRiRifwd.js → iframeResizer.contentWindow.flH1YmDM.js} +1 -1
  24. streamlit/static/static/js/{index.D9rv1PQ0.js → index.-WtL21xT.js} +1 -1
  25. streamlit/static/static/js/{index.BWeYb5ES.js → index.B0VH6CCN.js} +1 -1
  26. streamlit/static/static/js/{index.pvQjxG7y.js → index.B6RoN18x.js} +1 -1
  27. streamlit/static/static/js/{index.DkgVNhWs.js → index.B7TcBuqC.js} +1 -1
  28. streamlit/static/static/js/{index.CM12P2T1.js → index.BCg2ff_8.js} +2 -2
  29. streamlit/static/static/js/{index.CUz1_nAm.js → index.BFxZ-0WR.js} +1 -1
  30. streamlit/static/static/js/{index.CO3dZWKG.js → index.BJIOzTyr.js} +1 -1
  31. streamlit/static/static/js/{index.Dzp8iBkF.js → index.BMUI3dle.js} +1 -1
  32. streamlit/static/static/js/{index.DfNAkKAr.js → index.BUNYdCvS.js} +8 -8
  33. streamlit/static/static/js/{index.DWFLx6Tc.js → index.BV2qQuMO.js} +5 -5
  34. streamlit/static/static/js/{index.D1K6NCBQ.js → index.BX8IgiDA.js} +1 -1
  35. streamlit/static/static/js/{index.DYUhWSq6.js → index.BYdIAAme.js} +1 -1
  36. streamlit/static/static/js/{index.CoUzNoRf.js → index.BzXJd4o6.js} +1 -1
  37. streamlit/static/static/js/{index.aL_kqyvR.js → index.BzxT1LSG.js} +1 -1
  38. streamlit/static/static/js/{index.CmYiLKNX.js → index.CHfW08Eb.js} +1 -1
  39. streamlit/static/static/js/{index.BUdhIGhT.js → index.CWFsehBI.js} +1 -1
  40. streamlit/static/static/js/{index.LL2DLZZA.js → index.C_m4U-ik.js} +2 -2
  41. streamlit/static/static/js/{index.ORHz8Y8P.js → index.CgbCWpVz.js} +8 -8
  42. streamlit/static/static/js/{index.V3Vj2d9m.js → index.ChXmN16b.js} +1 -1
  43. streamlit/static/static/js/{index.YNWoT4uW.js → index.D-_iawK3.js} +1 -1
  44. streamlit/static/static/js/{index.C_C365T5.js → index.D7qPBPzh.js} +1 -1
  45. streamlit/static/static/js/{index.fP6rBxlc.js → index.D9Gtya_A.js} +1 -1
  46. streamlit/static/static/js/{index.DJvwxFLn.js → index.D9jWe5tN.js} +1 -1
  47. streamlit/static/static/js/{index.Db3jGJxa.js → index.DB-0Yu8-.js} +1 -1
  48. streamlit/static/static/js/{index.D2xM-XzG.js → index.DGu65w1V.js} +3 -3
  49. streamlit/static/static/js/index.DIHkG0HG.js +12 -0
  50. streamlit/static/static/js/{index.CBre8Aui.js → index.DIgKi8Bp.js} +1 -1
  51. streamlit/static/static/js/{index.BrAW6bFJ.js → index.DbiiV9to.js} +1 -1
  52. streamlit/static/static/js/{index.DgNQKEeQ.js → index.DgSb0EiE.js} +1 -1
  53. streamlit/static/static/js/{index.Ct7MPsA3.js → index.DkoFwjhv.js} +1 -1
  54. streamlit/static/static/js/{index.wxpL02VY.js → index.DwAnNzqz.js} +1 -1
  55. streamlit/static/static/js/{index.DIeegLbv.js → index.PrjikacM.js} +1 -1
  56. streamlit/static/static/js/{index.Dj91melR.js → index.QEh4WZkI.js} +1 -1
  57. streamlit/static/static/js/{index.CAHGh74D.js → index.iqovFu7V.js} +1 -1
  58. streamlit/static/static/js/{index.DkKZlAsv.js → index.mRpR0u1n.js} +1 -1
  59. streamlit/static/static/js/{index.BE6MTF-B.js → index.u-XgtJxJ.js} +3 -3
  60. streamlit/static/static/js/{index.DKuQg2D4.js → index.y-qJHV46.js} +1 -1
  61. streamlit/static/static/js/{input.D_dn5-2t.js → input.DqgaXn2o.js} +1 -1
  62. streamlit/static/static/js/{memory.pnMTtWQR.js → memory.DszNDPLb.js} +1 -1
  63. streamlit/static/static/js/{mergeWith.CRrYodeI.js → mergeWith.DFTSkXIf.js} +1 -1
  64. streamlit/static/static/js/{number-overlay-editor.C65GBS2P.js → number-overlay-editor.C8_ha9YJ.js} +1 -1
  65. streamlit/static/static/js/{possibleConstructorReturn.BnQk7lq_.js → possibleConstructorReturn.cS4Ei6et.js} +1 -1
  66. streamlit/static/static/js/{sandbox.CrxXt1li.js → sandbox.Bj-BfqPP.js} +1 -1
  67. streamlit/static/static/js/{textarea.DiFyO5JY.js → textarea.BrvMyGxB.js} +1 -1
  68. streamlit/static/static/js/{timepicker.B1Y7LIk4.js → timepicker.Ds8_GzH8.js} +2 -2
  69. streamlit/static/static/js/{toConsumableArray.BWpBUK-j.js → toConsumableArray.RfoD5uEy.js} +1 -1
  70. streamlit/static/static/js/{uniqueId.7ecIUkUs.js → uniqueId.R_vr2E5T.js} +1 -1
  71. streamlit/static/static/js/{useBasicWidgetState.deG0KPm0.js → useBasicWidgetState.Cglgg1W1.js} +1 -1
  72. streamlit/static/static/js/{useOnInputChange.CQ7sD7CO.js → useOnInputChange.CFTHBDsA.js} +1 -1
  73. streamlit/static/static/js/{withFullScreenWrapper.D0wnBu3k.js → withFullScreenWrapper.BcyXoen-.js} +1 -1
  74. streamlit/user_info.py +3 -0
  75. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/METADATA +1 -1
  76. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/RECORD +80 -80
  77. streamlit/static/static/js/index.Bb4OB39A.js +0 -12
  78. {streamlit_nightly-1.42.3.dev20250227.data → streamlit_nightly-1.42.3.dev20250228.data}/scripts/streamlit.cmd +0 -0
  79. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/WHEEL +0 -0
  80. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/entry_points.txt +0 -0
  81. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,10 @@
1
- import{I as _P,n as AP,G as Qe,aF as $P,aG as CE,aH as kP,aI as CP,aJ as pa,aK as Od,M as FP,y as TP,r as wt,L as ab,ad as MP,ao as DP,ak as FE,al as TE,W as OP,aL as RP,N as ME,aA as DE,as as rC,B as NP,j as dm,aM as LP}from"./index.DfNAkKAr.js";import{S as OE,T as PP}from"./Toolbar.CAOt-xaL.js";import{u as oC,E as sC,w as IP}from"./withFullScreenWrapper.D0wnBu3k.js";import{m as zP}from"./mergeWith.CRrYodeI.js";import{a as rc,n as BP,b as UP,c as ag,t as Os,p as jP,d as qP,e as WP,i as jo,f as ug,g as RE,l as $u,h as ub,j as lg,k as NE,m as ho,o as Ga,q as HP,r as qo,s as GP,u as VP,v as YP,w as XP}from"./threshold.DjX0wlsa.js";import{f as KP,a as Z0,b as aC,c as JP,R as cg,r as uC,d as lb,e as cb,C as fb,g as LE,h as PE,i as fg,j as e1,n as Bt,k as Oc,l as QP,m as ZP,o as eI,p as tI,q as nI,s as iI,t as rI,u as oI,v as sI,w as aI,x as uI,y as Rd}from"./value.CgPGBV_l.js";import{P as lI,i as cI,a as fI,b as dI,p as db,T as hI,n as gI,t as pI,d as mI}from"./timer.CAwTRJ_g.js";import{u as yI}from"./FormClearHelper.Drd1fMJc.js";const bI=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:_P(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),vI=AP("div",{target:"e1xm3y80"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,zIndex:e.zIndices.popup,top:`calc(${e.iconSizes.md} + 2 * ${e.spacing.xs} + ${e.spacing.xs})`,right:0,backgroundColor:e.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:e.radii.default,a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:`${e.spacing.twoXS} ${e.spacing.twoXL}`,color:e.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:e.colors.secondaryBg,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:e.spacing.xs,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.default,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix25},svg:{width:e.iconSizes.md,height:e.iconSizes.md}}}}));function IE(e,t){const n={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:Qe(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.md),titleColor:pa(t),titleFontStyle:"normal",labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal"},axis:{labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.sm),titleColor:pa(t),titleFontStyle:"normal",ticks:!1,gridColor:Od(t),domain:!1,domainWidth:1,domainColor:Od(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:Qe(t.spacing.lg),labelPadding:Qe(t.spacing.lg),labelSeparation:Qe(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:Qe(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),titleFontSize:Qe(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:pa(t),titlePadding:5,labelPadding:Qe(t.spacing.lg),columnPadding:Qe(t.spacing.sm),rowPadding:Qe(t.spacing.twoXS),padding:7,symbolStrokeWidth:Qe(t.spacing.twoXS)},range:{category:CP(t),diverging:kP(t),ramp:CE(t),heatmap:CE(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:$P(t)},bar:{binSpacing:Qe(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?zP({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function xI(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:Qe(i.twoSm),titleFontSize:Qe(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Od(t),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:Od(t),continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?FP({},s,e):s}const wI=20;function EI(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&ab(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const SI=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=IE(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=IE(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=xI(u.config,r),o?(u.width=s,u.height=a,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})):t&&(u.width=s,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})),u.padding||(u.padding={}),ab(u.padding.bottom)&&(u.padding.bottom=wI),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&EI(u),u},_I=e=>{const t=TP(),{expanded:n,width:i,height:r}=oC(sC),{id:o,formId:s,spec:a,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=e,h=wt.useMemo(()=>d,[JSON.stringify(d)]),g=wt.useMemo(()=>SI(a,c,f,h,t,n,i||0,r),[a,c,f,h,t,n,i,r]);return{id:o,formId:s,vegaLiteTheme:f,spec:g,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function An(e,t,n){return e.fields=t||[],e.fname=n,e}function Je(e){return e==null?null:e.fname}function qt(e){return e==null?null:e.fields}function lC(e){return e.length===1?AI(e[0]):$I(e)}const AI=e=>function(t){return t[e]},$I=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function N(e){throw Error(e)}function ar(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||N("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&N("Access path missing closing bracket: "+e),i&&N("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Qn(e,t,n){const i=ar(e);return e=i.length===1?i[0]:e,An((n&&n.get||lC)(i),[e],t||e)}const Rc=Qn("id"),Vt=An(e=>e,[],"identity"),fo=An(()=>0,[],"zero"),ku=An(()=>1,[],"one"),Pn=An(()=>!0,[],"true"),io=An(()=>!1,[],"false");function kI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const cC=0,hb=1,gb=2,fC=3,dC=4;function pb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kI,i=e||cC;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=hb&&n(t||"error","ERROR",arguments),this},warn(){return i>=gb&&n(t||"warn","WARN",arguments),this},info(){return i>=fC&&n(t||"log","INFO",arguments),this},debug(){return i>=dC&&n(t||"log","DEBUG",arguments),this}}}var P=Array.isArray;function Y(e){return e===Object(e)}const zE=e=>e!=="__proto__";function Cu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=CI(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Fu(i,o,r[o],s)}return i},{})}function Fu(e,t,n,i){if(!zE(t))return;let r,o;if(Y(n)&&!P(n)){o=Y(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Fu(o,r,n[r]):zE(r)&&(o[r]=n[r])}else e[t]=n}function CI(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function Ee(e){return e[e.length-1]}function Ut(e){return e==null||e===""?null:+e}const hC=e=>t=>e*Math.exp(t),gC=e=>t=>Math.log(e*t),pC=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),mC=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Nd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function dg(e,t,n,i){const r=n(e[0]),o=n(Ee(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function yC(e,t){return dg(e,t,Ut,Vt)}function bC(e,t){var n=Math.sign(e[0]);return dg(e,t,gC(n),hC(n))}function vC(e,t,n){return dg(e,t,Nd(n),Nd(1/n))}function xC(e,t,n){return dg(e,t,pC(n),mC(n))}function hg(e,t,n,i,r){const o=i(e[0]),s=i(Ee(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function mb(e,t,n){return hg(e,t,n,Ut,Vt)}function yb(e,t,n){const i=Math.sign(e[0]);return hg(e,t,n,gC(i),hC(i))}function Ld(e,t,n,i){return hg(e,t,n,Nd(i),Nd(1/i))}function bb(e,t,n,i){return hg(e,t,n,pC(i),mC(i))}function wC(e){return 1+~~(new Date(e).getMonth()/3)}function EC(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?P(e)?e:[e]:[]}function SC(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ge(e){return typeof e=="function"}const FI="descending";function vb(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],o={},s=n.comparator||TI;return X(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===FI?-1:1),r.push(a=ge(a)?a:Qn(a,null,n)),(qt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:An(s(r,i),Object.keys(o))}const gg=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),TI=(e,t)=>e.length===1?MI(e[0],t[0]):DI(e,t,e.length),MI=(e,t)=>function(n,i){return gg(e(n),e(i))*t},DI=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=gg(o(i),o(r));return s*t[a]});function Yt(e){return ge(e)?e:()=>e}function xb(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function he(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Qi(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function _C(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}const OI=Object.prototype.hasOwnProperty;function J(e,t){return OI.call(e,t)}const Af={};function Tu(e){let t={},n;function i(o){return J(t,o)&&t[o]!==Af}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===Af&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=Af),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==Af&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function AC(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=Ee(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),he(i,n)}function Ta(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function Wo(e){return typeof e=="boolean"}function So(e){return Object.prototype.toString.call(e)==="[object Date]"}function $C(e){return e&&ge(e[Symbol.iterator])}function Ae(e){return typeof e=="number"}function kC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function wb(e,t,n){e&&(e=t?X(e).map(a=>a.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||lC,o=a=>r(t?[a]:ar(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return An(s,e,"key")}function CC(e,t){const n=e[0],i=Ee(e),r=+t;return r?r===1?i:n+r*(i-n):n}const RI=1e4;function FC(e){e=+e||RI;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>J(t,s)||J(n,s),get:s=>J(t,s)?t[s]:J(n,s)?o(s,n[s]):void 0,set:(s,a)=>J(t,s)?t[s]=a:o(s,a)}}function TC(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Sl(e,t){let n="";for(;--t>=0;)n+=e;return n}function MC(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Sl(r,s)+o:i==="center"?Sl(r,~~(s/2))+o+Sl(r,Math.ceil(s/2)):o+Sl(r,s)}function Nc(e){return e&&Ee(e)-e[0]||0}function H(e){return P(e)?"["+e.map(H)+"]":Y(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Eb(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const NI=e=>Ae(e)||So(e)?e:Date.parse(e);function Sb(e,t){return t=t||NI,e==null||e===""?null:t(e)}function _b(e){return e==null||e===""?null:e+""}function xi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function DC(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function so(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var BE={},hm={},gm=34,Qu=10,pm=13;function OC(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function LI(e,t){var n=OC(e);return function(i,r){return t(n(i),r,e)}}function UE(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function hn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function PI(e){return e<0?"-"+hn(-e,6):e>9999?"+"+hn(e,6):hn(e,4)}function II(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":PI(e.getUTCFullYear())+"-"+hn(e.getUTCMonth()+1,2)+"-"+hn(e.getUTCDate(),2)+(r?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"."+hn(r,3)+"Z":i?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"Z":n||t?"T"+hn(t,2)+":"+hn(n,2)+"Z":"")}function zI(e){var t=new RegExp('["'+e+`
1
+ import{I as _P,n as AP,G as Qe,aF as $P,aG as CE,aH as kP,aI as CP,aJ as pa,aK as Od,M as FP,y as TP,r as wt,L as ab,ad as MP,ao as DP,ak as FE,al as TE,W as OP,aL as RP,N as ME,aA as DE,as as rC,B as NP,j as dm,aM as LP}from"./index.BUNYdCvS.js";import{S as OE,T as PP}from"./Toolbar.BpCHhFl7.js";import{u as oC,E as sC,w as IP}from"./withFullScreenWrapper.BcyXoen-.js";import{m as zP}from"./mergeWith.DFTSkXIf.js";import{a as rc,n as BP,b as UP,c as ag,t as Os,p as jP,d as qP,e as WP,i as jo,f as ug,g as RE,l as $u,h as ub,j as lg,k as NE,m as ho,o as Ga,q as HP,r as qo,s as GP,u as VP,v as YP,w as XP}from"./threshold.DjX0wlsa.js";import{f as KP,a as Z0,b as aC,c as JP,R as cg,r as uC,d as lb,e as cb,C as fb,g as LE,h as PE,i as fg,j as e1,n as Bt,k as Oc,l as QP,m as ZP,o as eI,p as tI,q as nI,s as iI,t as rI,u as oI,v as sI,w as aI,x as uI,y as Rd}from"./value.CgPGBV_l.js";import{P as lI,i as cI,a as fI,b as dI,p as db,T as hI,n as gI,t as pI,d as mI}from"./timer.CAwTRJ_g.js";import{u as yI}from"./FormClearHelper.CyjIZnZM.js";const bI=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:_P(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),vI=AP("div",{target:"e1xm3y80"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,zIndex:e.zIndices.popup,top:`calc(${e.iconSizes.md} + 2 * ${e.spacing.xs} + ${e.spacing.xs})`,right:0,backgroundColor:e.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:e.radii.default,a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:`${e.spacing.twoXS} ${e.spacing.twoXL}`,color:e.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:e.colors.secondaryBg,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:e.spacing.xs,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.default,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix25},svg:{width:e.iconSizes.md,height:e.iconSizes.md}}}}));function IE(e,t){const n={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:Qe(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.md),titleColor:pa(t),titleFontStyle:"normal",labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal"},axis:{labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.sm),titleColor:pa(t),titleFontStyle:"normal",ticks:!1,gridColor:Od(t),domain:!1,domainWidth:1,domainColor:Od(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:Qe(t.spacing.lg),labelPadding:Qe(t.spacing.lg),labelSeparation:Qe(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:Qe(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),titleFontSize:Qe(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:pa(t),titlePadding:5,labelPadding:Qe(t.spacing.lg),columnPadding:Qe(t.spacing.sm),rowPadding:Qe(t.spacing.twoXS),padding:7,symbolStrokeWidth:Qe(t.spacing.twoXS)},range:{category:CP(t),diverging:kP(t),ramp:CE(t),heatmap:CE(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:$P(t)},bar:{binSpacing:Qe(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?zP({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function xI(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:Qe(i.twoSm),titleFontSize:Qe(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Od(t),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:Od(t),continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?FP({},s,e):s}const wI=20;function EI(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&ab(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const SI=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=IE(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=IE(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=xI(u.config,r),o?(u.width=s,u.height=a,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})):t&&(u.width=s,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})),u.padding||(u.padding={}),ab(u.padding.bottom)&&(u.padding.bottom=wI),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&EI(u),u},_I=e=>{const t=TP(),{expanded:n,width:i,height:r}=oC(sC),{id:o,formId:s,spec:a,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=e,h=wt.useMemo(()=>d,[JSON.stringify(d)]),g=wt.useMemo(()=>SI(a,c,f,h,t,n,i||0,r),[a,c,f,h,t,n,i,r]);return{id:o,formId:s,vegaLiteTheme:f,spec:g,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function An(e,t,n){return e.fields=t||[],e.fname=n,e}function Je(e){return e==null?null:e.fname}function qt(e){return e==null?null:e.fields}function lC(e){return e.length===1?AI(e[0]):$I(e)}const AI=e=>function(t){return t[e]},$I=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function N(e){throw Error(e)}function ar(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||N("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&N("Access path missing closing bracket: "+e),i&&N("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Qn(e,t,n){const i=ar(e);return e=i.length===1?i[0]:e,An((n&&n.get||lC)(i),[e],t||e)}const Rc=Qn("id"),Vt=An(e=>e,[],"identity"),fo=An(()=>0,[],"zero"),ku=An(()=>1,[],"one"),Pn=An(()=>!0,[],"true"),io=An(()=>!1,[],"false");function kI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const cC=0,hb=1,gb=2,fC=3,dC=4;function pb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kI,i=e||cC;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=hb&&n(t||"error","ERROR",arguments),this},warn(){return i>=gb&&n(t||"warn","WARN",arguments),this},info(){return i>=fC&&n(t||"log","INFO",arguments),this},debug(){return i>=dC&&n(t||"log","DEBUG",arguments),this}}}var P=Array.isArray;function Y(e){return e===Object(e)}const zE=e=>e!=="__proto__";function Cu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=CI(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Fu(i,o,r[o],s)}return i},{})}function Fu(e,t,n,i){if(!zE(t))return;let r,o;if(Y(n)&&!P(n)){o=Y(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Fu(o,r,n[r]):zE(r)&&(o[r]=n[r])}else e[t]=n}function CI(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function Ee(e){return e[e.length-1]}function Ut(e){return e==null||e===""?null:+e}const hC=e=>t=>e*Math.exp(t),gC=e=>t=>Math.log(e*t),pC=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),mC=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Nd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function dg(e,t,n,i){const r=n(e[0]),o=n(Ee(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function yC(e,t){return dg(e,t,Ut,Vt)}function bC(e,t){var n=Math.sign(e[0]);return dg(e,t,gC(n),hC(n))}function vC(e,t,n){return dg(e,t,Nd(n),Nd(1/n))}function xC(e,t,n){return dg(e,t,pC(n),mC(n))}function hg(e,t,n,i,r){const o=i(e[0]),s=i(Ee(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function mb(e,t,n){return hg(e,t,n,Ut,Vt)}function yb(e,t,n){const i=Math.sign(e[0]);return hg(e,t,n,gC(i),hC(i))}function Ld(e,t,n,i){return hg(e,t,n,Nd(i),Nd(1/i))}function bb(e,t,n,i){return hg(e,t,n,pC(i),mC(i))}function wC(e){return 1+~~(new Date(e).getMonth()/3)}function EC(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?P(e)?e:[e]:[]}function SC(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ge(e){return typeof e=="function"}const FI="descending";function vb(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],o={},s=n.comparator||TI;return X(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===FI?-1:1),r.push(a=ge(a)?a:Qn(a,null,n)),(qt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:An(s(r,i),Object.keys(o))}const gg=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),TI=(e,t)=>e.length===1?MI(e[0],t[0]):DI(e,t,e.length),MI=(e,t)=>function(n,i){return gg(e(n),e(i))*t},DI=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=gg(o(i),o(r));return s*t[a]});function Yt(e){return ge(e)?e:()=>e}function xb(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function he(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Qi(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function _C(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}const OI=Object.prototype.hasOwnProperty;function J(e,t){return OI.call(e,t)}const Af={};function Tu(e){let t={},n;function i(o){return J(t,o)&&t[o]!==Af}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===Af&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=Af),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==Af&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function AC(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=Ee(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),he(i,n)}function Ta(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function Wo(e){return typeof e=="boolean"}function So(e){return Object.prototype.toString.call(e)==="[object Date]"}function $C(e){return e&&ge(e[Symbol.iterator])}function Ae(e){return typeof e=="number"}function kC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function wb(e,t,n){e&&(e=t?X(e).map(a=>a.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||lC,o=a=>r(t?[a]:ar(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return An(s,e,"key")}function CC(e,t){const n=e[0],i=Ee(e),r=+t;return r?r===1?i:n+r*(i-n):n}const RI=1e4;function FC(e){e=+e||RI;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>J(t,s)||J(n,s),get:s=>J(t,s)?t[s]:J(n,s)?o(s,n[s]):void 0,set:(s,a)=>J(t,s)?t[s]=a:o(s,a)}}function TC(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Sl(e,t){let n="";for(;--t>=0;)n+=e;return n}function MC(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Sl(r,s)+o:i==="center"?Sl(r,~~(s/2))+o+Sl(r,Math.ceil(s/2)):o+Sl(r,s)}function Nc(e){return e&&Ee(e)-e[0]||0}function H(e){return P(e)?"["+e.map(H)+"]":Y(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Eb(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const NI=e=>Ae(e)||So(e)?e:Date.parse(e);function Sb(e,t){return t=t||NI,e==null||e===""?null:t(e)}function _b(e){return e==null||e===""?null:e+""}function xi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function DC(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function so(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var BE={},hm={},gm=34,Qu=10,pm=13;function OC(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function LI(e,t){var n=OC(e);return function(i,r){return t(n(i),r,e)}}function UE(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function hn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function PI(e){return e<0?"-"+hn(-e,6):e>9999?"+"+hn(e,6):hn(e,4)}function II(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":PI(e.getUTCFullYear())+"-"+hn(e.getUTCMonth()+1,2)+"-"+hn(e.getUTCDate(),2)+(r?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"."+hn(r,3)+"Z":i?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"Z":n||t?"T"+hn(t,2)+":"+hn(n,2)+"Z":"")}function zI(e){var t=new RegExp('["'+e+`
2
2
  \r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?LI(m,d):OC(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,v=!1;f.charCodeAt(g-1)===Qu&&--g,f.charCodeAt(g-1)===pm&&--g;function x(){if(b)return hm;if(v)return v=!1,BE;var S,w=p,_;if(f.charCodeAt(w)===gm){for(;p++<g&&f.charCodeAt(p)!==gm||f.charCodeAt(++p)===gm;);return(S=p)>=g?b=!0:(_=f.charCodeAt(p++))===Qu?v=!0:_===pm&&(v=!0,f.charCodeAt(p)===Qu&&++p),f.slice(w+1,S-1).replace(/""/g,'"')}for(;p<g;){if((_=f.charCodeAt(S=p++))===Qu)v=!0;else if(_===pm)v=!0,f.charCodeAt(p)===Qu&&++p;else if(_!==n)continue;return f.slice(w,S)}return b=!0,f.slice(w,g)}for(;(y=x())!==hm;){for(var E=[];y!==BE&&y!==hm;)E.push(y),y=x();d&&(E=d(E,m++))==null||h.push(E)}return h}function o(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function s(f,d){return d==null&&(d=UE(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
3
3
  `)}function a(f,d){return d==null&&(d=UE(f)),o(f,d).join(`
4
4
  `)}function u(f){return f.map(l).join(`
5
5
  `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?II(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function BI(e){return e}function UI(e){if(e==null)return BI;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+o,f[1]=(n+=a[1])*r+s;l<c;)f[l]=a[l],++l;return f}}function jI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function qI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return jE(e,n)})}:jE(e,t)}function jE(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=RC(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function RC(e,t){var n=UI(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&jI(f,g)}function o(c){return n(c)}function s(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=s(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=s(c.arcs);break;case"MultiLineString":d=c.arcs.map(s);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function WI(e,t){var n={},i={},r={},o=[],s=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function HI(e){return RC(e,GI.apply(this,arguments))}function GI(e,t,n){var i,r,o;if(arguments.length>1)i=VI(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:WI(e,i)}}function VI(e,t,n){var i=[],r=[],o;function s(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function YI(e,t){let n=0,i,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(i=s-r,r+=i/++n,o+=i*(s-r));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,o+=i*(a-r))}if(n>1)return o/(n-1)}function XI(e,t){const n=YI(e,t);return n&&Math.sqrt(n)}class sn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[i++]=a),t=s}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,o,s=0;if(n>0){for(s=t[--n];n>0&&(i=s,r=t[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class qE extends Map{constructor(t,n=PC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(t1(this,t))}has(t){return super.has(t1(this,t))}set(t,n){return super.set(NC(this,t),n)}delete(t){return super.delete(LC(this,t))}}class Pd extends Set{constructor(t,n=PC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(t1(this,t))}add(t){return super.add(NC(this,t))}delete(t){return super.delete(LC(this,t))}}function t1({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function NC({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function LC({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function PC(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KI(e,t){return Array.from(t,n=>e[n])}function JI(e=rc){if(e===rc)return IC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function IC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function _s(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function n1(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function zC(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?IC:JI(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),g=Math.min(i,Math.floor(t+(u-l)*f/u+d));zC(e,t,h,g,r)}const o=e[t];let s=n,a=i;for(Zu(e,n,t),r(e[i],o)>0&&Zu(e,n,i);s<a;){for(Zu(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Zu(e,n,a):(++a,Zu(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Zu(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function i1(e,t,n){if(e=Float64Array.from(BP(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return n1(e);if(t>=1)return _s(e);var i,r=(i-1)*t,o=Math.floor(r),s=_s(zC(e,o).subarray(0,o+1)),a=n1(e.subarray(o+1));return s+(a-s)*(r-o)}}function BC(e,t,n=UP){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}}function QI(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function UC(e,t){return i1(e,.5,t)}function*ZI(e){for(const t of e)yield*t}function jC(e){return Array.from(ZI(e))}function Mn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++i<r;)o[i]=e+i*n;return o}function qC(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function ez(e,...t){e=new Pd(e),t=t.map(tz);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function tz(e){return e instanceof Pd?e:new Pd(e)}function nz(...e){const t=new Pd;for(const n of e)for(const i of n)t.add(i);return t}const mm=new Date,ym=new Date;function lt(e,t,n,i){function r(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(e(o=new Date(+o)),o),r.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const u=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return u;let l;do u.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return u},r.filter=o=>lt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(r.count=(o,s)=>(mm.setTime(+o),ym.setTime(+s),e(mm),e(ym),Math.floor(n(mm,ym))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const Va=lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Va.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?lt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Va);Va.range;const Cr=1e3,Gn=Cr*60,Fr=Gn*60,Ur=Fr*24,Ab=Ur*7,WE=Ur*30,bm=Ur*365,Tr=lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCSeconds());Tr.range;const pg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getMinutes());pg.range;const mg=lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getUTCMinutes());mg.range;const yg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr-e.getMinutes()*Gn)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getHours());yg.range;const bg=lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getUTCHours());bg.range;const Rr=lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Gn)/Ur,e=>e.getDate()-1);Rr.range;const _o=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>e.getUTCDate()-1);_o.range;const WC=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>Math.floor(e/Ur));WC.range;function Qs(e){return lt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Gn)/Ab)}const Mu=Qs(0),Id=Qs(1),iz=Qs(2),rz=Qs(3),Ya=Qs(4),oz=Qs(5),sz=Qs(6);Mu.range;Id.range;iz.range;rz.range;Ya.range;oz.range;sz.range;function Zs(e){return lt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Ab)}const Du=Zs(0),zd=Zs(1),az=Zs(2),uz=Zs(3),Xa=Zs(4),lz=Zs(5),cz=Zs(6);Du.range;zd.range;az.range;uz.range;Xa.range;lz.range;cz.range;const oc=lt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());oc.range;const sc=lt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());sc.range;const Zi=lt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Zi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Zi.range;const er=lt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());er.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});er.range;function HC(e,t,n,i,r,o){const s=[[Tr,1,Cr],[Tr,5,5*Cr],[Tr,15,15*Cr],[Tr,30,30*Cr],[o,1,Gn],[o,5,5*Gn],[o,15,15*Gn],[o,30,30*Gn],[r,1,Fr],[r,3,3*Fr],[r,6,6*Fr],[r,12,12*Fr],[i,1,Ur],[i,2,2*Ur],[n,1,Ab],[t,1,WE],[t,3,3*WE],[e,1,bm]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),g=h?h.range(l,+c+1):[];return d?g.reverse():g}function u(l,c,f){const d=Math.abs(c-l)/f,h=ag(([,,m])=>m).right(s,d);if(h===s.length)return e.every(Os(l/bm,c/bm,f));if(h===0)return Va.every(Math.max(Os(l,c,f),1));const[g,p]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return g.every(p)}return[a,u]}const[fz,dz]=HC(er,sc,Du,WC,bg,mg),[hz,gz]=HC(Zi,oc,Mu,Rr,yg,pg),Ct="year",vn="quarter",Wt="month",st="week",xn="date",zt="day",tr="dayofyear",In="hours",zn="minutes",Zn="seconds",wi="milliseconds",$b=[Ct,vn,Wt,st,xn,zt,tr,In,zn,Zn,wi],vm=$b.reduce((e,t,n)=>(e[t]=1+n,e),{});function kb(e){const t=X(e).slice(),n={};return t.length||N("Missing time unit."),t.forEach(r=>{J(vm,r)?n[r]=1:N(`Invalid time unit: ${r}.`)}),(n[st]||n[zt]?1:0)+(n[vn]||n[Wt]||n[xn]?1:0)+(n[tr]?1:0)>1&&N(`Incompatible time units: ${e}`),t.sort((r,o)=>vm[r]-vm[o]),t}const pz={[Ct]:"%Y ",[vn]:"Q%q ",[Wt]:"%b ",[xn]:"%d ",[st]:"W%U ",[zt]:"%a ",[tr]:"%j ",[In]:"%H:00",[zn]:"00:%M",[Zn]:":%S",[wi]:".%L",[`${Ct}-${Wt}`]:"%Y-%m ",[`${Ct}-${Wt}-${xn}`]:"%Y-%m-%d ",[`${In}-${zn}`]:"%H:%M"};function GC(e,t){const n=he({},pz,t),i=kb(e),r=i.length;let o="",s=0,a,u;for(s=0;s<r;)for(a=i.length;a>s;--a)if(u=i.slice(s,a).join("-"),n[u]!=null){o+=n[u],s=a;break}return o.trim()}const ms=new Date;function Cb(e){return ms.setFullYear(e),ms.setMonth(0),ms.setDate(1),ms.setHours(0,0,0,0),ms}function VC(e){return XC(new Date(e))}function YC(e){return r1(new Date(e))}function XC(e){return Rr.count(Cb(e.getFullYear())-1,e)}function r1(e){return Mu.count(Cb(e.getFullYear())-1,e)}function o1(e){return Cb(e).getDay()}function mz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);return a.setFullYear(e),a}return new Date(e,t,n,i,r,o,s)}function KC(e){return QC(new Date(e))}function JC(e){return s1(new Date(e))}function QC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return _o.count(t-1,e)}function s1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Du.count(t-1,e)}function a1(e){return ms.setTime(Date.UTC(e,0,1)),ms.getUTCDay()}function yz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,o,s))}function ZC(e,t,n,i,r){const o=t||1,s=Ee(e),a=(y,b,v)=>(v=v||y,bz(n[v],i[v],y===s&&o,b)),u=new Date,l=xi(e),c=l[Ct]?a(Ct):Yt(2012),f=l[Wt]?a(Wt):l[vn]?a(vn):fo,d=l[st]&&l[zt]?a(zt,1,st+zt):l[st]?a(st,1):l[zt]?a(zt,1):l[xn]?a(xn,1):l[tr]?a(tr,1):ku,h=l[In]?a(In):fo,g=l[zn]?a(zn):fo,p=l[Zn]?a(Zn):fo,m=l[wi]?a(wi):fo;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function bz(e,t,n,i){const r=n<=1?e:i?(o,s)=>i+n*Math.floor((e(o,s)-i)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(r(o,s),s):r}function Ka(e,t,n){return t+e*7-(n+6)%7}const vz={[Ct]:e=>e.getFullYear(),[vn]:e=>Math.floor(e.getMonth()/3),[Wt]:e=>e.getMonth(),[xn]:e=>e.getDate(),[In]:e=>e.getHours(),[zn]:e=>e.getMinutes(),[Zn]:e=>e.getSeconds(),[wi]:e=>e.getMilliseconds(),[tr]:e=>XC(e),[st]:e=>r1(e),[st+zt]:(e,t)=>Ka(r1(e),e.getDay(),o1(t)),[zt]:(e,t)=>Ka(1,e.getDay(),o1(t))},xz={[vn]:e=>3*e,[st]:(e,t)=>Ka(e,0,o1(t))};function eF(e,t){return ZC(e,t||1,vz,xz,mz)}const wz={[Ct]:e=>e.getUTCFullYear(),[vn]:e=>Math.floor(e.getUTCMonth()/3),[Wt]:e=>e.getUTCMonth(),[xn]:e=>e.getUTCDate(),[In]:e=>e.getUTCHours(),[zn]:e=>e.getUTCMinutes(),[Zn]:e=>e.getUTCSeconds(),[wi]:e=>e.getUTCMilliseconds(),[tr]:e=>QC(e),[st]:e=>s1(e),[zt]:(e,t)=>Ka(1,e.getUTCDay(),a1(t)),[st+zt]:(e,t)=>Ka(s1(e),e.getUTCDay(),a1(t))},Ez={[vn]:e=>3*e,[st]:(e,t)=>Ka(e,0,a1(t))};function tF(e,t){return ZC(e,t||1,wz,Ez,yz)}const Sz={[Ct]:Zi,[vn]:oc.every(3),[Wt]:oc,[st]:Mu,[xn]:Rr,[zt]:Rr,[tr]:Rr,[In]:yg,[zn]:pg,[Zn]:Tr,[wi]:Va},_z={[Ct]:er,[vn]:sc.every(3),[Wt]:sc,[st]:Du,[xn]:_o,[zt]:_o,[tr]:_o,[In]:bg,[zn]:mg,[Zn]:Tr,[wi]:Va};function Ou(e){return Sz[e]}function Ru(e){return _z[e]}function nF(e,t,n){return e?e.offset(t,n):void 0}function iF(e,t,n){return nF(Ou(e),t,n)}function rF(e,t,n){return nF(Ru(e),t,n)}function oF(e,t,n,i){return e?e.range(t,n,i):void 0}function sF(e,t,n,i){return oF(Ou(e),t,n,i)}function aF(e,t,n,i){return oF(Ru(e),t,n,i)}const _l=1e3,Al=_l*60,$l=Al*60,vg=$l*24,Az=vg*7,HE=vg*30,u1=vg*365,uF=[Ct,Wt,xn,In,zn,Zn,wi],kl=uF.slice(0,-1),Cl=kl.slice(0,-1),Fl=Cl.slice(0,-1),$z=Fl.slice(0,-1),kz=[Ct,st],GE=[Ct,Wt],lF=[Ct],el=[[kl,1,_l],[kl,5,5*_l],[kl,15,15*_l],[kl,30,30*_l],[Cl,1,Al],[Cl,5,5*Al],[Cl,15,15*Al],[Cl,30,30*Al],[Fl,1,$l],[Fl,3,3*$l],[Fl,6,6*$l],[Fl,12,12*$l],[$z,1,vg],[kz,1,Az],[GE,1,HE],[GE,3,3*HE],[lF,1,u1]];function cF(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Nc(t))/n;let r=ag(a=>a[2]).right(el,i),o,s;return r===el.length?(o=lF,s=Os(t[0]/u1,t[1]/u1,n)):r?(r=el[i/el[r-1][2]<el[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=uF,s=Math.max(Os(t[0],t[1],n),1)),{units:o,step:s}}function xm(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function wm(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fF(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,u=e.shortMonths,l=nl(r),c=il(r),f=nl(o),d=il(o),h=nl(s),g=il(s),p=nl(a),m=il(a),y=nl(u),b=il(u),v={a:L,A:z,b:I,B:Q,c:null,d:QE,e:QE,f:Kz,g:s6,G:u6,H:Vz,I:Yz,j:Xz,L:dF,m:Jz,M:Qz,p:ue,q:oe,Q:tS,s:nS,S:Zz,u:e6,U:t6,V:n6,w:i6,W:r6,x:null,X:null,y:o6,Y:a6,Z:l6,"%":eS},x={a:fe,A:Pe,b:de,B:Dt,c:null,d:ZE,e:ZE,f:h6,g:S6,G:A6,H:c6,I:f6,j:d6,L:gF,m:g6,M:p6,p:ts,q:to,Q:tS,s:nS,S:m6,u:y6,U:b6,V:v6,w:x6,W:w6,x:null,X:null,y:E6,Y:_6,Z:$6,"%":eS},E={a:k,A:C,b:O,B:M,c:F,d:KE,e:KE,f:qz,g:XE,G:YE,H:JE,I:JE,j:zz,L:jz,m:Iz,M:Bz,p:A,q:Pz,Q:Hz,s:Gz,S:Uz,u:Dz,U:Oz,V:Rz,w:Mz,W:Nz,x:$,X:T,y:XE,Y:YE,Z:Lz,"%":Wz};v.x=S(n,v),v.X=S(i,v),v.c=S(t,v),x.x=S(n,x),x.X=S(i,x),x.c=S(t,x);function S(Z,pe){return function(ye){var W=[],xt=-1,Te=0,Ot=Z.length,ft,Ni,_f;for(ye instanceof Date||(ye=new Date(+ye));++xt<Ot;)Z.charCodeAt(xt)===37&&(W.push(Z.slice(Te,xt)),(Ni=VE[ft=Z.charAt(++xt)])!=null?ft=Z.charAt(++xt):Ni=ft==="e"?" ":"0",(_f=pe[ft])&&(ft=_f(ye,Ni)),W.push(ft),Te=xt+1);return W.push(Z.slice(Te,xt)),W.join("")}}function w(Z,pe){return function(ye){var W=tl(1900,void 0,1),xt=_(W,Z,ye+="",0),Te,Ot;if(xt!=ye.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(pe&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=wm(tl(W.y,0,1)),Ot=Te.getUTCDay(),Te=Ot>4||Ot===0?zd.ceil(Te):zd(Te),Te=_o.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=xm(tl(W.y,0,1)),Ot=Te.getDay(),Te=Ot>4||Ot===0?Id.ceil(Te):Id(Te),Te=Rr.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Ot="Z"in W?wm(tl(W.y,0,1)).getUTCDay():xm(tl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Ot+5)%7:W.w+W.U*7-(Ot+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,wm(W)):xm(W)}}function _(Z,pe,ye,W){for(var xt=0,Te=pe.length,Ot=ye.length,ft,Ni;xt<Te;){if(W>=Ot)return-1;if(ft=pe.charCodeAt(xt++),ft===37){if(ft=pe.charAt(xt++),Ni=E[ft in VE?pe.charAt(xt++):ft],!Ni||(W=Ni(Z,ye,W))<0)return-1}else if(ft!=ye.charCodeAt(W++))return-1}return W}function A(Z,pe,ye){var W=l.exec(pe.slice(ye));return W?(Z.p=c.get(W[0].toLowerCase()),ye+W[0].length):-1}function k(Z,pe,ye){var W=h.exec(pe.slice(ye));return W?(Z.w=g.get(W[0].toLowerCase()),ye+W[0].length):-1}function C(Z,pe,ye){var W=f.exec(pe.slice(ye));return W?(Z.w=d.get(W[0].toLowerCase()),ye+W[0].length):-1}function O(Z,pe,ye){var W=y.exec(pe.slice(ye));return W?(Z.m=b.get(W[0].toLowerCase()),ye+W[0].length):-1}function M(Z,pe,ye){var W=p.exec(pe.slice(ye));return W?(Z.m=m.get(W[0].toLowerCase()),ye+W[0].length):-1}function F(Z,pe,ye){return _(Z,t,pe,ye)}function $(Z,pe,ye){return _(Z,n,pe,ye)}function T(Z,pe,ye){return _(Z,i,pe,ye)}function L(Z){return s[Z.getDay()]}function z(Z){return o[Z.getDay()]}function I(Z){return u[Z.getMonth()]}function Q(Z){return a[Z.getMonth()]}function ue(Z){return r[+(Z.getHours()>=12)]}function oe(Z){return 1+~~(Z.getMonth()/3)}function fe(Z){return s[Z.getUTCDay()]}function Pe(Z){return o[Z.getUTCDay()]}function de(Z){return u[Z.getUTCMonth()]}function Dt(Z){return a[Z.getUTCMonth()]}function ts(Z){return r[+(Z.getUTCHours()>=12)]}function to(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=S(Z+="",v);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=w(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=S(Z+="",x);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=w(Z+="",!0);return pe.toString=function(){return Z},pe}}}var VE={"-":"",_:" ",0:"0"},bt=/^\s*\d+/,Cz=/^%/,Fz=/[\\^$*+?|[\]().{}]/g;function $e(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Tz(e){return e.replace(Fz,"\\$&")}function nl(e){return new RegExp("^(?:"+e.map(Tz).join("|")+")","i")}function il(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Mz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Dz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Oz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Rz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Nz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function YE(e,t,n){var i=bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function XE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Lz(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Pz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Iz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function KE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function zz(e,t,n){var i=bt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function JE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Bz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Uz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function jz(e,t,n){var i=bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function qz(e,t,n){var i=bt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Wz(e,t,n){var i=Cz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Hz(e,t,n){var i=bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Gz(e,t,n){var i=bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function QE(e,t){return $e(e.getDate(),t,2)}function Vz(e,t){return $e(e.getHours(),t,2)}function Yz(e,t){return $e(e.getHours()%12||12,t,2)}function Xz(e,t){return $e(1+Rr.count(Zi(e),e),t,3)}function dF(e,t){return $e(e.getMilliseconds(),t,3)}function Kz(e,t){return dF(e,t)+"000"}function Jz(e,t){return $e(e.getMonth()+1,t,2)}function Qz(e,t){return $e(e.getMinutes(),t,2)}function Zz(e,t){return $e(e.getSeconds(),t,2)}function e6(e){var t=e.getDay();return t===0?7:t}function t6(e,t){return $e(Mu.count(Zi(e)-1,e),t,2)}function hF(e){var t=e.getDay();return t>=4||t===0?Ya(e):Ya.ceil(e)}function n6(e,t){return e=hF(e),$e(Ya.count(Zi(e),e)+(Zi(e).getDay()===4),t,2)}function i6(e){return e.getDay()}function r6(e,t){return $e(Id.count(Zi(e)-1,e),t,2)}function o6(e,t){return $e(e.getFullYear()%100,t,2)}function s6(e,t){return e=hF(e),$e(e.getFullYear()%100,t,2)}function a6(e,t){return $e(e.getFullYear()%1e4,t,4)}function u6(e,t){var n=e.getDay();return e=n>=4||n===0?Ya(e):Ya.ceil(e),$e(e.getFullYear()%1e4,t,4)}function l6(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function ZE(e,t){return $e(e.getUTCDate(),t,2)}function c6(e,t){return $e(e.getUTCHours(),t,2)}function f6(e,t){return $e(e.getUTCHours()%12||12,t,2)}function d6(e,t){return $e(1+_o.count(er(e),e),t,3)}function gF(e,t){return $e(e.getUTCMilliseconds(),t,3)}function h6(e,t){return gF(e,t)+"000"}function g6(e,t){return $e(e.getUTCMonth()+1,t,2)}function p6(e,t){return $e(e.getUTCMinutes(),t,2)}function m6(e,t){return $e(e.getUTCSeconds(),t,2)}function y6(e){var t=e.getUTCDay();return t===0?7:t}function b6(e,t){return $e(Du.count(er(e)-1,e),t,2)}function pF(e){var t=e.getUTCDay();return t>=4||t===0?Xa(e):Xa.ceil(e)}function v6(e,t){return e=pF(e),$e(Xa.count(er(e),e)+(er(e).getUTCDay()===4),t,2)}function x6(e){return e.getUTCDay()}function w6(e,t){return $e(zd.count(er(e)-1,e),t,2)}function E6(e,t){return $e(e.getUTCFullYear()%100,t,2)}function S6(e,t){return e=pF(e),$e(e.getUTCFullYear()%100,t,2)}function _6(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function A6(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Xa(e):Xa.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function $6(){return"+0000"}function eS(){return"%"}function tS(e){return+e}function nS(e){return Math.floor(+e/1e3)}var ma,Fb,mF,Tb,yF;k6({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function k6(e){return ma=fF(e),Fb=ma.format,mF=ma.parse,Tb=ma.utcFormat,yF=ma.utcParse,ma}function Tl(e){const t={};return n=>t[n]||(t[n]=e(n))}function C6(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=F6(i,r);const s=o<i.length?i.slice(o):"";for(;--o>r;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function F6(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function bF(e){const t=Tl(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=Z0(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return C6(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=Z0(s??",f");const a=Os(i,r,o),u=Math.max(Math.abs(i),Math.abs(r));let l;if(s.precision==null)switch(s.type){case"s":return isNaN(l=WP(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=qP(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=jP(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let l1;vF();function vF(){return l1=bF({format:aC,formatPrefix:JP})}function xF(e){return bF(KP(e))}function Bd(e){return arguments.length?l1=xF(e):l1}function iS(e,t,n){n=n||{},Y(n)||N(`Invalid time multi-format specifier: ${n}`);const i=t(Zn),r=t(zn),o=t(In),s=t(xn),a=t(st),u=t(Wt),l=t(vn),c=t(Ct),f=e(n[wi]||".%L"),d=e(n[Zn]||":%S"),h=e(n[zn]||"%I:%M"),g=e(n[In]||"%I %p"),p=e(n[xn]||n[zt]||"%a %d"),m=e(n[st]||"%b %d"),y=e(n[Wt]||"%B"),b=e(n[vn]||"%B"),v=e(n[Ct]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:o(x)<x?h:s(x)<x?g:u(x)<x?a(x)<x?p:m:c(x)<x?l(x)<x?y:b:v)(x)}function wF(e){const t=Tl(e.format),n=Tl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):iS(t,Ou,i),utcFormat:i=>K(i)?n(i):iS(n,Ru,i),timeParse:Tl(e.parse),utcParse:Tl(e.utcParse)}}let c1;EF();function EF(){return c1=wF({format:Fb,parse:mF,utcFormat:Tb,utcParse:yF})}function SF(e){return wF(fF(e))}function ac(e){return arguments.length?c1=SF(e):c1}const f1=(e,t)=>he({},e,t);function _F(e,t){const n=e?xF(e):Bd(),i=t?SF(t):ac();return f1(n,i)}function Mb(e,t){const n=arguments.length;return n&&n!==2&&N("defaultLocale expects either zero or two arguments."),n?f1(Bd(e),ac(t)):f1(Bd(),ac())}function T6(){return vF(),EF(),Mb()}const M6=/^(data:|([A-Za-z]+:)?\/\/)/,D6=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,rS="file://";function R6(e,t){return n=>({options:n||{},sanitize:L6,load:N6,fileAccess:!1,file:P6(t),http:z6(e)})}async function N6(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function L6(e,t){t=he({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=D6.test(e.replace(O6,""));(e==null||typeof e!="string"||!a)&&N("Sanitize failure, invalid URI: "+H(e));const u=M6.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(rS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(rS.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function P6(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):I6}async function I6(){N("No file system access.")}function z6(e){return e?async function(t,n){const i=he({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?ge(o[r])?o[r]():o.text():N(o.status+""+o.statusText)}:B6}async function B6(){N("No HTTP fetch method available.")}const U6=e=>e!=null&&e===e,j6=e=>e==="true"||e==="false"||e===!0||e===!1,q6=e=>!Number.isNaN(Date.parse(e)),AF=e=>!Number.isNaN(+e)&&!(e instanceof Date),W6=e=>AF(e)&&Number.isInteger(+e),d1={boolean:Eb,integer:Ut,number:Ut,date:Sb,string:_b,unknown:Vt},$f=[j6,W6,AF,q6],H6=["boolean","integer","number","date"];function $F(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=$f.length,r=$f.map((o,s)=>s+1);for(let o=0,s=0,a,u;o<n;++o)for(u=t?e[o][t]:e[o],a=0;a<i;++a)if(r[a]&&U6(u)&&!$f[a](u)&&(r[a]=0,++s,s===$f.length))return"string";return H6[r.reduce((o,s)=>o===0?s:o,0)-1]}function kF(e,t){return t.reduce((n,i)=>(n[i]=$F(e,i),n),{})}function oS(e){const t=function(n,i){const r={delimiter:e};return Db(n,i?he(i,r):r)};return t.responseType="text",t}function Db(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
6
6
  `+e),zI(t.delimiter).parse(e+"")}Db.responseType="text";function G6(e){return typeof Buffer=="function"&&ge(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Ob(e,t){const n=t&&t.property?Qn(t.property):Vt;return Y(e)&&!G6(e)?V6(n(e),t):n(JSON.parse(e))}Ob.responseType="json";function V6(e,t){return!P(e)&&$C(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const Y6={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function CF(e,t){let n,i,r,o;return e=Ob(e,t),t&&t.feature?(n=qI,r=t.feature):t&&t.mesh?(n=HI,r=t.mesh,o=Y6[t.filter]):N("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):N("Invalid TopoJSON object: "+r),i&&i.features||[i]}CF.responseType="json";const ld={dsv:Db,csv:oS(","),tsv:oS(" "),json:Ob,topojson:CF};function Rb(e,t){return arguments.length>1?(ld[e]=t,this):J(ld,e)?ld[e]:null}function FF(e){const t=Rb(e);return t&&t.responseType||"text"}function TF(e,t,n,i){t=t||{};const r=Rb(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&X6(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function X6(e,t,n,i){if(!e.length)return;const r=ac();n=n||r.timeParse,i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,l,c,f;t==="auto"&&(t=kF(e,o)),o=Object.keys(t);const d=o.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!d1[g])throw Error("Illegal format pattern: "+h+":"+g);return d1[g]});for(u=0,c=e.length,f=o.length;u<c;++u)for(s=e[u],l=0;l<f;++l)a=o[l],s[a]=d[l](s[a])}const xg=R6(typeof fetch<"u"&&fetch,null);function wg(e){const t=e||Vt,n=[],i={};return n.add=r=>{const o=t(r);return i[o]||(i[o]=1,n.push(r)),n},n.remove=r=>{const o=t(r);if(i[o]){i[o]=0;const s=n.indexOf(r);s>=0&&n.splice(s,1)}return n},n}async function cd(e,t){try{await t(e)}catch(n){e.error(n)}}const MF=Symbol("vega_id");let K6=1;function Eg(e){return!!(e&&ie(e))}function ie(e){return e[MF]}function DF(e,t){return e[MF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return ie(t)?t:DF(t,K6++)}function Nb(e){return Sg(e,Ce({}))}function Sg(e,t){for(const n in e)t[n]=e[n];return t}function OF(e,t){return DF(t,ie(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||ie(t(n))-ie(t(i)):(n,i)=>e(n,i)||ie(n)-ie(i):null}function RF(e){return e&&e.constructor===ta}function ta(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:ta,insert(a){const u=X(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ge(a)?i:t,l=X(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Yt(l)};return ge(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ge(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,u){const l={},c={};let f,d,h,g,p,m;for(f=0,d=u.length;f<d;++f)l[ie(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[ie(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[ie(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=ie(p),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[ie(p)]<0&&a.rem.push(p);function y(b,v,x){x?b[v]=x(b):a.encode=v,s||(c[ie(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[ie(p)],m>0&&(y(p,g,h.value),a.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[ie(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[ie(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||i.length))&&a.clean(!0),a}}}const fd="_:mod:_";function _g(){Object.defineProperty(this,fd,{writable:!0,value:{}})}_g.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[fd];return t!=null&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(r[e]=n,s[e]=P(n)?1+n.length:-1),r},modified(e,t){const n=this[fd];if(arguments.length){if(P(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[fd]={},this}};let J6=0;const Q6="pulse",Z6=new _g,e4=1,t4=2;function Ie(e,t,n,i){this.id=++J6,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function sS(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ie.prototype={targets(){return this._targets||(this._targets=wg(Rc))},set(e){return this.value!==e?(this.value=e,1):0},skip:sS(e4),modified:sS(t4),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new _g,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Ie?(h!==this&&(t&&h.targets().add(this),o.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(s in e)if(a=e[s],s===Q6)X(a).forEach(f=>{f instanceof Ie?f!==this&&(f.targets().add(this),o.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(P(a))for(i.set(s,-1,Array(u=a.length)),l=0;l<u;++l)c(s,l,a[l]);else c(s,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||Z6,n=this._argops;let i,r,o,s;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],o=i.op,s=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,s);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function n4(e,t,n,i){let r=1,o;return e instanceof Ie?o=e:e&&e.prototype instanceof Ie?o=new e:ge(e)?o=new Ie(null,e):(r=0,o=new Ie(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function i4(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let r4=0;function Ag(e,t,n){this.id=++r4,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function ro(e,t,n){return new Ag(e,t,n)}Ag.prototype={_filter:Pn,_apply:Vt,targets(){return this._targets||(this._targets=wg(Rc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=ro(e);return this.targets().add(t),t},apply(e){const t=ro(null,e);return this.targets().add(t),t},merge(){const e=ro();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=ro();return this.targets().add(ro(null,null,xb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(ro(null,null,()=>n=!0)),t.targets().add(ro(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Pn,this._targets=null}};function o4(e,t,n,i){const r=this,o=ro(n,i),s=function(l){l.dataflow=r;try{o.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=X(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function s4(e,t){const n=this.locale();return TF(e,t,n.timeParse,n.utcParse)}function a4(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function u4(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:FF(t&&t.type)});try{r=n.parse(r,t)}catch(o){i=-2,n.warn("Data ingestion failed",e,o)}}catch(o){i=-1,n.warn("Loading failed",e,o)}return{data:r,status:i}}async function l4(e,t,n){const i=this,r=i._pending||c4(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Pn).insert(o.data||[])),r.done(),o}function c4(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const f4={skip:!0};function d4(e,t,n,i,r){return(e instanceof Ie?g4:h4)(this,e,t,n,i,r),this}function h4(e,t,n,i,r,o){const s=he({},o,f4);let a,u;ge(n)||(n=Yt(n)),i===void 0?a=l=>e.touch(n(l)):ge(i)?(u=new Ie(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;RF(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function g4(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Ie(null,p4(n,i),r,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function p4(e,t){return t=ge(t)?t:Yt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function m4(e){e.rank=++this._rank}function y4(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&N("Cycle detected in dataflow graph.")}const Ud={},Bi=1,ao=2,Sr=4,b4=Bi|ao,aS=Bi|Sr,ya=Bi|ao|Sr,uS=8,rl=16,lS=32,cS=64;function Ao(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Em(e,t){const n=[];return so(e,t,i=>n.push(i)),n}function fS(e,t){const n={};return e.visit(t,i=>{n[ie(i)]=1}),i=>n[ie(i)]?null:i}function kf(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ao.prototype={StopPropagation:Ud,ADD:Bi,REM:ao,MOD:Sr,ADD_REM:b4,ADD_MOD:aS,ALL:ya,REFLOW:uS,SOURCE:rl,NO_SOURCE:lS,NO_FIELDS:cS,fork(e){return new Ao(this.dataflow).init(this,e)},clone(){const e=this.fork(ya);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(ya|rl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ao(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&cS)&&(n.fields=e.fields),t&Bi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&ao?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Sr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&lS?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||ya;return t&Bi&&this.add.length||t&ao&&this.rem.length||t&Sr&&this.mod.length},reflow(e){if(e)return this.fork(ya).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Sr,fS(this,Bi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return P(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?P(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Bi&&(n.addF=kf(n.addF,t)),e&ao&&(n.remF=kf(n.remF,t)),e&Sr&&(n.modF=kf(n.modF,t)),e&rl&&(n.srcF=kf(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Bi&&t.addF&&(t.add=Em(t.add,t.addF),t.addF=null),e&ao&&t.remF&&(t.rem=Em(t.rem,t.remF),t.remF=null),e&Sr&&t.modF&&(t.mod=Em(t.mod,t.modF),t.modF=null),e&rl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&rl)return so(n.source,n.srcF,i),n;e&Bi&&so(n.add,n.addF,i),e&ao&&so(n.rem,n.remF,i),e&Sr&&so(n.mod,n.modF,i);const r=n.source;if(e&uS&&r){const o=n.add.length+n.mod.length;o===r.length||(o?so(r,fS(n,aS),i):so(r,n.srcF,i))}return n}};function Lb(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=r.fields||(r.fields={});for(const u in s.fields)a[u]=1}s.changed(r.ADD)&&(o|=r.ADD),s.changed(r.REM)&&(o|=r.REM),s.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}G(Lb,Ao,{fork(e){const t=new Ao(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?P(e)?e.some(i=>n[i]):n[e]:0},filter(){N("MultiPulse does not support filtering.")},materialize(){N("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});async function v4(e,t,n){const i=this,r=[];if(i._pulse)return NF(i);if(i._pending&&await i._pending,t&&await cd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Ao(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=wg(Rc);let s=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Ud),u!==Ud&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++s}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${s} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await cd(i,c[f].callback)}return n&&await cd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function x4(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function w4(e,t,n){return this._pulse?NF(this):(this.evaluate(e,t,n),this)}function E4(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function NF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function S4(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function _4(e,t){const n=e.source,i=this._clock;return n&&P(n)?new Lb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||A4(this._pulse,n&&n.pulse)}function A4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ud&&(e.source=t.source),e)}const Pb={skip:!1,force:!1};function $4(e,t){const n=t||Pb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function k4(e,t,n){const i=n||Pb;return(e.set(t)||i.force)&&this.touch(e,i),this}function C4(e,t,n){this.touch(e,n||Pb);const i=new Ao(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function F4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),LF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,T4(t,0,e)):i=n,i}}}function LF(e,t,n,i){let r,o;const s=e[n];for(;n>t;){if(o=n-1>>1,r=e[o],i(s,r)<0){e[n]=r,n=o;continue}break}return e[n]=s}function T4(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,LF(e,i,t,n)}function Pa(){this.logger(pb()),this.logLevel(hb),this._clock=0,this._rank=0,this._locale=Mb();try{this._loader=xg()}catch{}this._touched=wg(Rc),this._input={},this._pulse=null,this._heap=F4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}Pa.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ol("error"),warn:ol("warn"),info:ol("info"),debug:ol("debug"),logLevel:ol("level"),cleanThreshold:1e4,add:n4,connect:i4,rank:m4,rerank:y4,pulse:C4,touch:$4,update:k4,changeset:ta,ingest:a4,parse:s4,preload:l4,request:u4,events:o4,on:d4,evaluate:v4,run:w4,runAsync:x4,runAfter:E4,_enqueue:S4,_getPulse:_4};function D(e,t){Ie.call(this,e,null,t)}G(D,Ie,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Ja={};function PF(e){const t=IF(e);return t&&t.Definition||null}function IF(e){return e=e&&e.toLowerCase(),J(Ja,e)?Ja[e]:null}function*zF(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Ib(e,t,n){const i=Float64Array.from(zF(e,n));return i.sort(rc),t.map(r=>BC(i,r))}function zb(e,t){return Ib(e,[.25,.5,.75],t)}function Bb(e,t){const n=e.length,i=XI(e,t),r=zb(e,t),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function BF(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,l,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+p)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var ei=Math.random;function M4(e){ei=e}function UF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(zF(e,i)),o=r.length,s=t;let a,u,l,c;for(l=0,c=Array(s);l<s;++l){for(a=0,u=0;u<o;++u)a+=r[~~(ei()*o)];c[l]=a/o}return c.sort(rc),[i1(c,n/2),i1(c,1-n/2)]}function jF(e,t,n,i){i=i||(d=>d);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;s<a;++s)o[s]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;s<a;++s)o[s]=l;return n?D4(o,t+t/4):o}function D4(e,t){const n=e.length;let i=0,r=1,o,s;for(;e[i]===e[r];)++r;for(;r<n;){for(o=r+1;e[r]===e[o];)++o;if(e[r]-e[r-1]<t){for(s=r+(i+o-r-r>>1);s<r;)e[s++]=e[r];for(;s>r;)e[s--]=e[i]}i=r,r=o}return e}function O4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function R4(e,t){t==null&&(t=e,e=0);let n,i,r;const o={min(s){return arguments.length?(n=s||0,r=i-n,o):n},max(s){return arguments.length?(i=s||0,r=i-n,o):i},sample(){return n+Math.floor(r*ei())},pdf(s){return s===Math.floor(s)&&s>=n&&s<i?1/r:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=i?1:(a-n+1)/r},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*r):NaN}};return o.min(e).max(t)}const qF=Math.sqrt(2*Math.PI),N4=Math.SQRT2;let sl=NaN;function $g(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(sl===sl)n=sl,sl=NaN;else{do n=ei()*2-1,i=ei()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,sl=i*o}return e+n*t}function Ub(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*qF)}function kg(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37)o=0;else{const s=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,o=s*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,o=o/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,o=s/a/2.506628274631)}return i>0?1-o:o}function Cg(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*N4*L4(2*e-1)}function L4(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function jb(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>$g(n,i),pdf:o=>Ub(o,n,i),cdf:o=>kg(o,n,i),icdf:o=>Cg(o,n,i)};return r.mean(e).stdev(t)}function qb(e,t){const n=jb();let i=0;const r={data(o){return arguments.length?(e=o,i=o?o.length:0,r.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Bb(e)),r):t},sample(){return e[~~(ei()*i)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<i;++a)s+=n.pdf((o-e[a])/t);return s/t/i},cdf(o){let s=0,a=0;for(;a<i;++a)s+=n.cdf((o-e[a])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Wb(e,t){return e=e||0,t=t??1,Math.exp(e+$g()*t)}function Hb(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*qF*e)}function Gb(e,t,n){return kg(Math.log(e),t,n)}function Vb(e,t,n){return Math.exp(Cg(e,t,n))}function WF(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>Wb(n,i),pdf:o=>Hb(o,n,i),cdf:o=>Gb(o,n,i),icdf:o=>Vb(o,n,i)};return r.mean(e).stdev(t)}function HF(e,t){let n=0,i;function r(s){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=s[l]==null?1:+s[l];for(l=0;l<n;++l)a[l]/=u;return a}const o={weights(s){return arguments.length?(i=r(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=ei();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(s<u){a=e[l];break}return a.sample()},pdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(s);return a},cdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function Yb(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*ei()}function Xb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Kb(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Jb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function GF(e,t){let n,i;const r={min(o){return arguments.length?(n=o||0,r):n},max(o){return arguments.length?(i=o??1,r):i},sample:()=>Yb(n,i),pdf:o=>Xb(o,n,i),cdf:o=>Kb(o,n,i),icdf:o=>Jb(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Qb(e,t,n){let i=0,r=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(i+=(s-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Lc(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function Fg(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)o[a]-=u,s[a]-=l;return[o,s,u,l]}function Pc(e,t,n,i){let r=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&i(o,s,++r)}function Nu(e,t,n,i,r){let o=0,s=0;return Pc(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function Zb(e,t,n){let i=0,r=0,o=0,s=0,a=0;Pc(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=Lc(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Nu(e,t,n,r,l)}}function VF(e,t,n){let i=0,r=0,o=0,s=0,a=0;Pc(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=Lc(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Nu(e,t,n,r,l)}}function YF(e,t,n){const[i,r,o,s]=Fg(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,g;Pc(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),g=d*v,a+=(v*h-a)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=Lc(u/s,a/s,l/s,c/s),y=b=>Math.exp(p+m*(b-o));return{coef:[Math.exp(p-m*o),m],predict:y,rSquared:Nu(e,t,n,s,y)}}function XF(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Pc(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,o+=(h*g-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=Lc(i,r,o,s),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Nu(e,t,n,a,c)}}function ev(e,t,n){const[i,r,o,s]=Fg(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<a;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,S=w=>(w=w-o,v*w*w+x*w+E+s);return{coef:[E-x*o+v*o*o+s,x-2*v*o,v],predict:S,rSquared:Nu(e,t,n,s,S)}}function KF(e,t,n,i){if(i===0)return Qb(e,t,n);if(i===1)return Zb(e,t,n);if(i===2)return ev(e,t,n);const[r,o,s,a]=Fg(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*o[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=I4(c),b=v=>{v-=s;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:P4(f,y,-s,a),predict:b,rSquared:Nu(e,t,n,a,b)}}function P4(e,t,n,i){const r=Array(e);let o,s,a,u;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],u=1,r[o]+=a,s=1;s<=o;++s)u*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*u;return r[0]+=i,r}function I4(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;i<t;++i){for(s=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][s])&&(s=r);for(o=i;o<t+1;++o)a=e[o][i],e[o][i]=e[o][s],e[o][s]=a;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,o=r+1;o<t;++o)a+=e[o][r]*n[o];n[r]=(e[t][r]-a)/e[r][r]}return n}const dS=2,hS=1e-12;function JF(e,t,n,i){const[r,o,s,a]=Fg(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=dS;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],v=g[1],x=y-r[b]>r[v]-y?b:v;let E=0,S=0,w=0,_=0,A=0;const k=1/Math.abs(r[x]-y||1);for(let M=b;M<=v;++M){const F=r[M],$=o[M],T=z4(Math.abs(y-F)*k)*d[M],L=F*T;E+=T,S+=L,w+=$*T,_+=$*L,A+=F*L}const[C,O]=Lc(S/E,w/E,_/E,A/E);c[m]=C+O*y,f[m]=Math.abs(o[m]-c[m]),B4(r,m+1,g)}if(h===dS)break;const p=UC(f);if(Math.abs(p)<hS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?hS:(b=1-y*y)*b}return U4(r,c,s,a)}function z4(e){return(e=1-e*e*e)*e*e}function B4(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}function U4(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],l;for(;s<r;++s)l=e[s]+n,u[0]===l?u[1]+=(t[s]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[s]],o.push(u));return u[1]+=i,o}const j4=.5*Math.PI/180;function Tg(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(o+p/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let p=n;--p>0;)c.push(r(o+p/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,g=q4(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&W4(f,p,d,h,g)>j4?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function q4(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const s=t[o][1];s<n&&(n=s),s>i&&(i=s)}return 1/(i-n)}function W4(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),s=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-s)}function H4(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function h1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:H4(e)}function QF(e,t,n){return n||e+(t?"_"+t:"")}const Sm=()=>{},G4={init:Sm,add:Sm,rem:Sm,idx:0},uc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Ic=Object.keys(uc).filter(e=>e!=="__count__");function V4(e,t){return(n,i)=>he({name:e,aggregate_param:i,out:n||e},G4,t)}[...Ic,"__count__"].forEach(e=>{uc[e]=V4(e,uc[e])});function ZF(e,t,n){return uc[e](n,t)}function eT(e,t){return e.idx-t.idx}function Y4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=uc[r]())})};return e.forEach(n),Object.values(t).sort(eT)}function X4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function K4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function J4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function Q4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function tT(e,t){const n=t||Vt,i=Y4(e),r=e.slice().sort(eT);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=X4,o.prototype.add=K4,o.prototype.rem=J4,o.prototype.set=Q4,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function tv(e){this._key=e?Qn(e):ie,this.reset()}const Mt=tv.prototype;Mt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Mt.add=function(e){this._add.push(e)};Mt.rem=function(e){this._rem.push(e)};Mt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,l;for(a=0;a<r;++a)s[n(t[a])]=1;for(a=0,u=0;a<i;++a)s[n(l=e[a])]?s[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o};Mt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",J(n,o)||(n[o]=1,++r);return r};Mt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=_C(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Mt.argmin=function(e){return this.extent(e)[0]||{}};Mt.argmax=function(e){return this.extent(e)[1]||{}};Mt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Mt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Mt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=zb(this.values(),e),this._get=e),this._q};Mt.q1=function(e){return this.quartile(e)[0]};Mt.q2=function(e){return this.quartile(e)[1]};Mt.q3=function(e){return this.quartile(e)[2]};Mt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=UF(this.values(),1e3,.05,e),this._get=e),this._ci};Mt.ci0=function(e){return this.ci(e)[0]};Mt.ci1=function(e){return this.ci(e)[1]};function Fo(e){D.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Fo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ic},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(Fo,D,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}o(e._prev),o(t);function s(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?s(h,u,l):t[h]||e.cell(h,u)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=X(qt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=X(e.groupby),this._dnames=this._dims.map(b=>{const v=Je(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:h1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,g,p,m,y;for(l!==s.length&&N("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&N("Null aggregate field specified."),p=Je(f),m=QF(d,p,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}g=c[p],g||(r(f),g=c[p]=[],g.field=f,this._measures.push(g)),d!=="count"&&(this._countOnly=!1),g.push(ZF(d,h,m))}return this._measures=this._measures.map(b=>tT(b,b.field)),Object.create(null)},cellkey:h1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let o=0;o<r;++o)n.agg[o]=new i[o](n)}return n.store&&(n.data=new tv),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let s=0;s<r;++s)o[n[s]]=i[s](e);return t?OF(t.tuple,o):Ce(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,o=i.length;r<o;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,s=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&s.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?s:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const Z4=1e-14;function nv(e){D.call(this,null,e)}nv.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(nv,D,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,o=i.step,s=e.as||["bin0","bin1"],a=s[0],u=s[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(qt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+o*(1+(f-r)/o)}:c=>c[a]=i(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=BF(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;(s=e.anchor)!=null&&(a=s-(r+i*Math.floor((s-r)/i)),r+=a,o+=a);const u=function(l){let c=Ut(t(l));return c==null?null:c<r?-1/0:c>o?1/0:(c=Math.max(r,Math.min(c,o-i)),r+i*Math.floor(Z4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=An(u,qt(t),e.name||"bin_"+Je(t))}});function nT(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:u=>o.push(u),remove:u=>s[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!s[i(c)]),s={},a=0),l&&u&&r.sort(u),o.length&&(r=u?TC(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function iv(e){D.call(this,[],e)}iv.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(iv,D,{transform(e,t){const n=t.fork(t.ALL),i=nT(ie,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(ea(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function iT(e){Ie.call(this,null,e9,e)}G(iT,Ie);function e9(e){return this.value&&!e.modified()?this.value:vb(e.fields,e.orders)}function rv(e){D.call(this,null,e)}rv.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function t9(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(rv,D,{transform(e,t){const n=f=>d=>{for(var h=t9(a(d),e.case,o)||[],g,p=0,m=h.length;p<m;++p)s.test(g=h[p])||f(g)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,s=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[o]=l,s.add.push(u)):l===0?(u&&s.rem.push(u),n[a]=null,i[a]=null):u[o]!==l&&(u[o]=l,s.mod.push(u));return s.modifies(t)}});function ov(e){D.call(this,null,e)}ov.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(ov,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=n9(a,r,o,e.filter||Pn)):n.mod=a,n.source=this.value,n.modifies(i)}});function n9(e,t,n,i){for(var r=[],o={},s=e.length,a=0,u,l;a<s;++a)for(o[t]=l=e[a],u=0;u<s;++u)o[n]=e[u],i(o)&&(r.push(Ce(o)),o={},o[t]=l);return r}const gS={kde:qb,mixture:HF,normal:jb,lognormal:WF,uniform:GF},i9="distributions",pS="function",r9="field";function rT(e,t){const n=e[pS];J(gS,n)||N("Unknown distribution function: "+n);const i=gS[n]();for(const r in e)r===r9?i.data((e.from||t()).map(e[r])):r===i9?i[r](e[r].map(o=>rT(o,t))):typeof i[r]===pS&&i[r](e[r]);return i}function sv(e){D.call(this,null,e)}const oT=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],o9={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:oT},{name:"weights",type:"number",array:!0}]};sv.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:oT.concat(o9)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(sv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=rT(e.distribution,s9(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&N("Invalid density method: "+s),!e.extent&&!i.data&&N("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||Qi(i.data()),l=Tg(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function s9(e){return()=>e.materialize(e.SOURCE).source}function sT(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function av(e,t,n){const i=[],r=f=>f(u);let o,s,a,u,l,c;if(t==null)i.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)u=e[s],l=t.map(r),c=o[l],c||(o[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const aT="bin";function uv(e){D.call(this,null,e)}uv.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:aT}]};const a9=(e,t)=>Nc(Qi(e,t))/30;G(uv,D,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=av(t.source,e.groupby,Vt),r=e.smooth||!1,o=e.field,s=e.step||a9(n,o),a=ea((g,p)=>o(g)-o(p)),u=e.as||aT,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(a);h=-1;for(const p of jF(g,s,r,o))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function uT(e){Ie.call(this,null,u9,e),this.modified(!0)}G(uT,Ie);function u9(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:An(n=>t(n,e),qt(t),Je(t))}function lv(e){D.call(this,[void 0,void 0],e)}lv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(lv,D,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if((r||o==null)&&(o=1/0,s=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Ut(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Je(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function cv(e,t){Ie.call(this,e),this.parent=t,this.count=0}G(cv,Ie,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Mg(e){D.call(this,{},e),this._keys=Tu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Mg,D,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=J(r,e)&&r[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=i||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new cv(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),r[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,s=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ie(u),c=o.get(l);c!==void 0&&(o.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);o.set(ie(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ie(u),c=o.get(l),f=i(u);c===f?a(f).mod(u):(o.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(o.get(ie(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=ie(u),c=o.get(l),f=i(u);c!==f&&(o.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function lT(e){Ie.call(this,null,l9,e)}G(lT,Ie);function l9(e){return this.value&&!e.modified()?this.value:P(e.name)?X(e.name).map(t=>Qn(t)):Qn(e.name,e.as)}function fv(e){D.call(this,Tu(),e)}fv.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(fv,D,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ie(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(ie(f),1)});function c(f){const d=ie(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),o.push(f)):!h&&!g?(i.set(d,1),s.push(f)):l&&h&&!g&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function dv(e){D.call(this,[],e)}dv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(dv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=sT(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(g=>g(a)),l=u.reduce((g,p)=>Math.max(g,p.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Nb(a),f=0;f<s;++f)d[r[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}});function hv(e){D.call(this,[],e)}hv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(hv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Je),o=e.as||["key","value"],s=o[0],a=o[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Nb(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function gv(e){D.call(this,null,e)}gv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(gv,D,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,s=>s[i]=n(s,e))}});function cT(e){D.call(this,[],e)}G(cT,D,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;)s.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=r.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-o);return n.source=this.value=r,n}});const Cf={value:"value",median:UC,mean:QI,min:n1,max:_s},c9=[];function pv(e){D.call(this,[],e)}pv.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function f9(e){var t=e.method||Cf.value,n;if(Cf[t]==null)N("Unrecognized imputation method: "+t);else return t===Cf.value?(n=e.value!==void 0?e.value:0,()=>n):Cf[t]}function d9(e){const t=e.field;return n=>n?t(n):NaN}G(pv,D,{transform(e,t){var n=t.fork(t.ALL),i=f9(e),r=d9(e),o=Je(e.field),s=Je(e.key),a=(e.groupby||[]).map(Je),u=h9(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],E={_impute:!0},y=0,x=g.length;y<x;++y)E[a[y]]=g[y];E[s]=p,E[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function h9(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,g,p,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=a[g]||(a[g]=s.push(g)),c=(l=t?t.map(r):c9)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function mv(e){Fo.call(this,e)}mv.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Ic},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(mv,Fo,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(r=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{he(o,r[n.cellkey(o)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function yv(e){D.call(this,null,e)}yv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(yv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=av(i,e.groupby,e.field),o=(e.groupby||[]).map(Je),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&N("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Qi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=qb(h,s)[a],p=e.counts?h.length:1,m=c||Qi(h);Tg(g,m,f,d).forEach(y=>{const b={};for(let v=0;v<o.length;++v)b[o[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*p,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function fT(e){Ie.call(this,null,g9,e)}G(fT,Ie);function g9(e){return this.value&&!e.modified()?this.value:wb(e.fields,e.flat)}function dT(e){D.call(this,[],e),this._pending=null}G(dT,D,{transform(e,t){const n=t.dataflow;return this._pending?_m(this,t,this._pending):p9(e)?t.StopPropagation:e.values?_m(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=X(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>_m(this,t,X(i.data)))}});function p9(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function _m(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function bv(e){D.call(this,{},e)}bv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(bv,D,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&N('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&N('The "as" parameter has too few output field names.'),c=c||r.map(Je),f=function(g){for(var p=0,m=0,y,b;p<a;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=o;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||N("Missing output field names."),f=function(g){for(var p=0,m;p<a;++p)m=i.get(n[p](g)),g[c[p]]=m??o}),s?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function hT(e){Ie.call(this,null,m9,e)}G(hT,Ie);function m9(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<i&&(i=s[0]),s[1]>r&&(r=s[1]);return[i,r]}function gT(e){Ie.call(this,null,y9,e)}G(gT,Ie);function y9(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function pT(e){D.call(this,null,e)}G(pT,D,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function vv(e){Fo.call(this,e)}vv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ic,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(vv,Fo,{_transform:Fo.prototype.transform,transform(e,t){return this._transform(b9(e,t),t)}});function b9(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=qt(n).concat(qt(i)),s=x9(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(a=>v9(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function v9(e,t,n,i){return An(r=>t(r)===e?n(r):NaN,i,e+"")}function x9(e,t,n){const i={},r=[];return n.visit(n.SOURCE,o=>{const s=e(o);i[s]||(i[s]=1,r.push(s))}),r.sort(gg),t?r.slice(0,t):r}function mT(e){Mg.call(this,e)}G(mT,Mg,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(ie(o),n,t,o);return(e.modified("field")||i&&t.modified(qt(i)))&&N("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,o=>{const s=r(o);i(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=r(o);i(o).forEach(a=>s.add(Ce(a)))}),t.visit(t.REM,o=>{const s=r(o);i(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>r(o).mod(o)),t.visit(t.ADD,o=>r(o).add(o)),t.visit(t.REM,o=>r(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function xv(e){D.call(this,null,e)}xv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(xv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=sT(e.fields,e.as||[]),o=i?(a,u)=>w9(a,u,i,r):Sg;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=ie(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Ce({}));s[ie(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[ie(a)]))}),n}});function w9(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function yT(e){D.call(this,null,e)}G(yT,D,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function wv(e){D.call(this,null,e)}wv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const E9=1e-14;G(wv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=av(r,e.groupby,e.field),s=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Mn(u/2,1-E9,u),c=l.length;return o.forEach(f=>{const d=Ib(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<s.length;++p)g[s[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],a.push(Ce(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function bT(e){D.call(this,null,e)}G(bT,D,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const o=ie(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=Nb(r);i[ie(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[ie(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function Ev(e){D.call(this,[],e),this.count=0}Ev.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(Ev,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[ie(f)]=1,c),{});let s=this.value,a=this.count,u=0;function l(c){let f,d;s.length<r?s.push(c):(d=~~((a+1)*ei()),d<s.length&&d>=u&&(f=s[d],o[ie(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ie(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[ie(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[ie(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[ie(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ie(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[ie(c)])),this.count=a,this.value=n.source=s,n}});function Sv(e){D.call(this,null,e)}Sv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(Sv,D,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Mn(e.start,e.stop,e.step||1).map(r=>{const o={};return o[i]=r,Ce(o)}),n.add=t.add.concat(this.value),n}});function vT(e){D.call(this,null,e),this.modified(!0)}G(vT,D,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function _v(e){D.call(this,null,e)}const xT=["unit0","unit1"];_v.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:$b,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:xT}]};G(_v,D,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?Ru:Ou)(o.unit).offset,a=e.as||xT,u=a[0],l=a[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(qt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=o(p),i&&(g[l]=y=s(m,c)),m<f&&(f=m),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:cF({extent:e.extent||Qi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=kb(i),s=this.value||{},a=(n?tF:eF)(o,r);return a.unit=Ee(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function wT(e){D.call(this,Tu(),e)}G(wT,D,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=a=>r.set(i(a),a);let s=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function ET(e){D.call(this,null,e)}G(ET,D,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ea(e.sort)):t.source).map(e.field))}});function S9(e,t,n,i){const r=lc[e](t,n);return{init:r.init||fo,update:function(o,s){s[i]=r.next(o)}}}const lc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||N("ntile num must be greater than zero.");const n=lc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||N("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=_9(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function _9(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const A9=Object.keys(lc);function ST(e){const t=X(e.ops),n=X(e.fields),i=X(e.params),r=X(e.aggregate_params),o=X(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){X(qt(g)).forEach(p=>u[p]=1)}h(e.sort),t.forEach((g,p)=>{const m=n[p],y=i[p],b=r[p]||null,v=Je(m),x=QF(g,v,o[p]);if(h(m),s.push(x),J(lc,g))a.push(S9(g,m,y,x));else{if(m==null&&g!=="count"&&N("Null aggregate field specified."),g==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(ZF(g,b,x))}}),(c.length||f.length)&&(this.cell=$9(f,c,d)),this.inputs=Object.keys(u)}const _T=ST.prototype;_T.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};_T.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(r[s]);for(s=e.p1;s<e.i1;++s)n.add(r[s]);n.set(t)}for(s=0;s<o;++s)i[s].update(e,t)};function $9(e,t,n){e=e.map(u=>tT(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),s=0;s<r;++s)o[s]=new e[s](i);if(i.store)var a=i.data=new tv;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)o[l].add(o[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)o[l].rem(o[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)o[u].init()},i}function Av(e){D.call(this,{},e),this._mlen=0,this._mods=[]}Av.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:A9.concat(Ic)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(Av,D,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=h1(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new ST(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)k9(this._mods[a],s,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=nT(ie),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function k9(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,s=i.frame||[null,0],a=e.data(n),u=a.length,l=o?ag(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Yt(-1)};t.init();for(let f=0;f<u;++f)C9(c,s,f,u),o&&F9(c,l),t.update(c,a[f])}function C9(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function F9(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,s=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<s&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}const T9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Fo,bin:nv,collect:iv,compare:iT,countpattern:rv,cross:ov,density:sv,dotbin:uv,expression:uT,extent:lv,facet:Mg,field:lT,filter:fv,flatten:dv,fold:hv,formula:gv,generate:cT,impute:pv,joinaggregate:mv,kde:yv,key:fT,load:dT,lookup:bv,multiextent:hT,multivalues:gT,params:pT,pivot:vv,prefacet:mT,project:xv,proxy:yT,quantile:wv,relay:bT,sample:Ev,sequence:Sv,sieve:vT,subflow:cv,timeunit:_v,tupleindex:wT,values:ET,window:Av},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const mS=Math.abs,Rt=Math.atan2,ns=Math.cos,M9=Math.max,Am=Math.min,Li=Math.sin,ws=Math.sqrt,Lt=1e-12,Qa=Math.PI,jd=Qa/2,AT=2*Qa;function D9(e){return e>1?0:e<-1?Qa:Math.acos(e)}function yS(e){return e>=1?jd:e<=-1?-jd:Math.asin(e)}function Dg(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new lI(t)}function O9(e){return e.innerRadius}function R9(e){return e.outerRadius}function N9(e){return e.startAngle}function L9(e){return e.endAngle}function P9(e){return e&&e.padAngle}function I9(e,t,n,i,r,o,s,a){var u=n-e,l=i-t,c=s-r,f=a-o,d=f*u-c*l;if(!(d*d<Lt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function Ff(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/ws(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,v=p-h,x=b*b+v*v,E=r-o,S=d*p-g*h,w=(v<0?-1:1)*ws(M9(0,E*E*x-S*S)),_=(S*v-b*w)/x,A=(-S*b-v*w)/x,k=(S*v+b*w)/x,C=(-S*b+v*w)/x,O=_-m,M=A-y,F=k-m,$=C-y;return O*O+M*M>F*F+$*$&&(_=k,A=C),{cx:_,cy:A,x01:-c,y01:-f,x11:_*(r/E-1),y11:A*(r/E-1)}}function z9(){var e=O9,t=R9,n=Fe(0),i=null,r=N9,o=L9,s=P9,a=null,u=Dg(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-jd,p=o.apply(this,arguments)-jd,m=mS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Lt))a.moveTo(0,0);else if(m>AT-Lt)a.moveTo(h*ns(g),h*Li(g)),a.arc(0,0,h,g,p,!y),d>Lt&&(a.moveTo(d*ns(p),d*Li(p)),a.arc(0,0,d,p,g,y));else{var b=g,v=p,x=g,E=p,S=m,w=m,_=s.apply(this,arguments)/2,A=_>Lt&&(i?+i.apply(this,arguments):ws(d*d+h*h)),k=Am(mS(h-d)/2,+n.apply(this,arguments)),C=k,O=k,M,F;if(A>Lt){var $=yS(A/d*Li(_)),T=yS(A/h*Li(_));(S-=$*2)>Lt?($*=y?1:-1,x+=$,E-=$):(S=0,x=E=(g+p)/2),(w-=T*2)>Lt?(T*=y?1:-1,b+=T,v-=T):(w=0,b=v=(g+p)/2)}var L=h*ns(b),z=h*Li(b),I=d*ns(E),Q=d*Li(E);if(k>Lt){var ue=h*ns(v),oe=h*Li(v),fe=d*ns(x),Pe=d*Li(x),de;if(m<Qa)if(de=I9(L,z,fe,Pe,ue,oe,I,Q)){var Dt=L-de[0],ts=z-de[1],to=ue-de[0],Z=oe-de[1],pe=1/Li(D9((Dt*to+ts*Z)/(ws(Dt*Dt+ts*ts)*ws(to*to+Z*Z)))/2),ye=ws(de[0]*de[0]+de[1]*de[1]);C=Am(k,(d-ye)/(pe-1)),O=Am(k,(h-ye)/(pe+1))}else C=O=0}w>Lt?O>Lt?(M=Ff(fe,Pe,L,z,h,O,y),F=Ff(ue,oe,I,Q,h,O,y),a.moveTo(M.cx+M.x01,M.cy+M.y01),O<k?a.arc(M.cx,M.cy,O,Rt(M.y01,M.x01),Rt(F.y01,F.x01),!y):(a.arc(M.cx,M.cy,O,Rt(M.y01,M.x01),Rt(M.y11,M.x11),!y),a.arc(0,0,h,Rt(M.cy+M.y11,M.cx+M.x11),Rt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,O,Rt(F.y11,F.x11),Rt(F.y01,F.x01),!y))):(a.moveTo(L,z),a.arc(0,0,h,b,v,!y)):a.moveTo(L,z),!(d>Lt)||!(S>Lt)?a.lineTo(I,Q):C>Lt?(M=Ff(I,Q,ue,oe,d,-C,y),F=Ff(L,z,fe,Pe,d,-C,y),a.lineTo(M.cx+M.x01,M.cy+M.y01),C<k?a.arc(M.cx,M.cy,C,Rt(M.y01,M.x01),Rt(F.y01,F.x01),!y):(a.arc(M.cx,M.cy,C,Rt(M.y01,M.x01),Rt(M.y11,M.x11),!y),a.arc(0,0,d,Rt(M.cy+M.y11,M.cx+M.x11),Rt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,C,Rt(F.y11,F.x11),Rt(F.y01,F.x01),!y))):a.arc(0,0,d,E,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Qa/2;return[ns(f)*c,Li(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Fe(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Fe(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Fe(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Fe(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Fe(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Fe(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Fe(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function $T(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kT(e){this._context=e}kT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function $v(e){return new kT(e)}function CT(e){return e[0]}function FT(e){return e[1]}function TT(e,t){var n=Fe(!0),i=null,r=$v,o=null,s=Dg(a);e=typeof e=="function"?e:e===void 0?CT:Fe(e),t=typeof t=="function"?t:t===void 0?FT:Fe(t);function a(u){var l,c=(u=$T(u)).length,f,d=!1,h;for(i==null&&(o=r(h=s())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Fe(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Fe(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Fe(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(o=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=o=null:o=r(i=u),a):i},a}function MT(e,t,n){var i=null,r=Fe(!0),o=null,s=$v,a=null,u=Dg(l);e=typeof e=="function"?e:e===void 0?CT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?FT:Fe(+n);function l(f){var d,h,g,p=(f=$T(f)).length,m,y=!1,b,v=new Array(p),x=new Array(p);for(o==null&&(a=s(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=d-1;g>=h;--g)a.point(v[g],x[g]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return TT().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Fe(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Fe(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Fe(!!f),l):r},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}const B9={draw(e,t){const n=ws(t/Qa);e.moveTo(n,0),e.arc(0,0,n,0,AT)}};function U9(e,t){let n=null,i=Dg(r);e=typeof e=="function"?e:Fe(e||B9),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function r(){let o;if(n||(n=o=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return r.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function To(){}function qd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Og(e){this._context=e}Og.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:qd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function j9(e){return new Og(e)}function DT(e){this._context=e}DT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function q9(e){return new DT(e)}function OT(e){this._context=e}OT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function W9(e){return new OT(e)}function RT(e,t){this._basis=new Og(e),this._beta=t}RT.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const H9=function e(t){function n(i){return t===1?new Og(i):new RT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Wd(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function kv(e,t){this._context=e,this._k=(1-t)/6}kv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Wd(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const G9=function e(t){function n(i){return new kv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Cv(e,t){this._context=e,this._k=(1-t)/6}Cv.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const V9=function e(t){function n(i){return new Cv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Fv(e,t){this._context=e,this._k=(1-t)/6}Fv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Y9=function e(t){function n(i){return new Fv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Tv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Lt){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Lt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function NT(e,t){this._context=e,this._alpha=t}NT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const X9=function e(t){function n(i){return t?new NT(i,t):new kv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function LT(e,t){this._context=e,this._alpha=t}LT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const K9=function e(t){function n(i){return t?new LT(i,t):new Cv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function PT(e,t){this._context=e,this._alpha=t}PT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const J9=function e(t){function n(i){return t?new PT(i,t):new Fv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function IT(e){this._context=e}IT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Q9(e){return new IT(e)}function bS(e){return e<0?-1:1}function vS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(bS(o)+bS(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function xS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $m(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function Hd(e){this._context=e}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$m(this,this._t0,xS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,$m(this,xS(this,n=vS(this,e,t)),n);break;default:$m(this,this._t0,n=vS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zT(e){this._context=new BT(e)}(zT.prototype=Object.create(Hd.prototype)).point=function(e,t){Hd.prototype.point.call(this,t,e)};function BT(e){this._context=e}BT.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function Z9(e){return new Hd(e)}function e8(e){return new zT(e)}function UT(e){this._context=e}UT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=wS(e),r=wS(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function wS(e){var t,n=e.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(r[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function t8(e){return new UT(e)}function Rg(e,t){this._context=e,this._t=t}Rg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function n8(e){return new Rg(e,.5)}function i8(e){return new Rg(e,0)}function r8(e){return new Rg(e,1)}function $o(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const o8=()=>typeof Image<"u"?Image:null,g1=Symbol("implicit");function Mv(){var e=new qE,t=[],n=[],i=g1;function r(o){let s=e.get(o);if(s===void 0){if(i!==g1)return i;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new qE;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Mv(t,n).unknown(i)},jo.apply(r,arguments),r}const jT=Math.PI/180,qT=180/Math.PI,Gd=18,WT=.96422,HT=1,GT=.82521,VT=4/29,Ia=6/29,YT=3*Ia*Ia,s8=Ia*Ia*Ia;function XT(e){if(e instanceof Yi)return new Yi(e.l,e.a,e.b,e.opacity);if(e instanceof Mr)return KT(e);e instanceof cg||(e=uC(e));var t=Tm(e.r),n=Tm(e.g),i=Tm(e.b),r=km((.2225045*t+.7168786*n+.0606169*i)/HT),o,s;return t===n&&n===i?o=s=r:(o=km((.4360747*t+.3850649*n+.1430804*i)/WT),s=km((.0139322*t+.0971045*n+.7141733*i)/GT)),new Yi(116*r-16,500*(o-r),200*(r-s),e.opacity)}function Vd(e,t,n,i){return arguments.length===1?XT(e):new Yi(e,t,n,i??1)}function Yi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}lb(Yi,Vd,cb(fb,{brighter(e){return new Yi(this.l+Gd*(e??1),this.a,this.b,this.opacity)},darker(e){return new Yi(this.l-Gd*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=WT*Cm(t),e=HT*Cm(e),n=GT*Cm(n),new cg(Fm(3.1338561*t-1.6168667*e-.4906146*n),Fm(-.9787684*t+1.9161415*e+.033454*n),Fm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function km(e){return e>s8?Math.pow(e,1/3):e/YT+VT}function Cm(e){return e>Ia?e*e*e:YT*(e-VT)}function Fm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Tm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function a8(e){if(e instanceof Mr)return new Mr(e.h,e.c,e.l,e.opacity);if(e instanceof Yi||(e=XT(e)),e.a===0&&e.b===0)return new Mr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*qT;return new Mr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Yd(e,t,n,i){return arguments.length===1?a8(e):new Mr(e,t,n,i??1)}function Mr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function KT(e){if(isNaN(e.h))return new Yi(e.l,0,0,e.opacity);var t=e.h*jT;return new Yi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}lb(Mr,Yd,cb(fb,{brighter(e){return new Mr(this.h,this.c,this.l+Gd*(e??1),this.opacity)},darker(e){return new Mr(this.h,this.c,this.l-Gd*(e??1),this.opacity)},rgb(){return KT(this).rgb()}}));var JT=-.14861,Dv=1.78277,Ov=-.29227,Ng=-.90649,cc=1.97294,ES=cc*Ng,SS=cc*Dv,_S=Dv*Ov-Ng*JT;function u8(e){if(e instanceof As)return new As(e.h,e.s,e.l,e.opacity);e instanceof cg||(e=uC(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(_S*i+ES*t-SS*n)/(_S+ES-SS),o=i-r,s=(cc*(n-r)-Ov*o)/Ng,a=Math.sqrt(s*s+o*o)/(cc*r*(1-r)),u=a?Math.atan2(s,o)*qT-120:NaN;return new As(u<0?u+360:u,a,r,e.opacity)}function p1(e,t,n,i){return arguments.length===1?u8(e):new As(e,t,n,i??1)}function As(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lb(As,p1,cb(fb,{brighter(e){return e=e==null?PE:Math.pow(PE,e),new As(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?LE:Math.pow(LE,e),new As(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*jT,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new cg(255*(t+n*(JT*i+Dv*r)),255*(t+n*(Ov*i+Ng*r)),255*(t+n*(cc*i)),this.opacity)}}));function l8(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function c8(e,t){var n=fg(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function QT(e){return function(t,n){var i=e((t=e1(t)).h,(n=e1(n)).h),r=Bt(t.s,n.s),o=Bt(t.l,n.l),s=Bt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const f8=QT(fg);var d8=QT(Bt);function h8(e,t){var n=Bt((e=Vd(e)).l,(t=Vd(t)).l),i=Bt(e.a,t.a),r=Bt(e.b,t.b),o=Bt(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=i(s),e.b=r(s),e.opacity=o(s),e+""}}function ZT(e){return function(t,n){var i=e((t=Yd(t)).h,(n=Yd(n)).h),r=Bt(t.c,n.c),o=Bt(t.l,n.l),s=Bt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const g8=ZT(fg);var p8=ZT(Bt);function eM(e){return function t(n){n=+n;function i(r,o){var s=e((r=p1(r)).h,(o=p1(o)).h),a=Bt(r.s,o.s),u=Bt(r.l,o.l),l=Bt(r.opacity,o.opacity);return function(c){return r.h=s(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const m8=eM(fg);var y8=eM(Bt);function Rv(e,t){t===void 0&&(t=e,e=Oc);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function b8(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const v8=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Oc,interpolateArray:QP,interpolateBasis:ZP,interpolateBasisClosed:eI,interpolateCubehelix:m8,interpolateCubehelixLong:y8,interpolateDate:tI,interpolateDiscrete:l8,interpolateHcl:g8,interpolateHclLong:p8,interpolateHsl:f8,interpolateHslLong:d8,interpolateHue:c8,interpolateLab:h8,interpolateNumber:nI,interpolateNumberArray:iI,interpolateObject:rI,interpolateRgb:oI,interpolateRgbBasis:sI,interpolateRgbBasisClosed:aI,interpolateRound:ug,interpolateString:uI,interpolateTransformCss:cI,interpolateTransformSvg:fI,interpolateZoom:dI,piecewise:Rv,quantize:b8},Symbol.toStringTag,{value:"Module"}));function tM(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,RE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return tM(e).unknown(t)},e=arguments.length?Array.from(e,RE):[0,1],$u(n)}function nM(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),e[n]=t.floor(r),e[i]=t.ceil(o),e}function AS(e){return Math.log(e)}function $S(e){return Math.exp(e)}function x8(e){return-Math.log(-e)}function w8(e){return-Math.exp(-e)}function E8(e){return isFinite(e)?+("1e"+e):e<0?0:e}function S8(e){return e===10?E8:e===Math.E?Math.exp:t=>Math.pow(e,t)}function _8(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kS(e){return(t,n)=>-e(-t,n)}function Nv(e){const t=e(AS,$S),n=t.domain;let i=10,r,o;function s(){return r=_8(i),o=S8(i),n()[0]<0?(r=kS(r),o=kS(o),e(x8,w8)):e(AS,$S),t}return t.base=function(a){return arguments.length?(i=+a,s()):i},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),g,p;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(g=1;g<i;++g)if(p=d<0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(p=d>0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}y.length*2<m&&(y=NE(l,c,m))}else y=NE(d,h,Math.min(h-d,m)).map(o);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Z0(u)).precision==null&&(u.trim=!0),u=aC(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/o(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(nM(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function iM(){const e=Nv(ub()).domain([1,10]);return e.copy=()=>lg(e,iM()).base(e.base()),jo.apply(e,arguments),e}function CS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lv(e){var t=1,n=e(CS(t),FS(t));return n.constant=function(i){return arguments.length?e(CS(t=+i),FS(t)):t},$u(n)}function rM(){var e=Lv(ub());return e.copy=function(){return lg(e,rM()).constant(e.constant())},jo.apply(e,arguments)}function TS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function A8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $8(e){return e<0?-e*e:e*e}function Pv(e){var t=e(ho,ho),n=1;function i(){return n===1?e(ho,ho):n===.5?e(A8,$8):e(TS(n),TS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},$u(t)}function Iv(){var e=Pv(ub());return e.copy=function(){return lg(e,Iv()).exponent(e.exponent())},jo.apply(e,arguments),e}function k8(){return Iv.apply(null,arguments).exponent(.5)}function oM(){var e=[],t=[],n=[],i;function r(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=BC(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[Ga(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(rc),r()},o.range=function(s){return arguments.length?(t=Array.from(s),r()):t.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return oM().domain(e).range(t).unknown(i)},jo.apply(o,arguments)}function sM(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[Ga(i,u,0,n)]:o}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},s.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},s.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},s.unknown=function(u){return arguments.length&&(o=u),s},s.thresholds=function(){return i.slice()},s.copy=function(){return sM().domain([e,t]).range(r).unknown(o)},jo.apply($u(s),arguments)}function C8(e){return new Date(e)}function F8(e){return e instanceof Date?+e:+new Date(+e)}function zv(e,t,n,i,r,o,s,a,u,l){var c=HP(),f=c.invert,d=c.domain,h=l(".%L"),g=l(":%S"),p=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function E(S){return(u(S)<S?h:a(S)<S?g:s(S)<S?p:o(S)<S?m:i(S)<S?r(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?d(Array.from(S,F8)):d().map(C8)},c.ticks=function(S){var w=d();return e(w[0],w[w.length-1],S??10)},c.tickFormat=function(S,w){return w==null?E:l(w)},c.nice=function(S){var w=d();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?d(nM(w,S)):c},c.copy=function(){return lg(c,zv(e,t,n,i,r,o,s,a,u,l))},c}function T8(){return jo.apply(zv(hz,gz,Zi,oc,Mu,Rr,yg,pg,Tr,Fb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function M8(){return jo.apply(zv(fz,dz,er,sc,Du,_o,bg,mg,Tr,Tb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lg(){var e=0,t=1,n,i,r,o,s=ho,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:s(r===0?.5:(f=(o(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),i=o(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function c(f){return function(d){var h,g;return arguments.length?([h,g]=d,s=f(h,g),l):[s(0),s(1)]}}return l.range=c(Oc),l.rangeRound=c(ug),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function Ho(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Bv(){var e=$u(Lg()(ho));return e.copy=function(){return Ho(e,Bv())},qo.apply(e,arguments)}function aM(){var e=Nv(Lg()).domain([1,10]);return e.copy=function(){return Ho(e,aM()).base(e.base())},qo.apply(e,arguments)}function uM(){var e=Lv(Lg());return e.copy=function(){return Ho(e,uM()).constant(e.constant())},qo.apply(e,arguments)}function Uv(){var e=Pv(Lg());return e.copy=function(){return Ho(e,Uv()).exponent(e.exponent())},qo.apply(e,arguments)}function D8(){return Uv.apply(null,arguments).exponent(.5)}function Pg(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=ho,c,f=!1,d;function h(p){return isNaN(p=+p)?d:(p=.5+((p=+c(p))-o)*(i*p<i*o?a:u),l(f?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,n]=p,r=c(e=+e),o=c(t=+t),s=c(n=+n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h):[e,t,n]},h.clamp=function(p){return arguments.length?(f=!!p,h):f},h.interpolator=function(p){return arguments.length?(l=p,h):l};function g(p){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Rv(p,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=g(Oc),h.rangeRound=g(ug),h.unknown=function(p){return arguments.length?(d=p,h):d},function(p){return c=p,r=p(e),o=p(t),s=p(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function lM(){var e=$u(Pg()(ho));return e.copy=function(){return Ho(e,lM())},qo.apply(e,arguments)}function cM(){var e=Nv(Pg()).domain([.1,1,10]);return e.copy=function(){return Ho(e,cM()).base(e.base())},qo.apply(e,arguments)}function fM(){var e=Lv(Pg());return e.copy=function(){return Ho(e,fM()).constant(e.constant())},qo.apply(e,arguments)}function jv(){var e=Pv(Pg());return e.copy=function(){return Ho(e,jv()).exponent(e.exponent())},qo.apply(e,arguments)}function O8(){return jv.apply(null,arguments).exponent(.5)}function ur(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const R8=ur("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),N8=ur("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),L8=ur("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),P8=ur("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),I8=ur("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),z8=ur("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),B8=ur("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),U8=ur("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),j8=ur("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),q8=ur("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function qv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const W8="identity",Za="linear",jr="log",zc="pow",Bc="sqrt",Ig="symlog",Rs="time",Ns="utc",Xi="sequential",Lu="diverging",eu="quantile",zg="quantize",Bg="threshold",Wv="ordinal",m1="point",dM="band",Hv="bin-ordinal",ct="continuous",Uc="discrete",jc="discretizing",ri="interpolating",Gv="temporal";function H8(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function G8(e){return function(t){const n=e.range();let i=t[0],r=t[1],o=-1,s,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(o<0&&(o=u),s=u);if(!(o<0))return i=e.invertExtent(n[o]),r=e.invertExtent(n[s]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Vv(){const e=Mv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,o,s=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],g=qv(f,a,u);let p=i[d-0];r=(h-p)/(g||1),s&&(r=Math.floor(r)),p+=(h-p-r*(f-a))*l,o=r*(1-a),s&&(p=Math.round(p),o=Math.round(o));const m=Mn(f).map(y=>p+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),g=h.length-1;let p=+f[0],m=+f[1],y,b,v;if(!(p!==p||m!==m)&&(m<p&&(v=p,p=m,m=v),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Ga(h,p)-1),b=p===m?y:Ga(h,m)-1,p-h[y]>o+1e-10&&++y,d&&(v=y,y=g-b,b=g-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Vv().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function hM(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return hM(t())},e}function V8(){return hM(Vv().paddingInner(1))}var Y8=Array.prototype.map;function X8(e){return Y8.call(e,Ut)}const K8=Array.prototype.slice;function gM(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Ga(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=X8(i),n):e.slice()},n.range=function(i){return arguments.length?(t=K8.call(i),n):t.slice()},n.tickFormat=function(i,r){return YP(e[0],Ee(e),i??10,r)},n.copy=function(){return gM().domain(n.domain()).range(n.range())},n}const Xd=new Map,pM=Symbol("vega_scale");function mM(e){return e[pM]=!0,e}function J8(e){return e&&e[pM]===!0}function Q8(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?H8(o):o.invertExtent?G8(o):void 0),o.type=e,mM(o)};return i.metadata=xi(X(n)),i}function ke(e,t,n){return arguments.length>1?(Xd.set(e,Q8(e,t,n)),this):yM(e)?Xd.get(e):void 0}ke(W8,tM);ke(Za,GP,ct);ke(jr,iM,[ct,jr]);ke(zc,Iv,ct);ke(Bc,k8,ct);ke(Ig,rM,ct);ke(Rs,T8,[ct,Gv]);ke(Ns,M8,[ct,Gv]);ke(Xi,Bv,[ct,ri]);ke(`${Xi}-${Za}`,Bv,[ct,ri]);ke(`${Xi}-${jr}`,aM,[ct,ri,jr]);ke(`${Xi}-${zc}`,Uv,[ct,ri]);ke(`${Xi}-${Bc}`,D8,[ct,ri]);ke(`${Xi}-${Ig}`,uM,[ct,ri]);ke(`${Lu}-${Za}`,lM,[ct,ri]);ke(`${Lu}-${jr}`,cM,[ct,ri,jr]);ke(`${Lu}-${zc}`,jv,[ct,ri]);ke(`${Lu}-${Bc}`,O8,[ct,ri]);ke(`${Lu}-${Ig}`,fM,[ct,ri]);ke(eu,oM,[jc,eu]);ke(zg,sM,jc);ke(Bg,VP,jc);ke(Hv,gM,[Uc,jc]);ke(Wv,Mv,Uc);ke(dM,Vv,Uc);ke(m1,V8,Uc);function yM(e){return Xd.has(e)}function na(e,t){const n=Xd.get(e);return n&&n.metadata[t]}function Yv(e){return na(e,ct)}function tu(e){return na(e,Uc)}function y1(e){return na(e,jc)}function bM(e){return na(e,jr)}function Z8(e){return na(e,Gv)}function vM(e){return na(e,ri)}function xM(e){return na(e,eu)}const e7=["clamp","base","constant","exponent"];function wM(e,t){const n=t[0],i=Ee(t)-n;return function(r){return e(n+r*i)}}function Ug(e,t,n){return Rv(Xv(t||"rgb",n),e)}function EM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function SM(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?Yt(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=ke(o)().domain([t,n]).range([0,1]),e7.forEach(a=>e[a]?s[a](e[a]()):0),s)}function Xv(e,t){const n=v8[t7(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function t7(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const n7={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},i7={accent:N8,category10:R8,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:L8,observable10:P8,paired:I8,pastel1:z8,pastel2:B8,set1:U8,set2:j8,set3:q8,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function _M(e){if(P(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function AM(e,t){for(const n in e)Kv(n,t(e[n]))}const MS={};AM(i7,_M);AM(n7,e=>Ug(_M(e)));function Kv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(MS[e]=t,this):MS[e]}const dd="symbol",r7="discrete",o7="gradient",s7=e=>P(e)?e.map(t=>String(t)):String(e),a7=(e,t)=>e[1]-t[1],u7=(e,t)=>t[1]-e[1];function Jv(e,t,n){let i;return Ae(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Nc(e.domain())/n||1)+1))),Y(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Rs?Ou(t):e.type==Ns?Ru(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function $M(e,t,n){let i=e.range(),r=i[0],o=Ee(i),s=a7;if(r>o&&(i=o,o=r,r=i,s=u7),r=Math.floor(r),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ee(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Qv(e,t){return e.bins?$M(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function kM(e,t,n,i,r,o){const s=t.type;let a=s7;if(s===Rs||r===Rs)a=e.timeFormat(i);else if(s===Ns||r===Ns)a=e.utcFormat(i);else if(bM(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=CM(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function CM(e,t,n){const i=Qv(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/o));return l*r<r-.5&&(l*=r),l<=s};return n?i.filter(a):a}const b1={[eu]:"quantiles",[zg]:"thresholds",[Bg]:"domain"},FM={[eu]:"quantiles",[zg]:"domain"};function TM(e,t){return e.bins?f7(e.bins):e.type===jr?CM(e,t,!0):b1[e.type]?c7(e[b1[e.type]]()):Qv(e,t)}function l7(e,t,n){const i=t[FM[t.type]](),r=i.length;let o=r>1?i[1]-i[0]:i[0],s;for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,3*10,n)}function c7(e){const t=[-1/0].concat(e);return t.max=1/0,t}function f7(e){const t=e.slice(0,-1);return t.max=Ee(e),t}const d7=e=>b1[e.type]||e.bins;function MM(e,t,n,i,r,o,s){const a=FM[t.type]&&o!==Rs&&o!==Ns?l7(e,t,r):kM(e,t,n,r,o,s);return i===dd&&d7(t)?h7(a):i===r7?g7(a):p7(a)}const h7=e=>(t,n,i)=>{const r=DS(i[n+1],DS(i.max,1/0)),o=OS(t,e),s=OS(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},DS=(e,t)=>e??t,g7=e=>(t,n)=>n?e(t):null,p7=e=>t=>e(t),OS=(e,t)=>Number.isFinite(e)?t(e):null;function m7(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ee(t),o=r-i;if(e.type===Bg){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function y7(e,t,n,i){const r=i||t.type;return K(n)&&Z8(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Rs?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Ns?e.utcFormat("%A, %d %B %Y, %X UTC"):MM(e,t,5,null,n,i,!0)}function DM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=y7(e,t,n.format,n.formatType);if(y1(t.type)){const o=TM(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(tu(t.type)){const o=t.domain(),s=o.length,a=s>i?o.slice(0,i-2).map(r).join(", ")+", ending with "+o.slice(-1).map(r):o.map(r).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${r(o[0])} to ${r(Ee(o))}`}}let OM=0;function b7(){OM=0}const Kd="p_";function Zv(e){return e&&e.gradient}function RM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Kd:"";return r||(r=e.id="gradient_"+OM++,i==="radial"?(e.x1=Pi(e.x1,.5),e.y1=Pi(e.y1,.5),e.r1=Pi(e.r1,0),e.x2=Pi(e.x2,.5),e.y2=Pi(e.y2,.5),e.r2=Pi(e.r2,.5),o=Kd):(e.x1=Pi(e.x1,0),e.y1=Pi(e.y1,0),e.x2=Pi(e.x2,1),e.y2=Pi(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function Pi(e,t){return e??t}function NM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const RS={basis:{curve:j9},"basis-closed":{curve:q9},"basis-open":{curve:W9},bundle:{curve:H9,tension:"beta",value:.85},cardinal:{curve:G9,tension:"tension",value:0},"cardinal-open":{curve:Y9,tension:"tension",value:0},"cardinal-closed":{curve:V9,tension:"tension",value:0},"catmull-rom":{curve:X9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:K9,tension:"alpha",value:.5},"catmull-rom-open":{curve:J9,tension:"alpha",value:.5},linear:{curve:$v},"linear-closed":{curve:Q9},monotone:{horizontal:e8,vertical:Z9},natural:{curve:t8},step:{curve:n8},"step-after":{curve:r8},"step-before":{curve:i8}};function ex(e,t,n){var i=J(RS,e)&&RS[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const v7={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},x7=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,w7=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,E7=/^((\s+,?\s*)|(,\s*))/,S7=/^[01]/;function nu(e){const t=[];return(e.match(x7)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=v7[o],a=_7(o,s,i.slice(1).trim()),u=a.length;if(u<s||u&&u%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,s)]),u!==s){o==="m"&&(r=r==="M"?"L":"l");for(let l=s;l<u;l+=s)t.push([r,...a.slice(l,l+s)])}}),t}function _7(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?S7:w7,a=n.slice(r).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(E7);u!==null&&(r+=u[0].length)}return i}const Mo=Math.PI/180,A7=1e-14,ys=Math.PI/2,qi=Math.PI*2,ba=Math.sqrt(3)/2;var Mm={},Dm={},LM=[].join;function $7(e,t,n,i,r,o,s,a,u){const l=LM.call(arguments);if(Mm[l])return Mm[l];const c=s*Mo,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,g=d*(u-t)*.5-f*(a-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,S=m*e+y*t,w=b*e+v*t;let A=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;A<0&&(A=0);let k=Math.sqrt(A);o==r&&(k=-k);const C=.5*(x+S)-k*(w-E),O=.5*(E+w)+k*(S-x),M=Math.atan2(E-O,x-C);let $=Math.atan2(w-O,S-C)-M;$<0&&o===1?$+=qi:$>0&&o===0&&($-=qi);const T=Math.ceil(Math.abs($/(ys+.001))),L=[];for(let z=0;z<T;++z){const I=M+z*$/T,Q=M+(z+1)*$/T;L[z]=[C,O,I,Q,n,i,f,d]}return Mm[l]=L}function k7(e){const t=LM.call(e);if(Dm[t])return Dm[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7];const c=l*s,f=-u*a,d=u*s,h=l*a,g=Math.cos(r),p=Math.sin(r),m=Math.cos(o),y=Math.sin(o),b=.5*(o-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+g-x*p,S=i+p+x*g,w=n+m,_=i+y,A=w+x*y,k=_-x*m;return Dm[t]=[c*E+f*S,d*E+h*S,c*A+f*k,d*A+h*k,c*w+f*_,d*w+h*_]}const jn=["l",0,0,0,0,0,0,0];function C7(e,t,n){const i=jn[0]=e[0];if(i==="a"||i==="A")jn[1]=t*e[1],jn[2]=n*e[2],jn[3]=e[3],jn[4]=e[4],jn[5]=e[5],jn[6]=t*e[6],jn[7]=n*e[7];else if(i==="h"||i==="H")jn[1]=t*e[1];else if(i==="v"||i==="V")jn[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)jn[r]=(r%2==1?t:n)*e[r];return jn}function fc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,g,p,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),o==null&&(o=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(s=t[b],(r!==1||o!==1)&&(s=C7(s,r,o)),s[0]){case"l":u+=s[1],l+=s[2],e.lineTo(u+n,l+i);break;case"L":u=s[1],l=s[2],e.lineTo(u+n,l+i);break;case"h":u+=s[1],e.lineTo(u+n,l+i);break;case"H":u=s[1],e.lineTo(u+n,l+i);break;case"v":l+=s[1],e.lineTo(u+n,l+i);break;case"V":l=s[1],e.lineTo(u+n,l+i);break;case"m":u+=s[1],l+=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=s[1],l=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+s[5],h=l+s[6],c=u+s[3],f=l+s[4],e.bezierCurveTo(u+s[1]+n,l+s[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=s[5],l=s[6],c=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+s[3],h=l+s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+s[1]+n,l+s[2]+i,d+n,h+i),c=u+s[1],f=l+s[2],u=d,l=h;break;case"S":d=s[3],h=s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"q":d=u+s[3],h=l+s[4],c=u+s[1],f=l+s[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"t":d=u+s[1],h=l+s[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-g,f=2*l-p):a[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+s[1],f=l+s[2];break;case"T":d=s[1],h=s[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":NS(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+n,s[7]+l+i]),u+=s[6],l+=s[7];break;case"A":NS(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),u=s[6],l=s[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=s}}function NS(e,t,n,i){const r=$7(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const s=k7(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const LS=.5773502691896257,PS={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,qi)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*LS,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*LS;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function PM(e){return J(PS,e)?PS[e]:F7(e)}var Om={};function F7(e){if(!J(Om,e)){const t=nu(e);Om[e]={draw:function(n,i){fc(n,t,0,0,Math.sqrt(i)/2)}}}return Om[e]}const no=.448084975506;function T7(e){return e.x}function M7(e){return e.y}function D7(e){return e.width}function O7(e){return e.height}function vr(e){return typeof e=="function"?e:()=>+e}function Tf(e,t,n){return Math.max(t,Math.min(e,n))}function IM(){var e=T7,t=M7,n=D7,i=O7,r=vr(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Tf(+r.call(this,c),0,b),x=Tf(+o.call(this,c),0,b),E=Tf(+s.call(this,c),0,b),S=Tf(+a.call(this,c),0,b);if(u||(u=h=db()),v<=0&&x<=0&&E<=0&&S<=0)u.rect(g,p,m,y);else{var w=g+m,_=p+y;u.moveTo(g+v,p),u.lineTo(w-x,p),u.bezierCurveTo(w-no*x,p,w,p+no*x,w,p+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-no*S,w-no*S,_,w-S,_),u.lineTo(g+E,_),u.bezierCurveTo(g+no*E,_,g,_-no*E,g,_-E),u.lineTo(g,p+v),u.bezierCurveTo(g,p+no*v,g+no*v,p,g+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=vr(c),l):e},l.y=function(c){return arguments.length?(t=vr(c),l):t},l.width=function(c){return arguments.length?(n=vr(c),l):n},l.height=function(c){return arguments.length?(i=vr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=vr(c),o=f!=null?vr(f):r,a=d!=null?vr(d):r,s=h!=null?vr(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function zM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const g=h/2;if(o){var p=a-d,m=f-s;if(p||m){var y=Math.hypot(p,m),b=(p/=y)*u,v=(m/=y)*u,x=Math.atan2(m,p);r.moveTo(s-b,a-v),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,x-Math.PI,x),r.lineTo(s+b,a+v),r.arc(s,a,u,x,x+Math.PI)}else r.arc(f,d,g,0,qi);r.closePath()}else o=1;s=f,a=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=db()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(o=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function qc(e,t){return e??t}const Wc=e=>e.x||0,Hc=e=>e.y||0,R7=e=>e.width||0,N7=e=>e.height||0,L7=e=>(e.x||0)+(e.width||0),P7=e=>(e.y||0)+(e.height||0),I7=e=>e.startAngle||0,z7=e=>e.endAngle||0,B7=e=>e.padAngle||0,U7=e=>e.innerRadius||0,j7=e=>e.outerRadius||0,q7=e=>e.cornerRadius||0,W7=e=>qc(e.cornerRadiusTopLeft,e.cornerRadius)||0,H7=e=>qc(e.cornerRadiusTopRight,e.cornerRadius)||0,G7=e=>qc(e.cornerRadiusBottomRight,e.cornerRadius)||0,V7=e=>qc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,Y7=e=>qc(e.size,64),X7=e=>e.size||1,jg=e=>e.defined!==!1,K7=e=>PM(e.shape||"circle"),J7=z9().startAngle(I7).endAngle(z7).padAngle(B7).innerRadius(U7).outerRadius(j7).cornerRadius(q7),Q7=MT().x(Wc).y1(Hc).y0(P7).defined(jg),Z7=MT().y(Hc).x1(Wc).x0(L7).defined(jg),eB=TT().x(Wc).y(Hc).defined(jg),tB=IM().x(Wc).y(Hc).width(R7).height(N7).cornerRadius(W7,H7,G7,V7),nB=U9().type(K7).size(Y7),iB=zM().x(Wc).y(Hc).defined(jg).size(X7);function tx(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function rB(e,t){return J7.context(e)(t)}function oB(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?Z7:Q7).curve(ex(i,n.orient,n.tension)).context(e)(t)}function sB(e,t){const n=t[0],i=n.interpolate||"linear";return eB.curve(ex(i,n.orient,n.tension)).context(e)(t)}function Pu(e,t,n,i){return tB.context(e)(t,n,i)}function aB(e,t){return(t.mark.shape||t.shape).context(e)(t)}function uB(e,t){return nB.context(e)(t)}function lB(e,t){return iB.context(e)(t)}var BM=1;function UM(){BM=1}function nx(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+BM++),s=r.clipping[o]||(r.clipping[o]={id:o});return ge(i)?s.path=i(null):tx(n)?s.path=Pu(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function it(e){this.clear(),e&&this.union(e)}it.prototype={clone(){return new it(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*s+l,u*i+a*s+c,a*o-u*r+l,u*o+a*r+c,a*o-u*s+l,u*o+a*s+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function qg(e){this.mark=e,this.bounds=this.bounds||new it}function Wg(e){qg.call(this,e),this.items=this.items||[]}G(Wg,qg);class jM{constructor(t){this._pending=0,this._loader=t||xg()}pending(){return this._pending}sanitizeURL(t){const n=this;return IS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(al(n),i)).catch(()=>(al(n),null))}loadImage(t){const n=this,i=o8();return IS(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=J(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>al(n),s.onerror=()=>al(n),s.src=o,s}).catch(r=>(al(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function IS(e){e._pending+=1}function al(e){e._pending-=1}function Gr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?cB(t,i):0))}return e}function cB(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const fB=qi-1e-8;let Hg,hd,gd,Es,v1,pd,x1,w1;const go=(e,t)=>Hg.add(e,t),md=(e,t)=>go(hd=e,gd=t),zS=e=>go(e,Hg.y1),BS=e=>go(Hg.x1,e),bs=(e,t)=>v1*e+x1*t,vs=(e,t)=>pd*e+w1*t,Rm=(e,t)=>go(bs(e,t),vs(e,t)),Nm=(e,t)=>md(bs(e,t),vs(e,t));function Gc(e,t){return Hg=e,t?(Es=t*Mo,v1=w1=Math.cos(Es),pd=Math.sin(Es),x1=-pd):(v1=w1=1,Es=pd=x1=0),dB}const dB={beginPath(){},closePath(){},moveTo:Nm,lineTo:Nm,rect(e,t,n,i){Es?(Rm(e+n,t),Rm(e+n,t+i),Rm(e,t+i),Nm(e,t)):(go(e+n,t+i),md(e,t))},quadraticCurveTo(e,t,n,i){const r=bs(e,t),o=vs(e,t),s=bs(n,i),a=vs(n,i);US(hd,r,s,zS),US(gd,o,a,BS),md(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=bs(e,t),a=vs(e,t),u=bs(n,i),l=vs(n,i),c=bs(r,o),f=vs(r,o);jS(hd,s,u,c,zS),jS(gd,a,l,f,BS),md(c,f)},arc(e,t,n,i,r,o){if(i+=Es,r+=Es,hd=n*Math.cos(r)+e,gd=n*Math.sin(r)+t,Math.abs(r-i)>fB)go(e-n,t-n),go(e+n,t+n);else{const s=l=>go(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%qi,i<0&&(i+=qi),r=r%qi,r<0&&(r+=qi),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=qi,a=i-i%ys,u=0;u<4&&a>r;++u,a-=ys)s(a);else for(a=i-i%ys+ys,u=0;u<4&&a<r;++u,a=a+ys)s(a)}}};function US(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function jS(e,t,n,i,r){const o=i-e+3*t-3*n,s=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(o)>A7?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),u=(-s+c)/o,l=(-s-c)/o)):u=.5*a/s,0<u&&u<1&&r(qS(u,e,t,n,i)),0<l&&l<1&&r(qS(l,e,t,n,i))}function qS(e,t,n,i,r){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*i+a*e*r}var ko=(ko=$o(1,1))?ko.getContext("2d"):null;const E1=new it;function ix(e){return function(t,n){if(!ko)return!0;e(ko,t),E1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=E1;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(ko.isPointInPath(u,a))return!0;return!1}}function rx(e,t){return t.contains(e.x||0,e.y||0)}function qM(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(E1.set(n,i,n+r,i+o))}function WM(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:i;return Ma(t,n,i,r,o)}function Ma(e,t,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(o-t)),m===1&&(h=l,g=a-t),m===2&&(h=-c,g=-(s-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function iu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function ui(e,t){return e??t}function WS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function hB(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+ui(t.x1,.5)*i,n.y1+ui(t.y1,.5)*r,Math.max(i,r)*ui(t.r1,0),n.x1+ui(t.x2,.5)*i,n.y1+ui(t.y2,.5)*r,Math.max(i,r)*ui(t.r2,.5));else{const s=ui(t.x1,0),a=ui(t.y1,0),u=ui(t.x2,1),l=ui(t.y2,0);if(s===u||a===l||i===r)o=e.createLinearGradient(n.x1+s*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=$o(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=WS(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return WS(o,t.stops)}function HM(e,t,n){return Zv(n)?hB(e,n,t.bounds):n}function Jd(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=HM(e,t,t.fill),!0):!1}var gB=[];function ru(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=HM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||gB),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function pB(e,t){return e.zindex-t.zindex||e.index-t.index}function ox(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(pB)}function Ei(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=ox(e);if(o&&o.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=o}for(i=0,r=n.length;i<r;++i)t(n[i])}function Qd(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=ox(e);for(o&&o.length&&(n=o),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===o){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function sx(e){return function(t,n,i){Ei(n,r=>{(!i||i.intersects(r.bounds))&&GM(e,t,r,r)})}}function mB(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&GM(e,t,n.items[0],n.items)}}function GM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(iu(t,n),n.fill&&Jd(t,n,r)&&t.fill(),n.stroke&&ru(t,n,r)&&t.stroke()))}function Gg(e){return e=e||Pn,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Qd(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Vc(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t??s.fill,u=s.stroke&&n.isPointInStroke,l,c;return u&&(l=s.strokeWidth,c=s.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function ax(e){return Gg(Vc(e))}function $s(e,t){return"translate("+e+","+t+")"}function ux(e){return"rotate("+e+")"}function yB(e,t){return"scale("+e+","+t+")"}function VM(e){return $s(e.x||0,e.y||0)}function bB(e){return $s(e.x||0,e.y||0)+(e.angle?" "+ux(e.angle):"")}function vB(e){return $s(e.x||0,e.y||0)+(e.angle?" "+ux(e.angle):"")+(e.scaleX||e.scaleY?" "+yB(e.scaleX||1,e.scaleY||1):"")}function lx(e,t,n){function i(s,a){s("transform",bB(a)),s("d",t(null,a))}function r(s,a){return t(Gc(s,a.angle),a),Gr(s,a).translate(a.x||0,a.y||0)}function o(s,a){var u=a.x||0,l=a.y||0,c=a.angle||0;s.translate(u,l),c&&s.rotate(c*=Mo),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:sx(o),pick:ax(o),isect:n||ix(o)}}var xB=lx("arc",rB);function wB(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=1/0,s,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<o&&(o=a,s=e[r]));return s}function EB(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,o,s;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],o=e[i].y-t[1],s=r*r+o*o,s<n))return e[i];return null}function SB(e,t){for(var n=e.length,i,r,o;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],o=i*i+r*r,i=e[n].size||1,o<i*i))return e[n];return null}function cx(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Gc(u),c),Gr(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Vc(o);function a(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:mB(o),pick:a,isect:rx,tip:n}}var _B=cx("area",oB,wB);function AB(e,t){var n=t.clip;e.save(),ge(n)?(e.beginPath(),n(e),e.clip()):YM(e,t.group)}function YM(e,t){e.beginPath(),tx(t)?Pu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function XM(e){const t=ui(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function $B(e,t){e("transform",VM(t))}function KM(e,t){const n=XM(t);e("d",Pu(null,t,n,n))}function kB(e,t){e("class","background"),e("aria-hidden",!0),KM(e,t)}function CB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?KM(e,t):e("d","")}function FB(e,t,n){const i=t.clip?nx(n,t,t):null;e("clip-path",i)}function TB(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Gr(e,t),e.translate(t.x||0,t.y||0)}function dc(e,t,n,i){const r=XM(t);e.beginPath(),Pu(e,t,(n||0)+r,(i||0)+r)}const MB=Vc(dc),DB=Vc(dc,!1),OB=Vc(dc,!0);function RB(e,t,n,i){Ei(t,r=>{const o=r.x||0,s=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(dc(e,r,o,s),iu(e,r),r.fill&&Jd(e,r,u)&&e.fill(),r.stroke&&!a&&ru(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&YM(e,r),n&&n.translate(-o,-s),Ei(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(o,s),e.restore(),a&&r.stroke&&u&&(dc(e,r,o,s),iu(e,r),ru(e,r,u)&&e.stroke())})}function NB(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const s=n*e.pixelRatio,a=i*e.pixelRatio;return Qd(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||o<f||o>g))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,p&&tx(u)&&!OB(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&DB(e,u,s,a)?(e.restore(),u):(l=Qd(u,b=>LB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&MB(e,u,s,a)&&(l=u),e.restore(),l||null)})}function LB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var PB={type:"group",tag:"g",nested:!1,attr:$B,bound:TB,draw:RB,pick:NB,isect:qM,content:FB,background:kB,foreground:CB},hc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function fx(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function dx(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function hx(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Vg(e,t){return e==="center"?t/2:e==="right"?t:0}function Yg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function IB(e,t,n){const i=fx(t,n),r=dx(t,i),o=hx(t,i),s=(t.x||0)-Vg(t.align,r),a=(t.y||0)-Yg(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,hc["xmlns:xlink"],"xlink:href"),e("transform",$s(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function zB(e,t){const n=t.image,i=dx(t,n),r=hx(t,n),o=(t.x||0)-Vg(t.align,i),s=(t.y||0)-Yg(t.baseline,r);return e.set(o,s,o+i,s+r)}function BB(e,t,n){Ei(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=fx(i,this);let o=dx(i,r),s=hx(i,r);if(o===0||s===0)return;let a=(i.x||0)-Vg(i.align,o),u=(i.y||0)-Yg(i.baseline,s),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(s-d)/2,s=d):(d=s*c,a+=(o-d)/2,o=d))),(r.complete||r.toDataURL)&&(iu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var UB={type:"image",tag:"image",nested:!1,attr:IB,bound:zB,draw:BB,pick:Gg(),isect:Pn,get:fx,xOffset:Vg,yOffset:Yg},jB=cx("line",sB,EB);function qB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",vB(t)),e("d",t.path)}function yd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*Mo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=nu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),fc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):fc(e,u,i,r,o,s)}function WB(e,t){return yd(Gc(e,t.angle),t)?e.set(0,0,0,0):Gr(e,t,!0)}var HB={type:"path",tag:"path",nested:!1,attr:qB,bound:WB,draw:sx(yd),pick:ax(yd),isect:ix(yd)};function GB(e,t){e("d",Pu(null,t))}function VB(e,t){var n,i;return Gr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function HS(e,t){e.beginPath(),Pu(e,t)}var YB={type:"rect",tag:"path",nested:!1,attr:GB,bound:VB,draw:sx(HS),pick:ax(HS),isect:qM};function XB(e,t){e("transform",VM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function KB(e,t){var n,i;return Gr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function JM(e,t,n){var i,r,o,s;return t.stroke&&ru(e,t,n)?(i=t.x||0,r=t.y||0,o=t.x2!=null?t.x2:i,s=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,s),!0):!1}function JB(e,t,n){Ei(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&JM(e,i,r)&&(iu(e,i),e.stroke())}})}function QB(e,t,n,i){return e.isPointInStroke?JM(e,t,1)&&e.isPointInStroke(n,i):!1}var ZB={type:"rule",tag:"line",nested:!1,attr:XB,bound:KB,draw:JB,pick:Gg(QB),isect:WM},eU=lx("shape",aB),tU=lx("symbol",uB,rx);const GS=FC();var Rn={height:lr,measureWidth:gx,estimateWidth:Zd,width:Zd,canvas:QM};QM(!0);function QM(e){Rn.width=e&&ko?gx:Zd}function Zd(e,t){return ZM(Oo(e,t),lr(e))}function ZM(e,t){return~~(.8*e.length*t)}function gx(e,t){return lr(e)<=0||!(t=Oo(e,t))?0:eD(t,Xg(e))}function eD(e,t){const n=`(${t}) ${e}`;let i=GS.get(n);return i===void 0&&(ko.font=t,i=ko.measureText(e).width,GS.set(n,i)),i}function lr(e){return e.fontSize!=null?+e.fontSize||0:11}function Do(e){return e.lineHeight!=null?e.lineHeight:lr(e)+2}function nU(e){return P(e)?e.length>1?e:e[0]:e}function Yc(e){return nU(e.lineBreak&&e.text&&!P(e.text)?e.text.split(e.lineBreak):e.text)}function px(e){const t=Yc(e);return(P(t)?t.length-1:0)*Do(e)}function Oo(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?rU(e,n):n}function iU(e){if(Rn.width===gx){const t=Xg(e);return n=>eD(n,t)}else if(Rn.width===Zd){const t=lr(e);return n=>ZM(n,t)}else return t=>Rn.width(e,t)}function rU(e,t){var n=+e.limit,i=iU(e);if(i(t)<n)return t;var r=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,u;if(n-=i(r),o){for(;s<a;)u=s+a>>>1,i(t.slice(u))>n?s=u+1:a=u;return r+t.slice(s)}else{for(;s<a;)u=1+(s+a>>>1),i(t.slice(0,u))<n?s=u:a=u-1;return t.slice(0,s)+r}}function Xc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+lr(e)+"px "+Xc(e,t)}function mx(e){var t=e.baseline,n=lr(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Do(e):t==="line-bottom"?.29*n-.5*Do(e):0)}const oU={left:"start",center:"middle",right:"end"},Wl=new it;function Kg(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-ys,t+=i*Math.cos(r),n+=i*Math.sin(r)),Wl.x1=t,Wl.y1=n,Wl}function sU(e,t){var n=t.dx||0,i=(t.dy||0)+mx(t),r=Kg(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",oU[t.align]||"start"),a?(u=$s(o,s)+" "+ux(a),(n||i)&&(u+=" "+$s(n,i))):u=$s(o+n,s+i),e("transform",u)}function yx(e,t,n){var i=Rn.height(t),r=t.align,o=Kg(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+mx(t)-Math.round(.8*i),c=Yc(t),f;if(P(c)?(i+=Do(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Rn.width(t,h)),0)):f=Rn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=s,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Mo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Mo,s,a);return e}function aU(e,t,n){Ei(t,i=>{var r=i.opacity==null?1:i.opacity,o,s,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Xg(i),e.textAlign=i.align||"left",o=Kg(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Mo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+mx(i),c=Yc(i),iu(e,i),P(c))for(l=Do(i),u=0;u<c.length;++u)f=Oo(i,c[u]),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ru(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=Oo(i,c),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ru(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function uU(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Kg(t),a=s.x1,u=s.y1,l=yx(Wl,t,1),c=-t.angle*Mo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),g=d*r+f*o+(u-d*a-f*u);return l.contains(h,g)}function lU(e,t){const n=yx(Wl,e,2);return Ma(t,n[0],n[1],n[2],n[3])||Ma(t,n[0],n[1],n[4],n[5])||Ma(t,n[4],n[5],n[6],n[7])||Ma(t,n[2],n[3],n[6],n[7])}var cU={type:"text",tag:"text",nested:!1,attr:sU,bound:yx,draw:aU,pick:Gg(uU),isect:lU},fU=cx("trail",lB,SB),Bn={arc:xB,area:_B,group:PB,image:UB,line:jB,path:HB,rect:YB,rule:ZB,shape:eU,symbol:tU,text:cU,trail:fU};function S1(e,t,n){var i=Bn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new it),e,n)}var VS={mark:null};function tD(e,t,n){var i=Bn[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(VS.mark=e,l=VS),c=S1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new it,s)for(a=0,u=o.length;a<u;++a)t.union(S1(o[a],r,n));return e.bounds=t}const dU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function nD(e,t){return JSON.stringify(e,dU,t)}function iD(e){const t=typeof e=="string"?JSON.parse(e):e;return rD(t)}function rD(e){var t=e.marktype,n=e.items,i,r,o;if(n)for(r=0,o=n.length;r<o;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&rD(n[r]);return t&&tD(e),e}class oD{constructor(t){arguments.length?this.root=iD(t):(this.root=YS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Wg(this.root)])}toJSON(t){return nD(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=YS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function YS(e,t){const n={bounds:new it,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function po(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function bx(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function ot(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=po(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function Wn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function sD(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Jg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function hU(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=Bn[r.marktype]).tip){for(s=Jg(t,n),s[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(r.items,s)}return e}let vx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||xg(),this._tooltip=n||gU}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(t.type,t),s=po(null,"a");for(const a in r)s.setAttribute(a,r[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=hU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=t.bounds,s=o.width(),a=o.height();let u=o.x1+r[0]+i.left,l=o.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:s,height:a,left:u,top:l,right:u+s,bottom:l+a}}};function gU(e,t,n,i){e.element().setAttribute("title",i||"")}class Kc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new jM(t)}initialize(t,n,i,r,o){return this._el=t,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const pU="keydown",mU="keypress",yU="keyup",aD="dragenter",bd="dragleave",uD="dragover",_1="pointerdown",bU="pointerup",eh="pointermove",vd="pointerout",lD="pointerover",A1="mousedown",vU="mouseup",cD="mousemove",th="mouseout",fD="mouseover",nh="click",xU="dblclick",wU="wheel",dD="mousewheel",ih="touchstart",rh="touchmove",oh="touchend",EU=[pU,mU,yU,aD,bd,uD,_1,bU,eh,vd,lD,A1,vU,cD,th,fD,nh,xU,wU,dD,ih,rh,oh],$1=eh,Hl=th,k1=nh;class Jc extends vx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=EU,this.pointermove=KS([eh,cD],[lD,fD],[vd,th]),this.dragover=KS([uD],[aD],[bd]),this.pointerout=JS([vd,th]),this.dragleave=JS([bd])}initialize(t,n,i){return this._canvas=t&&bx(t,"canvas"),[nh,A1,_1,eh,vd,bd].forEach(r=>XS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(dD,t)}pointerdown(t){this._down=this._active,this.fire(_1,t)}mousedown(t){this._down=this._active,this.fire(A1,t)}click(t){this._down===this._active&&(this.fire(nh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(ih,t,!0)}touchmove(t){this.fire(rh,t,!0)}touchend(t){this.fire(oh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===k1&&r&&r.href?this.handleHref(n,r,r.href):(t===$1||t===Hl)&&this.handleTooltip(n,r,t!==Hl),o)for(let s=0,a=o.length;s<a;++s)o[s].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(XS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&r.splice(o,1),this}pickEvent(t){const n=Jg(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,o){const s=this.context();return Bn[t.marktype].pick.call(this,s,t,n,i,r,o)}}const SU=e=>e===ih||e===rh||e===oh?[ih,rh,oh]:[e];function XS(e,t){SU(t).forEach(n=>_U(e,n))}function _U(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Ml(e,t,n){t.forEach(i=>e.fire(i,n))}function KS(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?Ml(this,e,i):((!r||!r.exit)&&Ml(this,n,i),this._active=o,Ml(this,t,i),Ml(this,e,i))}}function JS(e){return function(t){Ml(this,e,t),this._active=null}}function AU(){return typeof window<"u"&&window.devicePixelRatio||1}function $U(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?AU():r;e.width=t*u,e.height=n*u;for(const l in o)a[l]=o[l];return s&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class sh extends Kc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new it,this._tempb=new it}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:$o(1,1,this._options.type),t&&this._canvas&&(Wn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,o)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)$U(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||N("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,a=this._dirty,u=kU(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):CU(i,u.intersect(a),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=Bn[n.marktype];n.clip&&AB(t,n),o.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,i,r))}}const kU=(e,t,n)=>new it().set(0,0,t,n).translate(-e[0],-e[1]);function CU(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class hD extends vx{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Lm(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Lm(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Hl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(k1,this._hrefHandler),r.removeEventListener($1,this._tooltipHandler),r.removeEventListener(Hl,this._tooltipHandler)),this._svg=r=t&&bx(t,"svg"),r&&(r.addEventListener(k1,this._hrefHandler),r.addEventListener($1,this._tooltipHandler),r.addEventListener(Hl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const s={type:t,handler:n,listener:Lm(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Lm=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},gD="aria-hidden",xx="aria-label",wx="role",Ex="aria-roledescription",pD="graphics-object",Sx="graphics-symbol",mD=(e,t,n)=>({[wx]:e,[Ex]:t,[xx]:n||void 0}),FU=xi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),QS={axis:{desc:"axis",caption:DU},legend:{desc:"legend",caption:OU},"title-text":{desc:"title",caption:e=>`Title text '${e_(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${e_(e)}'`}},ZS={ariaRole:wx,ariaRoleDescription:Ex,description:xx};function yD(e,t){const n=t.aria===!1;if(e(gD,n||void 0),n||t.description==null)for(const i in ZS)e(ZS[i],void 0);else{const i=t.mark.marktype;e(xx,t.description),e(wx,t.ariaRole||(i==="group"?pD:Sx)),e(Ex,t.ariaRoleDescription||`${i} mark`)}}function bD(e){return e.aria===!1?{[gD]:!0}:FU[e.role]?null:QS[e.role]?MU(e,QS[e.role]):TU(e)}function TU(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return mD(n?pD:Sx,`${t} mark container`,e.description)}function MU(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return mD(t.role||Sx,t.desc,n.description||i(n))}catch{return null}}function e_(e){return X(e.text).join(" ")}function DU(e){const t=e.datum,n=e.orient,i=t.title?vD(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${tu(a)?"discrete":a} scale with ${DM(s,o,e)}`}function OU(e){const t=e.datum,n=t.title?vD(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return NU(i)+(n?` titled '${n}'`:"")+` for ${RU(o)} with ${DM(u,a,e)}`}function vD(e){try{return X(Ee(e.items).items[0].text).join(" ")}catch{return null}}function RU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ee(e)}function NU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const xD=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),LU=e=>xD(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function _x(){let e="",t="",n="";const i=[],r=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},s=(u,l)=>(l!=null&&(t+=` ${u}="${LU(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=xD(u),a),toString:()=>e};return a}const wD=e=>ED(_x(),e)+"";function ED(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):ED(e,i)}return e.close()}const ah={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},uh={blend:"mix-blend-mode"},SD={fill:"none","stroke-miterlimit":10},ul=0,t_="http://www.w3.org/2000/xmlns/",rt=hc.xmlns;class Ax extends Kc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,o){return this._defs={},this._clearDefs(),t&&(this._svg=ot(t,0,"svg",rt),this._svg.setAttributeNS(t_,"xmlns",rt),this._svg.setAttributeNS(t_,"xmlns:xlink",hc["xmlns:xlink"]),this._svg.setAttribute("version",hc.version),this._svg.setAttribute("class","marks"),Wn(t,1),this._root=ot(this._svg,ul,"g",rt),mo(this._root,SD),Wn(this._svg,ul+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(mo(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=ot(t,ul,"rect",rt),mo(i,{width:this._width,height:this._height,fill:n}));const r=wD(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Wn(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,o,s,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==o&&(o=r.marktype,s=Bn[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,n_(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){s.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(s,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=s.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,n_(i,n)):this._update(s,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Bn[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=i_(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return Wn(c,0),n._svg;c.setAttribute("class",sD(n));const f=bD(n);for(const p in f)Jt(c,p,f[p]);l||Jt(c,"pointer-events",u),Jt(c,"clip-path",n.clip?nx(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=i_(p,c,d,a.tag,o);m&&(this._update(a,y,p),l&&zU(this,y,p,r)),d=y,++h};return a.nested?n.items.length&&g(n.items[0]):Ei(n,g),Wn(c,h),c}_update(t,n,i){Dr=n,It=n.__values__,yD(Gl,i),t.attr(Gl,i,this);const r=UU[t.type];r&&r.call(this,t,n,i),Dr&&this.style(Dr,i)}style(t,n){if(n!=null){for(const i in ah){let r=i==="font"?Xc(n):n[i];if(r===It[i])continue;const o=ah[i];r==null?t.removeAttribute(o):(Zv(r)&&(r=RM(r,this._defs.gradient,_D())),t.setAttribute(o,r+"")),It[i]=r}for(const i in uh)xd(t,uh[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=ot(t,ul+1,"defs",rt)),r=PU(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=ot(t,ul+1,"defs",rt)),r=IU(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):Wn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function n_(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function PU(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=ot(e,n++,"pattern",rt);mo(s,{id:Kd+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=ot(s,0,"rect",rt),mo(s,{width:1,height:1,fill:`url(${_D()}#${t.id})`}),e=ot(e,n++,"radialGradient",rt),mo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=ot(e,n++,"linearGradient",rt),mo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=ot(e,i,"stop",rt),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return Wn(e,i),n}function IU(e,t,n){let i;return e=ot(e,n,"clipPath",rt),e.setAttribute("id",t.id),t.path?(i=ot(e,0,"path",rt),i.setAttribute("d",t.path)):(i=ot(e,0,"rect",rt),mo(i,{x:0,y:0,width:t.width,height:t.height})),Wn(e,1),n+1}function zU(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;Ei(n,s=>{r=e.mark(t,s,r,i),++o}),Wn(t,1+o)}function i_(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=po(s,i,rt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=po(s,"path",rt);o.appendChild(a),a.__data__=e;const u=po(s,"g",rt);o.appendChild(u),u.__data__=e;const l=po(s,"path",rt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||BU(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function BU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Dr=null,It=null;const UU={group(e,t,n){const i=Dr=t.childNodes[2];It=i.__values__,e.foreground(Gl,n,this),It=t.__values__,Dr=t.childNodes[1],e.content(Gl,n,this);const r=Dr=t.childNodes[0];e.background(Gl,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==It.events&&(Jt(i,"pointer-events",o),Jt(r,"pointer-events",o),It.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Jt(i,"display",null),this.style(r,n),Jt(r,"stroke",null),s&&(n.fill=null),It=i.__values__,this.style(i,n),s&&(n.fill=s),Dr=null}else Jt(i,"display","none")},image(e,t,n){n.smooth===!1?(xd(t,"image-rendering","optimizeSpeed"),xd(t,"image-rendering","pixelated")):xd(t,"image-rendering",null)},text(e,t,n){const i=Yc(n);let r,o,s,a;P(i)?(o=i.map(u=>Oo(n,u)),r=o.join(`
7
- `),r!==It.text&&(Wn(t,0),s=t.ownerDocument,a=Do(n),o.forEach((u,l)=>{const c=po(s,"tspan",rt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),It.text=r)):(o=Oo(n,i),o!==It.text&&(t.textContent=o,It.text=o)),Jt(t,"font-family",Xc(n)),Jt(t,"font-size",lr(n)+"px"),Jt(t,"font-style",n.fontStyle),Jt(t,"font-variant",n.fontVariant),Jt(t,"font-weight",n.fontWeight)}};function Gl(e,t,n){t!==It[e]&&(n?jU(Dr,e,t,n):Jt(Dr,e,t),It[e]=t)}function xd(e,t,n){n!==It[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),It[t]=n)}function mo(e,t){for(const n in t)Jt(e,n,t[n])}function Jt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function jU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function _D(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class AD extends Kc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=_x();n.open("svg",he({},hc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",SD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Bn[n.marktype],r=i.tag,o=[yD,i.attr];t.open("g",{class:sD(n),"clip-path":n.clip?nx(this,n,n.group):null},bD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Yc(a);if(P(l)){const c={x:0,dy:Do(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Oo(a,l[f])).close()}else t.text(Oo(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),Ei(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):Ei(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&qU(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Kd+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function qU(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Xc(t),e["font-size"]=lr(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in ah){let a=t[s];const u=ah[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Zv(a)&&(a=RM(a,r.gradient,"")),e[u]=a)}for(const s in uh){const a=t[s];a!=null&&(o=o||[],o.push(`${uh[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const ci={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function WU(e){ci.svgMarkTypes=e.svgMarkTypes??["text"],ci.svgOnTop=e.svgOnTop??!0,ci.debug=e.debug??!1}class C1 extends Kc{constructor(t){super(t),this._svgRenderer=new Ax(t),this._canvasRenderer=new sh(t)}initialize(t,n,i,r,o){this._root_el=ot(t,0,"div");const s=ot(this._root_el,0,"div"),a=ot(this._root_el,1,"div");return this._root_el.style.position="relative",ci.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ci.svgOnTop?a:s,this._canvasEl=ci.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return ci.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!ci.svgMarkTypes.includes(o));this._svgRenderer.render(t,ci.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ci.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class $D extends Jc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=ot(ot(t,0,"div"),ci.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const kD="canvas",CD="hybrid",FD="png",TD="svg",MD="none",yo={Canvas:kD,PNG:FD,SVG:TD,Hybrid:CD,None:MD},Ls={};Ls[kD]=Ls[FD]={renderer:sh,headless:sh,handler:Jc};Ls[TD]={renderer:Ax,headless:AD,handler:hD};Ls[CD]={renderer:C1,headless:C1,handler:$D};Ls[MD]={};function Qg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ls[e]=t,this):Ls[e]}function DD(e,t,n){const i=[],r=new it().union(t),o=e.marktype;return o?OD(e,r,n,i):o==="group"?RD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function OD(e,t,n,i){if(HU(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)RD(r[a],t,n,i);else for(const u=Bn[o].isect;a<s;++a){const l=r[a];ND(l,t,u)&&i.push(l)}}return i}function HU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function RD(e,t,n,i){n&&n(e.mark)&&ND(e,t,Bn.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)OD(r[u],t,n,i);t.translate(s,a)}return i}function ND(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Pm=new it;function LD(e){const t=e.clip;if(ge(t))t(Gc(Pm.clear()));else if(t)Pm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Pm)}const GU=1e-9;function $x(e,t,n){return e===t?!0:n==="path"?PD(e,t):e instanceof Date&&t instanceof Date?+e==+t:Ae(e)&&Ae(t)?Math.abs(e-t)<=GU:!e||!t||!Y(e)&&!Y(t)?e==t:VU(e,t)}function PD(e,t){return $x(nu(e),nu(t))}function VU(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!$x(e[r],t[r],r))return!1;return typeof e==typeof t}function YU(){UM(),b7()}const ou="top",hi="left",gi="right",Ro="bottom",XU="top-left",KU="top-right",JU="bottom-left",QU="bottom-right",kx="start",F1="middle",Qt="end",ZU="x",ej="y",Zg="group",Cx="axis",Fx="title",tj="frame",nj="scope",Tx="legend",ID="row-header",zD="row-footer",BD="row-title",UD="column-header",jD="column-footer",qD="column-title",ij="padding",rj="symbol",WD="fit",HD="fit-x",GD="fit-y",oj="pad",Mx="none",Mf="all",T1="each",Dx="flush",bo="column",vo="row";function VD(e){D.call(this,null,e)}G(VD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Bn[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=Df(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Zg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Df(l,s))),i.role){case Cx:case Tx:case Fx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Df(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Df(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return LD(i),t.modifies("bounds")}});function Df(e,t,n){return t(e.bounds.clear(),e,n)}const r_=":vega_identifier:";function Ox(e){D.call(this,0,e)}Ox.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(Ox,D,{transform(e,t){const n=sj(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function sj(e){return e._signals[r_]||(e._signals[r_]=e.add(0))}function YD(e){D.call(this,null,e)}G(YD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,aj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===Zg?Wg:qg;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function aj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function XD(e){D.call(this,null,e)}const o_={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!KD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},KD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),s_=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(KD(r,o=e[n].bounds,t))return!0},uj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},lj=(e,t,n)=>{var i=e.range(),r=new it;return t===ou||t===Ro?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},a_=e=>(e.forEach(t=>t.opacity=1),e),u_=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(XD,D,{transform(e,t){const n=o_[e.method]||o_.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(a_(r),t=u_(t,e)),t;if(r=r.filter(uj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=a_(r),t=u_(t,e),o.length>=3&&s_(o,i)){do o=n(o,i);while(o.length>=3&&s_(o,i));o.length<3&&!Ee(r).opacity&&(o.length>1&&(Ee(o).opacity=0),Ee(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=lj(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function JD(e){D.call(this,null,e)}G(JD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Pt=new it;function Da(e,t,n){return e[t]===n?0:(e[t]=n,1)}function cj(e){var t=e.items[0].orient;return t===hi||t===gi}function fj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function dj(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=fj(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=o.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&px(g),b=0,v=0,x,E;switch(Pt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),g&&Of(e,g,E,p,y,0,-1,m);break;case hi:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),g&&Of(e,g,E,p,y,1,-1,m);break;case gi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),g&&Of(e,g,E,p,y,1,1,m);break;case Ro:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),g&&Of(e,g,E,p,0,0,1,m);break;default:b=r.x,v=r.y}return Gr(m.translate(b,v),r),Da(r,"x",b+s)|Da(r,"y",v+s)&&(r.bounds=Pt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Of(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const l_=(e,t)=>Math.floor(Math.min(e,t)),c_=(e,t)=>Math.ceil(Math.max(e,t));function hj(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===Zg)switch(r.role){case Cx:case Tx:case Fx:break;case ID:s.rowheaders.push(...o);break;case zD:s.rowfooters.push(...o);break;case UD:s.colheaders.push(...o);break;case jD:s.colfooters.push(...o);break;case BD:s.rowtitle=o[0];break;case qD:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function gj(e){return new it().set(0,0,e.width||0,e.height||0)}function pj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function f_(e){return e<0?Math.ceil(-e):0}function QD(e,t,n){var i=!n.nodirty,r=n.bounds===Dx?gj:pj,o=Pt.set(0,0,0,0),s=je(n.align,bo),a=je(n.align,vo),u=je(n.padding,bo),l=je(n.padding,vo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,A,k,C,O,M,F,$,T;for(w=0;w<c;++w)g[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)C=t[w],k=E[w]=r(C),C.x=C.x||0,v[w]=0,C.y=C.y||0,x[w]=0,_=w%c,A=~~(w/c),p=Math.max(p,O=Math.ceil(k.x2)),b=Math.max(b,M=Math.ceil(k.y2)),g[_]=Math.max(g[_],O),y[A]=Math.max(y[A],M),h[w]=u+f_(k.x1),m[w]=l+f_(k.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(s===T1)for(_=1;_<c;++_){for(T=0,w=_;w<d;w+=c)T<h[w]&&(T=h[w]);for(w=_;w<d;w+=c)h[w]=T+g[_-1]}else if(s===Mf){for(T=0,w=0;w<d;++w)w%c&&T<h[w]&&(T=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=T+p)}else for(s=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=g[_-1];if(a===T1)for(A=1;A<f;++A){for(T=0,w=A*c,S=w+c;w<S;++w)T<m[w]&&(T=m[w]);for(w=A*c;w<S;++w)m[w]=T+y[A-1]}else if(a===Mf){for(T=0,w=c;w<d;++w)T<m[w]&&(T=m[w]);for(w=c;w<d;++w)m[w]=T+b}else for(a=!1,A=1;A<f;++A)for(w=A*c,S=w+c;w<S;++w)m[w]+=y[A-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for($=0,w=_;w<d;w+=c)$+=m[w],x[w]+=$-t[w].y;if(s&&je(n.center,bo)&&f>1)for(w=0;w<d;++w)k=s===Mf?p:g[w%c],F=k-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,vo)&&c!==1)for(w=0;w<d;++w)k=a===Mf?b:y[~~(w/c)],$=k-E[w].y2-t[w].y-x[w],$>0&&(x[w]+=$/2);for(w=0;w<d;++w)o.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,ZU),$=je(n.anchor,ej),je(n.anchor,bo)){case Qt:F-=o.width();break;case F1:F-=o.width()/2}switch(je(n.anchor,vo)){case Qt:$-=o.height();break;case F1:$-=o.height()/2}for(F=Math.round(F),$=Math.round($),o.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)C=t[w],C.x+=v[w]+=F,C.y+=x[w]+=$,o.union(C.mark.bounds.union(C.bounds.translate(v[w],x[w]))),i&&e.dirty(C);return o}function mj(e,t,n){var i=hj(t),r=i.marks,o=n.bounds===Dx?yj:bj,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=QD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=je(n.headerBand,vo,null),c=Rf(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),l_,0,o,"x1",0,a,1,p)),i.colheaders&&(p=je(n.headerBand,bo,null),f=Rf(e,i.colheaders,r,a,a,-je(s,"columnHeader"),l_,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=je(n.footerBand,vo,null),d=Rf(e,i.rowfooters,r,a,u,je(s,"rowFooter"),c_,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=je(n.footerBand,bo,null),h=Rf(e,i.colfooters,r,a,a,je(s,"columnFooter"),c_,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=je(n.titleAnchor,vo),m=je(s,"rowTitle"),m=g===Qt?d+m:c-m,p=je(n.titleBand,vo,.5),d_(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=je(n.titleAnchor,bo),m=je(s,"columnTitle"),m=g===Qt?h+m:f-m,p=je(n.titleBand,bo,.5),d_(e,i.coltitle,m,1,y,p))}function yj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function bj(e,t){return e.bounds[t]}function Rf(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,v,x,E,S,w,_,A;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=s(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=o,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),A=p):(_=p,A=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),A-(S.y||0))),S.x=_,S.y=A,e.dirty(S),m=s(m,E[l])}return m}function d_(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function vj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function xj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function wj(e,t,n,i,r,o,s){const a=vj(n,t),u=xj(e,a("offset",0)),l=a("anchor",kx),c=l===Qt?1:l===F1?.5:0,f={align:T1,bounds:a("bounds",Dx),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case hi:f.anchor={x:Math.floor(i.x1)-u,column:Qt,y:c*(s||i.height()+2*i.y1),row:l};break;case gi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Qt,x:c*(o||r.width()+2*r.x1),column:l};break;case Ro:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case XU:f.anchor={x:u,y:u};break;case KU:f.anchor={x:o-u,y:u,column:Qt};break;case JU:f.anchor={x:u,y:s-u,row:Qt};break;case QU:f.anchor={x:o-u,y:s-u,column:Qt,row:Qt};break}return f}function Ej(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),_j(e,n,n.items[0].items[0]),o=Sj(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===rj&&Aj(n.items[0].items[0].items[0].items),r!==Mx&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Gr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function Sj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function _j(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&ll(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case hi:r+=Math.ceil(s.bounds.width())+u;break;case gi:case Ro:break;default:o+=s.bounds.height()+u}switch((r||o)&&ll(e,n,r,o),s.orient){case hi:c+=va(t,n,s,a,1,1);break;case gi:l+=va(t,n,s,Qt,0,0)+u,c+=va(t,n,s,a,1,1);break;case Ro:l+=va(t,n,s,a,0,0),c+=va(t,n,s,Qt,-1,0,1)+u;break;default:l+=va(t,n,s,a,0,0)}(l||c)&&ll(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(ll(e,n,-l,0),ll(e,s,-l,0))}}function va(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:px(n);return Math.round(i===kx?f:i===Qt?d-h:.5*(c-h))}function ll(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function Aj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function $j(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===hi||a===gi?i:n,g=0,p=0,m=0,y=0,b=0,v;if(s!==Zg?a===hi?(g=r.y2,h=r.y1):a===gi?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===hi&&(g=i,h=0),v=u===kx?g:u===Qt?h:(g+h)/2,d&&d.text){switch(a){case ou:case Ro:b=f.bounds.height()+c;break;case hi:y=f.bounds.width()+c;break;case gi:y=-f.bounds.width()-c;break}Pt.clear().union(d.bounds),Pt.translate(y-(d.x||0),b-(d.y||0)),Da(d,"x",y)|Da(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Pt),d.mark.bounds.clear().union(Pt),e.dirty(d)),Pt.clear().union(d.bounds)}else Pt.clear();switch(Pt.union(f.bounds),a){case ou:p=v,m=r.y1-Pt.height()-l;break;case hi:p=r.x1-Pt.width()-l,m=v;break;case gi:p=r.x2+Pt.width()+l,m=v;break;case Ro:p=v,m=r.y2+l;break;default:p=o.x,m=o.y}return Da(o,"x",p)|Da(o,"y",m)&&(Pt.translate(p,m),e.dirty(o),o.bounds.clear().union(Pt),t.bounds.clear().union(Pt),e.dirty(o)),o.bounds}function ZD(e){D.call(this,null,e)}G(ZD,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&mj(n,i,e.layout),Cj(n,i,e)}),kj(e.mark.group)?t.reflow():t}});function kj(e){return e&&e.mark.role!=="legend-entry"}function Cj(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new it().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case Cx:h=cj(f)?a:u,h.union(dj(e,f,r,o));break;case Fx:c=f;break;case Tx:l.push(Ej(e,f));break;case tj:case nj:case ID:case zD:case BD:case UD:case jD:case qD:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||gi,d!==Mx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];QD(e,b,wj(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===WD||n.autosize.type===HD||n.autosize.type===GD))switch(y.orient){case hi:case gi:s.add(b.x1,0).add(b.x2,0);break;case ou:case Ro:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union($j(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Fj(e,t,s,n)}function Fj(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===ij){const g=e.padding();s-=g.left+g.right,a-=g.top+g.bottom}o===Mx?(l=0,f=0,u=s,c=a):o===WD?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===HD?(u=Math.max(0,s-l-d),a=c+f+h):o===GD?(s=u+l+d,c=Math.max(0,a-f-h)):o===oj&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const Tj=Object.freeze(Object.defineProperty({__proto__:null,bound:VD,identifier:Ox,mark:YD,overlap:XD,render:JD,viewlayout:ZD},Symbol.toStringTag,{value:"Module"}));function eO(e){D.call(this,null,e)}G(eO,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Jv(o,s,e.minstep),u=e.format||kM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$M(o,e.values,a):Qv(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function tO(e){D.call(this,null,e)}function Mj(){return Ce({})}function Dj(e){const t=Tu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(tO,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Mj,o=e.key||ie,s=this.value;return P(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&N("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Dj(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function nO(e){D.call(this,null,e)}G(nO,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(P(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||io,u=r.enter||io,l=r.exit||io,c=(o&&!s?r[o]:a)||io;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==io&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==io&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==io){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function iO(e){D.call(this,[],e)}G(iO,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||dd,s=e.scale,a=+e.limit,u=Jv(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===dd,c=e.format||MM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||TM(s,u),d,h,g,p,m;return r&&(i.rem=r),o===dd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ge(g=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=Yt(p=g||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):o===o7?(d=s.domain(),h=SM(s,d[0],Ee(d)),f.length<3&&!e.values&&d[0]!==Ee(d)&&(f=[d[0],Ee(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=m7(s),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const Oj=e=>e.source.x,Rj=e=>e.source.y,Nj=e=>e.target.x,Lj=e=>e.target.y;function Rx(e){D.call(this,{},e)}Rx.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Rx,D,{transform(e,t){var n=e.sourceX||Oj,i=e.sourceY||Rj,r=e.targetX||Nj,o=e.targetY||Lj,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=h_.get(u+"-"+a)||h_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const rO=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Pj=(e,t,n,i)=>rO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),oO=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},Ij=(e,t,n,i)=>oO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),sO=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},zj=(e,t,n,i)=>sO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Bj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Uj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,jj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},qj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},Wj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Hj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a},h_=Tu({line:rO,"line-radial":Pj,arc:oO,"arc-radial":Ij,curve:sO,"curve-radial":zj,"orthogonal-horizontal":Bj,"orthogonal-vertical":Uj,"orthogonal-radial":jj,"diagonal-horizontal":qj,"diagonal-vertical":Wj,"diagonal-radial":Hj});function Nx(e){D.call(this,null,e)}Nx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(Nx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||ku,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/qC(l),h=Mn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Gj=5;function Vj(e){const t=e.type;return!e.bins&&(t===Za||t===zc||t===Bc)}function aO(e){return Yv(e)&&e!==Xi}const Yj=xi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function uO(e){D.call(this,null,e),this.modified(!0)}G(uO,D,{transform(e,t){var n=t.dataflow,i=this.value,r=Xj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!Yj[r]){if(r==="padding"&&aO(i.type))continue;ge(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return tq(i,e,eq(i,e,Jj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Xj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+Za:(Kj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Lu+"-":""),(n+t||Za).toLowerCase())}function Kj(e){const t=e.type;return Yv(t)&&t!==Rs&&t!==Ns&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Jj(e,t,n){const i=Qj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Vj(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return aO(o)&&t.padding&&r[0]!==Ee(r)&&(r=Zj(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(lO(o,r,n)),o===Wv&&e.unknown(t.domainImplicit?g1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Jv(e,t.nice)||null),r.length}function Qj(e,t,n){return t?(e.domain(lO(e.type,t,n)),t.length):-1}function Zj(e,t,n,i,r,o){var s=Math.abs(Ee(n)-n[0]),a=s/(s-2*i),u=e===jr?yb(t,null,a):e===Bc?Ld(t,null,a,.5):e===zc?Ld(t,null,a,r||1):e===Ig?bb(t,null,a,o||1):mb(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function lO(e,t,n){if(bM(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function eq(e,t,n){let i=t.bins;if(i&&!P(i)){const r=e.domain(),o=r[0],s=Ee(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||N("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Mn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Hv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function tq(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=nq(i,t,n);else if(t.scheme&&(o=iq(i,t,n),ge(o))){if(e.interpolator)return e.interpolator(o);N(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&vM(i))return e.interpolator(Ug(M1(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Xv(t.interpolate,t.interpolateGamma)):ge(e.round)?e.round(r):ge(e.rangeRound)&&e.interpolate(r?ug:Oc),o&&e.range(M1(o,t.reverse))}function nq(e,t,n){e!==dM&&e!==m1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===m1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*qv(n,r,i)]}function iq(e,t,n){var i=t.schemeExtent,r,o;return P(t.scheme)?o=Ug(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=Kv(r),o||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bg?n+1:e===Hv?n-1:e===eu||e===zg?+t.schemeCount||Gj:n,vM(e)?g_(o,i,t.reverse):ge(o)?EM(g_(o,i),n):e===Wv?o:o.slice(0,n)}function g_(e,t,n){return ge(e)&&(t||n)?wM(e,M1(t||[0,1],n)):e}function M1(e,t){return t?e.slice().reverse():e}function cO(e){D.call(this,null,e)}G(cO,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const p_="zero",fO="center",dO="normalize",hO=["y0","y1"];function Lx(e){D.call(this,null,e)}Lx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:p_,values:[p_,fO,dO]},{name:"as",type:"string",array:!0,length:2,default:hO}]};G(Lx,D,{transform(e,t){var n=e.as||hO,i=n[0],r=n[1],o=ea(e.sort),s=e.field||ku,a=e.offset===fO?rq:e.offset===dO?oq:sq,u,l,c,f;for(u=aq(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function rq(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function oq(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function sq(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function aq(e,t,n,i){var r=[],o=p=>p(c),s,a,u,l,c,f,d,h,g;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,g=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const uq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:eO,datajoin:tO,encode:nO,legendentries:iO,linkpath:Rx,pie:Nx,scale:uO,sortitems:cO,stack:Lx},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,D1=1e-12,be=Math.PI,Xe=be/2,lh=be/4,un=be*2,Ze=180/be,me=be/180,we=Math.abs,Iu=Math.atan,ti=Math.atan2,se=Math.cos,Nf=Math.ceil,gO=Math.exp,O1=Math.hypot,ch=Math.log,Im=Math.pow,re=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},ln=Math.sqrt,Px=Math.tan;function pO(e){return e>1?0:e<-1?be:Math.acos(e)}function wn(e){return e>1?Xe:e<-1?-Xe:Math.asin(e)}function $t(){}function fh(e,t){e&&y_.hasOwnProperty(e.type)&&y_[e.type](e,t)}var m_={Feature:function(e,t){fh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)fh(n[i].geometry,t)}},y_={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){R1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)R1(n[i],t,0)},Polygon:function(e,t){b_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)b_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)fh(n[i],t)}};function R1(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function b_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)R1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&m_.hasOwnProperty(e.type)?m_[e.type](e,t):fh(e,t)}var dh=new sn,hh=new sn,mO,yO,N1,L1,P1,nr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){dh=new sn,nr.lineStart=lq,nr.lineEnd=cq},polygonEnd:function(){var e=+dh;hh.add(e<0?un+e:e),this.lineStart=this.lineEnd=this.point=$t},sphere:function(){hh.add(un)}};function lq(){nr.point=fq}function cq(){bO(mO,yO)}function fq(e,t){nr.point=bO,mO=e,yO=t,e*=me,t*=me,N1=e,L1=se(t=t/2+lh),P1=re(t)}function bO(e,t){e*=me,t*=me,t=t/2+lh;var n=e-N1,i=n>=0?1:-1,r=i*n,o=se(t),s=re(t),a=P1*s,u=L1*o+a*se(r),l=a*i*re(r);dh.add(ti(l,u)),N1=e,L1=o,P1=s}function dq(e){return hh=new sn,$r(e,nr),hh*2}function gh(e){return[ti(e[1],e[0]),wn(e[2])]}function Ps(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*re(t),re(n)]}function Lf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function su(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function zm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ph(e){var t=ln(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,pn,Ve,Fn,gs,vO,xO,za,Vl,uo,qr,_r={point:I1,lineStart:v_,lineEnd:x_,polygonStart:function(){_r.point=EO,_r.lineStart=hq,_r.lineEnd=gq,Vl=new sn,nr.polygonStart()},polygonEnd:function(){nr.polygonEnd(),_r.point=I1,_r.lineStart=v_,_r.lineEnd=x_,dh<0?(He=-(Ve=180),pn=-(Fn=90)):Vl>ae?Fn=90:Vl<-1e-6&&(pn=-90),qr[0]=He,qr[1]=Ve},sphere:function(){He=-(Ve=180),pn=-(Fn=90)}};function I1(e,t){uo.push(qr=[He=e,Ve=e]),t<pn&&(pn=t),t>Fn&&(Fn=t)}function wO(e,t){var n=Ps([e*me,t*me]);if(za){var i=su(za,n),r=[i[1],-i[0],0],o=su(r,i);ph(o),o=gh(o);var s=e-gs,a=s>0?1:-1,u=o[0]*Ze*a,l,c=we(s)>180;c^(a*gs<u&&u<a*e)?(l=o[1]*Ze,l>Fn&&(Fn=l)):(u=(u+360)%360-180,c^(a*gs<u&&u<a*e)?(l=-o[1]*Ze,l<pn&&(pn=l)):(t<pn&&(pn=t),t>Fn&&(Fn=t))),c?e<gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e)}else uo.push(qr=[He=e,Ve=e]);t<pn&&(pn=t),t>Fn&&(Fn=t),za=n,gs=e}function v_(){_r.point=wO}function x_(){qr[0]=He,qr[1]=Ve,_r.point=I1,za=null}function EO(e,t){if(za){var n=e-gs;Vl.add(we(n)>180?n+(n>0?360:-360):n)}else vO=e,xO=t;nr.point(e,t),wO(e,t)}function hq(){nr.lineStart()}function gq(){EO(vO,xO),nr.lineEnd(),we(Vl)>ae&&(He=-(Ve=180)),qr[0]=He,qr[1]=Ve,za=null}function Cn(e,t){return(t-=e)<0?t+360:t}function pq(e,t){return e[0]-t[0]}function w_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function mq(e){var t,n,i,r,o,s,a;if(Fn=Ve=-(He=pn=1/0),uo=[],$r(e,_r),n=uo.length){for(uo.sort(pq),t=1,i=uo[0],o=[i];t<n;++t)r=uo[t],w_(i,r[0])||w_(i,r[1])?(Cn(i[0],r[1])>Cn(i[0],i[1])&&(i[1]=r[1]),Cn(r[0],i[1])>Cn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Cn(i[1],r[0]))>s&&(s=a,He=r[0],Ve=i[1])}return uo=qr=null,He===1/0||pn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,pn],[Ve,Fn]]}var Dl,mh,yh,bh,vh,xh,wh,Eh,z1,B1,U1,SO,_O,Zt,en,tn,pi={sphere:$t,point:Ix,lineStart:E_,lineEnd:S_,polygonStart:function(){pi.lineStart=vq,pi.lineEnd=xq},polygonEnd:function(){pi.lineStart=E_,pi.lineEnd=S_}};function Ix(e,t){e*=me,t*=me;var n=se(t);Qc(n*se(e),n*re(e),re(t))}function Qc(e,t,n){++Dl,yh+=(e-yh)/Dl,bh+=(t-bh)/Dl,vh+=(n-vh)/Dl}function E_(){pi.point=yq}function yq(e,t){e*=me,t*=me;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),pi.point=bq,Qc(Zt,en,tn)}function bq(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=ti(ln((s=en*o-tn*r)*s+(s=tn*i-Zt*o)*s+(s=Zt*r-en*i)*s),Zt*i+en*r+tn*o);mh+=s,xh+=s*(Zt+(Zt=i)),wh+=s*(en+(en=r)),Eh+=s*(tn+(tn=o)),Qc(Zt,en,tn)}function S_(){pi.point=Ix}function vq(){pi.point=wq}function xq(){AO(SO,_O),pi.point=Ix}function wq(e,t){SO=e,_O=t,e*=me,t*=me,pi.point=AO;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),Qc(Zt,en,tn)}function AO(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=en*o-tn*r,a=tn*i-Zt*o,u=Zt*r-en*i,l=O1(s,a,u),c=wn(l),f=l&&-c/l;z1.add(f*s),B1.add(f*a),U1.add(f*u),mh+=c,xh+=c*(Zt+(Zt=i)),wh+=c*(en+(en=r)),Eh+=c*(tn+(tn=o)),Qc(Zt,en,tn)}function Eq(e){Dl=mh=yh=bh=vh=xh=wh=Eh=0,z1=new sn,B1=new sn,U1=new sn,$r(e,pi);var t=+z1,n=+B1,i=+U1,r=O1(t,n,i);return r<D1&&(t=xh,n=wh,i=Eh,mh<ae&&(t=yh,n=bh,i=vh),r=O1(t,n,i),r<D1)?[NaN,NaN]:[ti(n,t)*Ze,wn(i/r)*Ze]}function j1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function q1(e,t){return we(e)>be&&(e-=Math.round(e/un)*un),[e,t]}q1.invert=q1;function $O(e,t,n){return(e%=un)?t||n?j1(A_(e),$_(t,n)):A_(e):t||n?$_(t,n):q1}function __(e){return function(t,n){return t+=e,we(t)>be&&(t-=Math.round(t/un)*un),[t,n]}}function A_(e){var t=__(e);return t.invert=__(-e),t}function $_(e,t){var n=se(e),i=re(e),r=se(t),o=re(t);function s(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*n+c*i;return[ti(f*r-h*o,c*n-d*i),wn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*r-f*o;return[ti(f*r+d*o,c*n+h*i),wn(h*n-c*i)]},s}function Sq(e){e=$O(e[0]*me,e[1]*me,e.length>2?e[2]*me:0);function t(n){return n=e(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n}return t.invert=function(n){return n=e.invert(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n},t}function _q(e,t,n,i,r,o){if(n){var s=se(t),a=re(t),u=i*n;r==null?(r=t+i*un,o=t-u/2):(r=k_(s,r),o=k_(s,o),(i>0?r<o:r>o)&&(r+=i*un));for(var l,c=r;i>0?c>o:c<o;c-=u)l=gh([s,-a*se(c),-a*re(c)]),e.point(l[0],l[1])}}function k_(e,t){t=Ps(t),t[0]-=e,ph(t);var n=pO(-t[1]);return((-t[2]<0?-n:n)+un-ae)%un}function kO(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:$t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function wd(e,t){return we(e[0]-t[0])<ae&&we(e[1]-t[1])<ae}function If(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function CO(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(wd(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ae}o.push(b=new If(m,g,null,!0)),s.push(b.o=new If(m,null,b,!1)),o.push(b=new If(y,g,null,!1)),s.push(b.o=new If(y,null,b,!0))}}),!!o.length){for(s.sort(t),C_(o),C_(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function C_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Bm(e){return we(e[0])<=be?e[0]:Vn(e[0])*((we(e[0])+be)%un-be)}function Aq(e,t){var n=Bm(t),i=t[1],r=re(i),o=[re(n),-se(n),0],s=0,a=0,u=new sn;r===1?i=Xe+ae:r===-1&&(i=-Xe-ae);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=Bm(h),p=h[1]/2+lh,m=re(p),y=se(p),b=0;b<d;++b,g=x,m=S,y=w,h=v){var v=f[b],x=Bm(v),E=v[1]/2+lh,S=re(E),w=se(E),_=x-g,A=_>=0?1:-1,k=A*_,C=k>be,O=m*S;if(u.add(ti(O*A*re(k),y*w+O*se(k))),s+=C?_+A*un:_,C^g>=n^x>=n){var M=su(Ps(h),Ps(v));ph(M);var F=su(o,M);ph(F);var $=(C^_>=0?-1:1)*wn(F[2]);(i>$||i===$&&(M[0]||M[1]))&&(a+=C^_>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function FO(e,t,n,i){return function(r){var o=t(r),s=kO(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=jC(c);var x=Aq(l,i);c.length?(u||(r.polygonStart(),u=!0),CO(c,kq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function g(x,E){o.point(x,E)}function p(){d.point=g,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=s.result(),S,w=E.length,_,A,k;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if(A=E[0],(_=A.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((k=A[S])[0],k[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter($q))}}return d}}function $q(e){return e.length>1}function kq(e,t){return((e=e.x)[0]<0?e[1]-Xe-ae:Xe-e[1])-((t=t.x)[0]<0?t[1]-Xe-ae:Xe-t[1])}const F_=FO(function(){return!0},Cq,Tq,[-be,-Xe]);function Cq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?be:-be,u=we(o-t);we(u-be)<ae?(e.point(t,n=(n+s)/2>0?Xe:-Xe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=be&&(we(t-i)<ae&&(t-=i*ae),we(o-a)<ae&&(o-=a*ae),n=Fq(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Fq(e,t,n,i){var r,o,s=re(e-n);return we(s)>ae?Iu((re(t)*(o=se(i))*re(n)-re(i)*(r=se(t))*re(e))/(r*o*s)):(t+i)/2}function Tq(e,t,n,i){var r;if(e==null)r=n*Xe,i.point(-be,r),i.point(0,r),i.point(be,r),i.point(be,0),i.point(be,-r),i.point(0,-r),i.point(-be,-r),i.point(-be,0),i.point(-be,r);else if(we(e[0]-t[0])>ae){var o=e[0]<t[0]?be:-be;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function Mq(e){var t=se(e),n=2*me,i=t>0,r=we(t)>ae;function o(c,f,d,h){_q(h,e,n,d,c,f)}function s(c,f){return se(c)*se(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],v,x=s(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?be:-be),y):0;if(!f&&(g=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||wd(f,v)||wd(b,v))&&(b[2]=1)),x!==h)p=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!wd(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=Ps(c),g=Ps(f),p=[1,0,0],m=su(h,g),y=Lf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=su(p,m),w=Pf(p,x),_=Pf(m,E);zm(w,_);var A=S,k=Lf(w,A),C=Lf(A,A),O=k*k-C*(Lf(w,w)-1);if(!(O<0)){var M=ln(O),F=Pf(A,(-k-M)/C);if(zm(F,w),F=gh(F),!d)return F;var $=c[0],T=f[0],L=c[1],z=f[1],I;T<$&&(I=$,$=T,T=I);var Q=T-$,ue=we(Q-be)<ae,oe=ue||Q<ae;if(!ue&&z<L&&(I=L,L=z,z=I),oe?ue?L+z>0^F[1]<(we(F[0]-$)<ae?L:z):L<=F[1]&&F[1]<=z:Q>be^($<=F[0]&&F[0]<=T)){var fe=Pf(A,(-k+M)/C);return zm(fe,w),[F,gh(fe)]}}}function l(c,f){var d=i?e:be-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return FO(s,a,o,i?[0,-e]:[-be,e-be])}function Dq(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,g;if(g=n-s,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-s,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=o-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var zf=1e9,Bf=-1e9;function TO(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,g=0;if(l==null||(h=s(l,f))!==(g=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==g);else d.point(c[0],c[1])}function s(l,c){return we(l[0]-e)<ae?c>0?0:3:we(l[0]-n)<ae?c>0?2:1:we(l[1]-t)<ae?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=kO(),d,h,g,p,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:M,polygonStart:k,polygonEnd:C};function _($,T){r($,T)&&c.point($,T)}function A(){for(var $=0,T=0,L=h.length;T<L;++T)for(var z=h[T],I=1,Q=z.length,ue=z[0],oe,fe,Pe=ue[0],de=ue[1];I<Q;++I)oe=Pe,fe=de,ue=z[I],Pe=ue[0],de=ue[1],fe<=i?de>i&&(Pe-oe)*(i-fe)>(de-fe)*(e-oe)&&++$:de<=i&&(Pe-oe)*(i-fe)<(de-fe)*(e-oe)&&--$;return $}function k(){c=f,d=[],h=[],S=!0}function C(){var $=A(),T=S&&$,L=(d=jC(d)).length;(T||L)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),L&&CO(d,a,$,o,l),l.polygonEnd()),c=l,d=h=g=null}function O(){w.point=F,h&&h.push(g=[]),E=!0,x=!1,b=v=NaN}function M(){d&&(F(p,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F($,T){var L=r($,T);if(h&&g.push([$,T]),E)p=$,m=T,y=L,E=!1,L&&(c.lineStart(),c.point($,T));else if(L&&x)c.point($,T);else{var z=[b=Math.max(Bf,Math.min(zf,b)),v=Math.max(Bf,Math.min(zf,v))],I=[$=Math.max(Bf,Math.min(zf,$)),T=Math.max(Bf,Math.min(zf,T))];Dq(z,I,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),L||c.lineEnd(),S=!1):L&&(c.lineStart(),c.point($,T),S=!1)}b=$,v=T,x=L}return w}}function T_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function M_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function Oq(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Mn(Nf(i/c)*c,n,c).map(g).concat(Mn(Nf(a/f)*f,s,f).map(p)).concat(Mn(Nf(t/u)*u,e,u).filter(function(v){return we(v%c)>ae}).map(d)).concat(Mn(Nf(o/l)*l,r,l).filter(function(v){return we(v%f)>ae}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(s).slice(1),g(n).reverse().slice(1),p(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],s=+v[1][1],i>n&&(v=i,i=n,n=v),a>s&&(v=a,a=s,s=v),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),o>r&&(v=o,o=r,r=v),y.precision(m)):[[t,o],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=T_(o,r,90),h=M_(t,e,m),g=T_(a,s,90),p=M_(i,n,m),y):m},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}const gc=e=>e;var Um=new sn,W1=new sn,MO,DO,H1,G1,kr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){kr.lineStart=Rq,kr.lineEnd=Lq},polygonEnd:function(){kr.lineStart=kr.lineEnd=kr.point=$t,Um.add(we(W1)),W1=new sn},result:function(){var e=Um/2;return Um=new sn,e}};function Rq(){kr.point=Nq}function Nq(e,t){kr.point=OO,MO=H1=e,DO=G1=t}function OO(e,t){W1.add(G1*e-H1*t),H1=e,G1=t}function Lq(){OO(MO,DO)}var au=1/0,Sh=au,pc=-au,_h=pc,Ah={point:Pq,lineStart:$t,lineEnd:$t,polygonStart:$t,polygonEnd:$t,result:function(){var e=[[au,Sh],[pc,_h]];return pc=_h=-(Sh=au=1/0),e}};function Pq(e,t){e<au&&(au=e),e>pc&&(pc=e),t<Sh&&(Sh=t),t>_h&&(_h=t)}var V1=0,Y1=0,Ol=0,$h=0,kh=0,Oa=0,X1=0,K1=0,Rl=0,RO,NO,Wi,Hi,Hn={point:Is,lineStart:D_,lineEnd:O_,polygonStart:function(){Hn.lineStart=Bq,Hn.lineEnd=Uq},polygonEnd:function(){Hn.point=Is,Hn.lineStart=D_,Hn.lineEnd=O_},result:function(){var e=Rl?[X1/Rl,K1/Rl]:Oa?[$h/Oa,kh/Oa]:Ol?[V1/Ol,Y1/Ol]:[NaN,NaN];return V1=Y1=Ol=$h=kh=Oa=X1=K1=Rl=0,e}};function Is(e,t){V1+=e,Y1+=t,++Ol}function D_(){Hn.point=Iq}function Iq(e,t){Hn.point=zq,Is(Wi=e,Hi=t)}function zq(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,Is(Wi=e,Hi=t)}function O_(){Hn.point=Is}function Bq(){Hn.point=jq}function Uq(){LO(RO,NO)}function jq(e,t){Hn.point=LO,Is(RO=Wi=e,NO=Hi=t)}function LO(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,r=Hi*e-Wi*t,X1+=r*(Wi+e),K1+=r*(Hi+t),Rl+=r*3,Is(Wi=e,Hi=t)}function PO(e){this._context=e}PO.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,un);break}}},result:$t};var J1=new sn,jm,IO,zO,Nl,Ll,mc={point:$t,lineStart:function(){mc.point=qq},lineEnd:function(){jm&&BO(IO,zO),mc.point=$t},polygonStart:function(){jm=!0},polygonEnd:function(){jm=null},result:function(){var e=+J1;return J1=new sn,e}};function qq(e,t){mc.point=BO,IO=Nl=e,zO=Ll=t}function BO(e,t){Nl-=e,Ll-=t,J1.add(ln(Nl*Nl+Ll*Ll)),Nl=e,Ll=t}let R_,Ch,N_,L_;class P_{constructor(t){this._append=t==null?UO:Wq(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==N_||this._append!==Ch){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,N_=i,Ch=this._append,L_=this._,this._=r}this._+=L_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function UO(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Wq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return UO;if(t!==R_){const n=10**t;R_=t,Ch=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return Ch}function jO(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),$r(a,r(o))),o.result()}return s.area=function(a){return $r(a,r(kr)),kr.result()},s.measure=function(a){return $r(a,r(mc)),mc.result()},s.bounds=function(a){return $r(a,r(Ah)),Ah.result()},s.centroid=function(a){return $r(a,r(Hn)),Hn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,gc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new P_(n)):new PO(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new P_(n)),s},s.projection(e).digits(n).context(t)}function ep(e){return function(t){var n=new Q1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Q1(){}Q1.prototype={constructor:Q1,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function zx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Ah)),t(Ah.result()),i!=null&&e.clipExtent(i),e}function tp(e,t,n){return zx(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function Bx(e,t,n){return tp(e,[[0,0],t],n)}function Ux(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function jx(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var I_=16,Hq=se(30*me);function z_(e,t){return+t?Vq(e,t):Gq(e)}function Gq(e){return ep({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Vq(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&p--){var x=s+d,E=a+h,S=u+g,w=ln(x*x+E*E+S*S),_=wn(S/=w),A=we(we(S)-1)<ae||we(o-f)<ae?(o+f)/2:ti(E,x),k=e(A,_),C=k[0],O=k[1],M=C-i,F=O-r,$=b*M-y*F;($*$/v>t||we((y*M+b*F)/v-.5)>.3||s*d+a*h+u*g<Hq)&&(n(i,r,o,s,a,u,C,O,A,x/=w,E/=w,S,p,m),m.point(C,O),n(C,O,A,x,E,S,l,c,f,d,h,g,p,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,A){_=e(_,A),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,A){var k=Ps([_,A]),C=e(_,A);n(f,d,c,h,g,p,f=C[0],d=C[1],c=_,h=k[0],g=k[1],p=k[2],I_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,A){v(r=_,A),o=f,s=d,a=h,u=g,l=p,m.point=v}function w(){n(f,d,c,h,g,p,o,s,r,a,u,l,I_,i),m.lineEnd=x,x()}return m}}var Yq=ep({point:function(e,t){this.stream.point(e*me,t*me)}});function Xq(e){return ep({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Kq(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function B_(e,t,n,i,r,o){if(!o)return Kq(e,t,n,i,r);var s=se(o),a=re(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function cr(e){return qO(function(){return e})()}function qO(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,g=null,p=F_,m=null,y,b,v,x=gc,E=.5,S,w,_,A,k;function C($){return _($[0]*me,$[1]*me)}function O($){return $=_.invert($[0],$[1]),$&&[$[0]*Ze,$[1]*Ze]}C.stream=function($){return A&&k===$?A:A=Yq(Xq(c)(p(S(x(k=$)))))},C.preclip=function($){return arguments.length?(p=$,g=void 0,F()):p},C.postclip=function($){return arguments.length?(x=$,m=y=b=v=null,F()):x},C.clipAngle=function($){return arguments.length?(p=+$?Mq(g=$*me):(g=null,F_),F()):g*Ze},C.clipExtent=function($){return arguments.length?(x=$==null?(m=y=b=v=null,gc):TO(m=+$[0][0],y=+$[0][1],b=+$[1][0],v=+$[1][1]),F()):m==null?null:[[m,y],[b,v]]},C.scale=function($){return arguments.length?(n=+$,M()):n},C.translate=function($){return arguments.length?(i=+$[0],r=+$[1],M()):[i,r]},C.center=function($){return arguments.length?(o=$[0]%360*me,s=$[1]%360*me,M()):[o*Ze,s*Ze]},C.rotate=function($){return arguments.length?(a=$[0]%360*me,u=$[1]%360*me,l=$.length>2?$[2]%360*me:0,M()):[a*Ze,u*Ze,l*Ze]},C.angle=function($){return arguments.length?(f=$%360*me,M()):f*Ze},C.reflectX=function($){return arguments.length?(d=$?-1:1,M()):d<0},C.reflectY=function($){return arguments.length?(h=$?-1:1,M()):h<0},C.precision=function($){return arguments.length?(S=z_(w,E=$*$),F()):ln(E)},C.fitExtent=function($,T){return tp(C,$,T)},C.fitSize=function($,T){return Bx(C,$,T)},C.fitWidth=function($,T){return Ux(C,$,T)},C.fitHeight=function($,T){return jx(C,$,T)};function M(){var $=B_(n,0,0,d,h,f).apply(null,t(o,s)),T=B_(n,i-$[0],r-$[1],d,h,f);return c=$O(a,u,l),w=j1(t,T),_=j1(c,w),S=z_(w,E),F()}function F(){return A=k=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&O,M()}}function qx(e){var t=0,n=be/3,i=qO(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*me,n=o[1]*me):[t*Ze,n*Ze]},r}function Jq(e){var t=se(e);function n(i,r){return[i*t,re(r)/t]}return n.invert=function(i,r){return[i/t,wn(r*t)]},n}function Qq(e,t){var n=re(e),i=(n+re(t))/2;if(we(i)<ae)return Jq(e);var r=1+n*(2*i-n),o=ln(r)/i;function s(a,u){var l=ln(r-2*i*re(u))/i;return[l*re(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=ti(a,we(l))*Vn(l);return l*i<0&&(c-=be*Vn(a)*Vn(l)),[c/i,wn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Fh(){return qx(Qq).scale(155.424).center([0,33.6442])}function WO(){return Fh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Zq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function eW(){var e,t,n=WO(),i,r=Fh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Fh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],g=d[1];return u=null,i.point(h,g),u||(o.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Zq([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),o=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ae,p+.12*h+ae],[g-.214*h-ae,p+.234*h-ae]]).stream(l),a=s.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ae,p+.166*h+ae],[g-.115*h-ae,p+.234*h-ae]]).stream(l),f()},c.fitExtent=function(d,h){return tp(c,d,h)},c.fitSize=function(d,h){return Bx(c,d,h)},c.fitWidth=function(d,h){return Ux(c,d,h)},c.fitHeight=function(d,h){return jx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function HO(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*re(t),o*re(n)]}}function Zc(e){return function(t,n){var i=ln(t*t+n*n),r=e(i),o=re(r),s=se(r);return[ti(t*o,i*s),wn(i&&n*o/i)]}}var GO=HO(function(e){return ln(2/(1+e))});GO.invert=Zc(function(e){return 2*wn(e/2)});function tW(){return cr(GO).scale(124.75).clipAngle(180-.001)}var VO=HO(function(e){return(e=pO(e))&&e/re(e)});VO.invert=Zc(function(e){return e});function nW(){return cr(VO).scale(79.4188).clipAngle(180-.001)}function np(e,t){return[e,ch(Px((Xe+t)/2))]}np.invert=function(e,t){return[e,2*Iu(gO(t))-Xe]};function iW(){return YO(np).scale(961/un)}function YO(e){var t=cr(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=be*i(),d=t(Sq(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===np?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function Uf(e){return Px((Xe+e)/2)}function rW(e,t){var n=se(e),i=e===t?re(e):ch(n/se(t))/ch(Uf(t)/Uf(e)),r=n*Im(Uf(e),i)/i;if(!i)return np;function o(s,a){r>0?a<-Xe+ae&&(a=-Xe+ae):a>Xe-ae&&(a=Xe-ae);var u=r/Im(Uf(a),i);return[u*re(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=Vn(i)*ln(s*s+u*u),c=ti(s,we(u))*Vn(u);return u*i<0&&(c-=be*Vn(s)*Vn(u)),[c/i,2*Iu(Im(r/l,1/i))-Xe]},o}function oW(){return qx(rW).scale(109.5).parallels([30,30])}function Th(e,t){return[e,t]}Th.invert=Th;function sW(){return cr(Th).scale(152.63)}function aW(e,t){var n=se(e),i=e===t?re(e):(n-se(t))/(t-e),r=n/i+e;if(we(i)<ae)return Th;function o(s,a){var u=r-a,l=i*s;return[u*re(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=ti(s,we(u))*Vn(u);return u*i<0&&(l-=be*Vn(s)*Vn(u)),[l/i,r-Vn(i)*ln(s*s+u*u)]},o}function uW(){return qx(aW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Xl=-.081106,Kl=893e-6,Jl=.003796,Mh=ln(3)/2,lW=12;function XO(e,t){var n=wn(Mh*re(t)),i=n*n,r=i*i*i;return[e*se(n)/(Mh*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))),n*(Yl+Xl*i+r*(Kl+Jl*i))]}XO.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<lW&&(a=n*(Yl+Xl*i+r*(Kl+Jl*i))-t,u=Yl+3*Xl*i+r*(7*Kl+9*Jl*i),n-=s=a/u,i=n*n,r=i*i*i,!(we(s)<D1));++o);return[Mh*e*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))/se(n),wn(re(n)/Mh)]};function cW(){return cr(XO).scale(177.158)}function KO(e,t){var n=se(t),i=se(e)*n;return[n*re(e)/i,re(t)/i]}KO.invert=Zc(Iu);function fW(){return cr(KO).scale(144.049).clipAngle(60)}function dW(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,g=ep({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),p=gc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(o){var w=S*s-E*a;E=E*s+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(o){var w=S*s+E*a;E=E*s-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=g(p(y=x))},v.postclip=function(x){return arguments.length?(p=x,u=l=c=f=null,b()):p},v.clipExtent=function(x){return arguments.length?(p=x==null?(u=l=c=f=null,gc):TO(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*me,a=re(o),s=se(o),b()):o*Ze},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return tp(v,x,E)},v.fitSize=function(x,E){return Bx(v,x,E)},v.fitWidth=function(x,E){return Ux(v,x,E)},v.fitHeight=function(x,E){return jx(v,x,E)},v}function JO(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}JO.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(we(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function hW(){return cr(JO).scale(175.295)}function QO(e,t){return[se(t)*re(e),re(t)]}QO.invert=Zc(wn);function gW(){return cr(QO).scale(249.5).clipAngle(90+ae)}function ZO(e,t){var n=se(t),i=1+se(e)*n;return[n*re(e)/i,re(t)/i]}ZO.invert=Zc(function(e){return 2*Iu(e)});function pW(){return cr(ZO).scale(250).clipAngle(142)}function eR(e,t){return[ch(Px((Xe+t)/2)),-e]}eR.invert=function(e,t){return[-t,2*Iu(gO(e))-Xe]};function mW(){var e=YO(eR),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var yW=Math.abs,Z1=Math.cos,Dh=Math.sin,bW=1e-6,tR=Math.PI,ey=tR/2,U_=vW(2);function j_(e){return e>1?ey:e<-1?-ey:Math.asin(e)}function vW(e){return e>0?Math.sqrt(e):0}function xW(e,t){var n=e*Dh(t),i=30,r;do t-=r=(t+Dh(t)-n)/(1+Z1(t));while(yW(r)>bW&&--i>0);return t/2}function wW(e,t,n){function i(r,o){return[e*r*Z1(o=xW(n,o)),t*Dh(o)]}return i.invert=function(r,o){return o=j_(o/t),[r/(e*Z1(o)),j_((2*o+Dh(2*o))/n)]},i}var EW=wW(U_/ey,U_,tR);function SW(){return cr(EW).scale(169.529)}const _W=jO(),ty=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function AW(e,t){return function n(){const i=t();return i.type=e,i.path=jO().projection(i),i.copy=i.copy||function(){const r=n();return ty.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},mM(i)}}function Wx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Oh[e]=AW(e,t),this):Oh[e]||null}function nR(e){return e&&e.path||_W}const Oh={albers:WO,albersusa:eW,azimuthalequalarea:tW,azimuthalequidistant:nW,conicconformal:oW,conicequalarea:Fh,conicequidistant:uW,equalEarth:cW,equirectangular:sW,gnomonic:fW,identity:dW,mercator:iW,mollweide:SW,naturalEarth1:hW,orthographic:gW,stereographic:pW,transversemercator:mW};for(const e in Oh)Wx(e,Oh[e]);function $W(){}const xr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function iR(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),kW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(CW((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,xr[m<<1].forEach(v);++h<e-1;)p=m,m=u[h+1]>=l,xr[p|m<<1].forEach(v);for(xr[m<<0].forEach(v);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,xr[m<<1|y<<2].forEach(v);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,xr[p|m<<1|y<<2|b<<3].forEach(v);xr[m|y<<3].forEach(v)}for(h=-1,y=u[g*e]>=l,xr[y<<2].forEach(v);++h<e-1;)b=y,y=u[g*e+h+1]>=l,xr[y<<2|b<<3].forEach(v);xr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+g],S=[x[1][0]+h,x[1][1]+g],w=s(E),_=s(S),A,k;(A=d[w])?(k=f[_])?(delete d[A.end],delete f[k.start],A===k?(A.ring.push(S),c(A.ring)):f[A.start]=d[k.end]={start:A.start,end:k.end,ring:A.ring.concat(k.ring)}):(delete d[A.end],A.ring.push(S),d[A.end=_]=A):(A=f[_])?(k=d[w])?(delete f[A.start],delete d[k.end],A===k?(A.ring.push(S),c(A.ring)):f[k.start]=d[A.end]={start:k.start,end:A.end,ring:k.ring.concat(A.ring)}):(delete f[A.start],A.ring.unshift(E),f[A.start=w]=A):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:$W,i):n===a},i}function kW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function CW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=FW(e,t[n]))return r;return 0}function FW(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(TW(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function TW(e,t,n){var i;return MW(e,t,n)&&DW(e[i=+(e[0]===t[0])],n[i],t[i])}function MW(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function DW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function rR(e,t,n){return function(i){var r=Qi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?Os(o,s,e):a/(e+1);return Mn(o+u,s,u)}}function Hx(e){D.call(this,null,e)}Hx.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Hx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Vt,o=iR().smooth(e.smooth!==!1),s=e.thresholds||OW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,P(s)?s:s(c.values));RW(f,c,l,e),f.forEach(d=>{u.push(Sg(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function OW(e,t,n){const i=rR(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>_s(t(r).values)))}function RW(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ge(r)&&(r=r(n,i)),ge(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(Ae(r)?r:r[0])||1,a=(Ae(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(oR(t,s,a,u,l))}function oR(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function q_(e,t,n){const i=e>=0?e:Bb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function qm(e){return ge(e)?e:Yt(+e)}function sR(){var e=u=>u[0],t=u=>u[1],n=ku,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=q_(i[0],u,e)>>s,f=q_(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>s),p=2*h+(o>>s),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(x=>{const E=d+(+e(x)>>s),S=h+(+t(x)>>s);E>=0&&E<g&&S>=0&&S<p&&(m[E+S*g]+=+n(x))}),c>0&&f>0?(xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f)):c>0?(xa(g,p,m,y,c),xa(g,p,y,m,c),xa(g,p,m,y,c),b=y):f>0&&(wa(g,p,m,y,f),wa(g,p,y,m,f),wa(g,p,m,y,f),b=y);const v=l?Math.pow(2,-2*s):1/qC(b);for(let x=0,E=g*p;x<E;++x)b[x]*=v;return{values:b,scale:1<<s,width:g,height:p,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=qm(u),a):e},a.y=function(u){return arguments.length?(t=qm(u),a):t},a.weight=function(u){return arguments.length?(n=qm(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function wa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function Gx(e){D.call(this,null,e)}Gx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const NW=["x","y","weight","size","cellSize","bandwidth"];function aR(e,t){return NW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(Gx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=LW(i,e.groupby),o=(e.groupby||[]).map(Je),s=aR(sR(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function LW(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Vx(e){D.call(this,null,e)}Vx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Vx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=iR().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||rR(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=aR(sR(),e)(r,!0),u=oR(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=P(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const ny="Feature",Yx="FeatureCollection",PW="MultiPoint";function Xx(e){D.call(this,null,e)}Xx.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Xx,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&Vt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(qt(a))||o&&t.modified(qt(o))||s&&t.modified(qt(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:ny,geometry:{type:PW,coordinates:i}})),this.value={type:Yx,features:n}}});function Kx(e){D.call(this,null,e)}Kx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(Kx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Vt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=nR(e.projection),n.materialize().reflow()):s=r===Vt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=IW(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function IW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(Jx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function Qx(e){D.call(this,null,e)}Qx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Qx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=zW(nR(e.projection),e.field||Qn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function zW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function Zx(e){D.call(this,[],e),this.generator=Oq()}Zx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Zx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ge(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(OF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function e2(e){D.call(this,null,e)}e2.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(e2,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Vt,o=UW(e.opacity,e),s=BW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?_s(n.map(l=>_s(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=he({},l,u);i||(f.$max=_s(c.values||[])),l[a]=jW(c,f,s.dep?s:Yt(s(f)),o.dep?o:Yt(o(f)))}),t.reflow(!0).modifies(a)}});function BW(e,t){let n;return ge(e)?(n=i=>Rd(e(i,t)),n.dep=uR(e)):n=Yt(Rd(e||"#888")),n}function UW(e,t){let n;return ge(e)?(n=i=>e(i,t),n.dep=uR(e)):e?n=Yt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function uR(e){if(!ge(e))return!1;const t=xi(qt(e));return t.$x||t.$y||t.$value||t.$max}function jW(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:fo,d=$o(u-s,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-s,l-a),p=g.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,v=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+v);const x=n(t);p[y+0]=x.r,p[y+1]=x.g,p[y+2]=x.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function lR(e){D.call(this,null,e),this.modified(!0)}G(lR,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=WW(e.type),ty.forEach(i=>{e[i]!=null&&W_(n,i,e[i])})):ty.forEach(i=>{e.modified(i)&&W_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&qW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qW(e,t){const n=HW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function WW(e){const t=Wx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function W_(e,t,n){ge(e[t])&&e[t](n)}function HW(e){return e=X(e),e.length===1?e[0]:{type:Yx,features:e.reduce((t,n)=>t.concat(GW(n)),[])}}function GW(e){return e.type===Yx?e.features:X(e).filter(t=>t!=null).map(t=>t.type===ny?t:{type:ny,geometry:t})}const VW=Object.freeze(Object.defineProperty({__proto__:null,contour:Vx,geojson:Xx,geopath:Kx,geopoint:Jx,geoshape:Qx,graticule:Zx,heatmap:e2,isocontour:Hx,kde2d:Gx,projection:lR},Symbol.toStringTag,{value:"Module"}));function YW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function XW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return cR(this.cover(t,n),t,n,e)}function cR(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,g,p,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|p]))return r[y]=s,e;if(h=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===h&&n===g)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function KW(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)cR(this,s[n],a[n],e[n]);return this}function JW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function QW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function ZW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function nn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function eH(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,g,p;for(h&&d.push(new nn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(s=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new nn(h[3],m,y,u,l),new nn(h[2],s,y,m,l),new nn(h[1],m,a,u,y),new nn(h[0],s,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,o=t-E,c=e+E,f=t+E,i=h.data}}return i}function tH(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(s+u)/2))?s=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function nH(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function iH(){return this._root}function rH(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function oH(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new nn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new nn(r,l,c,a,u)),(r=i[2])&&t.push(new nn(r,o,c,l,u)),(r=i[1])&&t.push(new nn(r,l,s,a,c)),(r=i[0])&&t.push(new nn(r,o,s,l,c))}return this}function sH(e){var t=[],n=[],i;for(this._root&&t.push(new nn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new nn(o,s,a,c,f)),(o=r[1])&&t.push(new nn(o,c,a,u,f)),(o=r[2])&&t.push(new nn(o,s,f,c,l)),(o=r[3])&&t.push(new nn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function aH(e){return e[0]}function uH(e){return arguments.length?(this._x=e,this):this._x}function lH(e){return e[1]}function cH(e){return arguments.length?(this._y=e,this):this._y}function t2(e,t,n){var i=new n2(t??aH,n??lH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function n2(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function H_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var fn=t2.prototype=n2.prototype;fn.copy=function(){var e=new n2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=H_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=H_(i));return e};fn.add=XW;fn.addAll=KW;fn.cover=JW;fn.data=QW;fn.extent=ZW;fn.find=eH;fn.remove=tH;fn.removeAll=nH;fn.root=iH;fn.size=rH;fn.visit=oH;fn.visitAfter=sH;fn.x=uH;fn.y=cH;function rn(e){return function(){return e}}function xo(e){return(e()-.5)*1e-6}function fH(e){return e.x+e.vx}function dH(e){return e.y+e.vy}function hH(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=rn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<o;++y)for(f=t2(t,fH,dH).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,A=v.r,k=p+A;if(_){if(_.index>d.index){var C=h-_.x-_.vx,O=g-_.y-_.vy,M=C*C+O*O;M<k*k&&(C===0&&(C=xo(i),M+=C*C),O===0&&(O=xo(i),M+=O*O),M=(k-(M=Math.sqrt(M)))/M*r,d.vx+=(C*=M)*(k=(A*=A)/(m+A)),d.vy+=(O*=M)*k,_.vx-=C*(k=1-k),_.vy-=O*k)}return}return x>h+k||S<h-k||E>g+k||w<g-k}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:rn(+l),u(),s):e},s}function gH(e){return e.index}function G_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function pH(e){var t=gH,n=f,i,r=rn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,A,k;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||xo(l),_=S.y+S.vy-E.y-E.vy||xo(l),A=Math.sqrt(w*w+_*_),A=(A-o[v])/A*m*i[v],w*=A,_*=A,S.vx-=w*(k=u[v]),S.vy-=_*k,E.vx+=w*(k=1-k),E.vy+=_*k}function h(){if(s){var m,y=s.length,b=e.length,v=new Map(s.map((E,S)=>[t(E,S,s),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=G_(v,x.source)),typeof x.target!="object"&&(x.target=G_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),g(),o=new Array(b),p()}}function g(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:rn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:rn(+m),p(),d):r},d}function mH(e,t,n){var i=new hI,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?gI():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const yH=1664525,bH=1013904223,V_=4294967296;function vH(){let e=1;return()=>(e=(yH*e+bH)%V_)/V_}function xH(e){return e.x}function wH(e){return e.y}var EH=10,SH=Math.PI*(3-Math.sqrt(5));function _H(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=pI(f),l=mI("tick","end"),c=vH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var v=0;v<p;++v)for(n+=(o-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=EH*Math.sqrt(.5+p),v=p*SH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(s=1-p,t):1-s},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=p-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function AH(){var e,t,n,i,r=rn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=t2(e,xH,wH).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(o=new Array(g),h=0;h<g;++h)p=e[h],o[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(p=h[x])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,v+=m*p.y);h.x=b/y,h.y=v/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=o[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-g,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)));do h.data!==t&&(v=o[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:rn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function $H(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}function kH(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}const Y_={center:YW,collide:hH,nbody:AH,link:pH,x:$H,y:kH},Pl="forces",iy=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],CH=["static","iterations"],fR=["x","y","vx","vy"];function i2(e){D.call(this,null,e)}i2.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:fR}]};G(i2,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(iy),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&dR(n,e,0,t)):(this.value=n=TH(t.source,e),n.on("tick",FH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(CH)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==Pl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(fR)}});function FH(e,t){return()=>e.touch(t).run()}function TH(e,t){const n=_H(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),dR(n,t,!0).on("end",()=>o=!0)}function dR(e,t,n,i){var r=X(t.forces),o,s,a,u;for(o=0,s=iy.length;o<s;++o)a=iy[o],a!==Pl&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=Pl+o,a=n||t.modified(Pl,o)?DH(r[o]):i&&MH(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(Pl+o,null);return e.numForces=r.length,e}function MH(e,t){var n,i;for(n in e)if(ge(i=e[n])&&t.modified(qt(i)))return 1;return 0}function DH(e){var t,n;J(Y_,e.force)||N("Unrecognized force: "+e.force),t=Y_[e.force]();for(n in e)ge(t[n])&&OH(t[n],e[n],e);return t}function OH(e,t,n){e(ge(t)?i=>t(i,n):t)}const RH=Object.freeze(Object.defineProperty({__proto__:null,force:i2},Symbol.toStringTag,{value:"Module"}));function NH(e,t){return e.parent===t.parent?1:2}function LH(e){return e.reduce(PH,0)/e.length}function PH(e,t){return e+t.x}function IH(e){return 1+e.reduce(zH,0)}function zH(e,t){return Math.max(e,t.y)}function BH(e){for(var t;t=e.children;)e=t[0];return e}function UH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function jH(){var e=NH,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=LH(h),d.y=IH(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=BH(o),l=UH(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function qH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function WH(){return this.eachAfter(qH)}function HH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function GH(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function VH(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function YH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function XH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function KH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function JH(e){for(var t=this,n=QH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function QH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function ZH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function eG(){return Array.from(this)}function tG(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nG(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*iG(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function r2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=sG)):t===void 0&&(t=oG);for(var n=new uu(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new uu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(hR)}function rG(){return r2(this).eachBefore(aG)}function oG(e){return e.children}function sG(e){return Array.isArray(e)?e[1]:null}function aG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function hR(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function uu(e){this.data=e,this.depth=this.height=0,this.parent=null}uu.prototype=r2.prototype={constructor:uu,count:WH,each:HH,eachAfter:VH,eachBefore:GH,find:YH,sum:XH,sort:KH,path:JH,ancestors:ZH,descendants:eG,leaves:tG,links:nG,copy:rG,[Symbol.iterator]:iG};function Ed(e){return e==null?null:gR(e)}function gR(e){if(typeof e!="function")throw new Error;return e}function xs(){return 0}function Ca(e){return function(){return e}}const uG=1664525,lG=1013904223,X_=4294967296;function cG(){let e=1;return()=>(e=(uG*e+lG)%X_)/X_}function fG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function hG(e,t){for(var n=0,i=(e=dG(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&pR(s,o)?++n:(s=pG(r=gG(r,o)),n=0);return s}function gG(e,t){var n,i;if(Wm(t,e))return[t];for(n=0;n<e.length;++n)if(jf(t,e[n])&&Wm(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(jf(Il(e[n],e[i]),t)&&jf(Il(e[n],t),e[i])&&jf(Il(e[i],t),e[n])&&Wm(mR(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function jf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function pR(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Wm(e,t){for(var n=0;n<t.length;++n)if(!pR(e,t[n]))return!1;return!0}function pG(e){switch(e.length){case 1:return mG(e[0]);case 2:return Il(e[0],e[1]);case 3:return mR(e[0],e[1],e[2])}}function mG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function mR(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,g=r-a,p=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,v=b-s*s-a*a+u*u,x=b-l*l-c*c+f*f,E=h*g-d*p,S=(g*x-p*v)/(E*2)-i,w=(p*m-g*y)/E,_=(h*v-d*x)/(E*2)-r,A=(d*y-h*m)/E,k=w*w+A*A-1,C=2*(o+S*w+_*A),O=S*S+_*_-o*o,M=-(Math.abs(k)>1e-6?(C+Math.sqrt(C*C-4*k*O))/(2*k):O/C);return{x:i+S+w*M,y:r+_+A*M,r:M}}function K_(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function J_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function qf(e){this._=e,this.next=null,this.previous=null}function yG(e,t){if(!(o=(e=fG(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;K_(i,n,r=e[2]),n=new qf(n),i=new qf(i),r=new qf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){K_(n._,i._,r=e[u]),r=new qf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(J_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(J_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=Q_(n);(r=r.next)!==i;)(a=Q_(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=hG(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function bG(e){return Math.sqrt(e.value)}function vG(){var e=null,t=1,n=1,i=xs;function r(o){const s=cG();return o.x=t/2,o.y=n/2,e?o.eachBefore(Z_(e)).eachAfter(Hm(i,.5,s)).eachBefore(eA(1)):o.eachBefore(Z_(bG)).eachAfter(Hm(xs,1,s)).eachAfter(Hm(i,o.r/Math.min(t,n),s)).eachBefore(eA(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=Ed(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:Ca(+o),r):i},r}function Z_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Hm(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=yG(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function eA(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function yR(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ef(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function xG(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(yR),s}function o(s,a){return function(u){u.children&&ef(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var wG={depth:-1},tA={},Gm={};function EG(e){return e.id}function SG(e){return e.parentId}function nA(){var e=EG,t=SG,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=o.map((x,E)=>_G(n(x,E,r))),b=y.map(iA),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(iA(x)),o.push(Gm));s=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new uu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?tA:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=o[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===tA)throw new Error("ambiguous: "+g);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Gm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Gm);--y)h.data=null}if(f.parent=wG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(hR),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ed(r),i):e},i.parentId=function(r){return arguments.length?(t=Ed(r),i):t},i.path=function(r){return arguments.length?(n=Ed(r),i):n},i}function _G(e){e=`${e}`;let t=e.length;return ry(e,t-1)&&!ry(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function iA(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ry(e,t););return e.slice(0,t)}function ry(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function AG(e,t){return e.parent===t.parent?1:2}function Vm(e){var t=e.children;return t?t[0]:e.t}function Ym(e){var t=e.children;return t?t[t.length-1]:e.t}function $G(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function kG(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function CG(e,t,n){return e.a.parent===t.parent?e.a:n}function Sd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Sd.prototype=Object.create(uu.prototype);function FG(e){for(var t=new Sd(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new Sd(o[s],s)),r.parent=n;return(t.parent=new Sd(null,0)).children=[t],t}function TG(){var e=AG,t=1,n=1,i=null;function r(l){var c=FG(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){kG(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,v=p.m,x;g=Ym(g),d=Vm(d),g&&d;)p=Vm(p),h=Ym(h),h.a=l,x=g.z+b-d.z-m+e(g._,d._),x>0&&($G(CG(g,l,f),l,x),m+=x,y+=x),b+=g.m,m+=d.m,v+=p.m,y+=h.m;g&&!Ym(h)&&(h.t=g,h.m+=b-y),d&&!Vm(p)&&(p.t=d,p.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function ip(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var bR=(1+Math.sqrt(5))/2;function vR(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,g=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(g/h,h/g)/(p*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}s.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?ef(u,n,i,r,p?i+=g*m/p:o):ip(u,n,i,p?n+=h*m/p:r,o),p-=m,c=f}return s}const xR=function e(t){function n(i,r,o,s,a){vR(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function MG(){var e=xR,t=!1,n=1,i=1,r=[0],o=xs,s=xs,a=xs,u=xs,l=xs;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(yR),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,g+=l(d)-h,p+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=gR(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Ca(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Ca(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Ca(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Ca(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Ca(+d),c):l},c}function DG(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,g,p,m,y){if(f>=d-1){var b=o[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,A=h-_;if(m-g>y-p){var k=h?(g*A+m*_)/h:m;c(f,E,_,g,p,k,y),c(E,d,A,k,p,m,y)}else{var C=h?(p*A+y*_)/h:y;c(f,E,_,g,p,m,C),c(E,d,A,g,C,m,y)}}}function OG(e,t,n,i,r){(e.depth&1?ip:ef)(e,t,n,i,r)}const RG=function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?ef(l,r,o,s,p?o+=(a-o)*l.value/p:a):ip(l,r,o,p?r+=(s-r)*l.value/p:s,a),p-=l.value}else i._squarify=u=vR(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function oy(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function o2(e){D.call(this,null,e)}o2.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const NG=e=>e.values;G(o2,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&Eg(s.data)&&r.rem.push(s.data)}),this.value=o=r2({values:X(e.keys).reduce((s,a)=>(s.key(a),s),LG()).entries(r.source)},NG),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),oy(o,ie,ie)),r.source.root=o,r}});function LG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function Vr(e){D.call(this,null,e)}const PG=(e,t)=>e.parent===t.parent?1:2;G(Vr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,s=>s.data)),IG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?PG:ku);try{this.value=n(r)}catch(s){N(s)}return r.each(s=>zG(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function IG(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function zG(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const sy=["x","y","r","depth","children"];function s2(e){Vr.call(this,e)}s2.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(s2,Vr,{layout:vG,params:["radius","size","padding"],fields:sy});const ay=["x0","y0","x1","y1","depth","children"];function a2(e){Vr.call(this,e)}a2.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ay.length,default:ay}]};G(a2,Vr,{layout:xG,params:["size","round","padding"],fields:ay});function u2(e){D.call(this,null,e)}u2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(u2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?oy(nA().id(e.key).parentId(e.parentKey)(r.source),e.key,Pn):oy(nA()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const rA={tidy:TG,cluster:jH},uy=["x","y","depth","children"];function l2(e){Vr.call(this,e)}l2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:uy.length,default:uy}]};G(l2,Vr,{layout(e){const t=e||"tidy";if(J(rA,t))return rA[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:uy});function c2(e){D.call(this,[],e)}c2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(c2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ie(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ie(a)]&&o[ie(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ie(s)]=1),n.forEach(s=>{(o[ie(s.source)]||o[ie(s.target)])&&r.mod.push(s)})),r}});const oA={binary:DG,dice:ef,slice:ip,slicedice:OG,squarify:xR,resquarify:RG},ly=["x0","y0","x1","y1","depth","children"];function f2(e){Vr.call(this,e)}f2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ly.length,default:ly}]};G(f2,Vr,{layout(){const e=MG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(oA,t)?e.tile(oA[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ly});const BG=Object.freeze(Object.defineProperty({__proto__:null,nest:o2,pack:s2,partition:a2,stratify:u2,tree:l2,treelinks:c2,treemap:f2},Symbol.toStringTag,{value:"Module"})),Xm=4278190080;function UG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function jG(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=$o(o,s).getContext("2d"),l=$o(o,s).getContext("2d"),c=a&&$o(o,s).getContext("2d");n.forEach(_=>_d(u,_,!1)),_d(l,t,!1),a&&_d(c,t,!0);const f=Km(u,o,s),d=Km(l,o,s),h=a&&Km(c,o,s),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<s;++y)for(m=0;m<o;++m)x=y*o+m,E=f[x]&Xm,w=d[x]&Xm,S=a&&h[x]&Xm,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&g.set(b,v),a&&(E||S)&&p.set(b,v));return[g,p]}function Km(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function _d(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>_d(e,o.items,n))}):Bn[i].draw(e,{items:n?t.map(qG):t})}function qG(e){const t=Sg(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const wr=5,Xt=31,yc=32,lo=new Uint32Array(yc+1),di=new Uint32Array(yc+1);di[0]=0;lo[0]=~di[0];for(let e=1;e<=yc;++e)di[e]=di[e-1]<<1|1,lo[e]=~di[e];function WG(e,t){const n=new Uint32Array(~~((e*t+yc)/yc));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>wr]&1<<(a&Xt)},set:(o,s)=>{const a=s*e+o;i(a>>>wr,1<<(a&Xt))},clear:(o,s)=>{const a=s*e+o;r(a>>>wr,~(1<<(a&Xt)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>wr,h=f>>>wr,d===h){if(n[d]&lo[c&Xt]&di[(f&Xt)+1])return!0}else{if(n[d]&lo[c&Xt]||n[h]&di[(f&Xt)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)i(f,lo[l&Xt]&di[(c&Xt)+1]);else for(i(f,lo[l&Xt]),i(d,di[(c&Xt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)r(f,di[l&Xt]|lo[(c&Xt)+1]);else for(r(f,di[l&Xt]),r(d,lo[(c&Xt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function HG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>WG(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function GG(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=Rn.width(s.datum,s.datum.text);let f=0,d,h,g,p,m,y,b;for(let v=0;v<u;++v)d=a[v].x,g=a[v].y,h=a[v].x2===void 0?d:a[v].x2,p=a[v].y2===void 0?g:a[v].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,g=s.y-y,p=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",g<0&&p<=o?s.baseline="top":0<=g&&o<p&&(s.baseline="bottom"),!0}}function Rh(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function wo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function VG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const g=e.invert(l),p=e.invert(c);let m=f,y=o,b;if(!Rh(g,p,d,h,r,o)&&!wo(e,g,p,h,d,m,s,a)&&!wo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,wo(e,g,p,h,d,b,s,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,v,x,E,S,w,_,A,k,C,O,M,F,$,T,L,z;for(let I=0;I<f;++I){for(b=c[I].x,x=c[I].y,v=c[I].x2===void 0?b:c[I].x2,E=c[I].y2===void 0?x:c[I].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),k=e(b),O=e(v),C=~~((k+O)/2),M=e(x),$=e(E),F=~~((M+$)/2),_=C;_>=k;--_)for(A=F;A>=M;--A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);for(_=C;_<=O;++_)for(A=F;A<=$;++A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);!p&&!n&&(T=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,T>=y&&!Rh(S,w,h,d,r,o)&&!wo(e,S,w,d,h,d,s,null)&&(y=T,l.x=S,l.y=w,m=!0))}return p||m?(S=h/2,w=d/2,s.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const YG=[-1,-1,1,1],XG=[-1,1,-1,1];function KG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,A,k,C,O,M,F;for(let $=0;$<f;++$){for(v=c[$].x,E=c[$].y,x=c[$].x2===void 0?v:c[$].x2,S=c[$].y2===void 0?E:c[$].y2,g.push([e((v+x)/2),e((E+S)/2)]);g.length;)if([A,k]=g.pop(),!(s.get(A,k)||a.get(A,k)||u.get(A,k))){u.set(A,k);for(let T=0;T<4;++T)w=A+YG[T],_=k+XG[T],u.outOfBounds(w,_,w,_)||g.push([w,_]);if(w=e.invert(A),_=e.invert(k),C=p,O=o,!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,C,s,a)&&!wo(e,w,_,d,h,d,s,null)){for(;O-C>=1;)M=(C+O)/2,wo(e,w,_,d,h,M,s,a)?O=M:C=M;C>p&&(l.x=w,l.y=_,p=C,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,d,s,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,s.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const JG=["right","center","left"],QG=["bottom","middle","top"];function ZG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,g,p,m,y,b,v,x,E,S,w,_,A,k,C;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,g=(n[O]>>>2&3)-1,p=h===0&&g===0||i[O]<0,m=h&&g?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+g]+y*f*g/2+i[O]*g*m,x=w-f/2,E=w+f/2,_=e(b),k=e(x),C=e(E),!d)if(sA(_,_,k,C,s,a,b,b,x,E,c,p))d=Rn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),A=e(v),sA(_,A,k,C,s,a,b,v,x,E,c,p))return l.x=h?h*y<0?v:b:S,l.y=g?g*y<0?E:x:w,l.align=JG[h*y+1],l.baseline=QG[g*y+1],s.setRange(_,k,A,C),!0}return!1}}function sA(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Jm=0,Qm=4,Zm=8,e0=0,t0=1,n0=2,eV={"top-left":Jm+e0,top:Jm+t0,"top-right":Jm+n0,left:Qm+e0,middle:Qm+t0,right:Qm+n0,"bottom-left":Zm+e0,bottom:Zm+t0,"bottom-right":Zm+n0},tV={naive:GG,"reduced-search":VG,floodfill:KG};function nV(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=iV(i,f),h=rV(r,f),g=oV(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=sV(g,p,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(k=>{const C=b?Rn.width(k,k.text):void 0;return x=Math.max(x,C),E=Math.max(E,k.fontSize),{datum:k,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(k),textWidth:C}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=HG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,M)=>n(O.datum,M.datum));let k=!1;for(let O=0;O<h.length&&!k;++O)k=h[O]===5||d[O]<0;const C=(g&&s||m)&&e.map(O=>O.datum);_=o.length||C?jG(w,C||[],o,k,m):UG(w,s&&S)}const A=m?tV[c](w,_,s,u):ZG(w,_,h,d);return S.forEach(k=>k.opacity=+A(k)),S}function iV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function rV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=eV[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function oV(e){return e&&e.mark&&e.mark.marktype}function sV(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const cy=["x","y","opacity","align","baseline"],wR=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function d2(e){D.call(this,null,e)}d2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:wR},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:cy.length,default:cy}]};G(d2,D,{transform(e,t){function n(o){const s=e[o];return ge(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||cy;return nV(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||wR),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const aV=Object.freeze(Object.defineProperty({__proto__:null,label:d2},Symbol.toStringTag,{value:"Module"}));function ER(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function h2(e){D.call(this,null,e)}h2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(h2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=o.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{JF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const fy={constant:Qb,linear:Zb,log:VF,exp:YF,pow:XF,quad:ev,poly:KF},uV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function g2(e){D.call(this,null,e)}g2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(fy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(g2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=e.method||"linear",a=e.order==null?3:e.order,u=uV(s,a),l=e.as||[Je(e.x),Je(e.y)],c=fy[s],f=[];let d=e.extent;J(fy,s)||N("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const p=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||Qi(h,e.x),y=b=>{const v={};for(let x=0;x<o.length;++x)v[o[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};s==="linear"||s==="constant"?m.forEach(b=>y([b,p.predict(b)])):Tg(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const lV=Object.freeze(Object.defineProperty({__proto__:null,loess:h2,regression:g2},Symbol.toStringTag,{value:"Module"})),Nr=11102230246251565e-32,Nt=134217729,cV=(3+8*Nr)*Nr;function i0(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function fV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function tf(e){return new Float64Array(e)}const dV=(3+16*Nr)*Nr,hV=(2+12*Nr)*Nr,gV=(9+64*Nr)*Nr*Nr,Ea=tf(4),aA=tf(8),uA=tf(12),lA=tf(16),Kt=tf(4);function pV(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,g,p,m,y,b,v,x,E,S,w,_;const A=e-r,k=n-r,C=t-o,O=i-o;x=A*O,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=C*k,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let M=fV(4,Ea),F=hV*s;if(M>=F||-M>=F||(f=e-A,a=e-(A+f)+(f-r),f=n-k,l=n-(k+f)+(f-r),f=t-C,u=t-(C+f)+(f-o),f=i-O,c=i-(O+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=gV*s+cV*Math.abs(M),M+=A*c+O*a-(C*l+k*u),M>=F||-M>=F))return M;x=a*O,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=u*k,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const $=i0(4,Ea,4,Kt,aA);x=A*c,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=C*l,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const T=i0($,aA,4,Kt,uA);x=a*c,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=u*l,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const L=i0(T,uA,4,Kt,lA);return lA[L-1]}function Wf(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=dV*l?u:-pV(e,t,n,i,r,o,l)}const cA=Math.pow(2,-52),Hf=new Uint32Array(512);class Nh{static from(t,n=xV,i=wV){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new Nh(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let A=0;A<s;A++){const k=t[2*A],C=t[2*A+1];k<a&&(a=k),C<u&&(u=C),k>l&&(l=k),C>c&&(c=C),this._ids[A]=A}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let A=0,k=1/0;A<s;A++){const C=r0(f,d,t[2*A],t[2*A+1]);C<k&&(h=A,k=C)}const m=t[2*h],y=t[2*h+1];for(let A=0,k=1/0;A<s;A++){if(A===h)continue;const C=r0(m,y,t[2*A],t[2*A+1]);C<k&&C>0&&(g=A,k=C)}let b=t[2*g],v=t[2*g+1],x=1/0;for(let A=0;A<s;A++){if(A===h||A===g)continue;const k=bV(m,y,b,v,t[2*A],t[2*A+1]);k<x&&(p=A,x=k)}let E=t[2*p],S=t[2*p+1];if(x===1/0){for(let C=0;C<s;C++)this._dists[C]=t[2*C]-t[0]||t[2*C+1]-t[1];Ra(this._ids,this._dists,0,s-1);const A=new Uint32Array(s);let k=0;for(let C=0,O=-1/0;C<s;C++){const M=this._ids[C],F=this._dists[M];F>O&&(A[k++]=M,O=F)}this.hull=A.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Wf(m,y,b,v,E,S)<0){const A=g,k=b,C=v;g=p,b=E,v=S,p=A,E=k,S=C}const w=vV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let A=0;A<s;A++)this._dists[A]=r0(t[2*A],t[2*A+1],w.x,w.y);Ra(this._ids,this._dists,0,s-1),this._hullStart=h;let _=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,v)]=g,o[this._hashKey(E,S)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let A=0,k,C;A<this._ids.length;A++){const O=this._ids[A],M=t[2*O],F=t[2*O+1];if(A>0&&Math.abs(M-k)<=cA&&Math.abs(F-C)<=cA||(k=M,C=F,O===h||O===g||O===p))continue;let $=0;for(let Q=0,ue=this._hashKey(M,F);Q<this._hashSize&&($=o[(ue+Q)%this._hashSize],!($!==-1&&$!==i[$]));Q++);$=n[$];let T=$,L;for(;L=i[T],Wf(M,F,t[2*T],t[2*T+1],t[2*L],t[2*L+1])>=0;)if(T=L,T===$){T=-1;break}if(T===-1)continue;let z=this._addTriangle(T,O,i[T],-1,-1,r[T]);r[O]=this._legalize(z+2),r[T]=z,_++;let I=i[T];for(;L=i[I],Wf(M,F,t[2*I],t[2*I+1],t[2*L],t[2*L+1])<0;)z=this._addTriangle(I,O,L,r[O],-1,r[I]),r[O]=this._legalize(z+2),i[I]=I,_--,I=L;if(T===$)for(;L=n[T],Wf(M,F,t[2*L],t[2*L+1],t[2*T],t[2*T+1])<0;)z=this._addTriangle(L,O,T,-1,r[T],r[L]),this._legalize(z+2),r[L]=z,i[T]=T,_--,T=L;this._hullStart=n[O]=T,i[T]=n[I]=O,i[O]=I,o[this._hashKey(M,F)]=O,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(_);for(let A=0,k=this._hullStart;A<_;A++)this.hull[A]=k,k=i[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(mV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=Hf[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],g=n[c],p=n[f];if(yV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<Hf.length&&(Hf[o++]=b)}else{if(o===0)break;t=Hf[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function mV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function r0(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function yV(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function bV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,g=(s*f-u*c)*d;return h*h+g*g}function vV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,g=t+(s*f-u*c)*d;return{x:h,y:g}}function Ra(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;cl(e,r,o),t[e[n]]>t[e[i]]&&cl(e,n,i),t[e[o]]>t[e[i]]&&cl(e,o,i),t[e[n]]>t[e[o]]&&cl(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;cl(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(Ra(e,t,o,i),Ra(e,t,n,s-1)):(Ra(e,t,n,s-1),Ra(e,t,o,i))}}function cl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function xV(e){return e[0]}function wV(e){return e[1]}const fA=1e-6;class Ss{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>fA||Math.abs(this._y1-o)>fA)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class dy{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let EV=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let p=0,m=0,y=i.length,b,v;p<y;p+=3,m+=2){const x=i[p]*2,E=i[p+1]*2,S=i[p+2]*2,w=t[x],_=t[x+1],A=t[E],k=t[E+1],C=t[S],O=t[S+1],M=A-w,F=k-_,$=C-w,T=O-_,L=(M*T-F*$)*2;if(Math.abs(L)<1e-9){if(o===void 0){o=s=0;for(const I of n)o+=t[I*2],s+=t[I*2+1];o/=n.length,s/=n.length}const z=1e9*Math.sign((o-w)*T-(s-_)*$);b=(w+C)/2-z*T,v=(_+O)/2+z*$}else{const z=1/L,I=M*M+F*F,Q=$*$+T*T;b=w+(T*I-F*Q)*z,v=_+(M*Q-$*I)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Ss:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,g=Math.floor(d/3)*2,p=s[h],m=s[h+1],y=s[g],b=s[g+1];this._renderSegment(p,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Ss:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Ss:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new dy;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let g,p,m,y,b;if(l===0){if((g=this._clipSegment(o,s,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const SV=2*Math.PI,Sa=Math.pow;function _V(e){return e[0]}function AV(e){return e[1]}function $V(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function kV(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class p2{static from(t,n=_V,i=AV,r){return new p2("length"in t?CV(t,n,i,r):Float64Array.from(FV(t,n,i,r)))}constructor(t){this._delaunator=new Nh(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&$V(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const g=kV(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new Nh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new EV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=Sa(n-l[g*2],2)+Sa(i-l[g*2+1],2);if(p<f&&(f=p,c=g),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==g&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Ss:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Ss:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,SV)}return i&&i.value()}renderHull(t){const n=t==null?t=new Ss:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new dy;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Ss:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new dy;return this.renderTriangle(t,n),n.value()}}function CV(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*FV(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function m2(e){D.call(this,null,e)}m2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const TV=[-1e5,-1e5,1e5,1e5];G(m2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:TV;const o=this.value=p2.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!DV(u)?MV(u):null}return t.reflow(e.modified()).modifies(n)}});function MV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function DV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const OV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:m2},Symbol.toStringTag,{value:"Module"}));var o0=Math.PI/180,zl=64,Ad=2048;function RV(){var e=[256,256],t,n,i,r,o,s,a,u=SR,l=[],c=Math.random,f={};f.layout=function(){for(var g=d($o()),p=BV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:o(S),rotate:s(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,NV(g,E,x,b),E.hasText&&h(p,E,m)&&(v.push(E),m?PV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(zl<<5)/p,g.height=Ad/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,A;(w=x(S+=E))&&(_=~~w[0],A=~~w[1],!(Math.min(Math.abs(_),Math.abs(A))>=v));)if(p.x=y+_,p.y=b+A,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!LV(p,g,e[0]))&&(!m||IV(p,m))){for(var k=p.sprite,C=p.width>>5,O=e[0]>>5,M=p.x-(C<<4),F=M&127,$=32-F,T=p.y1-p.y0,L=(p.y+p.y0)*O+(M>>5),z,I=0;I<T;I++){z=0;for(var Q=0;Q<=C;Q++)g[L+Q]|=z<<$|(Q<C?(z=k[I*C+Q])>>>F:0);L+=O}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=is(g),f):n},f.fontStyle=function(g){return arguments.length?(r=is(g),f):r},f.fontWeight=function(g){return arguments.length?(o=is(g),f):o},f.rotate=function(g){return arguments.length?(s=is(g),f):s},f.text=function(g){return arguments.length?(t=is(g),f):t},f.spiral=function(g){return arguments.length?(u=UV[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=is(g),f):i},f.padding=function(g){return arguments.length?(a=is(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function NV(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(zl<<5)/o,Ad/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,g;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var p=Math.sin(t.rotate*o0),m=Math.cos(t.rotate*o0),y=c*m,b=c*p,v=d*m,x=d*p;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=zl<<5&&(s=0,a+=u,u=0),a+d>=Ad)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*o0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var E=r.getImageData(0,0,(zl<<5)/o,Ad/o).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var w=0,_=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var A=f*g+(h>>5),k=E[(a+g)*(zl<<5)+(s+h)<<2]?1<<31-h%32:0;S[A]|=k,w|=k}w?_=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function LV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function PV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function IV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function SR(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function zV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function BV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function is(e){return typeof e=="function"?e:function(){return e}}var UV={archimedean:SR,rectangular:zV};const _R=["x","y","font","fontSize","fontStyle","fontWeight","angle"],jV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function y2(e){D.call(this,RV(),e)}y2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_R}]};G(y2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return ge(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||jV.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||_R;let a=e.fontSize||14,u;if(ge(a)?u=e.fontSizeRange:a=Yt(a),u){const g=a,p=ke("sqrt")().domain(Qi(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[s[0]]=NaN,g[s[1]]=NaN,g[s[3]]=0});const l=o.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(ei).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[s[0]]=p.x+f,m[s[1]]=p.y+d,m[s[2]]=p.font,m[s[3]]=p.size,m[s[4]]=p.style,m[s[5]]=p.weight,m[s[6]]=p.rotate;return t.reflow(i).modifies(s)}});const qV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:y2},Symbol.toStringTag,{value:"Module"})),WV=e=>new Uint8Array(e),HV=e=>new Uint16Array(e),Ql=e=>new Uint32Array(e);function GV(){let e=8,t=[],n=Ql(0),i=Gf(0,e),r=Gf(0,e);return{data:()=>t,seen:()=>n=VV(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=Gf(o,e,i),r=Gf(o,e))}}}function VV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Gf(e,t,n){const i=(t<257?WV:t<65537?HV:Ql)(e);return n&&i.set(n),i}function dA(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function hA(){let e=Ql(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Ql(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=YV(h,d),c)g=t,p=e,t=Array(c+f),e=Ql(c+f),XV(l,g,p,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[XP(u,a[0],0,l),Ga(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function YV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),KI(e,t)}function XV(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function b2(e){D.call(this,GV(),e),this._indices=null,this._dims=null}b2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(b2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=hA()),o.push(dA(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,g={};let p,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!s[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(p=g[y])||(o[y]=m=hA(),g[y]=p=m.insert(w,t.source,0)),s[E]=dA(m,E,r[E]).onAdd(p,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=s[g].insert(a[h],i,d)),o[h].onAdd(p,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=g=o[h],o[h]=a,g!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],g=l[1],p=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=s[g],o[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=s[g],o[m]^=h,i.push(m);e.range=t.slice()}});function v2(e){D.call(this,null,e)}v2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(v2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const KV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:b2,resolvefilter:v2},Symbol.toStringTag,{value:"Module"})),JV="RawCode",zs="Literal",QV="Property",ZV="Identifier",eY="ArrayExpression",tY="BinaryExpression",AR="CallExpression",nY="ConditionalExpression",iY="LogicalExpression",rY="MemberExpression",oY="ObjectExpression",sY="UnaryExpression";function ki(e){this.type=e}ki.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=aY(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function aY(e){switch(e.type){case eY:return e.elements;case tY:case iY:return[e.left,e.right];case AR:return[e.callee].concat(e.arguments);case nY:return[e.test,e.consequent,e.alternate];case rY:return[e.object,e.property];case oY:return e.properties;case QV:return[e.key,e.value];case sY:return[e.argument];case ZV:case zs:case JV:default:return[]}}var fr,ee,R,Ht,Me,rp=1,nf=2,Bs=3,Go=4,op=5,ia=6,gn=7,rf=8,uY=9;fr={};fr[rp]="Boolean";fr[nf]="<end>";fr[Bs]="Identifier";fr[Go]="Keyword";fr[op]="Null";fr[ia]="Numeric";fr[gn]="Punctuator";fr[rf]="String";fr[uY]="RegularExpression";var lY="ArrayExpression",cY="BinaryExpression",fY="CallExpression",dY="ConditionalExpression",$R="Identifier",hY="Literal",gY="LogicalExpression",pY="MemberExpression",mY="ObjectExpression",yY="Property",bY="UnaryExpression",ht="Unexpected token %0",vY="Unexpected number",xY="Unexpected string",wY="Unexpected identifier",EY="Unexpected reserved word",SY="Unexpected end of input",hy="Invalid regular expression",s0="Invalid regular expression: missing /",kR="Octal literals are not allowed in strict mode.",_Y="Duplicate data property in object literal not allowed in strict mode",kt="ILLEGAL",bc="Disabled.",AY=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$Y=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function sp(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ar(e){return e>=48&&e<=57}function x2(e){return"0123456789abcdefABCDEF".includes(e)}function Zl(e){return"01234567".includes(e)}function kY(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function vc(e){return e===10||e===13||e===8232||e===8233}function of(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&AY.test(String.fromCharCode(e))}function Lh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&$Y.test(String.fromCharCode(e))}const CY={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function CR(){for(;R<Ht;){const e=ee.charCodeAt(R);if(kY(e)||vc(e))++R;else break}}function gy(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<Ht&&x2(ee[R])?(i=ee[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},ht,kt);return String.fromCharCode(r)}function FY(){var e,t,n,i;for(e=ee[R],t=0,e==="}"&&_e({},ht,kt);R<Ht&&(e=ee[R++],!!x2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},ht,kt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function FR(){var e,t;for(e=ee.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!of(e.charCodeAt(0)))&&_e({},ht,kt),t=e);R<Ht&&(e=ee.charCodeAt(R),!!Lh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!Lh(e.charCodeAt(0)))&&_e({},ht,kt),t+=e);return t}function TY(){var e,t;for(e=R++;R<Ht;){if(t=ee.charCodeAt(R),t===92)return R=e,FR();if(Lh(t))++R;else break}return ee.slice(e,R)}function MY(){var e,t,n;return e=R,t=ee.charCodeAt(R)===92?FR():TY(),t.length===1?n=Bs:CY.hasOwnProperty(t)?n=Go:t==="null"?n=op:t==="true"||t==="false"?n=rp:n=Bs,{type:n,value:t,start:e,end:R}}function a0(){var e=R,t=ee.charCodeAt(R),n,i=ee[R],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:gn,value:String.fromCharCode(t),start:e,end:R};default:if(n=ee.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:gn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,ee.charCodeAt(R)===61&&++R,{type:gn,value:ee.slice(e,R),start:e,end:R}}}if(s=ee.substr(R,4),s===">>>=")return R+=4,{type:gn,value:s,start:e,end:R};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return R+=3,{type:gn,value:o,start:e,end:R};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:gn,value:r,start:e,end:R};if(r==="//"&&_e({},ht,kt),"<>=!+-*%&|^/".includes(i))return++R,{type:gn,value:i,start:e,end:R};_e({},ht,kt)}function DY(e){let t="";for(;R<Ht&&x2(ee[R]);)t+=ee[R++];return t.length===0&&_e({},ht,kt),of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function OY(e){let t="0"+ee[R++];for(;R<Ht&&Zl(ee[R]);)t+=ee[R++];return(of(ee.charCodeAt(R))||Ar(ee.charCodeAt(R)))&&_e({},ht,kt),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function gA(){var e,t,n;if(n=ee[R],sp(Ar(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=ee[R++],n=ee[R],e==="0"){if(n==="x"||n==="X")return++R,DY(t);if(Zl(n))return OY(t);n&&Ar(n.charCodeAt(0))&&_e({},ht,kt)}for(;Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="."){for(e+=ee[R++];Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="e"||n==="E")if(e+=ee[R++],n=ee[R],(n==="+"||n==="-")&&(e+=ee[R++]),Ar(ee.charCodeAt(R)))for(;Ar(ee.charCodeAt(R));)e+=ee[R++];else _e({},ht,kt);return of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseFloat(e),start:t,end:R}}function RY(){var e="",t,n,i,r,o=!1;for(t=ee[R],sp(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<Ht;)if(i=ee[R++],i===t){t="";break}else if(i==="\\")if(i=ee[R++],!i||!vc(i.charCodeAt(0)))switch(i){case"u":case"x":ee[R]==="{"?(++R,e+=FY()):e+=gy(i);break;case"n":e+=`
7
+ `),r!==It.text&&(Wn(t,0),s=t.ownerDocument,a=Do(n),o.forEach((u,l)=>{const c=po(s,"tspan",rt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),It.text=r)):(o=Oo(n,i),o!==It.text&&(t.textContent=o,It.text=o)),Jt(t,"font-family",Xc(n)),Jt(t,"font-size",lr(n)+"px"),Jt(t,"font-style",n.fontStyle),Jt(t,"font-variant",n.fontVariant),Jt(t,"font-weight",n.fontWeight)}};function Gl(e,t,n){t!==It[e]&&(n?jU(Dr,e,t,n):Jt(Dr,e,t),It[e]=t)}function xd(e,t,n){n!==It[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),It[t]=n)}function mo(e,t){for(const n in t)Jt(e,n,t[n])}function Jt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function jU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function _D(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class AD extends Kc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=_x();n.open("svg",he({},hc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",SD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Bn[n.marktype],r=i.tag,o=[yD,i.attr];t.open("g",{class:sD(n),"clip-path":n.clip?nx(this,n,n.group):null},bD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Yc(a);if(P(l)){const c={x:0,dy:Do(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Oo(a,l[f])).close()}else t.text(Oo(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),Ei(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):Ei(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&qU(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Kd+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function qU(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Xc(t),e["font-size"]=lr(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in ah){let a=t[s];const u=ah[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Zv(a)&&(a=RM(a,r.gradient,"")),e[u]=a)}for(const s in uh){const a=t[s];a!=null&&(o=o||[],o.push(`${uh[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const ci={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function WU(e){ci.svgMarkTypes=e.svgMarkTypes??["text"],ci.svgOnTop=e.svgOnTop??!0,ci.debug=e.debug??!1}class C1 extends Kc{constructor(t){super(t),this._svgRenderer=new Ax(t),this._canvasRenderer=new sh(t)}initialize(t,n,i,r,o){this._root_el=ot(t,0,"div");const s=ot(this._root_el,0,"div"),a=ot(this._root_el,1,"div");return this._root_el.style.position="relative",ci.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ci.svgOnTop?a:s,this._canvasEl=ci.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return ci.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!ci.svgMarkTypes.includes(o));this._svgRenderer.render(t,ci.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ci.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class $D extends Jc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=ot(ot(t,0,"div"),ci.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const kD="canvas",CD="hybrid",FD="png",TD="svg",MD="none",yo={Canvas:kD,PNG:FD,SVG:TD,Hybrid:CD,None:MD},Ls={};Ls[kD]=Ls[FD]={renderer:sh,headless:sh,handler:Jc};Ls[TD]={renderer:Ax,headless:AD,handler:hD};Ls[CD]={renderer:C1,headless:C1,handler:$D};Ls[MD]={};function Qg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ls[e]=t,this):Ls[e]}function DD(e,t,n){const i=[],r=new it().union(t),o=e.marktype;return o?OD(e,r,n,i):o==="group"?RD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function OD(e,t,n,i){if(HU(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)RD(r[a],t,n,i);else for(const u=Bn[o].isect;a<s;++a){const l=r[a];ND(l,t,u)&&i.push(l)}}return i}function HU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function RD(e,t,n,i){n&&n(e.mark)&&ND(e,t,Bn.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)OD(r[u],t,n,i);t.translate(s,a)}return i}function ND(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Pm=new it;function LD(e){const t=e.clip;if(ge(t))t(Gc(Pm.clear()));else if(t)Pm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Pm)}const GU=1e-9;function $x(e,t,n){return e===t?!0:n==="path"?PD(e,t):e instanceof Date&&t instanceof Date?+e==+t:Ae(e)&&Ae(t)?Math.abs(e-t)<=GU:!e||!t||!Y(e)&&!Y(t)?e==t:VU(e,t)}function PD(e,t){return $x(nu(e),nu(t))}function VU(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!$x(e[r],t[r],r))return!1;return typeof e==typeof t}function YU(){UM(),b7()}const ou="top",hi="left",gi="right",Ro="bottom",XU="top-left",KU="top-right",JU="bottom-left",QU="bottom-right",kx="start",F1="middle",Qt="end",ZU="x",ej="y",Zg="group",Cx="axis",Fx="title",tj="frame",nj="scope",Tx="legend",ID="row-header",zD="row-footer",BD="row-title",UD="column-header",jD="column-footer",qD="column-title",ij="padding",rj="symbol",WD="fit",HD="fit-x",GD="fit-y",oj="pad",Mx="none",Mf="all",T1="each",Dx="flush",bo="column",vo="row";function VD(e){D.call(this,null,e)}G(VD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Bn[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=Df(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Zg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Df(l,s))),i.role){case Cx:case Tx:case Fx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Df(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Df(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return LD(i),t.modifies("bounds")}});function Df(e,t,n){return t(e.bounds.clear(),e,n)}const r_=":vega_identifier:";function Ox(e){D.call(this,0,e)}Ox.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(Ox,D,{transform(e,t){const n=sj(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function sj(e){return e._signals[r_]||(e._signals[r_]=e.add(0))}function YD(e){D.call(this,null,e)}G(YD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,aj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===Zg?Wg:qg;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function aj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function XD(e){D.call(this,null,e)}const o_={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!KD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},KD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),s_=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(KD(r,o=e[n].bounds,t))return!0},uj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},lj=(e,t,n)=>{var i=e.range(),r=new it;return t===ou||t===Ro?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},a_=e=>(e.forEach(t=>t.opacity=1),e),u_=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(XD,D,{transform(e,t){const n=o_[e.method]||o_.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(a_(r),t=u_(t,e)),t;if(r=r.filter(uj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=a_(r),t=u_(t,e),o.length>=3&&s_(o,i)){do o=n(o,i);while(o.length>=3&&s_(o,i));o.length<3&&!Ee(r).opacity&&(o.length>1&&(Ee(o).opacity=0),Ee(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=lj(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function JD(e){D.call(this,null,e)}G(JD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Pt=new it;function Da(e,t,n){return e[t]===n?0:(e[t]=n,1)}function cj(e){var t=e.items[0].orient;return t===hi||t===gi}function fj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function dj(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=fj(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=o.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&px(g),b=0,v=0,x,E;switch(Pt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),g&&Of(e,g,E,p,y,0,-1,m);break;case hi:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),g&&Of(e,g,E,p,y,1,-1,m);break;case gi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),g&&Of(e,g,E,p,y,1,1,m);break;case Ro:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),g&&Of(e,g,E,p,0,0,1,m);break;default:b=r.x,v=r.y}return Gr(m.translate(b,v),r),Da(r,"x",b+s)|Da(r,"y",v+s)&&(r.bounds=Pt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Of(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const l_=(e,t)=>Math.floor(Math.min(e,t)),c_=(e,t)=>Math.ceil(Math.max(e,t));function hj(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===Zg)switch(r.role){case Cx:case Tx:case Fx:break;case ID:s.rowheaders.push(...o);break;case zD:s.rowfooters.push(...o);break;case UD:s.colheaders.push(...o);break;case jD:s.colfooters.push(...o);break;case BD:s.rowtitle=o[0];break;case qD:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function gj(e){return new it().set(0,0,e.width||0,e.height||0)}function pj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function f_(e){return e<0?Math.ceil(-e):0}function QD(e,t,n){var i=!n.nodirty,r=n.bounds===Dx?gj:pj,o=Pt.set(0,0,0,0),s=je(n.align,bo),a=je(n.align,vo),u=je(n.padding,bo),l=je(n.padding,vo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,A,k,C,O,M,F,$,T;for(w=0;w<c;++w)g[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)C=t[w],k=E[w]=r(C),C.x=C.x||0,v[w]=0,C.y=C.y||0,x[w]=0,_=w%c,A=~~(w/c),p=Math.max(p,O=Math.ceil(k.x2)),b=Math.max(b,M=Math.ceil(k.y2)),g[_]=Math.max(g[_],O),y[A]=Math.max(y[A],M),h[w]=u+f_(k.x1),m[w]=l+f_(k.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(s===T1)for(_=1;_<c;++_){for(T=0,w=_;w<d;w+=c)T<h[w]&&(T=h[w]);for(w=_;w<d;w+=c)h[w]=T+g[_-1]}else if(s===Mf){for(T=0,w=0;w<d;++w)w%c&&T<h[w]&&(T=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=T+p)}else for(s=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=g[_-1];if(a===T1)for(A=1;A<f;++A){for(T=0,w=A*c,S=w+c;w<S;++w)T<m[w]&&(T=m[w]);for(w=A*c;w<S;++w)m[w]=T+y[A-1]}else if(a===Mf){for(T=0,w=c;w<d;++w)T<m[w]&&(T=m[w]);for(w=c;w<d;++w)m[w]=T+b}else for(a=!1,A=1;A<f;++A)for(w=A*c,S=w+c;w<S;++w)m[w]+=y[A-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for($=0,w=_;w<d;w+=c)$+=m[w],x[w]+=$-t[w].y;if(s&&je(n.center,bo)&&f>1)for(w=0;w<d;++w)k=s===Mf?p:g[w%c],F=k-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,vo)&&c!==1)for(w=0;w<d;++w)k=a===Mf?b:y[~~(w/c)],$=k-E[w].y2-t[w].y-x[w],$>0&&(x[w]+=$/2);for(w=0;w<d;++w)o.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,ZU),$=je(n.anchor,ej),je(n.anchor,bo)){case Qt:F-=o.width();break;case F1:F-=o.width()/2}switch(je(n.anchor,vo)){case Qt:$-=o.height();break;case F1:$-=o.height()/2}for(F=Math.round(F),$=Math.round($),o.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)C=t[w],C.x+=v[w]+=F,C.y+=x[w]+=$,o.union(C.mark.bounds.union(C.bounds.translate(v[w],x[w]))),i&&e.dirty(C);return o}function mj(e,t,n){var i=hj(t),r=i.marks,o=n.bounds===Dx?yj:bj,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=QD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=je(n.headerBand,vo,null),c=Rf(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),l_,0,o,"x1",0,a,1,p)),i.colheaders&&(p=je(n.headerBand,bo,null),f=Rf(e,i.colheaders,r,a,a,-je(s,"columnHeader"),l_,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=je(n.footerBand,vo,null),d=Rf(e,i.rowfooters,r,a,u,je(s,"rowFooter"),c_,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=je(n.footerBand,bo,null),h=Rf(e,i.colfooters,r,a,a,je(s,"columnFooter"),c_,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=je(n.titleAnchor,vo),m=je(s,"rowTitle"),m=g===Qt?d+m:c-m,p=je(n.titleBand,vo,.5),d_(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=je(n.titleAnchor,bo),m=je(s,"columnTitle"),m=g===Qt?h+m:f-m,p=je(n.titleBand,bo,.5),d_(e,i.coltitle,m,1,y,p))}function yj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function bj(e,t){return e.bounds[t]}function Rf(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,v,x,E,S,w,_,A;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=s(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=o,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),A=p):(_=p,A=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),A-(S.y||0))),S.x=_,S.y=A,e.dirty(S),m=s(m,E[l])}return m}function d_(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function vj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function xj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function wj(e,t,n,i,r,o,s){const a=vj(n,t),u=xj(e,a("offset",0)),l=a("anchor",kx),c=l===Qt?1:l===F1?.5:0,f={align:T1,bounds:a("bounds",Dx),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case hi:f.anchor={x:Math.floor(i.x1)-u,column:Qt,y:c*(s||i.height()+2*i.y1),row:l};break;case gi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Qt,x:c*(o||r.width()+2*r.x1),column:l};break;case Ro:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case XU:f.anchor={x:u,y:u};break;case KU:f.anchor={x:o-u,y:u,column:Qt};break;case JU:f.anchor={x:u,y:s-u,row:Qt};break;case QU:f.anchor={x:o-u,y:s-u,column:Qt,row:Qt};break}return f}function Ej(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),_j(e,n,n.items[0].items[0]),o=Sj(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===rj&&Aj(n.items[0].items[0].items[0].items),r!==Mx&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Gr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function Sj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function _j(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&ll(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case hi:r+=Math.ceil(s.bounds.width())+u;break;case gi:case Ro:break;default:o+=s.bounds.height()+u}switch((r||o)&&ll(e,n,r,o),s.orient){case hi:c+=va(t,n,s,a,1,1);break;case gi:l+=va(t,n,s,Qt,0,0)+u,c+=va(t,n,s,a,1,1);break;case Ro:l+=va(t,n,s,a,0,0),c+=va(t,n,s,Qt,-1,0,1)+u;break;default:l+=va(t,n,s,a,0,0)}(l||c)&&ll(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(ll(e,n,-l,0),ll(e,s,-l,0))}}function va(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:px(n);return Math.round(i===kx?f:i===Qt?d-h:.5*(c-h))}function ll(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function Aj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function $j(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===hi||a===gi?i:n,g=0,p=0,m=0,y=0,b=0,v;if(s!==Zg?a===hi?(g=r.y2,h=r.y1):a===gi?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===hi&&(g=i,h=0),v=u===kx?g:u===Qt?h:(g+h)/2,d&&d.text){switch(a){case ou:case Ro:b=f.bounds.height()+c;break;case hi:y=f.bounds.width()+c;break;case gi:y=-f.bounds.width()-c;break}Pt.clear().union(d.bounds),Pt.translate(y-(d.x||0),b-(d.y||0)),Da(d,"x",y)|Da(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Pt),d.mark.bounds.clear().union(Pt),e.dirty(d)),Pt.clear().union(d.bounds)}else Pt.clear();switch(Pt.union(f.bounds),a){case ou:p=v,m=r.y1-Pt.height()-l;break;case hi:p=r.x1-Pt.width()-l,m=v;break;case gi:p=r.x2+Pt.width()+l,m=v;break;case Ro:p=v,m=r.y2+l;break;default:p=o.x,m=o.y}return Da(o,"x",p)|Da(o,"y",m)&&(Pt.translate(p,m),e.dirty(o),o.bounds.clear().union(Pt),t.bounds.clear().union(Pt),e.dirty(o)),o.bounds}function ZD(e){D.call(this,null,e)}G(ZD,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&mj(n,i,e.layout),Cj(n,i,e)}),kj(e.mark.group)?t.reflow():t}});function kj(e){return e&&e.mark.role!=="legend-entry"}function Cj(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new it().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case Cx:h=cj(f)?a:u,h.union(dj(e,f,r,o));break;case Fx:c=f;break;case Tx:l.push(Ej(e,f));break;case tj:case nj:case ID:case zD:case BD:case UD:case jD:case qD:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||gi,d!==Mx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];QD(e,b,wj(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===WD||n.autosize.type===HD||n.autosize.type===GD))switch(y.orient){case hi:case gi:s.add(b.x1,0).add(b.x2,0);break;case ou:case Ro:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union($j(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Fj(e,t,s,n)}function Fj(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===ij){const g=e.padding();s-=g.left+g.right,a-=g.top+g.bottom}o===Mx?(l=0,f=0,u=s,c=a):o===WD?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===HD?(u=Math.max(0,s-l-d),a=c+f+h):o===GD?(s=u+l+d,c=Math.max(0,a-f-h)):o===oj&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const Tj=Object.freeze(Object.defineProperty({__proto__:null,bound:VD,identifier:Ox,mark:YD,overlap:XD,render:JD,viewlayout:ZD},Symbol.toStringTag,{value:"Module"}));function eO(e){D.call(this,null,e)}G(eO,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Jv(o,s,e.minstep),u=e.format||kM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$M(o,e.values,a):Qv(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function tO(e){D.call(this,null,e)}function Mj(){return Ce({})}function Dj(e){const t=Tu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(tO,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Mj,o=e.key||ie,s=this.value;return P(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&N("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Dj(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function nO(e){D.call(this,null,e)}G(nO,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(P(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||io,u=r.enter||io,l=r.exit||io,c=(o&&!s?r[o]:a)||io;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==io&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==io&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==io){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function iO(e){D.call(this,[],e)}G(iO,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||dd,s=e.scale,a=+e.limit,u=Jv(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===dd,c=e.format||MM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||TM(s,u),d,h,g,p,m;return r&&(i.rem=r),o===dd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ge(g=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=Yt(p=g||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):o===o7?(d=s.domain(),h=SM(s,d[0],Ee(d)),f.length<3&&!e.values&&d[0]!==Ee(d)&&(f=[d[0],Ee(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=m7(s),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const Oj=e=>e.source.x,Rj=e=>e.source.y,Nj=e=>e.target.x,Lj=e=>e.target.y;function Rx(e){D.call(this,{},e)}Rx.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Rx,D,{transform(e,t){var n=e.sourceX||Oj,i=e.sourceY||Rj,r=e.targetX||Nj,o=e.targetY||Lj,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=h_.get(u+"-"+a)||h_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const rO=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Pj=(e,t,n,i)=>rO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),oO=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},Ij=(e,t,n,i)=>oO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),sO=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},zj=(e,t,n,i)=>sO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Bj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Uj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,jj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},qj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},Wj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Hj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a},h_=Tu({line:rO,"line-radial":Pj,arc:oO,"arc-radial":Ij,curve:sO,"curve-radial":zj,"orthogonal-horizontal":Bj,"orthogonal-vertical":Uj,"orthogonal-radial":jj,"diagonal-horizontal":qj,"diagonal-vertical":Wj,"diagonal-radial":Hj});function Nx(e){D.call(this,null,e)}Nx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(Nx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||ku,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/qC(l),h=Mn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Gj=5;function Vj(e){const t=e.type;return!e.bins&&(t===Za||t===zc||t===Bc)}function aO(e){return Yv(e)&&e!==Xi}const Yj=xi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function uO(e){D.call(this,null,e),this.modified(!0)}G(uO,D,{transform(e,t){var n=t.dataflow,i=this.value,r=Xj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!Yj[r]){if(r==="padding"&&aO(i.type))continue;ge(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return tq(i,e,eq(i,e,Jj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Xj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+Za:(Kj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Lu+"-":""),(n+t||Za).toLowerCase())}function Kj(e){const t=e.type;return Yv(t)&&t!==Rs&&t!==Ns&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Jj(e,t,n){const i=Qj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Vj(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return aO(o)&&t.padding&&r[0]!==Ee(r)&&(r=Zj(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(lO(o,r,n)),o===Wv&&e.unknown(t.domainImplicit?g1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Jv(e,t.nice)||null),r.length}function Qj(e,t,n){return t?(e.domain(lO(e.type,t,n)),t.length):-1}function Zj(e,t,n,i,r,o){var s=Math.abs(Ee(n)-n[0]),a=s/(s-2*i),u=e===jr?yb(t,null,a):e===Bc?Ld(t,null,a,.5):e===zc?Ld(t,null,a,r||1):e===Ig?bb(t,null,a,o||1):mb(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function lO(e,t,n){if(bM(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function eq(e,t,n){let i=t.bins;if(i&&!P(i)){const r=e.domain(),o=r[0],s=Ee(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||N("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Mn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Hv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function tq(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=nq(i,t,n);else if(t.scheme&&(o=iq(i,t,n),ge(o))){if(e.interpolator)return e.interpolator(o);N(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&vM(i))return e.interpolator(Ug(M1(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Xv(t.interpolate,t.interpolateGamma)):ge(e.round)?e.round(r):ge(e.rangeRound)&&e.interpolate(r?ug:Oc),o&&e.range(M1(o,t.reverse))}function nq(e,t,n){e!==dM&&e!==m1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===m1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*qv(n,r,i)]}function iq(e,t,n){var i=t.schemeExtent,r,o;return P(t.scheme)?o=Ug(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=Kv(r),o||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bg?n+1:e===Hv?n-1:e===eu||e===zg?+t.schemeCount||Gj:n,vM(e)?g_(o,i,t.reverse):ge(o)?EM(g_(o,i),n):e===Wv?o:o.slice(0,n)}function g_(e,t,n){return ge(e)&&(t||n)?wM(e,M1(t||[0,1],n)):e}function M1(e,t){return t?e.slice().reverse():e}function cO(e){D.call(this,null,e)}G(cO,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const p_="zero",fO="center",dO="normalize",hO=["y0","y1"];function Lx(e){D.call(this,null,e)}Lx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:p_,values:[p_,fO,dO]},{name:"as",type:"string",array:!0,length:2,default:hO}]};G(Lx,D,{transform(e,t){var n=e.as||hO,i=n[0],r=n[1],o=ea(e.sort),s=e.field||ku,a=e.offset===fO?rq:e.offset===dO?oq:sq,u,l,c,f;for(u=aq(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function rq(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function oq(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function sq(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function aq(e,t,n,i){var r=[],o=p=>p(c),s,a,u,l,c,f,d,h,g;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,g=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const uq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:eO,datajoin:tO,encode:nO,legendentries:iO,linkpath:Rx,pie:Nx,scale:uO,sortitems:cO,stack:Lx},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,D1=1e-12,be=Math.PI,Xe=be/2,lh=be/4,un=be*2,Ze=180/be,me=be/180,we=Math.abs,Iu=Math.atan,ti=Math.atan2,se=Math.cos,Nf=Math.ceil,gO=Math.exp,O1=Math.hypot,ch=Math.log,Im=Math.pow,re=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},ln=Math.sqrt,Px=Math.tan;function pO(e){return e>1?0:e<-1?be:Math.acos(e)}function wn(e){return e>1?Xe:e<-1?-Xe:Math.asin(e)}function $t(){}function fh(e,t){e&&y_.hasOwnProperty(e.type)&&y_[e.type](e,t)}var m_={Feature:function(e,t){fh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)fh(n[i].geometry,t)}},y_={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){R1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)R1(n[i],t,0)},Polygon:function(e,t){b_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)b_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)fh(n[i],t)}};function R1(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function b_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)R1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&m_.hasOwnProperty(e.type)?m_[e.type](e,t):fh(e,t)}var dh=new sn,hh=new sn,mO,yO,N1,L1,P1,nr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){dh=new sn,nr.lineStart=lq,nr.lineEnd=cq},polygonEnd:function(){var e=+dh;hh.add(e<0?un+e:e),this.lineStart=this.lineEnd=this.point=$t},sphere:function(){hh.add(un)}};function lq(){nr.point=fq}function cq(){bO(mO,yO)}function fq(e,t){nr.point=bO,mO=e,yO=t,e*=me,t*=me,N1=e,L1=se(t=t/2+lh),P1=re(t)}function bO(e,t){e*=me,t*=me,t=t/2+lh;var n=e-N1,i=n>=0?1:-1,r=i*n,o=se(t),s=re(t),a=P1*s,u=L1*o+a*se(r),l=a*i*re(r);dh.add(ti(l,u)),N1=e,L1=o,P1=s}function dq(e){return hh=new sn,$r(e,nr),hh*2}function gh(e){return[ti(e[1],e[0]),wn(e[2])]}function Ps(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*re(t),re(n)]}function Lf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function su(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function zm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ph(e){var t=ln(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,pn,Ve,Fn,gs,vO,xO,za,Vl,uo,qr,_r={point:I1,lineStart:v_,lineEnd:x_,polygonStart:function(){_r.point=EO,_r.lineStart=hq,_r.lineEnd=gq,Vl=new sn,nr.polygonStart()},polygonEnd:function(){nr.polygonEnd(),_r.point=I1,_r.lineStart=v_,_r.lineEnd=x_,dh<0?(He=-(Ve=180),pn=-(Fn=90)):Vl>ae?Fn=90:Vl<-1e-6&&(pn=-90),qr[0]=He,qr[1]=Ve},sphere:function(){He=-(Ve=180),pn=-(Fn=90)}};function I1(e,t){uo.push(qr=[He=e,Ve=e]),t<pn&&(pn=t),t>Fn&&(Fn=t)}function wO(e,t){var n=Ps([e*me,t*me]);if(za){var i=su(za,n),r=[i[1],-i[0],0],o=su(r,i);ph(o),o=gh(o);var s=e-gs,a=s>0?1:-1,u=o[0]*Ze*a,l,c=we(s)>180;c^(a*gs<u&&u<a*e)?(l=o[1]*Ze,l>Fn&&(Fn=l)):(u=(u+360)%360-180,c^(a*gs<u&&u<a*e)?(l=-o[1]*Ze,l<pn&&(pn=l)):(t<pn&&(pn=t),t>Fn&&(Fn=t))),c?e<gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e)}else uo.push(qr=[He=e,Ve=e]);t<pn&&(pn=t),t>Fn&&(Fn=t),za=n,gs=e}function v_(){_r.point=wO}function x_(){qr[0]=He,qr[1]=Ve,_r.point=I1,za=null}function EO(e,t){if(za){var n=e-gs;Vl.add(we(n)>180?n+(n>0?360:-360):n)}else vO=e,xO=t;nr.point(e,t),wO(e,t)}function hq(){nr.lineStart()}function gq(){EO(vO,xO),nr.lineEnd(),we(Vl)>ae&&(He=-(Ve=180)),qr[0]=He,qr[1]=Ve,za=null}function Cn(e,t){return(t-=e)<0?t+360:t}function pq(e,t){return e[0]-t[0]}function w_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function mq(e){var t,n,i,r,o,s,a;if(Fn=Ve=-(He=pn=1/0),uo=[],$r(e,_r),n=uo.length){for(uo.sort(pq),t=1,i=uo[0],o=[i];t<n;++t)r=uo[t],w_(i,r[0])||w_(i,r[1])?(Cn(i[0],r[1])>Cn(i[0],i[1])&&(i[1]=r[1]),Cn(r[0],i[1])>Cn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Cn(i[1],r[0]))>s&&(s=a,He=r[0],Ve=i[1])}return uo=qr=null,He===1/0||pn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,pn],[Ve,Fn]]}var Dl,mh,yh,bh,vh,xh,wh,Eh,z1,B1,U1,SO,_O,Zt,en,tn,pi={sphere:$t,point:Ix,lineStart:E_,lineEnd:S_,polygonStart:function(){pi.lineStart=vq,pi.lineEnd=xq},polygonEnd:function(){pi.lineStart=E_,pi.lineEnd=S_}};function Ix(e,t){e*=me,t*=me;var n=se(t);Qc(n*se(e),n*re(e),re(t))}function Qc(e,t,n){++Dl,yh+=(e-yh)/Dl,bh+=(t-bh)/Dl,vh+=(n-vh)/Dl}function E_(){pi.point=yq}function yq(e,t){e*=me,t*=me;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),pi.point=bq,Qc(Zt,en,tn)}function bq(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=ti(ln((s=en*o-tn*r)*s+(s=tn*i-Zt*o)*s+(s=Zt*r-en*i)*s),Zt*i+en*r+tn*o);mh+=s,xh+=s*(Zt+(Zt=i)),wh+=s*(en+(en=r)),Eh+=s*(tn+(tn=o)),Qc(Zt,en,tn)}function S_(){pi.point=Ix}function vq(){pi.point=wq}function xq(){AO(SO,_O),pi.point=Ix}function wq(e,t){SO=e,_O=t,e*=me,t*=me,pi.point=AO;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),Qc(Zt,en,tn)}function AO(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=en*o-tn*r,a=tn*i-Zt*o,u=Zt*r-en*i,l=O1(s,a,u),c=wn(l),f=l&&-c/l;z1.add(f*s),B1.add(f*a),U1.add(f*u),mh+=c,xh+=c*(Zt+(Zt=i)),wh+=c*(en+(en=r)),Eh+=c*(tn+(tn=o)),Qc(Zt,en,tn)}function Eq(e){Dl=mh=yh=bh=vh=xh=wh=Eh=0,z1=new sn,B1=new sn,U1=new sn,$r(e,pi);var t=+z1,n=+B1,i=+U1,r=O1(t,n,i);return r<D1&&(t=xh,n=wh,i=Eh,mh<ae&&(t=yh,n=bh,i=vh),r=O1(t,n,i),r<D1)?[NaN,NaN]:[ti(n,t)*Ze,wn(i/r)*Ze]}function j1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function q1(e,t){return we(e)>be&&(e-=Math.round(e/un)*un),[e,t]}q1.invert=q1;function $O(e,t,n){return(e%=un)?t||n?j1(A_(e),$_(t,n)):A_(e):t||n?$_(t,n):q1}function __(e){return function(t,n){return t+=e,we(t)>be&&(t-=Math.round(t/un)*un),[t,n]}}function A_(e){var t=__(e);return t.invert=__(-e),t}function $_(e,t){var n=se(e),i=re(e),r=se(t),o=re(t);function s(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*n+c*i;return[ti(f*r-h*o,c*n-d*i),wn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*r-f*o;return[ti(f*r+d*o,c*n+h*i),wn(h*n-c*i)]},s}function Sq(e){e=$O(e[0]*me,e[1]*me,e.length>2?e[2]*me:0);function t(n){return n=e(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n}return t.invert=function(n){return n=e.invert(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n},t}function _q(e,t,n,i,r,o){if(n){var s=se(t),a=re(t),u=i*n;r==null?(r=t+i*un,o=t-u/2):(r=k_(s,r),o=k_(s,o),(i>0?r<o:r>o)&&(r+=i*un));for(var l,c=r;i>0?c>o:c<o;c-=u)l=gh([s,-a*se(c),-a*re(c)]),e.point(l[0],l[1])}}function k_(e,t){t=Ps(t),t[0]-=e,ph(t);var n=pO(-t[1]);return((-t[2]<0?-n:n)+un-ae)%un}function kO(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:$t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function wd(e,t){return we(e[0]-t[0])<ae&&we(e[1]-t[1])<ae}function If(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function CO(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(wd(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ae}o.push(b=new If(m,g,null,!0)),s.push(b.o=new If(m,null,b,!1)),o.push(b=new If(y,g,null,!1)),s.push(b.o=new If(y,null,b,!0))}}),!!o.length){for(s.sort(t),C_(o),C_(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function C_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Bm(e){return we(e[0])<=be?e[0]:Vn(e[0])*((we(e[0])+be)%un-be)}function Aq(e,t){var n=Bm(t),i=t[1],r=re(i),o=[re(n),-se(n),0],s=0,a=0,u=new sn;r===1?i=Xe+ae:r===-1&&(i=-Xe-ae);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=Bm(h),p=h[1]/2+lh,m=re(p),y=se(p),b=0;b<d;++b,g=x,m=S,y=w,h=v){var v=f[b],x=Bm(v),E=v[1]/2+lh,S=re(E),w=se(E),_=x-g,A=_>=0?1:-1,k=A*_,C=k>be,O=m*S;if(u.add(ti(O*A*re(k),y*w+O*se(k))),s+=C?_+A*un:_,C^g>=n^x>=n){var M=su(Ps(h),Ps(v));ph(M);var F=su(o,M);ph(F);var $=(C^_>=0?-1:1)*wn(F[2]);(i>$||i===$&&(M[0]||M[1]))&&(a+=C^_>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function FO(e,t,n,i){return function(r){var o=t(r),s=kO(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=jC(c);var x=Aq(l,i);c.length?(u||(r.polygonStart(),u=!0),CO(c,kq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function g(x,E){o.point(x,E)}function p(){d.point=g,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=s.result(),S,w=E.length,_,A,k;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if(A=E[0],(_=A.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((k=A[S])[0],k[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter($q))}}return d}}function $q(e){return e.length>1}function kq(e,t){return((e=e.x)[0]<0?e[1]-Xe-ae:Xe-e[1])-((t=t.x)[0]<0?t[1]-Xe-ae:Xe-t[1])}const F_=FO(function(){return!0},Cq,Tq,[-be,-Xe]);function Cq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?be:-be,u=we(o-t);we(u-be)<ae?(e.point(t,n=(n+s)/2>0?Xe:-Xe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=be&&(we(t-i)<ae&&(t-=i*ae),we(o-a)<ae&&(o-=a*ae),n=Fq(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Fq(e,t,n,i){var r,o,s=re(e-n);return we(s)>ae?Iu((re(t)*(o=se(i))*re(n)-re(i)*(r=se(t))*re(e))/(r*o*s)):(t+i)/2}function Tq(e,t,n,i){var r;if(e==null)r=n*Xe,i.point(-be,r),i.point(0,r),i.point(be,r),i.point(be,0),i.point(be,-r),i.point(0,-r),i.point(-be,-r),i.point(-be,0),i.point(-be,r);else if(we(e[0]-t[0])>ae){var o=e[0]<t[0]?be:-be;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function Mq(e){var t=se(e),n=2*me,i=t>0,r=we(t)>ae;function o(c,f,d,h){_q(h,e,n,d,c,f)}function s(c,f){return se(c)*se(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],v,x=s(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?be:-be),y):0;if(!f&&(g=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||wd(f,v)||wd(b,v))&&(b[2]=1)),x!==h)p=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!wd(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=Ps(c),g=Ps(f),p=[1,0,0],m=su(h,g),y=Lf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=su(p,m),w=Pf(p,x),_=Pf(m,E);zm(w,_);var A=S,k=Lf(w,A),C=Lf(A,A),O=k*k-C*(Lf(w,w)-1);if(!(O<0)){var M=ln(O),F=Pf(A,(-k-M)/C);if(zm(F,w),F=gh(F),!d)return F;var $=c[0],T=f[0],L=c[1],z=f[1],I;T<$&&(I=$,$=T,T=I);var Q=T-$,ue=we(Q-be)<ae,oe=ue||Q<ae;if(!ue&&z<L&&(I=L,L=z,z=I),oe?ue?L+z>0^F[1]<(we(F[0]-$)<ae?L:z):L<=F[1]&&F[1]<=z:Q>be^($<=F[0]&&F[0]<=T)){var fe=Pf(A,(-k+M)/C);return zm(fe,w),[F,gh(fe)]}}}function l(c,f){var d=i?e:be-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return FO(s,a,o,i?[0,-e]:[-be,e-be])}function Dq(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,g;if(g=n-s,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-s,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=o-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var zf=1e9,Bf=-1e9;function TO(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,g=0;if(l==null||(h=s(l,f))!==(g=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==g);else d.point(c[0],c[1])}function s(l,c){return we(l[0]-e)<ae?c>0?0:3:we(l[0]-n)<ae?c>0?2:1:we(l[1]-t)<ae?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=kO(),d,h,g,p,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:M,polygonStart:k,polygonEnd:C};function _($,T){r($,T)&&c.point($,T)}function A(){for(var $=0,T=0,L=h.length;T<L;++T)for(var z=h[T],I=1,Q=z.length,ue=z[0],oe,fe,Pe=ue[0],de=ue[1];I<Q;++I)oe=Pe,fe=de,ue=z[I],Pe=ue[0],de=ue[1],fe<=i?de>i&&(Pe-oe)*(i-fe)>(de-fe)*(e-oe)&&++$:de<=i&&(Pe-oe)*(i-fe)<(de-fe)*(e-oe)&&--$;return $}function k(){c=f,d=[],h=[],S=!0}function C(){var $=A(),T=S&&$,L=(d=jC(d)).length;(T||L)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),L&&CO(d,a,$,o,l),l.polygonEnd()),c=l,d=h=g=null}function O(){w.point=F,h&&h.push(g=[]),E=!0,x=!1,b=v=NaN}function M(){d&&(F(p,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F($,T){var L=r($,T);if(h&&g.push([$,T]),E)p=$,m=T,y=L,E=!1,L&&(c.lineStart(),c.point($,T));else if(L&&x)c.point($,T);else{var z=[b=Math.max(Bf,Math.min(zf,b)),v=Math.max(Bf,Math.min(zf,v))],I=[$=Math.max(Bf,Math.min(zf,$)),T=Math.max(Bf,Math.min(zf,T))];Dq(z,I,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),L||c.lineEnd(),S=!1):L&&(c.lineStart(),c.point($,T),S=!1)}b=$,v=T,x=L}return w}}function T_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function M_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function Oq(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Mn(Nf(i/c)*c,n,c).map(g).concat(Mn(Nf(a/f)*f,s,f).map(p)).concat(Mn(Nf(t/u)*u,e,u).filter(function(v){return we(v%c)>ae}).map(d)).concat(Mn(Nf(o/l)*l,r,l).filter(function(v){return we(v%f)>ae}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(s).slice(1),g(n).reverse().slice(1),p(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],s=+v[1][1],i>n&&(v=i,i=n,n=v),a>s&&(v=a,a=s,s=v),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),o>r&&(v=o,o=r,r=v),y.precision(m)):[[t,o],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=T_(o,r,90),h=M_(t,e,m),g=T_(a,s,90),p=M_(i,n,m),y):m},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}const gc=e=>e;var Um=new sn,W1=new sn,MO,DO,H1,G1,kr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){kr.lineStart=Rq,kr.lineEnd=Lq},polygonEnd:function(){kr.lineStart=kr.lineEnd=kr.point=$t,Um.add(we(W1)),W1=new sn},result:function(){var e=Um/2;return Um=new sn,e}};function Rq(){kr.point=Nq}function Nq(e,t){kr.point=OO,MO=H1=e,DO=G1=t}function OO(e,t){W1.add(G1*e-H1*t),H1=e,G1=t}function Lq(){OO(MO,DO)}var au=1/0,Sh=au,pc=-au,_h=pc,Ah={point:Pq,lineStart:$t,lineEnd:$t,polygonStart:$t,polygonEnd:$t,result:function(){var e=[[au,Sh],[pc,_h]];return pc=_h=-(Sh=au=1/0),e}};function Pq(e,t){e<au&&(au=e),e>pc&&(pc=e),t<Sh&&(Sh=t),t>_h&&(_h=t)}var V1=0,Y1=0,Ol=0,$h=0,kh=0,Oa=0,X1=0,K1=0,Rl=0,RO,NO,Wi,Hi,Hn={point:Is,lineStart:D_,lineEnd:O_,polygonStart:function(){Hn.lineStart=Bq,Hn.lineEnd=Uq},polygonEnd:function(){Hn.point=Is,Hn.lineStart=D_,Hn.lineEnd=O_},result:function(){var e=Rl?[X1/Rl,K1/Rl]:Oa?[$h/Oa,kh/Oa]:Ol?[V1/Ol,Y1/Ol]:[NaN,NaN];return V1=Y1=Ol=$h=kh=Oa=X1=K1=Rl=0,e}};function Is(e,t){V1+=e,Y1+=t,++Ol}function D_(){Hn.point=Iq}function Iq(e,t){Hn.point=zq,Is(Wi=e,Hi=t)}function zq(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,Is(Wi=e,Hi=t)}function O_(){Hn.point=Is}function Bq(){Hn.point=jq}function Uq(){LO(RO,NO)}function jq(e,t){Hn.point=LO,Is(RO=Wi=e,NO=Hi=t)}function LO(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,r=Hi*e-Wi*t,X1+=r*(Wi+e),K1+=r*(Hi+t),Rl+=r*3,Is(Wi=e,Hi=t)}function PO(e){this._context=e}PO.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,un);break}}},result:$t};var J1=new sn,jm,IO,zO,Nl,Ll,mc={point:$t,lineStart:function(){mc.point=qq},lineEnd:function(){jm&&BO(IO,zO),mc.point=$t},polygonStart:function(){jm=!0},polygonEnd:function(){jm=null},result:function(){var e=+J1;return J1=new sn,e}};function qq(e,t){mc.point=BO,IO=Nl=e,zO=Ll=t}function BO(e,t){Nl-=e,Ll-=t,J1.add(ln(Nl*Nl+Ll*Ll)),Nl=e,Ll=t}let R_,Ch,N_,L_;class P_{constructor(t){this._append=t==null?UO:Wq(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==N_||this._append!==Ch){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,N_=i,Ch=this._append,L_=this._,this._=r}this._+=L_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function UO(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Wq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return UO;if(t!==R_){const n=10**t;R_=t,Ch=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return Ch}function jO(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),$r(a,r(o))),o.result()}return s.area=function(a){return $r(a,r(kr)),kr.result()},s.measure=function(a){return $r(a,r(mc)),mc.result()},s.bounds=function(a){return $r(a,r(Ah)),Ah.result()},s.centroid=function(a){return $r(a,r(Hn)),Hn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,gc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new P_(n)):new PO(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new P_(n)),s},s.projection(e).digits(n).context(t)}function ep(e){return function(t){var n=new Q1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Q1(){}Q1.prototype={constructor:Q1,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function zx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Ah)),t(Ah.result()),i!=null&&e.clipExtent(i),e}function tp(e,t,n){return zx(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function Bx(e,t,n){return tp(e,[[0,0],t],n)}function Ux(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function jx(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var I_=16,Hq=se(30*me);function z_(e,t){return+t?Vq(e,t):Gq(e)}function Gq(e){return ep({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Vq(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&p--){var x=s+d,E=a+h,S=u+g,w=ln(x*x+E*E+S*S),_=wn(S/=w),A=we(we(S)-1)<ae||we(o-f)<ae?(o+f)/2:ti(E,x),k=e(A,_),C=k[0],O=k[1],M=C-i,F=O-r,$=b*M-y*F;($*$/v>t||we((y*M+b*F)/v-.5)>.3||s*d+a*h+u*g<Hq)&&(n(i,r,o,s,a,u,C,O,A,x/=w,E/=w,S,p,m),m.point(C,O),n(C,O,A,x,E,S,l,c,f,d,h,g,p,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,A){_=e(_,A),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,A){var k=Ps([_,A]),C=e(_,A);n(f,d,c,h,g,p,f=C[0],d=C[1],c=_,h=k[0],g=k[1],p=k[2],I_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,A){v(r=_,A),o=f,s=d,a=h,u=g,l=p,m.point=v}function w(){n(f,d,c,h,g,p,o,s,r,a,u,l,I_,i),m.lineEnd=x,x()}return m}}var Yq=ep({point:function(e,t){this.stream.point(e*me,t*me)}});function Xq(e){return ep({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Kq(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function B_(e,t,n,i,r,o){if(!o)return Kq(e,t,n,i,r);var s=se(o),a=re(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function cr(e){return qO(function(){return e})()}function qO(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,g=null,p=F_,m=null,y,b,v,x=gc,E=.5,S,w,_,A,k;function C($){return _($[0]*me,$[1]*me)}function O($){return $=_.invert($[0],$[1]),$&&[$[0]*Ze,$[1]*Ze]}C.stream=function($){return A&&k===$?A:A=Yq(Xq(c)(p(S(x(k=$)))))},C.preclip=function($){return arguments.length?(p=$,g=void 0,F()):p},C.postclip=function($){return arguments.length?(x=$,m=y=b=v=null,F()):x},C.clipAngle=function($){return arguments.length?(p=+$?Mq(g=$*me):(g=null,F_),F()):g*Ze},C.clipExtent=function($){return arguments.length?(x=$==null?(m=y=b=v=null,gc):TO(m=+$[0][0],y=+$[0][1],b=+$[1][0],v=+$[1][1]),F()):m==null?null:[[m,y],[b,v]]},C.scale=function($){return arguments.length?(n=+$,M()):n},C.translate=function($){return arguments.length?(i=+$[0],r=+$[1],M()):[i,r]},C.center=function($){return arguments.length?(o=$[0]%360*me,s=$[1]%360*me,M()):[o*Ze,s*Ze]},C.rotate=function($){return arguments.length?(a=$[0]%360*me,u=$[1]%360*me,l=$.length>2?$[2]%360*me:0,M()):[a*Ze,u*Ze,l*Ze]},C.angle=function($){return arguments.length?(f=$%360*me,M()):f*Ze},C.reflectX=function($){return arguments.length?(d=$?-1:1,M()):d<0},C.reflectY=function($){return arguments.length?(h=$?-1:1,M()):h<0},C.precision=function($){return arguments.length?(S=z_(w,E=$*$),F()):ln(E)},C.fitExtent=function($,T){return tp(C,$,T)},C.fitSize=function($,T){return Bx(C,$,T)},C.fitWidth=function($,T){return Ux(C,$,T)},C.fitHeight=function($,T){return jx(C,$,T)};function M(){var $=B_(n,0,0,d,h,f).apply(null,t(o,s)),T=B_(n,i-$[0],r-$[1],d,h,f);return c=$O(a,u,l),w=j1(t,T),_=j1(c,w),S=z_(w,E),F()}function F(){return A=k=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&O,M()}}function qx(e){var t=0,n=be/3,i=qO(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*me,n=o[1]*me):[t*Ze,n*Ze]},r}function Jq(e){var t=se(e);function n(i,r){return[i*t,re(r)/t]}return n.invert=function(i,r){return[i/t,wn(r*t)]},n}function Qq(e,t){var n=re(e),i=(n+re(t))/2;if(we(i)<ae)return Jq(e);var r=1+n*(2*i-n),o=ln(r)/i;function s(a,u){var l=ln(r-2*i*re(u))/i;return[l*re(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=ti(a,we(l))*Vn(l);return l*i<0&&(c-=be*Vn(a)*Vn(l)),[c/i,wn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Fh(){return qx(Qq).scale(155.424).center([0,33.6442])}function WO(){return Fh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Zq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function eW(){var e,t,n=WO(),i,r=Fh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Fh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],g=d[1];return u=null,i.point(h,g),u||(o.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Zq([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),o=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ae,p+.12*h+ae],[g-.214*h-ae,p+.234*h-ae]]).stream(l),a=s.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ae,p+.166*h+ae],[g-.115*h-ae,p+.234*h-ae]]).stream(l),f()},c.fitExtent=function(d,h){return tp(c,d,h)},c.fitSize=function(d,h){return Bx(c,d,h)},c.fitWidth=function(d,h){return Ux(c,d,h)},c.fitHeight=function(d,h){return jx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function HO(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*re(t),o*re(n)]}}function Zc(e){return function(t,n){var i=ln(t*t+n*n),r=e(i),o=re(r),s=se(r);return[ti(t*o,i*s),wn(i&&n*o/i)]}}var GO=HO(function(e){return ln(2/(1+e))});GO.invert=Zc(function(e){return 2*wn(e/2)});function tW(){return cr(GO).scale(124.75).clipAngle(180-.001)}var VO=HO(function(e){return(e=pO(e))&&e/re(e)});VO.invert=Zc(function(e){return e});function nW(){return cr(VO).scale(79.4188).clipAngle(180-.001)}function np(e,t){return[e,ch(Px((Xe+t)/2))]}np.invert=function(e,t){return[e,2*Iu(gO(t))-Xe]};function iW(){return YO(np).scale(961/un)}function YO(e){var t=cr(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=be*i(),d=t(Sq(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===np?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function Uf(e){return Px((Xe+e)/2)}function rW(e,t){var n=se(e),i=e===t?re(e):ch(n/se(t))/ch(Uf(t)/Uf(e)),r=n*Im(Uf(e),i)/i;if(!i)return np;function o(s,a){r>0?a<-Xe+ae&&(a=-Xe+ae):a>Xe-ae&&(a=Xe-ae);var u=r/Im(Uf(a),i);return[u*re(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=Vn(i)*ln(s*s+u*u),c=ti(s,we(u))*Vn(u);return u*i<0&&(c-=be*Vn(s)*Vn(u)),[c/i,2*Iu(Im(r/l,1/i))-Xe]},o}function oW(){return qx(rW).scale(109.5).parallels([30,30])}function Th(e,t){return[e,t]}Th.invert=Th;function sW(){return cr(Th).scale(152.63)}function aW(e,t){var n=se(e),i=e===t?re(e):(n-se(t))/(t-e),r=n/i+e;if(we(i)<ae)return Th;function o(s,a){var u=r-a,l=i*s;return[u*re(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=ti(s,we(u))*Vn(u);return u*i<0&&(l-=be*Vn(s)*Vn(u)),[l/i,r-Vn(i)*ln(s*s+u*u)]},o}function uW(){return qx(aW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Xl=-.081106,Kl=893e-6,Jl=.003796,Mh=ln(3)/2,lW=12;function XO(e,t){var n=wn(Mh*re(t)),i=n*n,r=i*i*i;return[e*se(n)/(Mh*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))),n*(Yl+Xl*i+r*(Kl+Jl*i))]}XO.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<lW&&(a=n*(Yl+Xl*i+r*(Kl+Jl*i))-t,u=Yl+3*Xl*i+r*(7*Kl+9*Jl*i),n-=s=a/u,i=n*n,r=i*i*i,!(we(s)<D1));++o);return[Mh*e*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))/se(n),wn(re(n)/Mh)]};function cW(){return cr(XO).scale(177.158)}function KO(e,t){var n=se(t),i=se(e)*n;return[n*re(e)/i,re(t)/i]}KO.invert=Zc(Iu);function fW(){return cr(KO).scale(144.049).clipAngle(60)}function dW(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,g=ep({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),p=gc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(o){var w=S*s-E*a;E=E*s+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(o){var w=S*s+E*a;E=E*s-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=g(p(y=x))},v.postclip=function(x){return arguments.length?(p=x,u=l=c=f=null,b()):p},v.clipExtent=function(x){return arguments.length?(p=x==null?(u=l=c=f=null,gc):TO(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*me,a=re(o),s=se(o),b()):o*Ze},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return tp(v,x,E)},v.fitSize=function(x,E){return Bx(v,x,E)},v.fitWidth=function(x,E){return Ux(v,x,E)},v.fitHeight=function(x,E){return jx(v,x,E)},v}function JO(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}JO.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(we(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function hW(){return cr(JO).scale(175.295)}function QO(e,t){return[se(t)*re(e),re(t)]}QO.invert=Zc(wn);function gW(){return cr(QO).scale(249.5).clipAngle(90+ae)}function ZO(e,t){var n=se(t),i=1+se(e)*n;return[n*re(e)/i,re(t)/i]}ZO.invert=Zc(function(e){return 2*Iu(e)});function pW(){return cr(ZO).scale(250).clipAngle(142)}function eR(e,t){return[ch(Px((Xe+t)/2)),-e]}eR.invert=function(e,t){return[-t,2*Iu(gO(e))-Xe]};function mW(){var e=YO(eR),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var yW=Math.abs,Z1=Math.cos,Dh=Math.sin,bW=1e-6,tR=Math.PI,ey=tR/2,U_=vW(2);function j_(e){return e>1?ey:e<-1?-ey:Math.asin(e)}function vW(e){return e>0?Math.sqrt(e):0}function xW(e,t){var n=e*Dh(t),i=30,r;do t-=r=(t+Dh(t)-n)/(1+Z1(t));while(yW(r)>bW&&--i>0);return t/2}function wW(e,t,n){function i(r,o){return[e*r*Z1(o=xW(n,o)),t*Dh(o)]}return i.invert=function(r,o){return o=j_(o/t),[r/(e*Z1(o)),j_((2*o+Dh(2*o))/n)]},i}var EW=wW(U_/ey,U_,tR);function SW(){return cr(EW).scale(169.529)}const _W=jO(),ty=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function AW(e,t){return function n(){const i=t();return i.type=e,i.path=jO().projection(i),i.copy=i.copy||function(){const r=n();return ty.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},mM(i)}}function Wx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Oh[e]=AW(e,t),this):Oh[e]||null}function nR(e){return e&&e.path||_W}const Oh={albers:WO,albersusa:eW,azimuthalequalarea:tW,azimuthalequidistant:nW,conicconformal:oW,conicequalarea:Fh,conicequidistant:uW,equalEarth:cW,equirectangular:sW,gnomonic:fW,identity:dW,mercator:iW,mollweide:SW,naturalEarth1:hW,orthographic:gW,stereographic:pW,transversemercator:mW};for(const e in Oh)Wx(e,Oh[e]);function $W(){}const xr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function iR(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),kW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(CW((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,xr[m<<1].forEach(v);++h<e-1;)p=m,m=u[h+1]>=l,xr[p|m<<1].forEach(v);for(xr[m<<0].forEach(v);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,xr[m<<1|y<<2].forEach(v);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,xr[p|m<<1|y<<2|b<<3].forEach(v);xr[m|y<<3].forEach(v)}for(h=-1,y=u[g*e]>=l,xr[y<<2].forEach(v);++h<e-1;)b=y,y=u[g*e+h+1]>=l,xr[y<<2|b<<3].forEach(v);xr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+g],S=[x[1][0]+h,x[1][1]+g],w=s(E),_=s(S),A,k;(A=d[w])?(k=f[_])?(delete d[A.end],delete f[k.start],A===k?(A.ring.push(S),c(A.ring)):f[A.start]=d[k.end]={start:A.start,end:k.end,ring:A.ring.concat(k.ring)}):(delete d[A.end],A.ring.push(S),d[A.end=_]=A):(A=f[_])?(k=d[w])?(delete f[A.start],delete d[k.end],A===k?(A.ring.push(S),c(A.ring)):f[k.start]=d[A.end]={start:k.start,end:A.end,ring:k.ring.concat(A.ring)}):(delete f[A.start],A.ring.unshift(E),f[A.start=w]=A):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:$W,i):n===a},i}function kW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function CW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=FW(e,t[n]))return r;return 0}function FW(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(TW(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function TW(e,t,n){var i;return MW(e,t,n)&&DW(e[i=+(e[0]===t[0])],n[i],t[i])}function MW(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function DW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function rR(e,t,n){return function(i){var r=Qi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?Os(o,s,e):a/(e+1);return Mn(o+u,s,u)}}function Hx(e){D.call(this,null,e)}Hx.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Hx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Vt,o=iR().smooth(e.smooth!==!1),s=e.thresholds||OW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,P(s)?s:s(c.values));RW(f,c,l,e),f.forEach(d=>{u.push(Sg(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function OW(e,t,n){const i=rR(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>_s(t(r).values)))}function RW(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ge(r)&&(r=r(n,i)),ge(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(Ae(r)?r:r[0])||1,a=(Ae(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(oR(t,s,a,u,l))}function oR(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function q_(e,t,n){const i=e>=0?e:Bb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function qm(e){return ge(e)?e:Yt(+e)}function sR(){var e=u=>u[0],t=u=>u[1],n=ku,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=q_(i[0],u,e)>>s,f=q_(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>s),p=2*h+(o>>s),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(x=>{const E=d+(+e(x)>>s),S=h+(+t(x)>>s);E>=0&&E<g&&S>=0&&S<p&&(m[E+S*g]+=+n(x))}),c>0&&f>0?(xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f)):c>0?(xa(g,p,m,y,c),xa(g,p,y,m,c),xa(g,p,m,y,c),b=y):f>0&&(wa(g,p,m,y,f),wa(g,p,y,m,f),wa(g,p,m,y,f),b=y);const v=l?Math.pow(2,-2*s):1/qC(b);for(let x=0,E=g*p;x<E;++x)b[x]*=v;return{values:b,scale:1<<s,width:g,height:p,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=qm(u),a):e},a.y=function(u){return arguments.length?(t=qm(u),a):t},a.weight=function(u){return arguments.length?(n=qm(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function wa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function Gx(e){D.call(this,null,e)}Gx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const NW=["x","y","weight","size","cellSize","bandwidth"];function aR(e,t){return NW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(Gx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=LW(i,e.groupby),o=(e.groupby||[]).map(Je),s=aR(sR(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function LW(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Vx(e){D.call(this,null,e)}Vx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Vx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=iR().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||rR(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=aR(sR(),e)(r,!0),u=oR(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=P(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const ny="Feature",Yx="FeatureCollection",PW="MultiPoint";function Xx(e){D.call(this,null,e)}Xx.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Xx,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&Vt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(qt(a))||o&&t.modified(qt(o))||s&&t.modified(qt(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:ny,geometry:{type:PW,coordinates:i}})),this.value={type:Yx,features:n}}});function Kx(e){D.call(this,null,e)}Kx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(Kx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Vt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=nR(e.projection),n.materialize().reflow()):s=r===Vt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=IW(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function IW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(Jx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function Qx(e){D.call(this,null,e)}Qx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Qx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=zW(nR(e.projection),e.field||Qn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function zW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function Zx(e){D.call(this,[],e),this.generator=Oq()}Zx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Zx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ge(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(OF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function e2(e){D.call(this,null,e)}e2.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(e2,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Vt,o=UW(e.opacity,e),s=BW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?_s(n.map(l=>_s(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=he({},l,u);i||(f.$max=_s(c.values||[])),l[a]=jW(c,f,s.dep?s:Yt(s(f)),o.dep?o:Yt(o(f)))}),t.reflow(!0).modifies(a)}});function BW(e,t){let n;return ge(e)?(n=i=>Rd(e(i,t)),n.dep=uR(e)):n=Yt(Rd(e||"#888")),n}function UW(e,t){let n;return ge(e)?(n=i=>e(i,t),n.dep=uR(e)):e?n=Yt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function uR(e){if(!ge(e))return!1;const t=xi(qt(e));return t.$x||t.$y||t.$value||t.$max}function jW(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:fo,d=$o(u-s,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-s,l-a),p=g.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,v=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+v);const x=n(t);p[y+0]=x.r,p[y+1]=x.g,p[y+2]=x.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function lR(e){D.call(this,null,e),this.modified(!0)}G(lR,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=WW(e.type),ty.forEach(i=>{e[i]!=null&&W_(n,i,e[i])})):ty.forEach(i=>{e.modified(i)&&W_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&qW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qW(e,t){const n=HW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function WW(e){const t=Wx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function W_(e,t,n){ge(e[t])&&e[t](n)}function HW(e){return e=X(e),e.length===1?e[0]:{type:Yx,features:e.reduce((t,n)=>t.concat(GW(n)),[])}}function GW(e){return e.type===Yx?e.features:X(e).filter(t=>t!=null).map(t=>t.type===ny?t:{type:ny,geometry:t})}const VW=Object.freeze(Object.defineProperty({__proto__:null,contour:Vx,geojson:Xx,geopath:Kx,geopoint:Jx,geoshape:Qx,graticule:Zx,heatmap:e2,isocontour:Hx,kde2d:Gx,projection:lR},Symbol.toStringTag,{value:"Module"}));function YW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function XW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return cR(this.cover(t,n),t,n,e)}function cR(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,g,p,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|p]))return r[y]=s,e;if(h=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===h&&n===g)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function KW(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)cR(this,s[n],a[n],e[n]);return this}function JW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function QW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function ZW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function nn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function eH(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,g,p;for(h&&d.push(new nn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(s=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new nn(h[3],m,y,u,l),new nn(h[2],s,y,m,l),new nn(h[1],m,a,u,y),new nn(h[0],s,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,o=t-E,c=e+E,f=t+E,i=h.data}}return i}function tH(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(s+u)/2))?s=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function nH(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function iH(){return this._root}function rH(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function oH(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new nn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new nn(r,l,c,a,u)),(r=i[2])&&t.push(new nn(r,o,c,l,u)),(r=i[1])&&t.push(new nn(r,l,s,a,c)),(r=i[0])&&t.push(new nn(r,o,s,l,c))}return this}function sH(e){var t=[],n=[],i;for(this._root&&t.push(new nn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new nn(o,s,a,c,f)),(o=r[1])&&t.push(new nn(o,c,a,u,f)),(o=r[2])&&t.push(new nn(o,s,f,c,l)),(o=r[3])&&t.push(new nn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function aH(e){return e[0]}function uH(e){return arguments.length?(this._x=e,this):this._x}function lH(e){return e[1]}function cH(e){return arguments.length?(this._y=e,this):this._y}function t2(e,t,n){var i=new n2(t??aH,n??lH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function n2(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function H_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var fn=t2.prototype=n2.prototype;fn.copy=function(){var e=new n2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=H_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=H_(i));return e};fn.add=XW;fn.addAll=KW;fn.cover=JW;fn.data=QW;fn.extent=ZW;fn.find=eH;fn.remove=tH;fn.removeAll=nH;fn.root=iH;fn.size=rH;fn.visit=oH;fn.visitAfter=sH;fn.x=uH;fn.y=cH;function rn(e){return function(){return e}}function xo(e){return(e()-.5)*1e-6}function fH(e){return e.x+e.vx}function dH(e){return e.y+e.vy}function hH(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=rn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<o;++y)for(f=t2(t,fH,dH).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,A=v.r,k=p+A;if(_){if(_.index>d.index){var C=h-_.x-_.vx,O=g-_.y-_.vy,M=C*C+O*O;M<k*k&&(C===0&&(C=xo(i),M+=C*C),O===0&&(O=xo(i),M+=O*O),M=(k-(M=Math.sqrt(M)))/M*r,d.vx+=(C*=M)*(k=(A*=A)/(m+A)),d.vy+=(O*=M)*k,_.vx-=C*(k=1-k),_.vy-=O*k)}return}return x>h+k||S<h-k||E>g+k||w<g-k}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:rn(+l),u(),s):e},s}function gH(e){return e.index}function G_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function pH(e){var t=gH,n=f,i,r=rn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,A,k;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||xo(l),_=S.y+S.vy-E.y-E.vy||xo(l),A=Math.sqrt(w*w+_*_),A=(A-o[v])/A*m*i[v],w*=A,_*=A,S.vx-=w*(k=u[v]),S.vy-=_*k,E.vx+=w*(k=1-k),E.vy+=_*k}function h(){if(s){var m,y=s.length,b=e.length,v=new Map(s.map((E,S)=>[t(E,S,s),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=G_(v,x.source)),typeof x.target!="object"&&(x.target=G_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),g(),o=new Array(b),p()}}function g(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:rn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:rn(+m),p(),d):r},d}function mH(e,t,n){var i=new hI,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?gI():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const yH=1664525,bH=1013904223,V_=4294967296;function vH(){let e=1;return()=>(e=(yH*e+bH)%V_)/V_}function xH(e){return e.x}function wH(e){return e.y}var EH=10,SH=Math.PI*(3-Math.sqrt(5));function _H(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=pI(f),l=mI("tick","end"),c=vH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var v=0;v<p;++v)for(n+=(o-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=EH*Math.sqrt(.5+p),v=p*SH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(s=1-p,t):1-s},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=p-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function AH(){var e,t,n,i,r=rn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=t2(e,xH,wH).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(o=new Array(g),h=0;h<g;++h)p=e[h],o[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(p=h[x])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,v+=m*p.y);h.x=b/y,h.y=v/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=o[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-g,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)));do h.data!==t&&(v=o[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:rn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function $H(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}function kH(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}const Y_={center:YW,collide:hH,nbody:AH,link:pH,x:$H,y:kH},Pl="forces",iy=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],CH=["static","iterations"],fR=["x","y","vx","vy"];function i2(e){D.call(this,null,e)}i2.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:fR}]};G(i2,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(iy),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&dR(n,e,0,t)):(this.value=n=TH(t.source,e),n.on("tick",FH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(CH)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==Pl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(fR)}});function FH(e,t){return()=>e.touch(t).run()}function TH(e,t){const n=_H(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),dR(n,t,!0).on("end",()=>o=!0)}function dR(e,t,n,i){var r=X(t.forces),o,s,a,u;for(o=0,s=iy.length;o<s;++o)a=iy[o],a!==Pl&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=Pl+o,a=n||t.modified(Pl,o)?DH(r[o]):i&&MH(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(Pl+o,null);return e.numForces=r.length,e}function MH(e,t){var n,i;for(n in e)if(ge(i=e[n])&&t.modified(qt(i)))return 1;return 0}function DH(e){var t,n;J(Y_,e.force)||N("Unrecognized force: "+e.force),t=Y_[e.force]();for(n in e)ge(t[n])&&OH(t[n],e[n],e);return t}function OH(e,t,n){e(ge(t)?i=>t(i,n):t)}const RH=Object.freeze(Object.defineProperty({__proto__:null,force:i2},Symbol.toStringTag,{value:"Module"}));function NH(e,t){return e.parent===t.parent?1:2}function LH(e){return e.reduce(PH,0)/e.length}function PH(e,t){return e+t.x}function IH(e){return 1+e.reduce(zH,0)}function zH(e,t){return Math.max(e,t.y)}function BH(e){for(var t;t=e.children;)e=t[0];return e}function UH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function jH(){var e=NH,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=LH(h),d.y=IH(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=BH(o),l=UH(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function qH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function WH(){return this.eachAfter(qH)}function HH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function GH(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function VH(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function YH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function XH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function KH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function JH(e){for(var t=this,n=QH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function QH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function ZH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function eG(){return Array.from(this)}function tG(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nG(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*iG(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function r2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=sG)):t===void 0&&(t=oG);for(var n=new uu(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new uu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(hR)}function rG(){return r2(this).eachBefore(aG)}function oG(e){return e.children}function sG(e){return Array.isArray(e)?e[1]:null}function aG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function hR(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function uu(e){this.data=e,this.depth=this.height=0,this.parent=null}uu.prototype=r2.prototype={constructor:uu,count:WH,each:HH,eachAfter:VH,eachBefore:GH,find:YH,sum:XH,sort:KH,path:JH,ancestors:ZH,descendants:eG,leaves:tG,links:nG,copy:rG,[Symbol.iterator]:iG};function Ed(e){return e==null?null:gR(e)}function gR(e){if(typeof e!="function")throw new Error;return e}function xs(){return 0}function Ca(e){return function(){return e}}const uG=1664525,lG=1013904223,X_=4294967296;function cG(){let e=1;return()=>(e=(uG*e+lG)%X_)/X_}function fG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function hG(e,t){for(var n=0,i=(e=dG(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&pR(s,o)?++n:(s=pG(r=gG(r,o)),n=0);return s}function gG(e,t){var n,i;if(Wm(t,e))return[t];for(n=0;n<e.length;++n)if(jf(t,e[n])&&Wm(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(jf(Il(e[n],e[i]),t)&&jf(Il(e[n],t),e[i])&&jf(Il(e[i],t),e[n])&&Wm(mR(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function jf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function pR(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Wm(e,t){for(var n=0;n<t.length;++n)if(!pR(e,t[n]))return!1;return!0}function pG(e){switch(e.length){case 1:return mG(e[0]);case 2:return Il(e[0],e[1]);case 3:return mR(e[0],e[1],e[2])}}function mG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function mR(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,g=r-a,p=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,v=b-s*s-a*a+u*u,x=b-l*l-c*c+f*f,E=h*g-d*p,S=(g*x-p*v)/(E*2)-i,w=(p*m-g*y)/E,_=(h*v-d*x)/(E*2)-r,A=(d*y-h*m)/E,k=w*w+A*A-1,C=2*(o+S*w+_*A),O=S*S+_*_-o*o,M=-(Math.abs(k)>1e-6?(C+Math.sqrt(C*C-4*k*O))/(2*k):O/C);return{x:i+S+w*M,y:r+_+A*M,r:M}}function K_(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function J_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function qf(e){this._=e,this.next=null,this.previous=null}function yG(e,t){if(!(o=(e=fG(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;K_(i,n,r=e[2]),n=new qf(n),i=new qf(i),r=new qf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){K_(n._,i._,r=e[u]),r=new qf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(J_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(J_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=Q_(n);(r=r.next)!==i;)(a=Q_(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=hG(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function bG(e){return Math.sqrt(e.value)}function vG(){var e=null,t=1,n=1,i=xs;function r(o){const s=cG();return o.x=t/2,o.y=n/2,e?o.eachBefore(Z_(e)).eachAfter(Hm(i,.5,s)).eachBefore(eA(1)):o.eachBefore(Z_(bG)).eachAfter(Hm(xs,1,s)).eachAfter(Hm(i,o.r/Math.min(t,n),s)).eachBefore(eA(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=Ed(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:Ca(+o),r):i},r}function Z_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Hm(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=yG(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function eA(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function yR(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ef(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function xG(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(yR),s}function o(s,a){return function(u){u.children&&ef(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var wG={depth:-1},tA={},Gm={};function EG(e){return e.id}function SG(e){return e.parentId}function nA(){var e=EG,t=SG,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=o.map((x,E)=>_G(n(x,E,r))),b=y.map(iA),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(iA(x)),o.push(Gm));s=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new uu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?tA:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=o[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===tA)throw new Error("ambiguous: "+g);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Gm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Gm);--y)h.data=null}if(f.parent=wG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(hR),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ed(r),i):e},i.parentId=function(r){return arguments.length?(t=Ed(r),i):t},i.path=function(r){return arguments.length?(n=Ed(r),i):n},i}function _G(e){e=`${e}`;let t=e.length;return ry(e,t-1)&&!ry(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function iA(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ry(e,t););return e.slice(0,t)}function ry(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function AG(e,t){return e.parent===t.parent?1:2}function Vm(e){var t=e.children;return t?t[0]:e.t}function Ym(e){var t=e.children;return t?t[t.length-1]:e.t}function $G(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function kG(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function CG(e,t,n){return e.a.parent===t.parent?e.a:n}function Sd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Sd.prototype=Object.create(uu.prototype);function FG(e){for(var t=new Sd(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new Sd(o[s],s)),r.parent=n;return(t.parent=new Sd(null,0)).children=[t],t}function TG(){var e=AG,t=1,n=1,i=null;function r(l){var c=FG(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){kG(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,v=p.m,x;g=Ym(g),d=Vm(d),g&&d;)p=Vm(p),h=Ym(h),h.a=l,x=g.z+b-d.z-m+e(g._,d._),x>0&&($G(CG(g,l,f),l,x),m+=x,y+=x),b+=g.m,m+=d.m,v+=p.m,y+=h.m;g&&!Ym(h)&&(h.t=g,h.m+=b-y),d&&!Vm(p)&&(p.t=d,p.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function ip(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var bR=(1+Math.sqrt(5))/2;function vR(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,g=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(g/h,h/g)/(p*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}s.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?ef(u,n,i,r,p?i+=g*m/p:o):ip(u,n,i,p?n+=h*m/p:r,o),p-=m,c=f}return s}const xR=function e(t){function n(i,r,o,s,a){vR(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function MG(){var e=xR,t=!1,n=1,i=1,r=[0],o=xs,s=xs,a=xs,u=xs,l=xs;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(yR),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,g+=l(d)-h,p+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=gR(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Ca(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Ca(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Ca(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Ca(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Ca(+d),c):l},c}function DG(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,g,p,m,y){if(f>=d-1){var b=o[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,A=h-_;if(m-g>y-p){var k=h?(g*A+m*_)/h:m;c(f,E,_,g,p,k,y),c(E,d,A,k,p,m,y)}else{var C=h?(p*A+y*_)/h:y;c(f,E,_,g,p,m,C),c(E,d,A,g,C,m,y)}}}function OG(e,t,n,i,r){(e.depth&1?ip:ef)(e,t,n,i,r)}const RG=function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?ef(l,r,o,s,p?o+=(a-o)*l.value/p:a):ip(l,r,o,p?r+=(s-r)*l.value/p:s,a),p-=l.value}else i._squarify=u=vR(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function oy(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function o2(e){D.call(this,null,e)}o2.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const NG=e=>e.values;G(o2,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&Eg(s.data)&&r.rem.push(s.data)}),this.value=o=r2({values:X(e.keys).reduce((s,a)=>(s.key(a),s),LG()).entries(r.source)},NG),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),oy(o,ie,ie)),r.source.root=o,r}});function LG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function Vr(e){D.call(this,null,e)}const PG=(e,t)=>e.parent===t.parent?1:2;G(Vr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,s=>s.data)),IG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?PG:ku);try{this.value=n(r)}catch(s){N(s)}return r.each(s=>zG(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function IG(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function zG(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const sy=["x","y","r","depth","children"];function s2(e){Vr.call(this,e)}s2.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(s2,Vr,{layout:vG,params:["radius","size","padding"],fields:sy});const ay=["x0","y0","x1","y1","depth","children"];function a2(e){Vr.call(this,e)}a2.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ay.length,default:ay}]};G(a2,Vr,{layout:xG,params:["size","round","padding"],fields:ay});function u2(e){D.call(this,null,e)}u2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(u2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?oy(nA().id(e.key).parentId(e.parentKey)(r.source),e.key,Pn):oy(nA()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const rA={tidy:TG,cluster:jH},uy=["x","y","depth","children"];function l2(e){Vr.call(this,e)}l2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:uy.length,default:uy}]};G(l2,Vr,{layout(e){const t=e||"tidy";if(J(rA,t))return rA[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:uy});function c2(e){D.call(this,[],e)}c2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(c2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ie(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ie(a)]&&o[ie(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ie(s)]=1),n.forEach(s=>{(o[ie(s.source)]||o[ie(s.target)])&&r.mod.push(s)})),r}});const oA={binary:DG,dice:ef,slice:ip,slicedice:OG,squarify:xR,resquarify:RG},ly=["x0","y0","x1","y1","depth","children"];function f2(e){Vr.call(this,e)}f2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ly.length,default:ly}]};G(f2,Vr,{layout(){const e=MG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(oA,t)?e.tile(oA[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ly});const BG=Object.freeze(Object.defineProperty({__proto__:null,nest:o2,pack:s2,partition:a2,stratify:u2,tree:l2,treelinks:c2,treemap:f2},Symbol.toStringTag,{value:"Module"})),Xm=4278190080;function UG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function jG(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=$o(o,s).getContext("2d"),l=$o(o,s).getContext("2d"),c=a&&$o(o,s).getContext("2d");n.forEach(_=>_d(u,_,!1)),_d(l,t,!1),a&&_d(c,t,!0);const f=Km(u,o,s),d=Km(l,o,s),h=a&&Km(c,o,s),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<s;++y)for(m=0;m<o;++m)x=y*o+m,E=f[x]&Xm,w=d[x]&Xm,S=a&&h[x]&Xm,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&g.set(b,v),a&&(E||S)&&p.set(b,v));return[g,p]}function Km(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function _d(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>_d(e,o.items,n))}):Bn[i].draw(e,{items:n?t.map(qG):t})}function qG(e){const t=Sg(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const wr=5,Xt=31,yc=32,lo=new Uint32Array(yc+1),di=new Uint32Array(yc+1);di[0]=0;lo[0]=~di[0];for(let e=1;e<=yc;++e)di[e]=di[e-1]<<1|1,lo[e]=~di[e];function WG(e,t){const n=new Uint32Array(~~((e*t+yc)/yc));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>wr]&1<<(a&Xt)},set:(o,s)=>{const a=s*e+o;i(a>>>wr,1<<(a&Xt))},clear:(o,s)=>{const a=s*e+o;r(a>>>wr,~(1<<(a&Xt)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>wr,h=f>>>wr,d===h){if(n[d]&lo[c&Xt]&di[(f&Xt)+1])return!0}else{if(n[d]&lo[c&Xt]||n[h]&di[(f&Xt)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)i(f,lo[l&Xt]&di[(c&Xt)+1]);else for(i(f,lo[l&Xt]),i(d,di[(c&Xt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)r(f,di[l&Xt]|lo[(c&Xt)+1]);else for(r(f,di[l&Xt]),r(d,lo[(c&Xt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function HG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>WG(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function GG(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=Rn.width(s.datum,s.datum.text);let f=0,d,h,g,p,m,y,b;for(let v=0;v<u;++v)d=a[v].x,g=a[v].y,h=a[v].x2===void 0?d:a[v].x2,p=a[v].y2===void 0?g:a[v].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,g=s.y-y,p=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",g<0&&p<=o?s.baseline="top":0<=g&&o<p&&(s.baseline="bottom"),!0}}function Rh(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function wo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function VG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const g=e.invert(l),p=e.invert(c);let m=f,y=o,b;if(!Rh(g,p,d,h,r,o)&&!wo(e,g,p,h,d,m,s,a)&&!wo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,wo(e,g,p,h,d,b,s,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,v,x,E,S,w,_,A,k,C,O,M,F,$,T,L,z;for(let I=0;I<f;++I){for(b=c[I].x,x=c[I].y,v=c[I].x2===void 0?b:c[I].x2,E=c[I].y2===void 0?x:c[I].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),k=e(b),O=e(v),C=~~((k+O)/2),M=e(x),$=e(E),F=~~((M+$)/2),_=C;_>=k;--_)for(A=F;A>=M;--A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);for(_=C;_<=O;++_)for(A=F;A<=$;++A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);!p&&!n&&(T=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,T>=y&&!Rh(S,w,h,d,r,o)&&!wo(e,S,w,d,h,d,s,null)&&(y=T,l.x=S,l.y=w,m=!0))}return p||m?(S=h/2,w=d/2,s.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const YG=[-1,-1,1,1],XG=[-1,1,-1,1];function KG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,A,k,C,O,M,F;for(let $=0;$<f;++$){for(v=c[$].x,E=c[$].y,x=c[$].x2===void 0?v:c[$].x2,S=c[$].y2===void 0?E:c[$].y2,g.push([e((v+x)/2),e((E+S)/2)]);g.length;)if([A,k]=g.pop(),!(s.get(A,k)||a.get(A,k)||u.get(A,k))){u.set(A,k);for(let T=0;T<4;++T)w=A+YG[T],_=k+XG[T],u.outOfBounds(w,_,w,_)||g.push([w,_]);if(w=e.invert(A),_=e.invert(k),C=p,O=o,!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,C,s,a)&&!wo(e,w,_,d,h,d,s,null)){for(;O-C>=1;)M=(C+O)/2,wo(e,w,_,d,h,M,s,a)?O=M:C=M;C>p&&(l.x=w,l.y=_,p=C,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,d,s,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,s.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const JG=["right","center","left"],QG=["bottom","middle","top"];function ZG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,g,p,m,y,b,v,x,E,S,w,_,A,k,C;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,g=(n[O]>>>2&3)-1,p=h===0&&g===0||i[O]<0,m=h&&g?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+g]+y*f*g/2+i[O]*g*m,x=w-f/2,E=w+f/2,_=e(b),k=e(x),C=e(E),!d)if(sA(_,_,k,C,s,a,b,b,x,E,c,p))d=Rn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),A=e(v),sA(_,A,k,C,s,a,b,v,x,E,c,p))return l.x=h?h*y<0?v:b:S,l.y=g?g*y<0?E:x:w,l.align=JG[h*y+1],l.baseline=QG[g*y+1],s.setRange(_,k,A,C),!0}return!1}}function sA(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Jm=0,Qm=4,Zm=8,e0=0,t0=1,n0=2,eV={"top-left":Jm+e0,top:Jm+t0,"top-right":Jm+n0,left:Qm+e0,middle:Qm+t0,right:Qm+n0,"bottom-left":Zm+e0,bottom:Zm+t0,"bottom-right":Zm+n0},tV={naive:GG,"reduced-search":VG,floodfill:KG};function nV(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=iV(i,f),h=rV(r,f),g=oV(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=sV(g,p,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(k=>{const C=b?Rn.width(k,k.text):void 0;return x=Math.max(x,C),E=Math.max(E,k.fontSize),{datum:k,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(k),textWidth:C}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=HG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,M)=>n(O.datum,M.datum));let k=!1;for(let O=0;O<h.length&&!k;++O)k=h[O]===5||d[O]<0;const C=(g&&s||m)&&e.map(O=>O.datum);_=o.length||C?jG(w,C||[],o,k,m):UG(w,s&&S)}const A=m?tV[c](w,_,s,u):ZG(w,_,h,d);return S.forEach(k=>k.opacity=+A(k)),S}function iV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function rV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=eV[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function oV(e){return e&&e.mark&&e.mark.marktype}function sV(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const cy=["x","y","opacity","align","baseline"],wR=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function d2(e){D.call(this,null,e)}d2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:wR},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:cy.length,default:cy}]};G(d2,D,{transform(e,t){function n(o){const s=e[o];return ge(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||cy;return nV(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||wR),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const aV=Object.freeze(Object.defineProperty({__proto__:null,label:d2},Symbol.toStringTag,{value:"Module"}));function ER(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function h2(e){D.call(this,null,e)}h2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(h2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=o.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{JF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const fy={constant:Qb,linear:Zb,log:VF,exp:YF,pow:XF,quad:ev,poly:KF},uV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function g2(e){D.call(this,null,e)}g2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(fy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(g2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=e.method||"linear",a=e.order==null?3:e.order,u=uV(s,a),l=e.as||[Je(e.x),Je(e.y)],c=fy[s],f=[];let d=e.extent;J(fy,s)||N("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const p=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||Qi(h,e.x),y=b=>{const v={};for(let x=0;x<o.length;++x)v[o[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};s==="linear"||s==="constant"?m.forEach(b=>y([b,p.predict(b)])):Tg(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const lV=Object.freeze(Object.defineProperty({__proto__:null,loess:h2,regression:g2},Symbol.toStringTag,{value:"Module"})),Nr=11102230246251565e-32,Nt=134217729,cV=(3+8*Nr)*Nr;function i0(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function fV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function tf(e){return new Float64Array(e)}const dV=(3+16*Nr)*Nr,hV=(2+12*Nr)*Nr,gV=(9+64*Nr)*Nr*Nr,Ea=tf(4),aA=tf(8),uA=tf(12),lA=tf(16),Kt=tf(4);function pV(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,g,p,m,y,b,v,x,E,S,w,_;const A=e-r,k=n-r,C=t-o,O=i-o;x=A*O,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=C*k,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let M=fV(4,Ea),F=hV*s;if(M>=F||-M>=F||(f=e-A,a=e-(A+f)+(f-r),f=n-k,l=n-(k+f)+(f-r),f=t-C,u=t-(C+f)+(f-o),f=i-O,c=i-(O+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=gV*s+cV*Math.abs(M),M+=A*c+O*a-(C*l+k*u),M>=F||-M>=F))return M;x=a*O,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=u*k,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const $=i0(4,Ea,4,Kt,aA);x=A*c,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=C*l,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const T=i0($,aA,4,Kt,uA);x=a*c,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=u*l,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const L=i0(T,uA,4,Kt,lA);return lA[L-1]}function Wf(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=dV*l?u:-pV(e,t,n,i,r,o,l)}const cA=Math.pow(2,-52),Hf=new Uint32Array(512);class Nh{static from(t,n=xV,i=wV){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new Nh(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let A=0;A<s;A++){const k=t[2*A],C=t[2*A+1];k<a&&(a=k),C<u&&(u=C),k>l&&(l=k),C>c&&(c=C),this._ids[A]=A}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let A=0,k=1/0;A<s;A++){const C=r0(f,d,t[2*A],t[2*A+1]);C<k&&(h=A,k=C)}const m=t[2*h],y=t[2*h+1];for(let A=0,k=1/0;A<s;A++){if(A===h)continue;const C=r0(m,y,t[2*A],t[2*A+1]);C<k&&C>0&&(g=A,k=C)}let b=t[2*g],v=t[2*g+1],x=1/0;for(let A=0;A<s;A++){if(A===h||A===g)continue;const k=bV(m,y,b,v,t[2*A],t[2*A+1]);k<x&&(p=A,x=k)}let E=t[2*p],S=t[2*p+1];if(x===1/0){for(let C=0;C<s;C++)this._dists[C]=t[2*C]-t[0]||t[2*C+1]-t[1];Ra(this._ids,this._dists,0,s-1);const A=new Uint32Array(s);let k=0;for(let C=0,O=-1/0;C<s;C++){const M=this._ids[C],F=this._dists[M];F>O&&(A[k++]=M,O=F)}this.hull=A.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Wf(m,y,b,v,E,S)<0){const A=g,k=b,C=v;g=p,b=E,v=S,p=A,E=k,S=C}const w=vV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let A=0;A<s;A++)this._dists[A]=r0(t[2*A],t[2*A+1],w.x,w.y);Ra(this._ids,this._dists,0,s-1),this._hullStart=h;let _=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,v)]=g,o[this._hashKey(E,S)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let A=0,k,C;A<this._ids.length;A++){const O=this._ids[A],M=t[2*O],F=t[2*O+1];if(A>0&&Math.abs(M-k)<=cA&&Math.abs(F-C)<=cA||(k=M,C=F,O===h||O===g||O===p))continue;let $=0;for(let Q=0,ue=this._hashKey(M,F);Q<this._hashSize&&($=o[(ue+Q)%this._hashSize],!($!==-1&&$!==i[$]));Q++);$=n[$];let T=$,L;for(;L=i[T],Wf(M,F,t[2*T],t[2*T+1],t[2*L],t[2*L+1])>=0;)if(T=L,T===$){T=-1;break}if(T===-1)continue;let z=this._addTriangle(T,O,i[T],-1,-1,r[T]);r[O]=this._legalize(z+2),r[T]=z,_++;let I=i[T];for(;L=i[I],Wf(M,F,t[2*I],t[2*I+1],t[2*L],t[2*L+1])<0;)z=this._addTriangle(I,O,L,r[O],-1,r[I]),r[O]=this._legalize(z+2),i[I]=I,_--,I=L;if(T===$)for(;L=n[T],Wf(M,F,t[2*L],t[2*L+1],t[2*T],t[2*T+1])<0;)z=this._addTriangle(L,O,T,-1,r[T],r[L]),this._legalize(z+2),r[L]=z,i[T]=T,_--,T=L;this._hullStart=n[O]=T,i[T]=n[I]=O,i[O]=I,o[this._hashKey(M,F)]=O,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(_);for(let A=0,k=this._hullStart;A<_;A++)this.hull[A]=k,k=i[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(mV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=Hf[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],g=n[c],p=n[f];if(yV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<Hf.length&&(Hf[o++]=b)}else{if(o===0)break;t=Hf[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function mV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function r0(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function yV(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function bV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,g=(s*f-u*c)*d;return h*h+g*g}function vV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,g=t+(s*f-u*c)*d;return{x:h,y:g}}function Ra(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;cl(e,r,o),t[e[n]]>t[e[i]]&&cl(e,n,i),t[e[o]]>t[e[i]]&&cl(e,o,i),t[e[n]]>t[e[o]]&&cl(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;cl(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(Ra(e,t,o,i),Ra(e,t,n,s-1)):(Ra(e,t,n,s-1),Ra(e,t,o,i))}}function cl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function xV(e){return e[0]}function wV(e){return e[1]}const fA=1e-6;class Ss{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>fA||Math.abs(this._y1-o)>fA)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class dy{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let EV=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let p=0,m=0,y=i.length,b,v;p<y;p+=3,m+=2){const x=i[p]*2,E=i[p+1]*2,S=i[p+2]*2,w=t[x],_=t[x+1],A=t[E],k=t[E+1],C=t[S],O=t[S+1],M=A-w,F=k-_,$=C-w,T=O-_,L=(M*T-F*$)*2;if(Math.abs(L)<1e-9){if(o===void 0){o=s=0;for(const I of n)o+=t[I*2],s+=t[I*2+1];o/=n.length,s/=n.length}const z=1e9*Math.sign((o-w)*T-(s-_)*$);b=(w+C)/2-z*T,v=(_+O)/2+z*$}else{const z=1/L,I=M*M+F*F,Q=$*$+T*T;b=w+(T*I-F*Q)*z,v=_+(M*Q-$*I)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Ss:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,g=Math.floor(d/3)*2,p=s[h],m=s[h+1],y=s[g],b=s[g+1];this._renderSegment(p,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Ss:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Ss:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new dy;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let g,p,m,y,b;if(l===0){if((g=this._clipSegment(o,s,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const SV=2*Math.PI,Sa=Math.pow;function _V(e){return e[0]}function AV(e){return e[1]}function $V(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function kV(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class p2{static from(t,n=_V,i=AV,r){return new p2("length"in t?CV(t,n,i,r):Float64Array.from(FV(t,n,i,r)))}constructor(t){this._delaunator=new Nh(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&$V(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const g=kV(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new Nh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new EV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=Sa(n-l[g*2],2)+Sa(i-l[g*2+1],2);if(p<f&&(f=p,c=g),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==g&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Ss:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Ss:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,SV)}return i&&i.value()}renderHull(t){const n=t==null?t=new Ss:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new dy;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Ss:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new dy;return this.renderTriangle(t,n),n.value()}}function CV(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*FV(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function m2(e){D.call(this,null,e)}m2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const TV=[-1e5,-1e5,1e5,1e5];G(m2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:TV;const o=this.value=p2.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!DV(u)?MV(u):null}return t.reflow(e.modified()).modifies(n)}});function MV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function DV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const OV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:m2},Symbol.toStringTag,{value:"Module"}));var o0=Math.PI/180,zl=64,Ad=2048;function RV(){var e=[256,256],t,n,i,r,o,s,a,u=SR,l=[],c=Math.random,f={};f.layout=function(){for(var g=d($o()),p=BV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:o(S),rotate:s(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,NV(g,E,x,b),E.hasText&&h(p,E,m)&&(v.push(E),m?PV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(zl<<5)/p,g.height=Ad/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,A;(w=x(S+=E))&&(_=~~w[0],A=~~w[1],!(Math.min(Math.abs(_),Math.abs(A))>=v));)if(p.x=y+_,p.y=b+A,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!LV(p,g,e[0]))&&(!m||IV(p,m))){for(var k=p.sprite,C=p.width>>5,O=e[0]>>5,M=p.x-(C<<4),F=M&127,$=32-F,T=p.y1-p.y0,L=(p.y+p.y0)*O+(M>>5),z,I=0;I<T;I++){z=0;for(var Q=0;Q<=C;Q++)g[L+Q]|=z<<$|(Q<C?(z=k[I*C+Q])>>>F:0);L+=O}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=is(g),f):n},f.fontStyle=function(g){return arguments.length?(r=is(g),f):r},f.fontWeight=function(g){return arguments.length?(o=is(g),f):o},f.rotate=function(g){return arguments.length?(s=is(g),f):s},f.text=function(g){return arguments.length?(t=is(g),f):t},f.spiral=function(g){return arguments.length?(u=UV[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=is(g),f):i},f.padding=function(g){return arguments.length?(a=is(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function NV(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(zl<<5)/o,Ad/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,g;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var p=Math.sin(t.rotate*o0),m=Math.cos(t.rotate*o0),y=c*m,b=c*p,v=d*m,x=d*p;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=zl<<5&&(s=0,a+=u,u=0),a+d>=Ad)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*o0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var E=r.getImageData(0,0,(zl<<5)/o,Ad/o).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var w=0,_=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var A=f*g+(h>>5),k=E[(a+g)*(zl<<5)+(s+h)<<2]?1<<31-h%32:0;S[A]|=k,w|=k}w?_=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function LV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function PV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function IV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function SR(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function zV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function BV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function is(e){return typeof e=="function"?e:function(){return e}}var UV={archimedean:SR,rectangular:zV};const _R=["x","y","font","fontSize","fontStyle","fontWeight","angle"],jV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function y2(e){D.call(this,RV(),e)}y2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_R}]};G(y2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return ge(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||jV.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||_R;let a=e.fontSize||14,u;if(ge(a)?u=e.fontSizeRange:a=Yt(a),u){const g=a,p=ke("sqrt")().domain(Qi(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[s[0]]=NaN,g[s[1]]=NaN,g[s[3]]=0});const l=o.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(ei).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[s[0]]=p.x+f,m[s[1]]=p.y+d,m[s[2]]=p.font,m[s[3]]=p.size,m[s[4]]=p.style,m[s[5]]=p.weight,m[s[6]]=p.rotate;return t.reflow(i).modifies(s)}});const qV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:y2},Symbol.toStringTag,{value:"Module"})),WV=e=>new Uint8Array(e),HV=e=>new Uint16Array(e),Ql=e=>new Uint32Array(e);function GV(){let e=8,t=[],n=Ql(0),i=Gf(0,e),r=Gf(0,e);return{data:()=>t,seen:()=>n=VV(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=Gf(o,e,i),r=Gf(o,e))}}}function VV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Gf(e,t,n){const i=(t<257?WV:t<65537?HV:Ql)(e);return n&&i.set(n),i}function dA(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function hA(){let e=Ql(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Ql(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=YV(h,d),c)g=t,p=e,t=Array(c+f),e=Ql(c+f),XV(l,g,p,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[XP(u,a[0],0,l),Ga(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function YV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),KI(e,t)}function XV(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function b2(e){D.call(this,GV(),e),this._indices=null,this._dims=null}b2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(b2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=hA()),o.push(dA(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,g={};let p,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!s[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(p=g[y])||(o[y]=m=hA(),g[y]=p=m.insert(w,t.source,0)),s[E]=dA(m,E,r[E]).onAdd(p,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=s[g].insert(a[h],i,d)),o[h].onAdd(p,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=g=o[h],o[h]=a,g!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],g=l[1],p=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=s[g],o[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=s[g],o[m]^=h,i.push(m);e.range=t.slice()}});function v2(e){D.call(this,null,e)}v2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(v2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if((r&n)===0)return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const KV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:b2,resolvefilter:v2},Symbol.toStringTag,{value:"Module"})),JV="RawCode",zs="Literal",QV="Property",ZV="Identifier",eY="ArrayExpression",tY="BinaryExpression",AR="CallExpression",nY="ConditionalExpression",iY="LogicalExpression",rY="MemberExpression",oY="ObjectExpression",sY="UnaryExpression";function ki(e){this.type=e}ki.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=aY(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function aY(e){switch(e.type){case eY:return e.elements;case tY:case iY:return[e.left,e.right];case AR:return[e.callee].concat(e.arguments);case nY:return[e.test,e.consequent,e.alternate];case rY:return[e.object,e.property];case oY:return e.properties;case QV:return[e.key,e.value];case sY:return[e.argument];case ZV:case zs:case JV:default:return[]}}var fr,ee,R,Ht,Me,rp=1,nf=2,Bs=3,Go=4,op=5,ia=6,gn=7,rf=8,uY=9;fr={};fr[rp]="Boolean";fr[nf]="<end>";fr[Bs]="Identifier";fr[Go]="Keyword";fr[op]="Null";fr[ia]="Numeric";fr[gn]="Punctuator";fr[rf]="String";fr[uY]="RegularExpression";var lY="ArrayExpression",cY="BinaryExpression",fY="CallExpression",dY="ConditionalExpression",$R="Identifier",hY="Literal",gY="LogicalExpression",pY="MemberExpression",mY="ObjectExpression",yY="Property",bY="UnaryExpression",ht="Unexpected token %0",vY="Unexpected number",xY="Unexpected string",wY="Unexpected identifier",EY="Unexpected reserved word",SY="Unexpected end of input",hy="Invalid regular expression",s0="Invalid regular expression: missing /",kR="Octal literals are not allowed in strict mode.",_Y="Duplicate data property in object literal not allowed in strict mode",kt="ILLEGAL",bc="Disabled.",AY=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$Y=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function sp(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ar(e){return e>=48&&e<=57}function x2(e){return"0123456789abcdefABCDEF".includes(e)}function Zl(e){return"01234567".includes(e)}function kY(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function vc(e){return e===10||e===13||e===8232||e===8233}function of(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&AY.test(String.fromCharCode(e))}function Lh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&$Y.test(String.fromCharCode(e))}const CY={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function CR(){for(;R<Ht;){const e=ee.charCodeAt(R);if(kY(e)||vc(e))++R;else break}}function gy(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<Ht&&x2(ee[R])?(i=ee[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},ht,kt);return String.fromCharCode(r)}function FY(){var e,t,n,i;for(e=ee[R],t=0,e==="}"&&_e({},ht,kt);R<Ht&&(e=ee[R++],!!x2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},ht,kt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function FR(){var e,t;for(e=ee.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!of(e.charCodeAt(0)))&&_e({},ht,kt),t=e);R<Ht&&(e=ee.charCodeAt(R),!!Lh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!Lh(e.charCodeAt(0)))&&_e({},ht,kt),t+=e);return t}function TY(){var e,t;for(e=R++;R<Ht;){if(t=ee.charCodeAt(R),t===92)return R=e,FR();if(Lh(t))++R;else break}return ee.slice(e,R)}function MY(){var e,t,n;return e=R,t=ee.charCodeAt(R)===92?FR():TY(),t.length===1?n=Bs:CY.hasOwnProperty(t)?n=Go:t==="null"?n=op:t==="true"||t==="false"?n=rp:n=Bs,{type:n,value:t,start:e,end:R}}function a0(){var e=R,t=ee.charCodeAt(R),n,i=ee[R],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:gn,value:String.fromCharCode(t),start:e,end:R};default:if(n=ee.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:gn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,ee.charCodeAt(R)===61&&++R,{type:gn,value:ee.slice(e,R),start:e,end:R}}}if(s=ee.substr(R,4),s===">>>=")return R+=4,{type:gn,value:s,start:e,end:R};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return R+=3,{type:gn,value:o,start:e,end:R};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:gn,value:r,start:e,end:R};if(r==="//"&&_e({},ht,kt),"<>=!+-*%&|^/".includes(i))return++R,{type:gn,value:i,start:e,end:R};_e({},ht,kt)}function DY(e){let t="";for(;R<Ht&&x2(ee[R]);)t+=ee[R++];return t.length===0&&_e({},ht,kt),of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function OY(e){let t="0"+ee[R++];for(;R<Ht&&Zl(ee[R]);)t+=ee[R++];return(of(ee.charCodeAt(R))||Ar(ee.charCodeAt(R)))&&_e({},ht,kt),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function gA(){var e,t,n;if(n=ee[R],sp(Ar(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=ee[R++],n=ee[R],e==="0"){if(n==="x"||n==="X")return++R,DY(t);if(Zl(n))return OY(t);n&&Ar(n.charCodeAt(0))&&_e({},ht,kt)}for(;Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="."){for(e+=ee[R++];Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="e"||n==="E")if(e+=ee[R++],n=ee[R],(n==="+"||n==="-")&&(e+=ee[R++]),Ar(ee.charCodeAt(R)))for(;Ar(ee.charCodeAt(R));)e+=ee[R++];else _e({},ht,kt);return of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseFloat(e),start:t,end:R}}function RY(){var e="",t,n,i,r,o=!1;for(t=ee[R],sp(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<Ht;)if(i=ee[R++],i===t){t="";break}else if(i==="\\")if(i=ee[R++],!i||!vc(i.charCodeAt(0)))switch(i){case"u":case"x":ee[R]==="{"?(++R,e+=FY()):e+=gy(i);break;case"n":e+=`
8
8
  `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:Zl(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),R<Ht&&Zl(ee[R])&&(o=!0,r=r*8+"01234567".indexOf(ee[R++]),"0123".includes(i)&&R<Ht&&Zl(ee[R])&&(r=r*8+"01234567".indexOf(ee[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&ee[R]===`
9
9
  `&&++R;else{if(vc(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},ht,kt),{type:rf,value:e,octal:o,start:n,end:R}}function NY(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";_e({},hy)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},hy)}try{return new RegExp(e,t)}catch{return null}}function LY(){var e,t,n,i,r;for(e=ee[R],sp(e==="/","Regular expression literal must start with a slash"),t=ee[R++],n=!1,i=!1;R<Ht;)if(e=ee[R++],t+=e,e==="\\")e=ee[R++],vc(e.charCodeAt(0))&&_e({},s0),t+=e;else if(vc(e.charCodeAt(0)))_e({},s0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||_e({},s0),r=t.substr(1,t.length-2),{value:r,literal:t}}function PY(){var e,t,n;for(t="",n="";R<Ht&&(e=ee[R],!!Lh(e.charCodeAt(0)));)++R,e==="\\"&&R<Ht?_e({},ht,kt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},hy,n),{value:n,literal:t}}function IY(){var e,t,n,i;return Me=null,CR(),e=R,t=LY(),n=PY(),i=NY(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function zY(e){return e.type===Bs||e.type===Go||e.type===rp||e.type===op}function TR(){if(CR(),R>=Ht)return{type:nf,start:R,end:R};const e=ee.charCodeAt(R);return of(e)?MY():e===40||e===41||e===59?a0():e===39||e===34?RY():e===46?Ar(ee.charCodeAt(R+1))?gA():a0():Ar(e)?gA():a0()}function mn(){const e=Me;return R=e.end,Me=TR(),R=e.end,e}function MR(){const e=R;Me=TR(),R=e}function BY(e){const t=new ki(lY);return t.elements=e,t}function pA(e,t,n){const i=new ki(e==="||"||e==="&&"?gY:cY);return i.operator=e,i.left=t,i.right=n,i}function UY(e,t){const n=new ki(fY);return n.callee=e,n.arguments=t,n}function jY(e,t,n){const i=new ki(dY);return i.test=e,i.consequent=t,i.alternate=n,i}function w2(e){const t=new ki($R);return t.name=e,t}function Bl(e){const t=new ki(hY);return t.value=e.value,t.raw=ee.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function mA(e,t,n){const i=new ki(pY);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function qY(e){const t=new ki(mY);return t.properties=e,t}function yA(e,t,n){const i=new ki(yY);return i.key=t,i.value=n,i.kind=e,i}function WY(e,t){const n=new ki(bY);return n.operator=e,n.argument=t,n.prefix=!0,n}function _e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(sp(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=R,n.description=r,n}function ap(e){e.type===nf&&_e(e,SY),e.type===ia&&_e(e,vY),e.type===rf&&_e(e,xY),e.type===Bs&&_e(e,wY),e.type===Go&&_e(e,EY),_e(e,ht,e.value)}function Gt(e){const t=mn();(t.type!==gn||t.value!==e)&&ap(t)}function Be(e){return Me.type===gn&&Me.value===e}function u0(e){return Me.type===Go&&Me.value===e}function HY(){const e=[];for(R=Me.start,Gt("[");!Be("]");)Be(",")?(mn(),e.push(null)):(e.push(Us()),Be("]")||Gt(","));return mn(),BY(e)}function bA(){R=Me.start;const e=mn();return e.type===rf||e.type===ia?(e.octal&&_e(e,kR),Bl(e)):w2(e.value)}function GY(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bs)return n=bA(),Gt(":"),i=Us(),yA("init",n,i);if(e.type===nf||e.type===gn)ap(e);else return t=bA(),Gt(":"),i=Us(),yA("init",t,i)}function VY(){var e=[],t,n,i,r={},o=String;for(R=Me.start,Gt("{");!Be("}");)t=GY(),t.key.type===$R?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},_Y):r[i]=!0,e.push(t),Be("}")||Gt(",");return Gt("}"),qY(e)}function YY(){Gt("(");const e=E2();return Gt(")"),e}const XY={if:1};function KY(){var e,t,n;if(Be("("))return YY();if(Be("["))return HY();if(Be("{"))return VY();if(e=Me.type,R=Me.start,e===Bs||XY[Me.value])n=w2(mn().value);else if(e===rf||e===ia)Me.octal&&_e(Me,kR),n=Bl(mn());else{if(e===Go)throw new Error(bc);e===rp?(t=mn(),t.value=t.value==="true",n=Bl(t)):e===op?(t=mn(),t.value=null,n=Bl(t)):Be("/")||Be("/=")?(n=Bl(IY()),MR()):ap(mn())}return n}function JY(){const e=[];if(Gt("("),!Be(")"))for(;R<Ht&&(e.push(Us()),!Be(")"));)Gt(",");return Gt(")"),e}function QY(){R=Me.start;const e=mn();return zY(e)||ap(e),w2(e.value)}function ZY(){return Gt("."),QY()}function eX(){Gt("[");const e=E2();return Gt("]"),e}function tX(){var e,t,n;for(e=KY();;)if(Be("."))n=ZY(),e=mA(".",e,n);else if(Be("("))t=JY(),e=UY(e,t);else if(Be("["))n=eX(),e=mA("[",e,n);else break;return e}function vA(){const e=tX();if(Me.type===gn&&(Be("++")||Be("--")))throw new Error(bc);return e}function $d(){var e,t;if(Me.type!==gn&&Me.type!==Go)t=vA();else{if(Be("++")||Be("--"))throw new Error(bc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=mn(),t=$d(),t=WY(e.value,t);else{if(u0("delete")||u0("void")||u0("typeof"))throw new Error(bc);t=vA()}}return t}function xA(e){let t=0;if(e.type!==gn&&e.type!==Go)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function nX(){var e,t,n,i,r,o,s,a,u,l;if(e=Me,u=$d(),i=Me,r=xA(i),r===0)return u;for(i.prec=r,mn(),t=[e,Me],s=$d(),o=[u,i,s];(r=xA(Me))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=pA(a,u,s),o.push(n);i=mn(),i.prec=r,o.push(i),t.push(Me),n=$d(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=pA(o[l-1].value,o[l-2],n),l-=2;return n}function Us(){var e,t,n;return e=nX(),Be("?")&&(mn(),t=Us(),Gt(":"),n=Us(),e=jY(e,t,n)),e}function E2(){const e=Us();if(Be(","))throw new Error(bc);return e}function S2(e){ee=e,R=0,Ht=ee.length,Me=null,MR();const t=E2();if(Me.type!==nf)throw new Error("Unexpect token after expression.");return t}var DR={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function OR(e){function t(s,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,u){return l=>t(s,l,a,u)}const i="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&N("Missing arguments to clamp function."),s.length>3&&N("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&N("Missing arguments to if function."),s.length>3&&N("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function iX(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function RR(e){e=e||{};const t=e.allowed?xi(e.allowed):{},n=e.forbidden?xi(e.forbidden):{},i=e.constants||DR,r=(e.functions||OR)(f),o=e.globalvar,s=e.fieldvar,a=ge(o)?o:g=>`${o}["${g}"]`;let u={},l={},c=0;function f(g){if(K(g))return g;const p=d[g.type];return p==null&&N("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:J(n,p)?N("Illegal identifier: "+p):J(i,p)?i[p]:J(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===s&&(l[iX(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&N("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=J(r,p)&&r[p];return y||N("Unrecognized function: "+p),ge(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const wA=Symbol("vega_selection_getter");function NR(e){return(!e.getter||!e.getter[wA])&&(e.getter=Qn(e.field),e.getter[wA]=!0),e.getter}const _2="intersect",EA="union",rX="vlMulti",oX="vlPoint",SA="or",sX="and",ji="_vgsid_",xc=Qn(ji),aX="E",uX="R",lX="R-E",cX="R-LE",fX="R-RE",Ph="index:unit";function _A(e,t){for(var n=t.fields,i=t.values,r=n.length,o=0,s,a;o<r;++o)if(a=n[o],s=NR(a)(e),So(s)&&(s=Ut(s)),So(i[o])&&(i[o]=Ut(i[o])),P(i[o])&&So(i[o][0])&&(i[o]=i[o].map(Ut)),a.type===aX){if(P(i[o])?i[o].indexOf(s)<0:s!==i[o])return!1}else if(a.type===uX){if(!Ta(s,i[o]))return!1}else if(a.type===fX){if(!Ta(s,i[o],!0,!1))return!1}else if(a.type===lX){if(!Ta(s,i[o],!1,!1))return!1}else if(a.type===cX&&!Ta(s,i[o],!1,!0))return!1;return!0}function dX(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[Ph]&&i[Ph].value:void 0,s=n===_2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],o&&s){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=_A(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=_A(t,l),s^h)return h;return a&&s}const LR=ag(xc),hX=LR.left,gX=LR.right;function pX(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[Ph]&&i[Ph].value:void 0,s=n===_2,a=xc(t),u=hX(r,a);if(u===r.length||xc(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(gX(r,a)-u<o.size)return!1}return!0}function mX(e,t){return e.map(n=>he(t.fields?{values:t.fields.map(i=>NR(i)(n.datum))}:{[ji]:xc(n.datum)},t))}function yX(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,g,p,m,y,b,v=o.length,x=0,E,S;x<v;++x)if(l=o[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)h=c[E],p=s[h.field]||(s[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=l0[`${y}_union`],p[d]=b(m,X(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(X(f).reduce((w,_,A)=>(w[c[A].field]=_,w),{})))}else h=ji,g=xc(l),p=s[h]||(s[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[ji]:g}));if(t=t||EA,s[ji]?s[ji]=l0[`${ji}_${t}`](...Object.values(s[ji])):Object.keys(s).forEach(w=>{s[w]=Object.keys(s[w]).map(_=>s[w][_]).reduce((_,A)=>_===void 0?A:l0[`${u[w]}_${t}`](_,A))}),o=Object.keys(a),n&&o.length){const w=i?oX:rX;s[w]=t===EA?{[SA]:o.reduce((_,A)=>(_.push(...a[A]),_),[])}:{[sX]:o.map(_=>({[SA]:a[_]}))}}return s}var l0={[`${ji}_union`]:nz,[`${ji}_intersect`]:ez,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=Ut(t[0]),i=Ut(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=Ut(t[0]),i=Ut(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const bX=":",vX="@";function A2(e,t,n,i){t[0].type!==zs&&N("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&Ee(t).value,s="unit",a=vX+s,u=bX+r;o===_2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function PR(e){const t=this.context.data[e];return t?t.values.value:[]}function xX(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function wX(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Pn).insert(t)),1}function EX(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const sf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},SX=sf("format"),IR=sf("timeFormat"),_X=sf("utcFormat"),AX=sf("timeParse"),$X=sf("utcParse"),Vf=new Date(2e3,0,1);function up(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Vf.setYear(2e3),Vf.setMonth(e),Vf.setDate(t),IR.call(this,Vf,n))}function kX(e){return up.call(this,e,1,"%B")}function CX(e){return up.call(this,e,1,"%b")}function FX(e){return up.call(this,0,2+e,"%A")}function TX(e){return up.call(this,0,2+e,"%a")}const MX=":",DX="@",py="%",zR="$";function $2(e,t,n,i){t[0].type!==zs&&N("First argument to data functions must be a string literal.");const r=t[0].value,o=MX+r;if(!J(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function OX(e,t,n,i){t[0].type!==zs&&N("First argument to indata must be a string literal."),t[1].type!==zs&&N("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=DX+o;J(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function an(e,t,n,i){if(t[0].type===zs)AA(n,i,t[0].value);else for(e in n.scales)AA(n,i,e)}function AA(e,t,n){const i=py+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function dr(e,t){if(ge(e))return e;if(K(e)){const n=t.scales[e];return n&&J8(n.value)?n.value:void 0}}function RX(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=an,n._range=an,n._scale=an;const i=r=>"_["+(r.type===zs?H(py+r.value):H(py)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function k2(e,t){return function(n,i,r){if(n){const o=dr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const NX=k2("area",dq),LX=k2("bounds",mq),PX=k2("centroid",Eq);function IX(e,t){const n=dr(e,(t||this).context);return n&&n.scale()}function zX(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function C2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function BX(){return C2(this.context.dataflow,"warn",arguments)}function UX(){return C2(this.context.dataflow,"info",arguments)}function jX(){return C2(this.context.dataflow,"debug",arguments)}function c0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function my(e){const t=Rd(e),n=c0(t.r),i=c0(t.g),r=c0(t.b);return .2126*n+.7152*i+.0722*r}function qX(e,t){const n=my(e),i=my(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function WX(){const e=[].slice.call(arguments);return e.unshift({}),he(...e)}function BR(e,t){return e===t||e!==e&&t!==t?!0:P(e)?P(t)&&e.length===t.length?HX(e,t):!1:Y(e)&&Y(t)?UR(e,t):!1}function HX(e,t){for(let n=0,i=e.length;n<i;++n)if(!BR(e[n],t[n]))return!1;return!0}function UR(e,t){for(const n in e)if(!BR(e[n],t[n]))return!1;return!0}function $A(e){return t=>UR(e,t)}function GX(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,l=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=s.changeset(),c.stamp=l,s.runAfter(()=>{a.modified=!0,s.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Pn:P(n)||Eg(n)?n:$A(n),c.remove(f)),t&&c.insert(t),i&&(f=$A(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function VX(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function YX(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const kA={};function XX(e,t){const n=kA[t]||(kA[t]=Qn(t));return P(e)?e.map(n):n(e)}function F2(e){return P(e)||ArrayBuffer.isView(e)?e:null}function T2(e){return F2(e)||(K(e)?e:null)}function KX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return F2(e).join(...n)}function JX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).indexOf(...n)}function QX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).lastIndexOf(...n)}function ZX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).slice(...n)}function eK(e,t,n){return ge(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function tK(e){return F2(e).slice().reverse()}function nK(e,t,n){return qv(e||0,t||0,n||0)}function iK(e,t){const n=dr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function rK(e,t){const n=dr(e,(t||this).context);return n?n.copy():void 0}function oK(e,t){const n=dr(e,(t||this).context);return n?n.domain():[]}function sK(e,t,n){const i=dr(e,(n||this).context);return i?P(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function aK(e,t){const n=dr(e,(t||this).context);return n&&n.range?n.range():[]}function uK(e,t,n){const i=dr(e,(n||this).context);return i?i(t):void 0}function lK(e,t,n,i,r){e=dr(e,(r||this).context);const o=NM(t,n);let s=e.domain(),a=s[0],u=Ee(s),l=Vt;return u-a?l=SM(e,a,u):e=(e.interpolator?ke("sequential")().interpolator(e.interpolator()):ke("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(s=e.ticks(+i||15),a!==s[0]&&s.unshift(a),u!==Ee(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function cK(e,t,n){const i=dr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function fK(e){let t=null;return function(n){return n?fc(n,t=t||nu(e)):e}}const jR=e=>e.data;function qR(e,t){const n=PR.call(t,e);return n.root&&n.root.lookup||{}}function dK(e,t,n){const i=qR(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(jR):void 0}function hK(e,t){const n=qR(e,this)[t];return n?n.ancestors().map(jR):void 0}const WR=()=>typeof window<"u"&&window||null;function gK(){const e=WR();return e?e.screen:{}}function pK(){const e=WR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function mK(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function HR(e,t,n){if(!e)return[];const[i,r]=e,o=new it().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return DD(s,o,yK(t))}function yK(e){let t=null;if(e){const n=X(e.marktype),i=X(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function bK(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=X(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function vK(e){return X(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function xK(e,t,n){const{x:i,y:r,mark:o}=n,s=new it().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<s.x1&&(s.x1=u),u>s.x2&&(s.x2=u),l<s.y1&&(s.y1=l),l>s.y2&&(s.y2=l);return s.translate(i,r),HR([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>wK(u.x,u.y,t))}function wK(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[s,a]=n[o],[u,l]=n[r];l>t!=a>t&&e<(s-u)*(t-l)/(a-l)+u&&i++}return i&1}const wc={random(){return ei()},cumulativeNormal:kg,cumulativeLogNormal:Gb,cumulativeUniform:Kb,densityNormal:Ub,densityLogNormal:Hb,densityUniform:Xb,quantileNormal:Cg,quantileLogNormal:Vb,quantileUniform:Jb,sampleNormal:$g,sampleLogNormal:Wb,sampleUniform:Yb,isArray:P,isBoolean:Wo,isDate:So,isDefined(e){return e!==void 0},isNumber:Ae,isObject:Y,isRegExp:kC,isString:K,isTuple:Eg,isValid(e){return e!=null&&e===e},toBoolean:Eb,toDate(e){return Sb(e)},toNumber:Ut,toString:_b,indexof:JX,join:KX,lastindexof:QX,replace:eK,reverse:tK,slice:ZX,flush:AC,lerp:CC,merge:WX,pad:MC,peek:Ee,pluck:XX,span:Nc,inrange:Ta,truncate:DC,rgb:Rd,lab:Vd,hcl:Yd,hsl:e1,luminance:my,contrast:qX,sequence:Mn,format:SX,utcFormat:_X,utcParse:$X,utcOffset:rF,utcSequence:aF,timeFormat:IR,timeParse:AX,timeOffset:iF,timeSequence:sF,timeUnitSpecifier:GC,monthFormat:kX,monthAbbrevFormat:CX,dayFormat:FX,dayAbbrevFormat:TX,quarter:wC,utcquarter:EC,week:YC,utcweek:JC,dayofyear:VC,utcdayofyear:KC,warn:BX,info:UX,debug:jX,extent(e){return Qi(e)},inScope:zX,intersect:HR,clampRange:SC,pinchDistance:VX,pinchAngle:YX,screen:gK,containerSize:mK,windowSize:pK,bandspace:nK,setdata:wX,pathShape:fK,panLinear:yC,panLog:bC,panPow:vC,panSymlog:xC,zoomLinear:mb,zoomLog:yb,zoomPow:Ld,zoomSymlog:bb,encode:EX,modify:GX,lassoAppend:bK,lassoPath:vK,intersectLasso:xK},EK=["view","item","group","xy","x","y"],SK="event.vega.",GR="this.",M2={},VR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(zR+e)}]`,functions:_K,constants:DR,visitors:M2},yy=RR(VR);function _K(e){const t=OR(e);EK.forEach(n=>t[n]=SK+n);for(const n in wc)t[n]=GR+n;return he(t,RX(e,wc,M2)),t}function nt(e,t,n){return arguments.length===1?wc[e]:(wc[e]=t,n&&(M2[e]=n),yy&&(yy.functions[e]=GR+e),this)}nt("bandwidth",iK,an);nt("copy",rK,an);nt("domain",oK,an);nt("range",aK,an);nt("invert",sK,an);nt("scale",uK,an);nt("gradient",lK,an);nt("geoArea",NX,an);nt("geoBounds",LX,an);nt("geoCentroid",PX,an);nt("geoShape",cK,an);nt("geoScale",IX,an);nt("indata",xX,OX);nt("data",PR,$2);nt("treePath",dK,$2);nt("treeAncestors",hK,$2);nt("vlSelectionTest",dX,A2);nt("vlSelectionIdTest",pX,A2);nt("vlSelectionResolve",yX,A2);nt("vlSelectionTuples",mX);function ir(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=S2(e)}catch{N("Expression parse error: "+e)}i.visit(o=>{if(o.type!==AR)return;const s=o.callee.name,a=VR.visitors[s];a&&a(s,o.arguments,t,n)});const r=yy(i);return r.globals.forEach(o=>{const s=zR+o;!J(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:he({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function AK(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const $K=xi(["rule"]),CA=xi(["group","image","rect"]);function kK(e,t){let n="";return $K[t]||(e.x2&&(e.x?(CA[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(CA[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function D2(e){return(e+"").toLowerCase()}function CK(e){return D2(e)==="operator"}function FK(e){return D2(e)==="collect"}function fl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function TK(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
10
10
  : (u > v || v == null) && u != null ? ${i}