Socket
Socket
Sign inDemoInstall

vega-scenegraph

Package Overview
Dependencies
6
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.9.0 to 4.9.1

2

build/vega-scenegraph.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("d3-shape"),require("d3-path"),require("vega-canvas"),require("vega-loader"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-shape","d3-path","vega-canvas","vega-loader","vega-scale"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={},t.vega,t.d3,t.d3,t.vega,t.vega,t.vega)}(this,(function(t,e,n,i,r,s,o){"use strict";var a=0;function l(t){return t&&t.gradient}function c(t,e,n){let i=t.id,r=t.gradient,s="radial"===r?"p_":"";return i||(i=t.id="gradient_"+a++,"radial"===r?(t.x1=h(t.x1,.5),t.y1=h(t.y1,.5),t.r1=h(t.r1,0),t.x2=h(t.x2,.5),t.y2=h(t.y2,.5),t.r2=h(t.r2,.5),s="p_"):(t.x1=h(t.x1,0),t.y1=h(t.y1,0),t.x2=h(t.x2,1),t.y2=h(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+s+i+")"}function h(t,e){return null!=t?t:e}const u={basis:{curve:n.curveBasis},"basis-closed":{curve:n.curveBasisClosed},"basis-open":{curve:n.curveBasisOpen},bundle:{curve:n.curveBundle,tension:"beta",value:.85},cardinal:{curve:n.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:n.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:n.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:n.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:n.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:n.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:n.curveLinear},"linear-closed":{curve:n.curveLinearClosed},monotone:{horizontal:n.curveMonotoneY,vertical:n.curveMonotoneX},natural:{curve:n.curveNatural},step:{curve:n.curveStep},"step-after":{curve:n.curveStepAfter},"step-before":{curve:n.curveStepBefore}};function d(t,n,i){var r=e.hasOwnProperty(u,t)&&u[t],s=null;return r&&(s=r.curve||r[n||"vertical"],r.tension&&null!=i&&(s=s[r.tension](i))),s}const f={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},p=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function g(t){let e,n,i,r,s,o,a,l,c,h,u,d=[];for(e=t.slice().replace(p[0],"###$1").split(p[1]).slice(1),l=0,h=e.length;l<h;++l){for(n=e[l],i=n.slice(1).trim().replace(p[2],"$1###$2").replace(p[3],"$1###$2").split(p[4]),o=n.charAt(0),r=[o],c=0,u=i.length;c<u;++c)(s=+i[c])===s&&r.push(s);if(a=f[o.toLowerCase()],r.length-1>a){let t=1,e=r.length;for(d.push([o].concat(r.slice(t,t+=a))),o="M"===o?"L":"m"===o?"l":o;t<e;t+=a)d.push([o].concat(r.slice(t,t+a)))}else d.push(r)}return d}const v=Math.PI/180,y=Math.PI/2,m=2*Math.PI,x=Math.sqrt(3)/2;var _={},b={},k=[].join;function w(t){var e=k.call(t);if(b[e])return b[e];var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=c*o,u=-l*a,d=l*o,f=c*a,p=Math.cos(r),g=Math.sin(r),v=Math.cos(s),y=Math.sin(s),m=.5*(s-r),x=Math.sin(.5*m),_=8/3*x*x/Math.sin(m),w=n+p-_*g,T=i+g+_*p,M=n+v,C=i+y,R=M+_*y,A=C-_*v;return b[e]=[h*w+u*T,d*w+f*T,h*R+u*A,d*R+f*A,h*M+u*C,d*M+f*C]}var T=["l",0,0,0,0,0,0,0];function M(t,e,n){var i=T[0]=t[0];if("a"===i||"A"===i)T[1]=e*t[1],T[2]=n*t[2],T[3]=t[3],T[4]=t[4],T[5]=t[5],T[6]=e*t[6],T[7]=n*t[7];else if("h"===i||"H"===i)T[1]=e*t[1];else if("v"===i||"V"===i)T[1]=n*t[1];else for(var r=1,s=t.length;r<s;++r)T[r]=(r%2==1?e:n)*t[r];return T}function C(t,e,n,i,r,s){var o,a,l,c,h,u=null,d=0,f=0,p=0,g=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==s&&(s=r),t.beginPath&&t.beginPath();for(var v=0,y=e.length;v<y;++v){switch(o=e[v],1===r&&1===s||(o=M(o,r,s)),o[0]){case"l":d+=o[1],f+=o[2],t.lineTo(d+n,f+i);break;case"L":d=o[1],f=o[2],t.lineTo(d+n,f+i);break;case"h":d+=o[1],t.lineTo(d+n,f+i);break;case"H":d=o[1],t.lineTo(d+n,f+i);break;case"v":f+=o[1],t.lineTo(d+n,f+i);break;case"V":f=o[1],t.lineTo(d+n,f+i);break;case"m":d+=o[1],f+=o[2],t.moveTo(d+n,f+i);break;case"M":d=o[1],f=o[2],t.moveTo(d+n,f+i);break;case"c":a=d+o[5],l=f+o[6],p=d+o[3],g=f+o[4],t.bezierCurveTo(d+o[1]+n,f+o[2]+i,p+n,g+i,a+n,l+i),d=a,f=l;break;case"C":d=o[5],f=o[6],p=o[3],g=o[4],t.bezierCurveTo(o[1]+n,o[2]+i,p+n,g+i,d+n,f+i);break;case"s":a=d+o[3],l=f+o[4],p=2*d-p,g=2*f-g,t.bezierCurveTo(p+n,g+i,d+o[1]+n,f+o[2]+i,a+n,l+i),p=d+o[1],g=f+o[2],d=a,f=l;break;case"S":a=o[3],l=o[4],p=2*d-p,g=2*f-g,t.bezierCurveTo(p+n,g+i,o[1]+n,o[2]+i,a+n,l+i),d=a,f=l,p=o[1],g=o[2];break;case"q":a=d+o[3],l=f+o[4],p=d+o[1],g=f+o[2],t.quadraticCurveTo(p+n,g+i,a+n,l+i),d=a,f=l;break;case"Q":a=o[3],l=o[4],t.quadraticCurveTo(o[1]+n,o[2]+i,a+n,l+i),d=a,f=l,p=o[1],g=o[2];break;case"t":a=d+o[1],l=f+o[2],null===u[0].match(/[QqTt]/)?(p=d,g=f):"t"===u[0]?(p=2*d-c,g=2*f-h):"q"===u[0]&&(p=2*d-p,g=2*f-g),c=p,h=g,t.quadraticCurveTo(p+n,g+i,a+n,l+i),f=l,p=(d=a)+o[1],g=f+o[2];break;case"T":a=o[1],l=o[2],p=2*d-p,g=2*f-g,t.quadraticCurveTo(p+n,g+i,a+n,l+i),d=a,f=l;break;case"a":R(t,d+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+d+n,o[7]+f+i]),d+=o[6],f+=o[7];break;case"A":R(t,d+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),d=o[6],f=o[7];break;case"z":case"Z":t.closePath()}u=o}}function R(t,e,n,i){for(var r=function(t,e,n,i,r,s,o,a,l){var c=k.call(arguments);if(_[c])return _[c];var h=o*v,u=Math.sin(h),d=Math.cos(h),f=d*(a-t)*.5+u*(l-e)*.5,p=d*(l-e)*.5-u*(a-t)*.5,g=f*f/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);g>1&&(n*=g=Math.sqrt(g),i*=g);var x=d/n,b=u/n,w=-u/i,T=d/i,M=x*a+b*l,C=w*a+T*l,R=x*t+b*e,A=w*t+T*e,z=1/((R-M)*(R-M)+(A-C)*(A-C))-.25;z<0&&(z=0);var P=Math.sqrt(z);s==r&&(P=-P);var S=.5*(M+R)-P*(A-C),L=.5*(C+A)+P*(R-M),O=Math.atan2(C-L,M-S),N=Math.atan2(A-L,R-S)-O;N<0&&1===s?N+=m:N>0&&0===s&&(N-=m);for(var q=Math.ceil(Math.abs(N/(y+.001))),D=[],E=0;E<q;++E){var I=O+E*N/q,V=O+(E+1)*N/q;D[E]=[S,L,I,V,n,i,u,d]}return _[c]=D}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),s=0;s<r.length;++s){var o=w(r[s]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var A=.5773502691896257,z={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,m)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,s=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-s),t.lineTo(r,-s),t.lineTo(0,-n),t.lineTo(-r,-s),t.lineTo(-i,-s),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n,r=i-n*A,s=n/4;t.moveTo(0,-i-r),t.lineTo(-s,i-r),t.lineTo(s,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n,r=i-n*A;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=x*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function P(t){return e.hasOwnProperty(z,t)?z[t]:function(t){if(!e.hasOwnProperty(S,t)){var n=g(t);S[t]={draw:function(t,e){C(t,n,0,0,Math.sqrt(e)/2)}}}return S[t]}(t)}var S={};const L=.448084975506;function O(t){return t.x}function N(t){return t.y}function q(t){return t.width}function D(t){return t.height}function E(t){return"function"==typeof t?t:()=>+t}function I(t,e,n){return Math.max(e,Math.min(t,n))}function V(){var t=O,e=N,n=q,r=D,s=E(0),o=s,a=s,l=s,c=null;function h(h,u,d){var f,p=null!=u?u:+t.call(this,h),g=null!=d?d:+e.call(this,h),v=+n.call(this,h),y=+r.call(this,h),m=Math.min(v,y)/2,x=I(+s.call(this,h),0,m),_=I(+o.call(this,h),0,m),b=I(+a.call(this,h),0,m),k=I(+l.call(this,h),0,m);if(c||(c=f=i.path()),x<=0&&_<=0&&b<=0&&k<=0)c.rect(p,g,v,y);else{var w=p+v,T=g+y;c.moveTo(p+x,g),c.lineTo(w-_,g),c.bezierCurveTo(w-L*_,g,w,g+L*_,w,g+_),c.lineTo(w,T-k),c.bezierCurveTo(w,T-L*k,w-L*k,T,w-k,T),c.lineTo(p+b,T),c.bezierCurveTo(p+L*b,T,p,T-L*b,p,T-b),c.lineTo(p,g+x),c.bezierCurveTo(p,g+L*x,p+L*x,g,p+x,g),c.closePath()}if(f)return c=null,f+""||null}return h.x=function(e){return arguments.length?(t=E(e),h):t},h.y=function(t){return arguments.length?(e=E(t),h):e},h.width=function(t){return arguments.length?(n=E(t),h):n},h.height=function(t){return arguments.length?(r=E(t),h):r},h.cornerRadius=function(t,e,n,i){return arguments.length?(s=E(t),o=null!=e?E(e):s,l=null!=n?E(n):s,a=null!=i?E(i):o,h):s},h.context=function(t){return arguments.length?(c=null==t?null:t,h):c},h}function B(){var t,e,n,r,s,o,a,l,c=null;function h(t,e,n){var i=n/2;if(s){var r=a-e,h=t-o;if(r||h){var u=Math.sqrt(r*r+h*h),d=(r/=u)*l,f=(h/=u)*l,p=Math.atan2(h,r);c.moveTo(o-d,a-f),c.lineTo(t-r*i,e-h*i),c.arc(t,e,i,p-Math.PI,p),c.lineTo(o+d,a+f),c.arc(o,a,l,p,p+Math.PI)}else c.arc(t,e,i,0,m);c.closePath()}else s=1;o=t,a=e,l=i}function u(o){var a,l,u,d=o.length,f=!1;for(null==c&&(c=u=i.path()),a=0;a<=d;++a)!(a<d&&r(l=o[a],a,o))===f&&(f=!f)&&(s=0),f&&h(+t(l,a,o),+e(l,a,o),+n(l,a,o));if(u)return c=null,u+""||null}return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(t){return arguments.length?(e=t,u):e},u.size=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(r=t,u):r},u.context=function(t){return arguments.length?(c=null==t?null:t,u):c},u}function $(t,e){return null!=t?t:e}const H=t=>t.x||0,j=t=>t.y||0,G=t=>!(!1===t.defined),W=n.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),X=n.area().x(H).y1(j).y0(t=>(t.y||0)+(t.height||0)).defined(G),U=n.area().y(j).x1(H).x0(t=>(t.x||0)+(t.width||0)).defined(G),F=n.line().x(H).y(j).defined(G),Y=V().x(H).y(j).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>$(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>$(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>$(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>$(t.cornerRadiusBottomLeft,t.cornerRadius)||0),J=n.symbol().type(t=>P(t.shape||"circle")).size(t=>$(t.size,64)),Q=B().x(H).y(j).defined(G).size(t=>t.size||1);function Z(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function K(t,e,n,i){return Y.context(t)(e,n,i)}var tt=1;function et(){tt=1}function nt(t,n,i){var r=n.clip,s=t._defs,o=n.clip_id||(n.clip_id="clip"+tt++),a=s.clipping[o]||(s.clipping[o]={id:o});return e.isFunction(r)?a.path=r(null):Z(i)?a.path=K(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+o+")"}function it(t){this.clear(),t&&this.union(t)}function rt(t){this.mark=t,this.bounds=this.bounds||new it}function st(t){rt.call(this,t),this.items=this.items||[]}function ot(t){this._pending=0,this._loader=t||s.loader()}function at(t){t._pending+=1}function lt(t){t._pending-=1}function ct(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}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(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,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(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const i=this.rotatedPoints(t,e,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(t,e,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,h=n-e*l-n*a;return[a*i-l*r+c,l*i+a*r+h,a*i-l*o+c,l*i+a*o+h,a*s-l*r+c,l*s+a*r+h,a*s-l*o+c,l*s+a*o+h]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},e.inherits(st,rt),ot.prototype={pending(){return this._pending},sanitizeURL(t){var e=this;return at(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return lt(e),t})).catch((function(){return lt(e),null}))},loadImage(t){const n=this,i=r.image();return at(n),n._loader.sanitize(t,{context:"image"}).then((function(t){const r=t.href;if(!r||!i)throw{url:r};const s=new i,o=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(s.crossOrigin=o),s.onload=()=>lt(n),s.onerror=()=>lt(n),s.src=r,s})).catch((function(t){return lt(n),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},ready(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))}};const ht=m-1e-8;let ut,dt,ft,pt,gt,vt,yt,mt;const xt=(t,e)=>ut.add(t,e),_t=(t,e)=>xt(dt=t,ft=e),bt=t=>xt(t,ut.y1),kt=t=>xt(ut.x1,t),wt=(t,e)=>gt*t+yt*e,Tt=(t,e)=>vt*t+mt*e,Mt=(t,e)=>xt(wt(t,e),Tt(t,e)),Ct=(t,e)=>_t(wt(t,e),Tt(t,e));function Rt(t,e){return ut=t,e?(pt=e*v,gt=mt=Math.cos(pt),vt=Math.sin(pt),yt=-vt):(gt=mt=1,pt=vt=yt=0),At}const At={beginPath(){},closePath(){},moveTo:Ct,lineTo:Ct,rect(t,e,n,i){pt?(Mt(t+n,e),Mt(t+n,e+i),Mt(t,e+i),Ct(t,e)):(xt(t+n,e+i),_t(t,e))},quadraticCurveTo(t,e,n,i){const r=wt(t,e),s=Tt(t,e),o=wt(n,i),a=Tt(n,i);zt(dt,r,o,bt),zt(ft,s,a,kt),_t(o,a)},bezierCurveTo(t,e,n,i,r,s){const o=wt(t,e),a=Tt(t,e),l=wt(n,i),c=Tt(n,i),h=wt(r,s),u=Tt(r,s);Pt(dt,o,l,h,bt),Pt(ft,a,c,u,kt),_t(h,u)},arc(t,e,n,i,r,s){if(i+=pt,r+=pt,dt=n*Math.cos(r)+t,ft=n*Math.sin(r)+e,Math.abs(r-i)>ht)xt(t-n,e-n),xt(t+n,e+n);else{const o=i=>xt(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(o(i),o(r),r!==i)if((i%=m)<0&&(i+=m),(r%=m)<0&&(r+=m),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=m,a=i-i%y,l=0;l<4&&a>r;++l,a-=y)o(a);else for(a=i-i%y+y,l=0;l<4&&a<r;++l,a+=y)o(a)}}};function zt(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function Pt(t,e,n,i,r){const s=i-t+3*e-3*n,o=t+n-2*e,a=t-e;let l,c=0,h=0;Math.abs(s)>1e-14?(l=o*o+a*s,l>=0&&(l=Math.sqrt(l),c=(-o+l)/s,h=(-o-l)/s)):c=.5*a/o,0<c&&c<1&&r(St(c,t,e,n,i)),0<h&&h<1&&r(St(h,t,e,n,i))}function St(t,e,n,i,r){const s=1-t,o=s*s,a=t*t;return o*s*e+3*o*t*n+3*s*a*i+a*t*r}var Lt=(Lt=r.canvas(1,1))?Lt.getContext("2d"):null;const Ot=new it;function Nt(t){return function(e,n){if(!Lt)return!0;t(Lt,e),Ot.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=Ot;for(let t=r;t<=o;++t)for(let e=i;e<=s;++e)if(Lt.isPointInPath(e,t))return!0;return!1}}function qt(t,e){return e.contains(t.x||0,t.y||0)}function Dt(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,s=t.height||0;return e.intersects(Ot.set(n,i,n+r,i+s))}function Et(t,e){const n=t.x||0,i=t.y||0;return It(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function It(t,e,n,i,r){const{x1:s,y1:o,x2:a,y2:l}=t,c=i-e,h=r-n;let u,d,f,p,g=0,v=1;for(p=0;p<4;++p){if(0===p&&(u=-c,d=-(s-e)),1===p&&(u=c,d=a-e),2===p&&(u=-h,d=-(o-n)),3===p&&(u=h,d=l-n),Math.abs(u)<1e-10&&d<0)return!1;if(f=d/u,u<0){if(f>v)return!1;f>g&&(g=f)}else if(u>0){if(f<g)return!1;f<v&&(v=f)}}return!0}function Vt(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Bt(t,e){return null==t?e:t}function $t(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Ht(t,e,n){return l(n)?function(t,e,n){const i=n.width(),s=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+Bt(e.x1,.5)*i,n.y1+Bt(e.y1,.5)*s,Math.max(i,s)*Bt(e.r1,0),n.x1+Bt(e.x2,.5)*i,n.y1+Bt(e.y2,.5)*s,Math.max(i,s)*Bt(e.r2,.5));else{const a=Bt(e.x1,0),l=Bt(e.y1,0),c=Bt(e.x2,1),h=Bt(e.y2,0);if(a!==c&&l!==h&&i!==s){const n=r.canvas(Math.ceil(i),Math.ceil(s)),o=n.getContext("2d");return o.scale(i,s),o.fillStyle=$t(o.createLinearGradient(a,l,c,h),e.stops),o.fillRect(0,0,i,s),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*i,n.y1+l*s,n.x1+c*i,n.y1+h*s)}return $t(o,e.stops)}(t,n,e.bounds):n}function jt(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Ht(t,e,e.fill),!0)}var Gt=[];function Wt(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Ht(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Gt),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Xt(t,e){return t.zindex-e.zindex||t.index-e.index}function Ut(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,s=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&s.push(e);return t.zdirty=!1,t.zitems=s.sort(Xt)}function Ft(t,e){var n,i,r=t.items;if(r&&r.length){var s=Ut(t);if(s&&s.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=s}for(n=0,i=r.length;n<i;++n)e(r[n])}}function Yt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var s=Ut(t);for(s&&s.length&&(r=s),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===s)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Jt(t){return function(e,n,i){Ft(n,(function(n){i&&!i.intersects(n.bounds)||Zt(t,e,n,n)}))}}function Qt(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Zt(t,e,n.items[0],n.items)}}function Zt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Vt(e,n),n.fill&&jt(e,n,r)&&e.fill(),n.stroke&&Wt(e,n,r)&&e.stroke()))}function Kt(t){return t=t||e.truthy,function(e,n,i,r,s,o){return i*=e.pixelRatio,r*=e.pixelRatio,Yt(n,(function(n){var a=n.bounds;if((!a||a.contains(s,o))&&a)return t(e,n,i,r,s,o)?n:void 0}))}}function te(t,e){return function(n,i,r,s){var o,a,l=Array.isArray(i)?i[0]:i,c=null==e?l.fill:e,h=l.stroke&&n.isPointInStroke;return h&&(o=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(c&&n.isPointInPath(r,s)||h&&n.isPointInStroke(r,s))}}function ee(t){return Kt(te(t))}function ne(t,e){return"translate("+t+","+e+")"}function ie(t){return"rotate("+t+")"}function re(t){return ne(t.x||0,t.y||0)}function se(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,s=n.angle||0;t.translate(i,r),s&&t.rotate(s*=v),t.beginPath(),e(t,n),s&&t.rotate(-s),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return ne(t.x||0,t.y||0)+(t.angle?" "+ie(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(Rt(t,n.angle),n),ct(t,n).translate(n.x||0,n.y||0)},draw:Jt(i),pick:ee(i),isect:n||Nt(i)}}var oe=se("arc",(function(t,e){return W.context(t)(e)}));function ae(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=te(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(Rt(t),i),ct(t,i[0]))},draw:Qt(i),pick:function(t,e,n,i,s,o){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(s,o)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:qt,tip:n}}var le=ae("area",(function(t,e){const n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?U:X).curve(d(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],s="horizontal"===t[0].orient?"y":"x",o=t.length,a=1/0;--o>=0;)!1!==t[o].defined&&(i=Math.abs(t[o][s]-r))<a&&(a=i,n=t[o]);return n}));function ce(t,e){t.beginPath(),Z(e)?K(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function he(t){const e=Bt(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function ue(t,e){const n=he(e);t("d",K(null,e,n,n))}function de(t,e,n,i){const r=he(e);t.beginPath(),K(t,e,(n||0)+r,(i||0)+r)}const fe=te(de),pe=te(de,!1),ge=te(de,!0);var ve={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",re(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e<i;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),ct(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){Ft(e,e=>{const i=e.x||0,r=e.y||0,s=e.strokeForeground,o=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&o&&(de(t,e,i,r),Vt(t,e),e.fill&&jt(t,e,o)&&t.fill(),e.stroke&&!s&&Wt(t,e,o)&&t.stroke()),t.save(),t.translate(i,r),e.clip&&ce(t,e),n&&n.translate(-i,-r),Ft(e,e=>{this.draw(t,e,n)}),n&&n.translate(i,r),t.restore(),s&&e.stroke&&o&&(de(t,e,i,r),Vt(t,e),Wt(t,e,o)&&t.stroke())})},pick:function(t,e,n,i,r,s){if(e.bounds&&!e.bounds.contains(r,s)||!e.items)return null;const o=n*t.pixelRatio,a=i*t.pixelRatio;return Yt(e,l=>{let c,h,u,d,f,p,g,v,y;if(v=l.bounds,(!v||v.contains(r,s))&&(d=l.x||0,f=l.y||0,p=d+(l.width||0),g=f+(l.height||0),y=l.clip,!y||!(r<d||r>p||s<f||s>g)))return t.save(),t.translate(d,f),d=r-d,f=s-f,y&&Z(l)&&!ge(t,l,o,a)?(t.restore(),null):(h=l.strokeForeground,u=!1!==e.interactive,u&&h&&l.stroke&&pe(t,l,o,a)?(t.restore(),l):(c=Yt(l,t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,f)?this.pick(t,n,i,d,f):null),!c&&u&&(l.fill||!h&&l.stroke)&&fe(t,l,o,a)&&(c=l),t.restore(),c||null))})},isect:Dt,content:function(t,e,n){t("clip-path",e.clip?nt(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),ue(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?ue(t,e):t("d","")}},ye={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function me(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function xe(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function _e(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function be(t,e){return"center"===t?e/2:"right"===t?e:0}function ke(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var we={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=me(e,n),r=xe(e,i),s=_e(e,i),o=(e.x||0)-be(e.align,r),a=(e.y||0)-ke(e.baseline,s);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",ye["xmlns:xlink"],"xlink:href"),t("transform",ne(o,a)),t("width",r),t("height",s),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=xe(e,n),r=_e(e,n),s=(e.x||0)-be(e.align,i),o=(e.y||0)-ke(e.baseline,r);return t.set(s,o,s+i,o+r)},draw:function(t,e,n){Ft(e,e=>{if(n&&!n.intersects(e.bounds))return;let i,r,s,o,a=me(e,this),l=xe(e,a),c=_e(e,a),h=(e.x||0)-be(e.align,l),u=(e.y||0)-ke(e.baseline,c);!1!==e.aspect&&(r=a.width/a.height,s=e.width/e.height,r==r&&s==s&&r!==s&&(s<r?(o=l/r,u+=(c-o)/2,c=o):(o=c*r,h+=(l-o)/2,l=o))),(a.complete||a.toDataURL)&&(Vt(t,e),t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(a,h,u,l,c))})},pick:Kt(),isect:e.truthy,get:me,xOffset:be,yOffset:ke},Te=ae("line",(function(t,e){const n=e[0],i=n.interpolate||"linear";return F.curve(d(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),s=t.length;--s>=0;)if(!1!==t[s].defined&&(n=t[s].x-e[0])*n+(i=t[s].y-e[1])*i<r)return t[s];return null}));function Me(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,s=e.scaleX||1,o=e.scaleY||1,a=(e.angle||0)*v,l=e.pathCache;l&&l.path===n||((e.pathCache=l=g(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),C(t,l,0,0,s,o),t.rotate(-a),t.translate(-i,-r)):C(t,l,i,r,s,o)}var Ce={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return ne(t.x||0,t.y||0)+(t.angle?" "+ie(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}(e)),t("d",e.path)},bound:function(t,e){return Me(Rt(t,e.angle),e)?t.set(0,0,0,0):ct(t,e,!0)},draw:Jt(Me),pick:ee(Me),isect:Nt(Me)};function Re(t,e){t.beginPath(),K(t,e)}var Ae={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",K(null,e))},bound:function(t,e){var n,i;return ct(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Jt(Re),pick:ee(Re),isect:Dt};function ze(t,e,n){var i,r,s,o;return!(!e.stroke||!Wt(t,e,n))&&(i=e.x||0,r=e.y||0,s=null!=e.x2?e.x2:i,o=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(s,o),!0)}var Pe={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",re(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return ct(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){Ft(e,(function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&ze(t,e,i)&&(Vt(t,e),t.stroke())}}))},pick:Kt((function(t,e,n,i){return!!t.isPointInStroke&&(ze(t,e,1)&&t.isPointInStroke(n,i))})),isect:Et},Se=se("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Le=se("symbol",(function(t,e){return J.context(t)(e)}),qt);const Oe=e.lruCache();var Ne={height:Be,measureWidth:Ie,estimateWidth:De,width:De,canvas:qe};function qe(t){Ne.width=t&&Lt?Ie:De}function De(t,e){return Ee(je(t,e),Be(t))}function Ee(t,e){return~~(.8*t.length*e)}function Ie(t,e){return Be(t)<=0||!(e=je(t,e))?0:Ve(e,We(t))}function Ve(t,e){const n=`(${e}) ${t}`;let i=Oe.get(n);return void 0===i&&(Lt.font=e,i=Lt.measureText(t).width,Oe.set(n,i)),i}function Be(t){return null!=t.fontSize?+t.fontSize||0:11}function $e(t){return null!=t.lineHeight?t.lineHeight:Be(t)+2}function He(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function je(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Ne.width===Ie){const e=We(t);return t=>Ve(t,e)}{const e=Be(t);return t=>Ee(t,e)}}(t);if(i(e)<n)return e;var r,s=t.ellipsis||"…",o="rtl"===t.dir,a=0,l=e.length;if(n-=i(s),o){for(;a<l;)r=a+l>>>1,i(e.slice(r))>n?a=r+1:l=r;return s+e.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(e.slice(0,r))<n?a=r:l=r-1;return e.slice(0,a)+s}(t,n):n}function Ge(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function We(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Be(t)+"px "+Ge(t,e)}function Xe(t){var e=t.baseline,n=Be(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*$e(t):"line-bottom"===e?.29*n-.5*$e(t):0)}qe(!0);var Ue={left:"start",center:"middle",right:"end"},Fe=new it;function Ye(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-y,n+=r*Math.cos(e),i+=r*Math.sin(e)),Fe.x1=n,Fe.y1=i,Fe}function Je(t,n,i){var r,s=Ne.height(n),o=n.align,a=Ye(n),l=a.x1,c=a.y1,h=n.dx||0,u=(n.dy||0)+Xe(n)-Math.round(.8*s),d=He(n);if(e.isArray(d)?(s+=$e(n)*(d.length-1),r=d.reduce((t,e)=>Math.max(t,Ne.width(n,e)),0)):r=Ne.width(n,d),"center"===o?h-=r/2:"right"===o&&(h-=r),t.set(h+=l,u+=c,h+r,u+s),n.angle&&!i)t.rotate(n.angle*v,l,c);else if(2===i)return t.rotatedPoints(n.angle*v,l,c);return t}var Qe={arc:oe,area:le,group:ve,image:we,line:Te,path:Ce,rect:Ae,rule:Pe,shape:Se,symbol:Le,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Xe(e),s=Ye(e),o=s.x1,a=s.y1,l=e.angle||0;t("text-anchor",Ue[e.align]||"start"),l?(n=ne(o,a)+" "+ie(l),(i||r)&&(n+=" "+ne(i,r))):n=ne(o+i,a+r),t("transform",n)},bound:Je,draw:function(t,n,i){Ft(n,(function(n){var r,s,o,a,l,c,h,u=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===u||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=We(n),t.textAlign=n.align||"left",s=(r=Ye(n)).x1,o=r.y1,n.angle&&(t.save(),t.translate(s,o),t.rotate(n.angle*v),s=o=0),s+=n.dx||0,o+=(n.dy||0)+Xe(n),c=He(n),Vt(t,n),e.isArray(c))for(l=$e(n),a=0;a<c.length;++a)h=je(n,c[a]),n.fill&&jt(t,n,u)&&t.fillText(h,s,o),n.stroke&&Wt(t,n,u)&&t.strokeText(h,s,o),o+=l;else h=je(n,c),n.fill&&jt(t,n,u)&&t.fillText(h,s,o),n.stroke&&Wt(t,n,u)&&t.strokeText(h,s,o);n.angle&&t.restore()}}))},pick:Kt((function(t,e,n,i,r,s){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var o=Ye(e),a=o.x1,l=o.y1,c=Je(Fe,e,1),h=-e.angle*v,u=Math.cos(h),d=Math.sin(h),f=u*r-d*s+(a-u*a+d*l),p=d*r+u*s+(l-d*a-u*l);return c.contains(f,p)})),isect:function(t,e){var n=Je(Fe,t,2);return It(e,n[0],n[1],n[2],n[3])||It(e,n[0],n[1],n[4],n[5])||It(e,n[4],n[5],n[6],n[7])||It(e,n[2],n[3],n[6],n[7])}},trail:ae("trail",(function(t,e){return Q.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Ze(t,e,n){var i=Qe[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new it),t,n)}var Ke={mark:null};function tn(t,e,n){var i,r,s,o,a=Qe[t.marktype],l=a.bound,c=t.items,h=c&&c.length;if(a.nested)return h?s=c[0]:(Ke.mark=t,s=Ke),o=Ze(s,l,n),e=e&&e.union(o)||o;if(e=e||t.bounds&&t.bounds.clear()||new it,h)for(i=0,r=c.length;i<r;++i)e.union(Ze(c[i],l,n));return t.bounds=e}var en=["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 nn(t,e){return JSON.stringify(t,en,e)}function rn(t){return function t(e){var n,i,r,s=e.marktype,o=e.items;if(o)for(i=0,r=o.length;i<r;++i)n=s?"mark":"group",o[i][n]=e,o[i].zindex&&(o[i][n].zdirty=!0),"group"===(s||n)&&t(o[i]);s&&tn(e);return e}("string"==typeof t?JSON.parse(t):t)}function sn(t){arguments.length?this.root=rn(t):(this.root=on({marktype:"group",name:"root",role:"frame"}),this.root.items=[new st(this.root)])}function on(t,e){const n={bounds:new it,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function an(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function ln(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function cn(t,e,n,i){var r,s=t.childNodes[e];return s&&s.tagName.toLowerCase()===n.toLowerCase()||(r=s||null,s=an(t.ownerDocument,n,i),t.insertBefore(s,r)),s}function hn(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function un(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function dn(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function fn(t,e){this._active=null,this._handlers={},this._loader=t||s.loader(),this._tooltip=e||pn}function pn(t,e,n,i){t.element().setAttribute("title",i||"")}function gn(t){this._el=null,this._bgcolor=null,this._loader=new ot(t)}sn.prototype={toJSON(t){return nn(this.root,t||0)},mark(t,e,n){var i=on(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},fn.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},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,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push.apply(n,e[this.eventName(t)]);else for(const t in e)n.push.apply(n,e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then(e=>{const n=new MouseEvent(t.type,t),i=an(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)}).catch((function(){}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,s,o=t&&t.mark;if(o&&(r=Qe[o.marktype]).tip){for((s=dn(e,n))[0]-=i[0],s[1]-=i[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=r.tip(o.items,s)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)a+=t.x||0,l+=t.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}},gn.prototype={initialize(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const vn="dragleave",yn="mousedown",mn="mousemove",xn="mouseout",_n="click",bn=["keydown","keypress","keyup","dragenter",vn,"dragover",yn,"mouseup",mn,xn,"mouseover",_n,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],kn=mn,wn=xn,Tn=_n;function Mn(t,e){fn.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Cn(t,e){(t=>"touchstart"===t||"touchmove"===t||"touchend"===t?["touchstart","touchmove","touchend"]:[t])(e).forEach(e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e))}function Rn(t,e,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r||(r&&r.exit||this.fire(n,i),this._active=s,this.fire(e,i)),this.fire(t,i)}}function An(t){return function(e){this.fire(t,e),this._active=null}}e.inherits(Mn,fn,{initialize(t,e,n){return this._canvas=t&&ln(t,"canvas"),[_n,yn,mn,xn,vn].forEach(t=>Cn(this,t)),fn.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:bn,DOMMouseScroll(t){this.fire("mousewheel",t)},mousemove:Rn(mn,"mouseover",xn),dragover:Rn("dragover","dragenter",vn),mouseout:An(xn),dragleave:An(vn),mousedown(t){this._down=this._active,this.fire(yn,t)},click(t){this._down===this._active&&(this.fire(_n,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},touchmove(t){this.fire("touchmove",t,!0)},touchend(t){this.fire("touchend",t,!0),this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===Tn&&i&&i.href?this.handleHref(e,i,i.href):t!==kn&&t!==wn||this.handleTooltip(e,i,t!==wn),r)for(let t=0,n=r.length;t<n;++t)r[t].handler.call(this._obj,e,i)},on(t,e){const n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(Cn(this,t),(i[n]||(i[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},pickEvent(t){const e=dn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const s=this.context();return Qe[t.marktype].pick.call(this,s,t,e,n,i,r)}});var zn="undefined"!=typeof window&&window.devicePixelRatio||1;function Pn(t){gn.call(this,t),this._options={},this._redraw=!1,this._dirty=new it,this._tempb=new it}const Sn=gn.prototype;function Ln(t,e){fn.call(this,t,e);const n=this;n._hrefHandler=On(n,(t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=On(n,(t,e)=>{n.handleTooltip(t,e,t.type!==wn)})}e.inherits(Pn,gn,{initialize(t,e,n,i,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:r.canvas(1,1,this._options.type),t&&this._canvas&&(hn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Sn.initialize.call(this,t,e,n,i,s)},resize(t,n,i,r){if(Sn.resize.call(this,t,n,i,r),this._canvas)!function(t,e,n,i,r,s){const o="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=o?zn:r;t.width=e*l,t.height=n*l;for(const t in s)a[t]=s[t];o&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||e.error("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.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){let e=this._tempb.clear().union(t.bounds),n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,s=this._dirty,o=(a=n,l=i,c=r,(new it).set(0,0,l,c).translate(-a[0],-a[1]));var a,l,c;e.save();const h=this._redraw||s.empty()?(this._redraw=!1,o.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(s),n);return this.clear(-n[0],-n[1],i,r),this.draw(e,t,h),e.restore(),s.clear(),this},draw(t,n,i){const r=Qe[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):ce(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},clear(t,e,n,i){const r=this._options,s=this.context();"pdf"===r.type||r.externalContext||s.clearRect(t,e,n,i),null!=this._bgcolor&&(s.fillStyle=this._bgcolor,s.fillRect(t,e,n,i))}});const On=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};e.inherits(Ln,fn,{initialize(t,e,n){let i=this._svg;return i&&(i.removeEventListener(Tn,this._hrefHandler),i.removeEventListener(kn,this._tooltipHandler),i.removeEventListener(wn,this._tooltipHandler)),this._svg=i=t&&ln(t,"svg"),i&&(i.addEventListener(Tn,this._hrefHandler),i.addEventListener(kn,this._tooltipHandler),i.addEventListener(wn,this._tooltipHandler)),fn.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:On(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const Nn=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),qn=e.toSet(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Dn={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?$n(t):null,r=t.context,s=r.scales[e.scale].value,a=r.dataflow.locale(),l=s.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${o.isDiscrete(l)?"discrete":l} scale with `+o.domainCaption(a,s,t)}},legend:{desc:"legend",caption:function(t){const n=t.datum,i=n.title?$n(t):null,r=((n.type||"")+" legend").trim(),s=n.scales,a=Object.keys(s),l=t.context,c=l.scales[s[a[0]]].value,h=l.dataflow.locale();return u=r,(u.length?u[0].toUpperCase()+u.slice(1):u)+(i?` titled '${i}'`:"")+" for "+function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+e.peek(t)}(a)+" with "+o.domainCaption(h,c,t);var u}},"title-text":{desc:"title",caption:t=>`Title text '${Bn(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Bn(t)}'`}},En={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function In(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in En)t(En[e],void 0);else{const n=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||n+" mark")}}function Vn(t){return!1===t.aria?{"aria-hidden":!0}:qn[t.role]?null:Dn[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return Nn(e.role||"graphics-symbol",e.desc,n.description||i(n))}catch(t){return null}}(t,Dn[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return Nn(n?"graphics-object":"graphics-symbol",e+" mark container",t.description)}(t)}function Bn(t){return e.array(t.text).join(" ")}function $n(t){try{return e.array(e.peek(t.items).items[0].text).join(" ")}catch(t){return null}}const Hn=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function jn(){let t="",e="",n="";const i=[],r=()=>e=n="",s=(t,n)=>{var i;return null!=n&&(e+=` ${t}="${i=n,Hn(i).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}"`),o},o={open(a,...l){(s=>{e&&(t+=`${e}>${n}`,r()),i.push(s)})(a),e="<"+a;for(const t of l)for(const e in t)s(e,t[e]);return o},close(){const s=i.pop();return t+=e?e+(n?`>${n}</${s}>`:"/>"):`</${s}>`,r(),o},attr:s,text:t=>(n+=Hn(t),o),toString:()=>t};return o}const Gn=t=>function t(e,n){if(e.open(n.tagName),n.hasAttributes()){const t=n.attributes,i=t.length;for(let n=0;n<i;++n)e.attr(t[n].name,t[n].value)}if(n.hasChildNodes()){const i=n.childNodes,r=i.length;for(let n=0;n<r;n++){const r=i[n];3===r.nodeType?e.text(r.nodeValue):t(e,r)}}return e.close()}(jn(),t)+"";const Wn={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",blend:"mix-blend-mode"},Xn={fill:"none","stroke-miterlimit":10},Un=ye.xmlns;function Fn(t){gn.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const Yn=gn.prototype;function Jn(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function Qn(t,e,n){let i,r,s;if("radial"===e.gradient){let i=cn(t,n++,"pattern",Un);si(i,{id:"p_"+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=cn(i,0,"rect",Un),si(i,{width:1,height:1,fill:`url(${ai()}#${e.id})`}),si(t=cn(t,n++,"radialGradient",Un),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else si(t=cn(t,n++,"linearGradient",Un),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,r=e.stops.length;i<r;++i)s=cn(t,i,"stop",Un),s.setAttribute("offset",e.stops[i].offset),s.setAttribute("stop-color",e.stops[i].color);return hn(t,i),n}function Zn(t,e,n){let i;return(t=cn(t,n,"clipPath",Un)).setAttribute("id",e.id),e.path?(i=cn(t,0,"path",Un),i.setAttribute("d",e.path)):(i=cn(t,0,"rect",Un),si(i,{x:0,y:0,width:e.width,height:e.height})),hn(t,1),n+1}function Kn(t,e,n,i,r){let s,o=t._svg;if(!o&&(s=e.ownerDocument,o=an(s,i,Un),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},"g"===i))){const e=an(s,"path",Un);o.appendChild(e),e.__data__=t;const n=an(s,"g",Un);o.appendChild(n),n.__data__=t;const i=an(s,"path",Un);o.appendChild(i),i.__data__=t,i.__values__={fill:"default"}}return(o.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}e.inherits(Fn,gn,{initialize(t,e,n,i,r){return this._defs={},this._clearDefs(),t&&(this._svg=cn(t,0,"svg",Un),si(this._svg,ye),this._svg.setAttribute("class","marks"),hn(t,1),this._root=cn(this._svg,0,"g",Un),si(this._root,Xn),hn(this._svg,1)),this.background(this._bgcolor),Yn.initialize.call(this,t,e,n,i,r)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),Yn.background.apply(this,arguments)},resize(t,e,n,i){return Yn.resize.call(this,t,e,n,i),this._svg&&(si(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,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=cn(t,0,"rect",Un),si(n,{width:this._width,height:this._height,fill:e}));const i=Gn(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),i},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),hn(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.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;let e,n,i,r,s,o,a,l=++this._dirtyID;for(s=0,o=t.length;s<o;++s)e=t[s],n=e.mark,n.marktype!==i&&(i=n.marktype,r=Qe[i]),n.zdirty&&n.dirty!==l&&(this._dirtyAll=!1,Jn(e,l),n.items.forEach((function(t){t.dirty=l}))),n.zdirty||(e.exit?(r.nested&&n.items.length?(a=n.items[0],a._svg&&this._update(r,a._svg,a)):e._svg&&(a=e._svg.parentNode,a&&a.removeChild(e._svg)),e._svg=null):(e=r.nested?n.items[0]:e,e._update!==l&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,Jn(e,l)),e._update=l)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;let i,r=this._svg,s=Qe[e.marktype],o=!1===e.interactive?"none":null,a="g"===s.tag,l=null,c=0;i=Kn(e,t,n,"g",r),i.setAttribute("class",un(e));const h=Vn(e);for(const t in h)oi(i,t,h[t]);a||oi(i,"pointer-events",o),oi(i,"clip-path",e.clip?nt(this,e,e.group):null);const u=t=>{const e=this.isDirty(t),n=Kn(t,i,l,s.tag,r);e&&(this._update(s,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let i,r=0;Ft(n,n=>{i=t.mark(e,n,i),++r}),hn(e,1+r)}(this,n,t)),l=n,++c};return s.nested?e.items.length&&u(e.items[0]):Ft(e,u),hn(i,c),i},_update(t,e,n){ti=e,ei=e.__values__,In(ii,n),t.attr(ii,n,this);const i=ni[t.type];i&&i.call(this,t,e,n),ti&&this.style(ti,n)},style(t,e){if(null!=e)for(const n in Wn){let i="font"===n?Ge(e):e[n];if(i===ei[n])continue;const r=Wn[n];null==i?t.removeAttribute(r):(l(i)&&(i=c(i,this._defs.gradient,ai())),t.setAttribute(r,i+"")),ei[n]=i}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=cn(t,1,"defs",Un)),i=Qn(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=cn(t,1,"defs",Un)),i=Zn(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):hn(n,i))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let ti=null,ei=null;const ni={group(t,e,n){const i=ti=e.childNodes[2];ei=i.__values__,t.foreground(ii,n,this),ei=e.__values__,ti=e.childNodes[1],t.content(ii,n,this);const r=ti=e.childNodes[0];t.background(ii,n,this);const s=!1===n.mark.interactive?"none":null;if(s!==ei.events&&(oi(i,"pointer-events",s),oi(r,"pointer-events",s),ei.events=s),n.strokeForeground&&n.stroke){const t=n.fill;oi(i,"display",null),this.style(r,n),oi(r,"stroke",null),t&&(n.fill=null),ei=i.__values__,this.style(i,n),t&&(n.fill=t),ti=null}else oi(i,"display","none")},image(t,e,n){!1===n.smooth?(ri(e,"image-rendering","optimizeSpeed"),ri(e,"image-rendering","pixelated")):ri(e,"image-rendering",null)},text(t,n,i){let r,s,o,a,l=He(i);e.isArray(l)?(s=l.map(t=>je(i,t)),r=s.join("\n"),r!==ei.text&&(hn(n,0),o=n.ownerDocument,a=$e(i),s.forEach((t,e)=>{const r=an(o,"tspan",Un);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),ei.text=r)):(s=je(i,l),s!==ei.text&&(n.textContent=s,ei.text=s)),oi(n,"font-family",Ge(i)),oi(n,"font-size",Be(i)+"px"),oi(n,"font-style",i.fontStyle),oi(n,"font-variant",i.fontVariant),oi(n,"font-weight",i.fontWeight)}};function ii(t,e,n){e!==ei[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(ti,t,e,n):oi(ti,t,e),ei[t]=e)}function ri(t,e,n){n!==ei[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),ei[e]=n)}function si(t,e){for(const n in e)oi(t,n,e[n])}function oi(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function ai(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function li(t){gn.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}e.inherits(li,gn,{svg(){return this._text},_render(t){const n=jn();n.open("svg",e.extend({},ye,{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&&"transparent"!==i&&"none"!==i&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",Xn,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this},mark(t,n){const i=Qe[n.marktype],r=i.tag,s=[In,i.attr];t.open("g",{class:un(n),"clip-path":n.clip?nt(this,n,n.group):null},Vn(n),{"pointer-events":"g"!==r&&!1===n.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(n,o,s,"g"!==r?r:null)),"text"===r){const n=He(o);if(e.isArray(n)){const e={x:0,dy:$e(o)};for(let i=0;i<n.length;++i)t.open("tspan",i?e:null).text(je(o,n[i])).close()}else t.text(je(o,n))}else if("g"===r){const e=o.strokeForeground,r=o.fill,s=o.stroke;e&&s&&(o.stroke=null),t.open("path",this.attr(n,o,i.background,"bgrect")).close(),t.open("g",this.attr(n,o,i.content)),Ft(o,e=>this.mark(t,e)),t.close(),e&&s?(r&&(o.fill=null),o.stroke=s,t.open("path",this.attr(n,o,i.foreground,"bgrect")).close(),r&&(o.fill=r)):t.open("path",this.attr(n,o,i.foreground,"bgfore")).close()}t.close(),a&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):Ft(n,o),t.close()},href(t){let e,n=t.href;if(n){if(e=this._hrefs&&this._hrefs[n])return e;this.sanitizeURL(n).then(t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[n]=t})}return null},attr(t,e,n,i){const r={},s=(t,e,n,i)=>{r[i||t]=e};return Array.isArray(n)?n.forEach(t=>t(s,e,this)):n(s,e,this),i&&function(t,e,n,i,r){if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===i&&(t["font-family"]=Ge(e),t["font-size"]=Be(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in Wn){let i=e[n];const s=Wn[n];("transparent"!==i||"fill"!==s&&"stroke"!==s)&&null!=i&&(l(i)&&(i=c(i,r.gradient,"")),t[s]=i)}}(r,e,t,i,this._defs),r},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const i=e[n],r=i.stops;"radial"===i.gradient?(t.open("pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e<r.length;++e)t.open("stop",{offset:r[e].offset,"stop-color":r[e].color}).close();t.close()}for(const e in n){const i=n[e];t.open("clipPath",{id:e}),i.path?t.open("path",{d:i.path}).close():t.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),t.close()}t.close()}}});var ci={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},hi={};function ui(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,s=t.marktype,o=r.length;let a=0;if("group"===s)for(;a<o;++a)di(r[a],e,n,i);else for(const t=Qe[s].isect;a<o;++a){let n=r[a];fi(n,e,t)&&i.push(n)}}return i}function di(t,e,n,i){n&&n(t.mark)&&fi(t,e,Qe.group.isect)&&i.push(t);const r=t.items,s=r&&r.length;if(s){const o=t.x||0,a=t.y||0;e.translate(-o,-a);for(let t=0;t<s;++t)ui(r[t],e,n,i);e.translate(o,a)}return i}function fi(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}hi.canvas=hi.png={renderer:Pn,headless:Pn,handler:Mn},hi.svg={renderer:Fn,headless:li,handler:Ln},hi.none={};const pi=new it;function gi(t,n,i){return t===n||("path"===i?vi(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&function(t,e){var n,i,r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(r.sort(),s.sort(),i=r.length-1;i>=0;i--)if(r[i]!=s[i])return!1;for(i=r.length-1;i>=0;i--)if(!gi(t[n=r[i]],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function vi(t,e){return gi(g(t),g(e))}t.Bounds=it,t.CanvasHandler=Mn,t.CanvasRenderer=Pn,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=st,t.Handler=fn,t.Item=rt,t.Marks=Qe,t.RenderType=ci,t.Renderer=gn,t.ResourceLoader=ot,t.SVGHandler=Ln,t.SVGRenderer=Fn,t.SVGStringRenderer=li,t.Scenegraph=sn,t.boundClip=function(t){const n=t.clip;if(e.isFunction(n))n(Rt(pi.clear()));else{if(!n)return;pi.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(pi)},t.boundContext=Rt,t.boundItem=Ze,t.boundMark=tn,t.boundStroke=ct,t.domChild=cn,t.domClear=hn,t.domCreate=an,t.domFind=ln,t.font=We,t.fontFamily=Ge,t.fontSize=Be,t.intersect=function(t,n,i){const r=[],s=(new it).union(n),o=t.marktype;return o?ui(t,s,i,r):"group"===o?di(t,s,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=It,t.intersectPath=Nt,t.intersectPoint=qt,t.intersectRule=Et,t.lineHeight=$e,t.markup=jn,t.multiLineOffset=function(t){const n=He(t);return(e.isArray(n)?n.length-1:0)*$e(t)},t.pathCurves=d,t.pathEqual=vi,t.pathParse=g,t.pathRectangle=V,t.pathRender=C,t.pathSymbols=P,t.pathTrail=B,t.point=dn,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(hi[t]=e,this):hi[t]},t.resetSVGClipId=et,t.resetSVGDefIds=function(){et(),a=0},t.sceneEqual=gi,t.sceneFromJSON=rn,t.scenePickVisit=Yt,t.sceneToJSON=nn,t.sceneVisit=Ft,t.sceneZOrder=Ut,t.serializeXML=Gn,t.textMetrics=Ne,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("d3-shape"),require("d3-path"),require("vega-canvas"),require("vega-loader"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-shape","d3-path","vega-canvas","vega-loader","vega-scale"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={},t.vega,t.d3,t.d3,t.vega,t.vega,t.vega)}(this,(function(t,e,n,i,r,s,o){"use strict";var a=0;const l="p_";function c(t){return t&&t.gradient}function h(t,e,n){const i=t.gradient;let r=t.id,s="radial"===i?l:"";return r||(r=t.id="gradient_"+a++,"radial"===i?(t.x1=u(t.x1,.5),t.y1=u(t.y1,.5),t.r1=u(t.r1,0),t.x2=u(t.x2,.5),t.y2=u(t.y2,.5),t.r2=u(t.r2,.5),s=l):(t.x1=u(t.x1,0),t.y1=u(t.y1,0),t.x2=u(t.x2,1),t.y2=u(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+s+r+")"}function u(t,e){return null!=t?t:e}const d={basis:{curve:n.curveBasis},"basis-closed":{curve:n.curveBasisClosed},"basis-open":{curve:n.curveBasisOpen},bundle:{curve:n.curveBundle,tension:"beta",value:.85},cardinal:{curve:n.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:n.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:n.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:n.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:n.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:n.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:n.curveLinear},"linear-closed":{curve:n.curveLinearClosed},monotone:{horizontal:n.curveMonotoneY,vertical:n.curveMonotoneX},natural:{curve:n.curveNatural},step:{curve:n.curveStep},"step-after":{curve:n.curveStepAfter},"step-before":{curve:n.curveStepBefore}};function f(t,n,i){var r=e.hasOwnProperty(d,t)&&d[t],s=null;return r&&(s=r.curve||r[n||"vertical"],r.tension&&null!=i&&(s=s[r.tension](i))),s}const p={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},g=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function v(t){const e=[];let n,i,r,s,o,a,l,c,h,u;const d=t.slice().replace(g[0],"###$1").split(g[1]).slice(1);for(l=0,h=d.length;l<h;++l){for(n=d[l],i=n.slice(1).trim().replace(g[2],"$1###$2").replace(g[3],"$1###$2").split(g[4]),o=n.charAt(0),r=[o],c=0,u=i.length;c<u;++c)(s=+i[c])===s&&r.push(s);if(a=p[o.toLowerCase()],r.length-1>a){const t=r.length;for(c=1,e.push([o].concat(r.slice(c,c+=a))),o="M"===o?"L":"m"===o?"l":o;c<t;c+=a)e.push([o].concat(r.slice(c,c+a)))}else e.push(r)}return e}const y=Math.PI/180,m=Math.PI/2,x=2*Math.PI,_=Math.sqrt(3)/2;var k={},b={},w=[].join;function T(t){var e=w.call(t);if(b[e])return b[e];var n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=c*o,u=-l*a,d=l*o,f=c*a,p=Math.cos(r),g=Math.sin(r),v=Math.cos(s),y=Math.sin(s),m=.5*(s-r),x=Math.sin(.5*m),_=8/3*x*x/Math.sin(m),k=n+p-_*g,T=i+g+_*p,M=n+v,C=i+y,R=M+_*y,A=C-_*v;return b[e]=[h*k+u*T,d*k+f*T,h*R+u*A,d*R+f*A,h*M+u*C,d*M+f*C]}var M=["l",0,0,0,0,0,0,0];function C(t,e,n){var i=M[0]=t[0];if("a"===i||"A"===i)M[1]=e*t[1],M[2]=n*t[2],M[3]=t[3],M[4]=t[4],M[5]=t[5],M[6]=e*t[6],M[7]=n*t[7];else if("h"===i||"H"===i)M[1]=e*t[1];else if("v"===i||"V"===i)M[1]=n*t[1];else for(var r=1,s=t.length;r<s;++r)M[r]=(r%2==1?e:n)*t[r];return M}function R(t,e,n,i,r,s){var o,a,l,c,h,u=null,d=0,f=0,p=0,g=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==s&&(s=r),t.beginPath&&t.beginPath();for(var v=0,y=e.length;v<y;++v){switch(o=e[v],1===r&&1===s||(o=C(o,r,s)),o[0]){case"l":d+=o[1],f+=o[2],t.lineTo(d+n,f+i);break;case"L":d=o[1],f=o[2],t.lineTo(d+n,f+i);break;case"h":d+=o[1],t.lineTo(d+n,f+i);break;case"H":d=o[1],t.lineTo(d+n,f+i);break;case"v":f+=o[1],t.lineTo(d+n,f+i);break;case"V":f=o[1],t.lineTo(d+n,f+i);break;case"m":d+=o[1],f+=o[2],t.moveTo(d+n,f+i);break;case"M":d=o[1],f=o[2],t.moveTo(d+n,f+i);break;case"c":a=d+o[5],l=f+o[6],p=d+o[3],g=f+o[4],t.bezierCurveTo(d+o[1]+n,f+o[2]+i,p+n,g+i,a+n,l+i),d=a,f=l;break;case"C":d=o[5],f=o[6],p=o[3],g=o[4],t.bezierCurveTo(o[1]+n,o[2]+i,p+n,g+i,d+n,f+i);break;case"s":a=d+o[3],l=f+o[4],p=2*d-p,g=2*f-g,t.bezierCurveTo(p+n,g+i,d+o[1]+n,f+o[2]+i,a+n,l+i),p=d+o[1],g=f+o[2],d=a,f=l;break;case"S":a=o[3],l=o[4],p=2*d-p,g=2*f-g,t.bezierCurveTo(p+n,g+i,o[1]+n,o[2]+i,a+n,l+i),d=a,f=l,p=o[1],g=o[2];break;case"q":a=d+o[3],l=f+o[4],p=d+o[1],g=f+o[2],t.quadraticCurveTo(p+n,g+i,a+n,l+i),d=a,f=l;break;case"Q":a=o[3],l=o[4],t.quadraticCurveTo(o[1]+n,o[2]+i,a+n,l+i),d=a,f=l,p=o[1],g=o[2];break;case"t":a=d+o[1],l=f+o[2],null===u[0].match(/[QqTt]/)?(p=d,g=f):"t"===u[0]?(p=2*d-c,g=2*f-h):"q"===u[0]&&(p=2*d-p,g=2*f-g),c=p,h=g,t.quadraticCurveTo(p+n,g+i,a+n,l+i),f=l,p=(d=a)+o[1],g=f+o[2];break;case"T":a=o[1],l=o[2],p=2*d-p,g=2*f-g,t.quadraticCurveTo(p+n,g+i,a+n,l+i),d=a,f=l;break;case"a":A(t,d+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+d+n,o[7]+f+i]),d+=o[6],f+=o[7];break;case"A":A(t,d+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),d=o[6],f=o[7];break;case"z":case"Z":t.closePath()}u=o}}function A(t,e,n,i){for(var r=function(t,e,n,i,r,s,o,a,l){var c=w.call(arguments);if(k[c])return k[c];var h=o*y,u=Math.sin(h),d=Math.cos(h),f=d*(a-t)*.5+u*(l-e)*.5,p=d*(l-e)*.5-u*(a-t)*.5,g=f*f/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);g>1&&(n*=g=Math.sqrt(g),i*=g);var v=d/n,_=u/n,b=-u/i,T=d/i,M=v*a+_*l,C=b*a+T*l,R=v*t+_*e,A=b*t+T*e,z=1/((R-M)*(R-M)+(A-C)*(A-C))-.25;z<0&&(z=0);var P=Math.sqrt(z);s==r&&(P=-P);var S=.5*(M+R)-P*(A-C),L=.5*(C+A)+P*(R-M),O=Math.atan2(C-L,M-S),N=Math.atan2(A-L,R-S)-O;N<0&&1===s?N+=x:N>0&&0===s&&(N-=x);for(var q=Math.ceil(Math.abs(N/(m+.001))),D=[],E=0;E<q;++E){var I=O+E*N/q,V=O+(E+1)*N/q;D[E]=[S,L,I,V,n,i,u,d]}return k[c]=D}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),s=0;s<r.length;++s){var o=T(r[s]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var z=.5773502691896257,P={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,x)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,s=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-s),t.lineTo(r,-s),t.lineTo(0,-n),t.lineTo(-r,-s),t.lineTo(-i,-s),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n,r=i-n*z,s=n/4;t.moveTo(0,-i-r),t.lineTo(-s,i-r),t.lineTo(s,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n,r=i-n*z;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function S(t){return e.hasOwnProperty(P,t)?P[t]:function(t){if(!e.hasOwnProperty(L,t)){var n=v(t);L[t]={draw:function(t,e){R(t,n,0,0,Math.sqrt(e)/2)}}}return L[t]}(t)}var L={};const O=.448084975506;function N(t){return t.x}function q(t){return t.y}function D(t){return t.width}function E(t){return t.height}function I(t){return"function"==typeof t?t:()=>+t}function V(t,e,n){return Math.max(e,Math.min(t,n))}function B(){var t=N,e=q,n=D,r=E,s=I(0),o=s,a=s,l=s,c=null;function h(h,u,d){var f,p=null!=u?u:+t.call(this,h),g=null!=d?d:+e.call(this,h),v=+n.call(this,h),y=+r.call(this,h),m=Math.min(v,y)/2,x=V(+s.call(this,h),0,m),_=V(+o.call(this,h),0,m),k=V(+a.call(this,h),0,m),b=V(+l.call(this,h),0,m);if(c||(c=f=i.path()),x<=0&&_<=0&&k<=0&&b<=0)c.rect(p,g,v,y);else{var w=p+v,T=g+y;c.moveTo(p+x,g),c.lineTo(w-_,g),c.bezierCurveTo(w-O*_,g,w,g+O*_,w,g+_),c.lineTo(w,T-b),c.bezierCurveTo(w,T-O*b,w-O*b,T,w-b,T),c.lineTo(p+k,T),c.bezierCurveTo(p+O*k,T,p,T-O*k,p,T-k),c.lineTo(p,g+x),c.bezierCurveTo(p,g+O*x,p+O*x,g,p+x,g),c.closePath()}if(f)return c=null,f+""||null}return h.x=function(e){return arguments.length?(t=I(e),h):t},h.y=function(t){return arguments.length?(e=I(t),h):e},h.width=function(t){return arguments.length?(n=I(t),h):n},h.height=function(t){return arguments.length?(r=I(t),h):r},h.cornerRadius=function(t,e,n,i){return arguments.length?(s=I(t),o=null!=e?I(e):s,l=null!=n?I(n):s,a=null!=i?I(i):o,h):s},h.context=function(t){return arguments.length?(c=null==t?null:t,h):c},h}function $(){var t,e,n,r,s,o,a,l,c=null;function h(t,e,n){var i=n/2;if(s){var r=a-e,h=t-o;if(r||h){var u=Math.sqrt(r*r+h*h),d=(r/=u)*l,f=(h/=u)*l,p=Math.atan2(h,r);c.moveTo(o-d,a-f),c.lineTo(t-r*i,e-h*i),c.arc(t,e,i,p-Math.PI,p),c.lineTo(o+d,a+f),c.arc(o,a,l,p,p+Math.PI)}else c.arc(t,e,i,0,x);c.closePath()}else s=1;o=t,a=e,l=i}function u(o){var a,l,u,d=o.length,f=!1;for(null==c&&(c=u=i.path()),a=0;a<=d;++a)!(a<d&&r(l=o[a],a,o))===f&&(f=!f)&&(s=0),f&&h(+t(l,a,o),+e(l,a,o),+n(l,a,o));if(u)return c=null,u+""||null}return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(t){return arguments.length?(e=t,u):e},u.size=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(r=t,u):r},u.context=function(t){return arguments.length?(c=null==t?null:t,u):c},u}function H(t,e){return null!=t?t:e}const j=t=>t.x||0,G=t=>t.y||0,W=t=>!(!1===t.defined),X=n.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),U=n.area().x(j).y1(G).y0(t=>(t.y||0)+(t.height||0)).defined(W),F=n.area().y(G).x1(j).x0(t=>(t.x||0)+(t.width||0)).defined(W),Y=n.line().x(j).y(G).defined(W),J=B().x(j).y(G).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>H(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>H(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>H(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>H(t.cornerRadiusBottomLeft,t.cornerRadius)||0),Q=n.symbol().type(t=>S(t.shape||"circle")).size(t=>H(t.size,64)),Z=$().x(j).y(G).defined(W).size(t=>t.size||1);function K(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function tt(t,e,n,i){return J.context(t)(e,n,i)}var et=1;function nt(){et=1}function it(t,n,i){var r=n.clip,s=t._defs,o=n.clip_id||(n.clip_id="clip"+et++),a=s.clipping[o]||(s.clipping[o]={id:o});return e.isFunction(r)?a.path=r(null):K(i)?a.path=tt(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+o+")"}function rt(t){this.clear(),t&&this.union(t)}function st(t){this.mark=t,this.bounds=this.bounds||new rt}function ot(t){st.call(this,t),this.items=this.items||[]}function at(t){this._pending=0,this._loader=t||s.loader()}function lt(t){t._pending+=1}function ct(t){t._pending-=1}function ht(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}rt.prototype={clone(){return new rt(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(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,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(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const i=this.rotatedPoints(t,e,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(t,e,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,h=n-e*l-n*a;return[a*i-l*r+c,l*i+a*r+h,a*i-l*o+c,l*i+a*o+h,a*s-l*r+c,l*s+a*r+h,a*s-l*o+c,l*s+a*o+h]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},e.inherits(ot,st),at.prototype={pending(){return this._pending},sanitizeURL(t){var e=this;return lt(e),e._loader.sanitize(t,{context:"href"}).then(t=>(ct(e),t)).catch(()=>(ct(e),null))},loadImage(t){const n=this,i=r.image();return lt(n),n._loader.sanitize(t,{context:"image"}).then(t=>{const r=t.href;if(!r||!i)throw{url:r};const s=new i,o=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(s.crossOrigin=o),s.onload=()=>ct(n),s.onerror=()=>ct(n),s.src=r,s}).catch(t=>(ct(n),{complete:!1,width:0,height:0,src:t&&t.url||""}))},ready(){var t=this;return new Promise(e=>{!function n(i){t.pending()?setTimeout(()=>{n(!0)},10):e(i)}(!1)})}};const ut=x-1e-8;let dt,ft,pt,gt,vt,yt,mt,xt;const _t=(t,e)=>dt.add(t,e),kt=(t,e)=>_t(ft=t,pt=e),bt=t=>_t(t,dt.y1),wt=t=>_t(dt.x1,t),Tt=(t,e)=>vt*t+mt*e,Mt=(t,e)=>yt*t+xt*e,Ct=(t,e)=>_t(Tt(t,e),Mt(t,e)),Rt=(t,e)=>kt(Tt(t,e),Mt(t,e));function At(t,e){return dt=t,e?(gt=e*y,vt=xt=Math.cos(gt),yt=Math.sin(gt),mt=-yt):(vt=xt=1,gt=yt=mt=0),zt}const zt={beginPath(){},closePath(){},moveTo:Rt,lineTo:Rt,rect(t,e,n,i){gt?(Ct(t+n,e),Ct(t+n,e+i),Ct(t,e+i),Rt(t,e)):(_t(t+n,e+i),kt(t,e))},quadraticCurveTo(t,e,n,i){const r=Tt(t,e),s=Mt(t,e),o=Tt(n,i),a=Mt(n,i);Pt(ft,r,o,bt),Pt(pt,s,a,wt),kt(o,a)},bezierCurveTo(t,e,n,i,r,s){const o=Tt(t,e),a=Mt(t,e),l=Tt(n,i),c=Mt(n,i),h=Tt(r,s),u=Mt(r,s);St(ft,o,l,h,bt),St(pt,a,c,u,wt),kt(h,u)},arc(t,e,n,i,r,s){if(i+=gt,r+=gt,ft=n*Math.cos(r)+t,pt=n*Math.sin(r)+e,Math.abs(r-i)>ut)_t(t-n,e-n),_t(t+n,e+n);else{const o=i=>_t(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(o(i),o(r),r!==i)if((i%=x)<0&&(i+=x),(r%=x)<0&&(r+=x),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=x,a=i-i%m,l=0;l<4&&a>r;++l,a-=m)o(a);else for(a=i-i%m+m,l=0;l<4&&a<r;++l,a+=m)o(a)}}};function Pt(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function St(t,e,n,i,r){const s=i-t+3*e-3*n,o=t+n-2*e,a=t-e;let l,c=0,h=0;Math.abs(s)>1e-14?(l=o*o+a*s,l>=0&&(l=Math.sqrt(l),c=(-o+l)/s,h=(-o-l)/s)):c=.5*a/o,0<c&&c<1&&r(Lt(c,t,e,n,i)),0<h&&h<1&&r(Lt(h,t,e,n,i))}function Lt(t,e,n,i,r){const s=1-t,o=s*s,a=t*t;return o*s*e+3*o*t*n+3*s*a*i+a*t*r}var Ot=(Ot=r.canvas(1,1))?Ot.getContext("2d"):null;const Nt=new rt;function qt(t){return function(e,n){if(!Ot)return!0;t(Ot,e),Nt.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=Nt;for(let t=r;t<=o;++t)for(let e=i;e<=s;++e)if(Ot.isPointInPath(e,t))return!0;return!1}}function Dt(t,e){return e.contains(t.x||0,t.y||0)}function Et(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,s=t.height||0;return e.intersects(Nt.set(n,i,n+r,i+s))}function It(t,e){const n=t.x||0,i=t.y||0;return Vt(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Vt(t,e,n,i,r){const{x1:s,y1:o,x2:a,y2:l}=t,c=i-e,h=r-n;let u,d,f,p,g=0,v=1;for(p=0;p<4;++p){if(0===p&&(u=-c,d=-(s-e)),1===p&&(u=c,d=a-e),2===p&&(u=-h,d=-(o-n)),3===p&&(u=h,d=l-n),Math.abs(u)<1e-10&&d<0)return!1;if(f=d/u,u<0){if(f>v)return!1;f>g&&(g=f)}else if(u>0){if(f<g)return!1;f<v&&(v=f)}}return!0}function Bt(t,e){t.globalCompositeOperation=e.blend||"source-over"}function $t(t,e){return null==t?e:t}function Ht(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function jt(t,e,n){return c(n)?function(t,e,n){const i=n.width(),s=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+$t(e.x1,.5)*i,n.y1+$t(e.y1,.5)*s,Math.max(i,s)*$t(e.r1,0),n.x1+$t(e.x2,.5)*i,n.y1+$t(e.y2,.5)*s,Math.max(i,s)*$t(e.r2,.5));else{const a=$t(e.x1,0),l=$t(e.y1,0),c=$t(e.x2,1),h=$t(e.y2,0);if(a!==c&&l!==h&&i!==s){const n=r.canvas(Math.ceil(i),Math.ceil(s)),o=n.getContext("2d");return o.scale(i,s),o.fillStyle=Ht(o.createLinearGradient(a,l,c,h),e.stops),o.fillRect(0,0,i,s),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*i,n.y1+l*s,n.x1+c*i,n.y1+h*s)}return Ht(o,e.stops)}(t,n,e.bounds):n}function Gt(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=jt(t,e,e.fill),!0)}var Wt=[];function Xt(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=jt(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Wt),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Ut(t,e){return t.zindex-e.zindex||t.index-e.index}function Ft(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,s=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&s.push(e);return t.zdirty=!1,t.zitems=s.sort(Ut)}function Yt(t,e){var n,i,r=t.items;if(r&&r.length){var s=Ft(t);if(s&&s.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=s}for(n=0,i=r.length;n<i;++n)e(r[n])}}function Jt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var s=Ft(t);for(s&&s.length&&(r=s),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===s)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Qt(t){return function(e,n,i){Yt(n,n=>{i&&!i.intersects(n.bounds)||Kt(t,e,n,n)})}}function Zt(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Kt(t,e,n.items[0],n.items)}}function Kt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Bt(e,n),n.fill&&Gt(e,n,r)&&e.fill(),n.stroke&&Xt(e,n,r)&&e.stroke()))}function te(t){return t=t||e.truthy,function(e,n,i,r,s,o){return i*=e.pixelRatio,r*=e.pixelRatio,Jt(n,n=>{var a=n.bounds;if((!a||a.contains(s,o))&&a)return t(e,n,i,r,s,o)?n:void 0})}}function ee(t,e){return function(n,i,r,s){var o,a,l=Array.isArray(i)?i[0]:i,c=null==e?l.fill:e,h=l.stroke&&n.isPointInStroke;return h&&(o=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(c&&n.isPointInPath(r,s)||h&&n.isPointInStroke(r,s))}}function ne(t){return te(ee(t))}function ie(t,e){return"translate("+t+","+e+")"}function re(t){return"rotate("+t+")"}function se(t){return ie(t.x||0,t.y||0)}function oe(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,s=n.angle||0;t.translate(i,r),s&&t.rotate(s*=y),t.beginPath(),e(t,n),s&&t.rotate(-s),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return ie(t.x||0,t.y||0)+(t.angle?" "+re(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(At(t,n.angle),n),ht(t,n).translate(n.x||0,n.y||0)},draw:Qt(i),pick:ne(i),isect:n||qt(i)}}var ae=oe("arc",(function(t,e){return X.context(t)(e)}));function le(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=ee(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(At(t),i),ht(t,i[0]))},draw:Zt(i),pick:function(t,e,n,i,s,o){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(s,o)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:Dt,tip:n}}var ce=le("area",(function(t,e){const n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?F:U).curve(f(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],s="horizontal"===t[0].orient?"y":"x",o=t.length,a=1/0;--o>=0;)!1!==t[o].defined&&(i=Math.abs(t[o][s]-r))<a&&(a=i,n=t[o]);return n}));function he(t,e){t.beginPath(),K(e)?tt(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function ue(t){const e=$t(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function de(t,e){const n=ue(e);t("d",tt(null,e,n,n))}function fe(t,e,n,i){const r=ue(e);t.beginPath(),tt(t,e,(n||0)+r,(i||0)+r)}const pe=ee(fe),ge=ee(fe,!1),ve=ee(fe,!0);var ye={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",se(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e<i;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),ht(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){Yt(e,e=>{const i=e.x||0,r=e.y||0,s=e.strokeForeground,o=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&o&&(fe(t,e,i,r),Bt(t,e),e.fill&&Gt(t,e,o)&&t.fill(),e.stroke&&!s&&Xt(t,e,o)&&t.stroke()),t.save(),t.translate(i,r),e.clip&&he(t,e),n&&n.translate(-i,-r),Yt(e,e=>{this.draw(t,e,n)}),n&&n.translate(i,r),t.restore(),s&&e.stroke&&o&&(fe(t,e,i,r),Bt(t,e),Xt(t,e,o)&&t.stroke())})},pick:function(t,e,n,i,r,s){if(e.bounds&&!e.bounds.contains(r,s)||!e.items)return null;const o=n*t.pixelRatio,a=i*t.pixelRatio;return Jt(e,l=>{let c,h,u;const d=l.bounds;if(d&&!d.contains(r,s))return;h=l.x||0,u=l.y||0;const f=h+(l.width||0),p=u+(l.height||0),g=l.clip;if(g&&(r<h||r>f||s<u||s>p))return;if(t.save(),t.translate(h,u),h=r-h,u=s-u,g&&K(l)&&!ve(t,l,o,a))return t.restore(),null;const v=l.strokeForeground,y=!1!==e.interactive;return y&&v&&l.stroke&&ge(t,l,o,a)?(t.restore(),l):(c=Jt(l,t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,h,u)?this.pick(t,n,i,h,u):null),!c&&y&&(l.fill||!v&&l.stroke)&&pe(t,l,o,a)&&(c=l),t.restore(),c||null)})},isect:Et,content:function(t,e,n){t("clip-path",e.clip?it(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),de(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?de(t,e):t("d","")}},me={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function xe(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function _e(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function ke(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function be(t,e){return"center"===t?e/2:"right"===t?e:0}function we(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Te={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=xe(e,n),r=_e(e,i),s=ke(e,i),o=(e.x||0)-be(e.align,r),a=(e.y||0)-we(e.baseline,s);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",me["xmlns:xlink"],"xlink:href"),t("transform",ie(o,a)),t("width",r),t("height",s),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=_e(e,n),r=ke(e,n),s=(e.x||0)-be(e.align,i),o=(e.y||0)-we(e.baseline,r);return t.set(s,o,s+i,o+r)},draw:function(t,e,n){Yt(e,e=>{if(n&&!n.intersects(e.bounds))return;const i=xe(e,this);let r,s,o,a,l=_e(e,i),c=ke(e,i),h=(e.x||0)-be(e.align,l),u=(e.y||0)-we(e.baseline,c);!1!==e.aspect&&(s=i.width/i.height,o=e.width/e.height,s==s&&o==o&&s!==o&&(o<s?(a=l/s,u+=(c-a)/2,c=a):(a=c*s,h+=(l-a)/2,l=a))),(i.complete||i.toDataURL)&&(Bt(t,e),t.globalAlpha=null!=(r=e.opacity)?r:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(i,h,u,l,c))})},pick:te(),isect:e.truthy,get:xe,xOffset:be,yOffset:we},Me=le("line",(function(t,e){const n=e[0],i=n.interpolate||"linear";return Y.curve(f(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),s=t.length;--s>=0;)if(!1!==t[s].defined&&(n=t[s].x-e[0])*n+(i=t[s].y-e[1])*i<r)return t[s];return null}));function Ce(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,s=e.scaleX||1,o=e.scaleY||1,a=(e.angle||0)*y,l=e.pathCache;l&&l.path===n||((e.pathCache=l=v(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),R(t,l,0,0,s,o),t.rotate(-a),t.translate(-i,-r)):R(t,l,i,r,s,o)}var Re={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return ie(t.x||0,t.y||0)+(t.angle?" "+re(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}(e)),t("d",e.path)},bound:function(t,e){return Ce(At(t,e.angle),e)?t.set(0,0,0,0):ht(t,e,!0)},draw:Qt(Ce),pick:ne(Ce),isect:qt(Ce)};function Ae(t,e){t.beginPath(),tt(t,e)}var ze={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",tt(null,e))},bound:function(t,e){var n,i;return ht(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Qt(Ae),pick:ne(Ae),isect:Et};function Pe(t,e,n){var i,r,s,o;return!(!e.stroke||!Xt(t,e,n))&&(i=e.x||0,r=e.y||0,s=null!=e.x2?e.x2:i,o=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(s,o),!0)}var Se={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",se(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return ht(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){Yt(e,e=>{if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&Pe(t,e,i)&&(Bt(t,e),t.stroke())}})},pick:te((function(t,e,n,i){return!!t.isPointInStroke&&(Pe(t,e,1)&&t.isPointInStroke(n,i))})),isect:It},Le=oe("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Oe=oe("symbol",(function(t,e){return Q.context(t)(e)}),Dt);const Ne=e.lruCache();var qe={height:$e,measureWidth:Ve,estimateWidth:Ee,width:Ee,canvas:De};function De(t){qe.width=t&&Ot?Ve:Ee}function Ee(t,e){return Ie(Ge(t,e),$e(t))}function Ie(t,e){return~~(.8*t.length*e)}function Ve(t,e){return $e(t)<=0||!(e=Ge(t,e))?0:Be(e,Xe(t))}function Be(t,e){const n=`(${e}) ${t}`;let i=Ne.get(n);return void 0===i&&(Ot.font=e,i=Ot.measureText(t).width,Ne.set(n,i)),i}function $e(t){return null!=t.fontSize?+t.fontSize||0:11}function He(t){return null!=t.lineHeight?t.lineHeight:$e(t)+2}function je(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function Ge(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(qe.width===Ve){const e=Xe(t);return t=>Be(t,e)}{const e=$e(t);return t=>Ie(t,e)}}(t);if(i(e)<n)return e;var r,s=t.ellipsis||"…",o="rtl"===t.dir,a=0,l=e.length;if(n-=i(s),o){for(;a<l;)r=a+l>>>1,i(e.slice(r))>n?a=r+1:l=r;return s+e.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(e.slice(0,r))<n?a=r:l=r-1;return e.slice(0,a)+s}(t,n):n}function We(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xe(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+$e(t)+"px "+We(t,e)}function Ue(t){var e=t.baseline,n=$e(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*He(t):"line-bottom"===e?.29*n-.5*He(t):0)}De(!0);var Fe={left:"start",center:"middle",right:"end"},Ye=new rt;function Je(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-m,n+=r*Math.cos(e),i+=r*Math.sin(e)),Ye.x1=n,Ye.y1=i,Ye}function Qe(t,n,i){var r,s=qe.height(n),o=n.align,a=Je(n),l=a.x1,c=a.y1,h=n.dx||0,u=(n.dy||0)+Ue(n)-Math.round(.8*s),d=je(n);if(e.isArray(d)?(s+=He(n)*(d.length-1),r=d.reduce((t,e)=>Math.max(t,qe.width(n,e)),0)):r=qe.width(n,d),"center"===o?h-=r/2:"right"===o&&(h-=r),t.set(h+=l,u+=c,h+r,u+s),n.angle&&!i)t.rotate(n.angle*y,l,c);else if(2===i)return t.rotatedPoints(n.angle*y,l,c);return t}var Ze={arc:ae,area:ce,group:ye,image:Te,line:Me,path:Re,rect:ze,rule:Se,shape:Le,symbol:Oe,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Ue(e),s=Je(e),o=s.x1,a=s.y1,l=e.angle||0;t("text-anchor",Fe[e.align]||"start"),l?(n=ie(o,a)+" "+re(l),(i||r)&&(n+=" "+ie(i,r))):n=ie(o+i,a+r),t("transform",n)},bound:Qe,draw:function(t,n,i){Yt(n,n=>{var r,s,o,a,l,c,h,u=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===u||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=Xe(n),t.textAlign=n.align||"left",s=(r=Je(n)).x1,o=r.y1,n.angle&&(t.save(),t.translate(s,o),t.rotate(n.angle*y),s=o=0),s+=n.dx||0,o+=(n.dy||0)+Ue(n),c=je(n),Bt(t,n),e.isArray(c))for(l=He(n),a=0;a<c.length;++a)h=Ge(n,c[a]),n.fill&&Gt(t,n,u)&&t.fillText(h,s,o),n.stroke&&Xt(t,n,u)&&t.strokeText(h,s,o),o+=l;else h=Ge(n,c),n.fill&&Gt(t,n,u)&&t.fillText(h,s,o),n.stroke&&Xt(t,n,u)&&t.strokeText(h,s,o);n.angle&&t.restore()}})},pick:te((function(t,e,n,i,r,s){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var o=Je(e),a=o.x1,l=o.y1,c=Qe(Ye,e,1),h=-e.angle*y,u=Math.cos(h),d=Math.sin(h),f=u*r-d*s+(a-u*a+d*l),p=d*r+u*s+(l-d*a-u*l);return c.contains(f,p)})),isect:function(t,e){var n=Qe(Ye,t,2);return Vt(e,n[0],n[1],n[2],n[3])||Vt(e,n[0],n[1],n[4],n[5])||Vt(e,n[4],n[5],n[6],n[7])||Vt(e,n[2],n[3],n[6],n[7])}},trail:le("trail",(function(t,e){return Z.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Ke(t,e,n){var i=Ze[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new rt),t,n)}var tn={mark:null};function en(t,e,n){var i,r,s,o,a=Ze[t.marktype],l=a.bound,c=t.items,h=c&&c.length;if(a.nested)return h?s=c[0]:(tn.mark=t,s=tn),o=Ke(s,l,n),e=e&&e.union(o)||o;if(e=e||t.bounds&&t.bounds.clear()||new rt,h)for(i=0,r=c.length;i<r;++i)e.union(Ke(c[i],l,n));return t.bounds=e}var nn=["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 rn(t,e){return JSON.stringify(t,nn,e)}function sn(t){return function t(e){var n,i,r,s=e.marktype,o=e.items;if(o)for(i=0,r=o.length;i<r;++i)n=s?"mark":"group",o[i][n]=e,o[i].zindex&&(o[i][n].zdirty=!0),"group"===(s||n)&&t(o[i]);s&&en(e);return e}("string"==typeof t?JSON.parse(t):t)}function on(t){arguments.length?this.root=sn(t):(this.root=an({marktype:"group",name:"root",role:"frame"}),this.root.items=[new ot(this.root)])}function an(t,e){const n={bounds:new rt,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function ln(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function cn(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function hn(t,e,n,i){var r,s=t.childNodes[e];return s&&s.tagName.toLowerCase()===n.toLowerCase()||(r=s||null,s=ln(t.ownerDocument,n,i),t.insertBefore(s,r)),s}function un(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function dn(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function fn(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function pn(t,e){this._active=null,this._handlers={},this._loader=t||s.loader(),this._tooltip=e||gn}function gn(t,e,n,i){t.element().setAttribute("title",i||"")}function vn(t){this._el=null,this._bgcolor=null,this._loader=new at(t)}on.prototype={toJSON(t){return rn(this.root,t||0)},mark(t,e,n){var i=an(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},pn.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},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,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push.apply(n,e[this.eventName(t)]);else for(const t in e)n.push.apply(n,e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then(e=>{const n=new MouseEvent(t.type,t),i=ln(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)}).catch(()=>{})},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,s,o=t&&t.mark;if(o&&(r=Ze[o.marktype]).tip){for((s=fn(e,n))[0]-=i[0],s[1]-=i[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=r.tip(o.items,s)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)a+=t.x||0,l+=t.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}},vn.prototype={initialize(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){var e=this.render(t);return this._ready?this._ready.then(()=>e):Promise.resolve(e)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then(t=>{t&&r(),n._ready=null})}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const yn="dragenter",mn="dragleave",xn="dragover",_n="mousedown",kn="mousemove",bn="mouseout",wn="mouseover",Tn="click",Mn="mousewheel",Cn="touchstart",Rn="touchmove",An="touchend",zn=["keydown","keypress","keyup",yn,mn,xn,_n,"mouseup",kn,bn,wn,Tn,"dblclick","wheel",Mn,Cn,Rn,An],Pn=kn,Sn=bn,Ln=Tn;function On(t,e){pn.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Nn(t,e){(t=>t===Cn||t===Rn||t===An?[Cn,Rn,An]:[t])(e).forEach(e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e))}function qn(t,e,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r||(r&&r.exit||this.fire(n,i),this._active=s,this.fire(e,i)),this.fire(t,i)}}function Dn(t){return function(e){this.fire(t,e),this._active=null}}e.inherits(On,pn,{initialize(t,e,n){return this._canvas=t&&cn(t,"canvas"),[Tn,_n,kn,bn,mn].forEach(t=>Nn(this,t)),pn.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:zn,DOMMouseScroll(t){this.fire(Mn,t)},mousemove:qn(kn,wn,bn),dragover:qn(xn,yn,mn),mouseout:Dn(bn),dragleave:Dn(mn),mousedown(t){this._down=this._active,this.fire(_n,t)},click(t){this._down===this._active&&(this.fire(Tn,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Cn,t,!0)},touchmove(t){this.fire(Rn,t,!0)},touchend(t){this.fire(An,t,!0),this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===Ln&&i&&i.href?this.handleHref(e,i,i.href):t!==Pn&&t!==Sn||this.handleTooltip(e,i,t!==Sn),r)for(let t=0,n=r.length;t<n;++t)r[t].handler.call(this._obj,e,i)},on(t,e){const n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(Nn(this,t),(i[n]||(i[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},pickEvent(t){const e=fn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const s=this.context();return Ze[t.marktype].pick.call(this,s,t,e,n,i,r)}});var En="undefined"!=typeof window&&window.devicePixelRatio||1;function In(t){vn.call(this,t),this._options={},this._redraw=!1,this._dirty=new rt,this._tempb=new rt}const Vn=vn.prototype;function Bn(t,e){pn.call(this,t,e);const n=this;n._hrefHandler=$n(n,(t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=$n(n,(t,e)=>{n.handleTooltip(t,e,t.type!==Sn)})}e.inherits(In,vn,{initialize(t,e,n,i,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:r.canvas(1,1,this._options.type),t&&this._canvas&&(un(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Vn.initialize.call(this,t,e,n,i,s)},resize(t,n,i,r){if(Vn.resize.call(this,t,n,i,r),this._canvas)!function(t,e,n,i,r,s){const o="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=o?En:r;t.width=e*l,t.height=n*l;for(const t in s)a[t]=s[t];o&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||e.error("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.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 e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,s=this._dirty,o=(a=n,l=i,c=r,(new rt).set(0,0,l,c).translate(-a[0],-a[1]));var a,l,c;e.save();const h=this._redraw||s.empty()?(this._redraw=!1,o.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(s),n);return this.clear(-n[0],-n[1],i,r),this.draw(e,t,h),e.restore(),s.clear(),this},draw(t,n,i){const r=Ze[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):he(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},clear(t,e,n,i){const r=this._options,s=this.context();"pdf"===r.type||r.externalContext||s.clearRect(t,e,n,i),null!=this._bgcolor&&(s.fillStyle=this._bgcolor,s.fillRect(t,e,n,i))}});const $n=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};e.inherits(Bn,pn,{initialize(t,e,n){let i=this._svg;return i&&(i.removeEventListener(Ln,this._hrefHandler),i.removeEventListener(Pn,this._tooltipHandler),i.removeEventListener(Sn,this._tooltipHandler)),this._svg=i=t&&cn(t,"svg"),i&&(i.addEventListener(Ln,this._hrefHandler),i.addEventListener(Pn,this._tooltipHandler),i.addEventListener(Sn,this._tooltipHandler)),pn.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:$n(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const Hn="aria-hidden",jn="aria-label",Gn="role",Wn="aria-roledescription",Xn="graphics-object",Un="graphics-symbol",Fn=(t,e,n)=>({[Gn]:t,[Wn]:e,[jn]:n||void 0}),Yn=e.toSet(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Jn={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?ei(t):null,r=t.context,s=r.scales[e.scale].value,a=r.dataflow.locale(),l=s.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${o.isDiscrete(l)?"discrete":l} scale with `+o.domainCaption(a,s,t)}},legend:{desc:"legend",caption:function(t){const n=t.datum,i=n.title?ei(t):null,r=((n.type||"")+" legend").trim(),s=n.scales,a=Object.keys(s),l=t.context,c=l.scales[s[a[0]]].value,h=l.dataflow.locale();return u=r,(u.length?u[0].toUpperCase()+u.slice(1):u)+(i?` titled '${i}'`:"")+" for "+function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+e.peek(t)}(a)+" with "+o.domainCaption(h,c,t);var u}},"title-text":{desc:"title",caption:t=>`Title text '${ti(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${ti(t)}'`}},Qn={ariaRole:Gn,ariaRoleDescription:Wn,description:jn};function Zn(t,e){const n=!1===e.aria;if(t(Hn,n||void 0),n||null==e.description)for(const e in Qn)t(Qn[e],void 0);else{const n=e.mark.marktype;t(jn,e.description),t(Gn,e.ariaRole||("group"===n?Xn:Un)),t(Wn,e.ariaRoleDescription||n+" mark")}}function Kn(t){return!1===t.aria?{[Hn]:!0}:Yn[t.role]?null:Jn[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return Fn(e.role||Un,e.desc,n.description||i(n))}catch(t){return null}}(t,Jn[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return Fn(n?Xn:Un,e+" mark container",t.description)}(t)}function ti(t){return e.array(t.text).join(" ")}function ei(t){try{return e.array(e.peek(t.items).items[0].text).join(" ")}catch(t){return null}}const ni=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function ii(){let t="",e="",n="";const i=[],r=()=>e=n="",s=(t,n)=>{var i;return null!=n&&(e+=` ${t}="${i=n,ni(i).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}"`),o},o={open(a,...l){(s=>{e&&(t+=`${e}>${n}`,r()),i.push(s)})(a),e="<"+a;for(const t of l)for(const e in t)s(e,t[e]);return o},close(){const s=i.pop();return t+=e?e+(n?`>${n}</${s}>`:"/>"):`</${s}>`,r(),o},attr:s,text:t=>(n+=ni(t),o),toString:()=>t};return o}const ri=t=>function t(e,n){if(e.open(n.tagName),n.hasAttributes()){const t=n.attributes,i=t.length;for(let n=0;n<i;++n)e.attr(t[n].name,t[n].value)}if(n.hasChildNodes()){const i=n.childNodes,r=i.length;for(let n=0;n<r;n++){const r=i[n];3===r.nodeType?e.text(r.nodeValue):t(e,r)}}return e.close()}(ii(),t)+"";const si={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",blend:"mix-blend-mode"},oi={fill:"none","stroke-miterlimit":10},ai=me.xmlns;function li(t){vn.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const ci=vn.prototype;function hi(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function ui(t,e,n){let i,r,s;if("radial"===e.gradient){let i=hn(t,n++,"pattern",ai);xi(i,{id:l+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=hn(i,0,"rect",ai),xi(i,{width:1,height:1,fill:`url(${ki()}#${e.id})`}),xi(t=hn(t,n++,"radialGradient",ai),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else xi(t=hn(t,n++,"linearGradient",ai),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,r=e.stops.length;i<r;++i)s=hn(t,i,"stop",ai),s.setAttribute("offset",e.stops[i].offset),s.setAttribute("stop-color",e.stops[i].color);return un(t,i),n}function di(t,e,n){let i;return(t=hn(t,n,"clipPath",ai)).setAttribute("id",e.id),e.path?(i=hn(t,0,"path",ai),i.setAttribute("d",e.path)):(i=hn(t,0,"rect",ai),xi(i,{x:0,y:0,width:e.width,height:e.height})),un(t,1),n+1}function fi(t,e,n,i,r){let s,o=t._svg;if(!o&&(s=e.ownerDocument,o=ln(s,i,ai),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},"g"===i))){const e=ln(s,"path",ai);o.appendChild(e),e.__data__=t;const n=ln(s,"g",ai);o.appendChild(n),n.__data__=t;const i=ln(s,"path",ai);o.appendChild(i),i.__data__=t,i.__values__={fill:"default"}}return(o.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}e.inherits(li,vn,{initialize(t,e,n,i,r){return this._defs={},this._clearDefs(),t&&(this._svg=hn(t,0,"svg",ai),xi(this._svg,me),this._svg.setAttribute("class","marks"),un(t,1),this._root=hn(this._svg,0,"g",ai),xi(this._root,oi),un(this._svg,1)),this.background(this._bgcolor),ci.initialize.call(this,t,e,n,i,r)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ci.background.apply(this,arguments)},resize(t,e,n,i){return ci.resize.call(this,t,e,n,i),this._svg&&(xi(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,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=hn(t,0,"rect",ai),xi(n,{width:this._width,height:this._height,fill:e}));const i=ri(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),i},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),un(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.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,i,r,s,o,a,l;for(o=0,a=t.length;o<a;++o)n=t[o],i=n.mark,i.marktype!==r&&(r=i.marktype,s=Ze[r]),i.zdirty&&i.dirty!==e&&(this._dirtyAll=!1,hi(n,e),i.items.forEach(t=>{t.dirty=e})),i.zdirty||(n.exit?(s.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(s,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=s.nested?i.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(s,n._svg,n):(this._dirtyAll=!1,hi(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const i=this._svg,r=Ze[e.marktype],s=!1===e.interactive?"none":null,o="g"===r.tag;let a=null,l=0;const c=fi(e,t,n,"g",i);c.setAttribute("class",dn(e));const h=Kn(e);for(const t in h)_i(c,t,h[t]);o||_i(c,"pointer-events",s),_i(c,"clip-path",e.clip?it(this,e,e.group):null);const u=t=>{const e=this.isDirty(t),n=fi(t,c,a,r.tag,i);e&&(this._update(r,n,t),o&&function(t,e,n){e=e.lastChild.previousSibling;let i,r=0;Yt(n,n=>{i=t.mark(e,n,i),++r}),un(e,1+r)}(this,n,t)),a=n,++l};return r.nested?e.items.length&&u(e.items[0]):Yt(e,u),un(c,l),c},_update(t,e,n){pi=e,gi=e.__values__,Zn(yi,n),t.attr(yi,n,this);const i=vi[t.type];i&&i.call(this,t,e,n),pi&&this.style(pi,n)},style(t,e){if(null!=e)for(const n in si){let i="font"===n?We(e):e[n];if(i===gi[n])continue;const r=si[n];null==i?t.removeAttribute(r):(c(i)&&(i=h(i,this._defs.gradient,ki())),t.setAttribute(r,i+"")),gi[n]=i}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=hn(t,1,"defs",ai)),i=ui(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=hn(t,1,"defs",ai)),i=di(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):un(n,i))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let pi=null,gi=null;const vi={group(t,e,n){const i=pi=e.childNodes[2];gi=i.__values__,t.foreground(yi,n,this),gi=e.__values__,pi=e.childNodes[1],t.content(yi,n,this);const r=pi=e.childNodes[0];t.background(yi,n,this);const s=!1===n.mark.interactive?"none":null;if(s!==gi.events&&(_i(i,"pointer-events",s),_i(r,"pointer-events",s),gi.events=s),n.strokeForeground&&n.stroke){const t=n.fill;_i(i,"display",null),this.style(r,n),_i(r,"stroke",null),t&&(n.fill=null),gi=i.__values__,this.style(i,n),t&&(n.fill=t),pi=null}else _i(i,"display","none")},image(t,e,n){!1===n.smooth?(mi(e,"image-rendering","optimizeSpeed"),mi(e,"image-rendering","pixelated")):mi(e,"image-rendering",null)},text(t,n,i){const r=je(i);let s,o,a,l;e.isArray(r)?(o=r.map(t=>Ge(i,t)),s=o.join("\n"),s!==gi.text&&(un(n,0),a=n.ownerDocument,l=He(i),o.forEach((t,e)=>{const r=ln(a,"tspan",ai);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",l)),n.appendChild(r)}),gi.text=s)):(o=Ge(i,r),o!==gi.text&&(n.textContent=o,gi.text=o)),_i(n,"font-family",We(i)),_i(n,"font-size",$e(i)+"px"),_i(n,"font-style",i.fontStyle),_i(n,"font-variant",i.fontVariant),_i(n,"font-weight",i.fontWeight)}};function yi(t,e,n){e!==gi[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(pi,t,e,n):_i(pi,t,e),gi[t]=e)}function mi(t,e,n){n!==gi[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),gi[e]=n)}function xi(t,e){for(const n in e)_i(t,n,e[n])}function _i(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function ki(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function bi(t){vn.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}e.inherits(bi,vn,{svg(){return this._text},_render(t){const n=ii();n.open("svg",e.extend({},me,{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&&"transparent"!==i&&"none"!==i&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",oi,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this},mark(t,n){const i=Ze[n.marktype],r=i.tag,s=[Zn,i.attr];t.open("g",{class:dn(n),"clip-path":n.clip?it(this,n,n.group):null},Kn(n),{"pointer-events":"g"!==r&&!1===n.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(n,o,s,"g"!==r?r:null)),"text"===r){const n=je(o);if(e.isArray(n)){const e={x:0,dy:He(o)};for(let i=0;i<n.length;++i)t.open("tspan",i?e:null).text(Ge(o,n[i])).close()}else t.text(Ge(o,n))}else if("g"===r){const e=o.strokeForeground,r=o.fill,s=o.stroke;e&&s&&(o.stroke=null),t.open("path",this.attr(n,o,i.background,"bgrect")).close(),t.open("g",this.attr(n,o,i.content)),Yt(o,e=>this.mark(t,e)),t.close(),e&&s?(r&&(o.fill=null),o.stroke=s,t.open("path",this.attr(n,o,i.foreground,"bgrect")).close(),r&&(o.fill=r)):t.open("path",this.attr(n,o,i.foreground,"bgfore")).close()}t.close(),a&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):Yt(n,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then(t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t})}return null},attr(t,e,n,i){const r={},s=(t,e,n,i)=>{r[i||t]=e};return Array.isArray(n)?n.forEach(t=>t(s,e,this)):n(s,e,this),i&&function(t,e,n,i,r){if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===i&&(t["font-family"]=We(e),t["font-size"]=$e(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in si){let i=e[n];const s=si[n];("transparent"!==i||"fill"!==s&&"stroke"!==s)&&null!=i&&(c(i)&&(i=h(i,r.gradient,"")),t[s]=i)}}(r,e,t,i,this._defs),r},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const i=e[n],r=i.stops;"radial"===i.gradient?(t.open("pattern",{id:l+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e<r.length;++e)t.open("stop",{offset:r[e].offset,"stop-color":r[e].color}).close();t.close()}for(const e in n){const i=n[e];t.open("clipPath",{id:e}),i.path?t.open("path",{d:i.path}).close():t.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),t.close()}t.close()}}});var wi="canvas",Ti="none",Mi={Canvas:wi,PNG:"png",SVG:"svg",None:Ti},Ci={};function Ri(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,s=t.marktype,o=r.length;let a=0;if("group"===s)for(;a<o;++a)Ai(r[a],e,n,i);else for(const t=Ze[s].isect;a<o;++a){const n=r[a];zi(n,e,t)&&i.push(n)}}return i}function Ai(t,e,n,i){n&&n(t.mark)&&zi(t,e,Ze.group.isect)&&i.push(t);const r=t.items,s=r&&r.length;if(s){const o=t.x||0,a=t.y||0;e.translate(-o,-a);for(let t=0;t<s;++t)Ri(r[t],e,n,i);e.translate(o,a)}return i}function zi(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}Ci.canvas=Ci.png={renderer:In,headless:In,handler:On},Ci.svg={renderer:li,headless:bi,handler:Bn},Ci.none={};const Pi=new rt;function Si(t,n,i){return t===n||("path"===i?Li(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?function(t,e){var n,i,r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(r.sort(),s.sort(),i=r.length-1;i>=0;i--)if(r[i]!=s[i])return!1;for(i=r.length-1;i>=0;i--)if(!Si(t[n=r[i]],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function Li(t,e){return Si(v(t),v(e))}t.Bounds=rt,t.CanvasHandler=On,t.CanvasRenderer=In,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=ot,t.Handler=pn,t.Item=st,t.Marks=Ze,t.RenderType=Mi,t.Renderer=vn,t.ResourceLoader=at,t.SVGHandler=Bn,t.SVGRenderer=li,t.SVGStringRenderer=bi,t.Scenegraph=on,t.boundClip=function(t){const n=t.clip;if(e.isFunction(n))n(At(Pi.clear()));else{if(!n)return;Pi.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Pi)},t.boundContext=At,t.boundItem=Ke,t.boundMark=en,t.boundStroke=ht,t.domChild=hn,t.domClear=un,t.domCreate=ln,t.domFind=cn,t.font=Xe,t.fontFamily=We,t.fontSize=$e,t.intersect=function(t,n,i){const r=[],s=(new rt).union(n),o=t.marktype;return o?Ri(t,s,i,r):"group"===o?Ai(t,s,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=Vt,t.intersectPath=qt,t.intersectPoint=Dt,t.intersectRule=It,t.lineHeight=He,t.markup=ii,t.multiLineOffset=function(t){const n=je(t);return(e.isArray(n)?n.length-1:0)*He(t)},t.pathCurves=f,t.pathEqual=Li,t.pathParse=v,t.pathRectangle=B,t.pathRender=R,t.pathSymbols=S,t.pathTrail=$,t.point=fn,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(Ci[t]=e,this):Ci[t]},t.resetSVGClipId=nt,t.resetSVGDefIds=function(){nt(),a=0},t.sceneEqual=Si,t.sceneFromJSON=sn,t.scenePickVisit=Jt,t.sceneToJSON=rn,t.sceneVisit=Yt,t.sceneZOrder=Ft,t.serializeXML=ri,t.textMetrics=qe,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "vega-scenegraph",
"version": "4.9.0",
"version": "4.9.1",
"description": "Vega scenegraph and renderers.",

@@ -23,10 +23,10 @@ "license": "BSD-3-Clause",

"dependencies": {
"d3-path": "^1.0.9",
"d3-shape": "^1.3.7",
"vega-canvas": "^1.2.3",
"vega-loader": "^4.3.1",
"vega-scale": "^7.0.1",
"vega-util": "^1.15.0"
"d3-path": "^2.0.0",
"d3-shape": "^2.0.0",
"vega-canvas": "^1.2.4",
"vega-loader": "^4.3.2",
"vega-scale": "^7.1.0",
"vega-util": "^1.15.1"
},
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
"gitHead": "8d6793f4ca7eaaf2d22186764e9ce2dae687cf52"
}

@@ -91,4 +91,4 @@ import Renderer from './Renderer';

dirty(item) {
let b = this._tempb.clear().union(item.bounds),
g = item.mark.group;
const b = this._tempb.clear().union(item.bounds);
let g = item.mark.group;

@@ -95,0 +95,0 @@ while (g) {

@@ -14,4 +14,5 @@ var gradient_id = 0;

export function gradientRef(g, defs, base) {
const type = g.gradient;
let id = g.id,
type = g.gradient,
prefix = type === 'radial' ? patternPrefix : '';

@@ -18,0 +19,0 @@

@@ -151,3 +151,3 @@ import {domCreate} from './util/dom';

})
.catch(function() { /* do nothing */ });
.catch(() => { /* do nothing */ });
},

@@ -154,0 +154,0 @@

@@ -29,3 +29,3 @@ import Marks from './marks/index';

for (const test = Marks[type].isect; i<n; ++i) {
let item = items[i];
const item = items[i];
if (intersectItem(item, box, test)) hits.push(item);

@@ -32,0 +32,0 @@ }

@@ -132,6 +132,6 @@ import {hasCornerRadius, rectangle} from '../path/shapes';

return pickVisit(scene, group => {
let hit, fore, ix, dx, dy, dw, dh, b, c;
let hit, dx, dy;
// first hit test bounding box
b = group.bounds;
const b = group.bounds;
if (b && !b.contains(gx, gy)) return;

@@ -142,5 +142,5 @@

dy = group.y || 0;
dw = dx + (group.width || 0);
dh = dy + (group.height || 0);
c = group.clip;
const dw = dx + (group.width || 0),
dh = dy + (group.height || 0),
c = group.clip;
if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return;

@@ -160,4 +160,4 @@

fore = group.strokeForeground;
ix = scene.interactive !== false;
const fore = group.strokeForeground,
ix = scene.interactive !== false;

@@ -164,0 +164,0 @@ // hit test against group foreground

@@ -71,4 +71,4 @@ import {visit} from '../util/visit';

let img = getImage(item, this),
w = imageWidth(item, img),
const img = getImage(item, this);
let w = imageWidth(item, img),
h = imageHeight(item, img),

@@ -75,0 +75,0 @@ x = (item.x || 0) - imageXOffset(item.align, w),

@@ -42,3 +42,3 @@ import boundStroke from '../bound/boundStroke';

function draw(context, scene, bounds) {
visit(scene, function(item) {
visit(scene, item => {
if (bounds && !bounds.intersects(item.bounds)) return; // bounds check

@@ -45,0 +45,0 @@ var opacity = item.opacity == null ? 1 : item.opacity;

@@ -97,3 +97,3 @@ import Bounds from '../Bounds';

function draw(context, scene, bounds) {
visit(scene, function(item) {
visit(scene, item => {
var opacity = item.opacity == null ? 1 : item.opacity,

@@ -100,0 +100,0 @@ p, x, y, i, lh, tl, str;

@@ -12,5 +12,4 @@ // Path parsing and rendering code adapted from fabric.js -- Thanks!

export default function(pathstr) {
let result = [],
path,
curr,
const result = [];
let curr,
chunks,

@@ -21,3 +20,3 @@ parsed, param,

// First, break path into command sequence
path = pathstr
const path = pathstr
.slice()

@@ -29,3 +28,3 @@ .replace(regexp[0], '###$1')

// Next, parse each command in turn
for (i=0, n=path.length; i<n; ++i) {
for (i = 0, n = path.length; i < n; ++i) {
curr = path[i];

@@ -41,3 +40,3 @@ chunks = curr

parsed = [cmd];
for (j=0, m=chunks.length; j<m; ++j) {
for (j = 0, m = chunks.length; j < m; ++j) {
if ((param = +chunks[j]) === param) { // not NaN

@@ -50,3 +49,4 @@ parsed.push(param);

if (parsed.length - 1 > len) {
let j = 1, m = parsed.length;
const m = parsed.length;
j = 1;
result.push([cmd].concat(parsed.slice(j, j += len)));

@@ -53,0 +53,0 @@

@@ -132,3 +132,3 @@ import ResourceLoader from './ResourceLoader';

return this._ready
? this._ready.then(function() { return r; })
? this._ready.then(() => r)
: Promise.resolve(r);

@@ -153,3 +153,3 @@ },

r._ready = r._loader.ready()
.then(function(redraw) {
.then(redraw => {
if (redraw) call();

@@ -156,0 +156,0 @@ r._ready = null;

@@ -28,7 +28,7 @@ import {image} from 'vega-canvas';

return loader._loader.sanitize(uri, {context:'href'})
.then(function(opt) {
.then(opt => {
decrement(loader);
return opt;
})
.catch(function() {
.catch(() => {
decrement(loader);

@@ -46,3 +46,3 @@ return null;

.sanitize(uri, {context: 'image'})
.then(function(opt) {
.then(opt => {
const url = opt.href;

@@ -65,3 +65,3 @@ if (!url || !Image) throw {url: url};

})
.catch(function(e) {
.catch(e => {
decrement(loader);

@@ -74,6 +74,6 @@ return {complete: false, width: 0, height: 0, src: e && e.url || ''};

var loader = this;
return new Promise(function(accept) {
return new Promise(accept => {
function poll(value) {
if (!loader.pending()) accept(value);
else setTimeout(function() { poll(true); }, 10);
else setTimeout(() => { poll(true); }, 10);
}

@@ -80,0 +80,0 @@ poll(false);

@@ -189,4 +189,4 @@ import Renderer from './Renderer';

let id = ++this._dirtyID,
item, mark, type, mdef, i, n, o;
const id = ++this._dirtyID;
let item, mark, type, mdef, i, n, o;

@@ -206,3 +206,3 @@ for (i=0, n=items.length; i<n; ++i) {

dirtyParents(item, id);
mark.items.forEach(function(i) { i.dirty = id; });
mark.items.forEach(i => { i.dirty = id; });
}

@@ -252,11 +252,11 @@ if (mark.zdirty) continue; // handle in standard drawing pass

let svg = this._svg,
mdef = marks[scene.marktype],
events = scene.interactive === false ? 'none' : null,
isGroup = mdef.tag === 'g',
sibling = null,
i = 0,
parent;
const svg = this._svg,
mdef = marks[scene.marktype],
events = scene.interactive === false ? 'none' : null,
isGroup = mdef.tag === 'g';
parent = bind(scene, el, prev, 'g', svg);
let sibling = null,
i = 0;
const parent = bind(scene, el, prev, 'g', svg);
parent.setAttribute('class', cssClass(scene));

@@ -593,4 +593,4 @@

text(mdef, el, item) {
let tl = textLines(item),
key, value, doc, lh;
const tl = textLines(item);
let key, value, doc, lh;

@@ -597,0 +597,0 @@ if (isArray(tl)) {

@@ -175,4 +175,4 @@ import Renderer from './Renderer';

href(item) {
let href = item.href,
attr;
const href = item.href;
let attr;

@@ -179,0 +179,0 @@ if (href) {

@@ -8,3 +8,3 @@ import blend from './blend';

return function(context, scene, bounds) {
visit(scene, function(item) {
visit(scene, item => {
if (!bounds || bounds.intersects(item.bounds)) {

@@ -11,0 +11,0 @@ drawPath(path, context, item, item);

@@ -11,3 +11,3 @@ import {pickVisit} from '../visit';

return pickVisit(scene, function(item) {
return pickVisit(scene, item => {
var b = item.bounds;

@@ -14,0 +14,0 @@ // first hit test against bounding box

@@ -12,3 +12,2 @@ import pathParse from '../path/parse';

: (!a || !b || !isObject(a) && !isObject(b)) ? a == b
: (a == null || b == null) ? false
: objectEqual(a, b);

@@ -15,0 +14,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc