text: define("nbextensions/jupyter-vega/index",[],(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=26)}([function(t,e,n){"use strict";var r=function(t,e,n){return t.fields=e||[],t.fname=n,t};function i(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}var a=function(t){throw Error(t)},s=function(t){var e,n,r,i=[],o=null,s=0,u=t.length,c="";function l(){i.push(c+t.substring(e,n)),c="",e=n+1}for(t+="",e=n=0;n<u;++n)if("\\"===(r=t[n]))c+=t.substring(e,n),e=++n;else if(r===o)l(),o=null,s=-1;else{if(o)continue;e===s&&'"'===r?(e=n+1,o=r):e===s&&"'"===r?(e=n+1,o=r):"."!==r||s?"["===r?(n>e&&l(),s=e=n+1):"]"===r&&(s||a("Access path missing open bracket: "+t),s>0&&l(),s=0,e=n+1):n>e?l():e=n+1}return s&&a("Access path missing closing bracket: "+t),o&&a("Access path missing closing quote: "+t),n>e&&(n++,l()),i},u=Array.isArray,c=function(t){return t===Object(t)},l=function(t){return"string"==typeof t};function f(t){return u(t)?"["+t.map(f)+"]":c(t)||l(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}var d=function(t,e){var n=s(t),i="return _["+n.map(f).join("][")+"];";return r(Function("_",i),[t=1===n.length?n[0]:t],e||t)},h=[],p=d("id"),g=r((function(t){return t}),h,"identity"),m=r((function(){return 0}),h,"zero"),v=r((function(){return 1}),h,"one"),y=r((function(){return!0}),h,"true"),b=r((function(){return!1}),h,"false");function x(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}var _=function(t,e){var n=t||0;return{level:function(t){return arguments.length?(n=+t,this):n},error:function(){return n>=1&&x(e||"error","ERROR",arguments),this},warn:function(){return n>=2&&x(e||"warn","WARN",arguments),this},info:function(){return n>=3&&x(e||"log","INFO",arguments),this},debug:function(){return n>=4&&x(e||"log","DEBUG",arguments),this}}};function w(...t){return t.reduce((t,e)=>{for(var n in e)if("signals"===n)t.signals=E(t.signals,e.signals);else{var r="legend"===n?{layout:1}:"style"===n||null;O(t,n,e[n],r)}return t},{})}function O(t,e,n,r){var i,o;if(c(n)&&!u(n))for(i in o=c(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?O(o,i,n[i]):o[i]=n[i];else t[e]=n}function E(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}var A=function(t){return t[t.length-1]},k=function(t){return null==t||""===t?null:+t};function S(t){return function(e){return t*Math.exp(e)}}function j(t){return function(e){return Math.log(t*e)}}function D(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function C(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function M(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function F(t,e,n,r){var i=n(t[0]),o=n(A(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function N(t,e){return F(t,e,k,g)}function T(t,e){var n=Math.sign(t[0]);return F(t,e,j(n),S(n))}function R(t,e,n){return F(t,e,M(n),M(1/n))}function z(t,e,n){return F(t,e,D(n),C(n))}function $(t,e,n,r,i){var o=r(t[0]),a=r(A(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function L(t,e,n){return $(t,e,n,k,g)}function I(t,e,n){var r=Math.sign(t[0]);return $(t,e,n,j(r),S(r))}function B(t,e,n,r){return $(t,e,n,M(r),M(1/r))}function P(t,e,n,r){return $(t,e,n,D(r),C(r))}function U(t){return 1+~~(new Date(t).getMonth()/3)}function q(t){return 1+~~(new Date(t).getUTCMonth()/3)}var W=function(t){return null!=t?u(t)?t:[t]:[]},H=function(t,e,n){var r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),(r=o-i)>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]},Y=function(t){return"function"==typeof t},G=function(t,e){var n,i,a,u,c,l,d,h,p,g=[],m=(t=W(t)).map((function(t,e){return null==t?null:(g.push(e),Y(t)?t:s(t).map(f).join("]["))})),v=g.length-1,y=W(e),b="var u,v;return ";if(v<0)return null;for(i=0;i<=v;++i)a=m[n=g[i]],Y(a)?(u="(u=this."+(l="f"+n)+"(a))",c="(v=this."+l+"(b))",(d=d||{})[l]=a):(u="(u=a["+a+"])",c="(v=b["+a+"])"),l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[n]?(p=1,h=-1):(p=-1,h=1),b+="("+u+"<"+c+"||u==null)&&v!=null?"+h+":(u>v||v==null)&&u!=null?"+p+":"+l+"!==u&&v===v?"+h+":v!==v&&u===u?"+p+(n<v?":":":0");return a=Function("a","b",b+";"),d&&(a=a.bind(d)),t=t.reduce((function(t,e){return Y(e)?(o(e)||[]).forEach((function(e){t[e]=1})):null!=e&&(t[e+""]=1),t}),{}),r(a,Object.keys(t))},V=function(t){return Y(t)?t:function(){return t}},X=function(t,e){var n,r;function i(){e(r),n=r=null}return function(e){r=e,n&&clearTimeout(n),n=setTimeout(i,t)}},J=function(t){for(var e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r])t[n]=e[n];return t},Z=function(t,e){var n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];null==r||r!=r;r=t[++a]);for(i=o=r;a<n;++a)null!=(r=t[a])&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);null==r||r!=r;r=e(t[++a]));for(i=o=r;a<n;++a)null!=(r=e(t[a]))&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]},Q=function(t,e){var n,r,i,o,a,s=-1,u=t.length;if(null==e){for(;++s<u;)if(null!=(r=t[s])&&r>=r){n=i=r;break}for(o=a=s;++s<u;)null!=(r=t[s])&&(n>r&&(n=r,o=s),i<r&&(i=r,a=s))}else{for(;++s<u;)if(null!=(r=e(t[s],s,t))&&r>=r){n=i=r;break}for(o=a=s;++s<u;)null!=(r=e(t[s],s,t))&&(n>r&&(n=r,o=s),i<r&&(i=r,a=s))}return[o,a]};const K=Object.prototype.hasOwnProperty;var tt=function(t,e){return K.call(t,e)},et={},nt=function(t){var e,n,r={};function i(t){return tt(r,t)&&r[t]!==et}return e={size:0,empty:0,object:r,has:i,get:function(t){return i(t)?r[t]:void 0},set:function(t,n){return i(t)||(++e.size,r[t]===et&&--e.empty),r[t]=n,this},delete:function(t){return i(t)&&(--e.size,++e.empty,r[t]=et),this},clear:function(){e.size=e.empty=0,e.object=r={}},test:function(t){return arguments.length?(n=t,e):n},clean:function(){var t,i,o={},a=0;for(t in r)(i=r[t])===et||n&&n(i)||(o[t]=i,++a);e.size=a,e.empty=0,e.object=r=o}},t&&Object.keys(t).forEach((function(n){e.set(n,t[n])})),e},rt=function(t,e,n,r,i,o){if(!n&&0!==n)return o;var a,s,u=t[0],c=A(t),l=+n;return c<u&&(a=u,u=c,c=a),(a=Math.abs(e-u))<(s=Math.abs(c-e))&&a<=l?r:s<=l?i:o},it=function(t,e){var n=t.prototype=Object.create(e.prototype);return n.constructor=t,n},ot=function(t,e,n,r){var i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)},at=function(t){return"boolean"==typeof t},st=function(t){return"[object Date]"===Object.prototype.toString.call(t)},ut=function(t){return"number"==typeof t},ct=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},lt=function(t,e){t&&(t=e?W(t).map((function(t){return t.replace(/\\(.)/g,"$1")})):W(t));var n=t&&t.length?Function("_","return ''+"+t.map((function(t){return"_["+(e?f(t):s(t).map(f).join("]["))+"]"})).join("+'|'+")+";"):function(){return""};return r(n,t,"key")},ft=function(t,e){const n=t[0],r=A(t),i=+e;return i?1===i?r:n+i*(r-n):n},dt=function(t,e,n,r){var i=e.length,o=n.length;if(!o)return e;if(!i)return n;for(var a=r||new e.constructor(i+o),s=0,u=0,c=0;s<i&&u<o;++c)a[c]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++c)a[c]=e[s];for(;u<o;++u,++c)a[c]=n[u];return a},ht=function(t,e){for(var n="";--e>=0;)n+=t;return n},pt=function(t,e,n,r){var i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?ht(i,a)+o:"center"===r?ht(i,~~(a/2))+o+ht(i,Math.ceil(a/2)):o+ht(i,a)},gt=function(t){return t&&A(t)-t[0]||0},mt=function(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t};function vt(t){return ut(t)?t:st(t)?t:Date.parse(t)}var yt=function(t,e){return e=e||vt,null==t||""===t?null:e(t)},bt=function(t){return null==t||""===t?null:t+""},xt=function(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=!0;return e},_t=function(t,e,n,r){var i=null!=r?r:"…",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i},wt=function(t,e,n){if(t){var r,i=0,o=t.length;if(e)for(;i<o;++i)(r=e(t[i]))&&n(r,i,t);else t.forEach(n)}};n.d(e,"f",(function(){return r})),n.d(e,"h",(function(){return i})),n.d(e,"g",(function(){return o})),n.d(e,"w",(function(){return p})),n.d(e,"x",(function(){return g})),n.d(e,"jb",(function(){return m})),n.d(e,"N",(function(){return v})),n.d(e,"fb",(function(){return y})),n.d(e,"r",(function(){return b})),n.d(e,"K",(function(){return _})),n.d(e,"d",(function(){return 0})),n.d(e,"b",(function(){return 1})),n.d(e,"e",(function(){return 2})),n.d(e,"c",(function(){return 3})),n.d(e,"a",(function(){return 4})),n.d(e,"M",(function(){return w})),n.d(e,"ib",(function(){return O})),n.d(e,"P",(function(){return N})),n.d(e,"Q",(function(){return T})),n.d(e,"R",(function(){return R})),n.d(e,"S",(function(){return z})),n.d(e,"kb",(function(){return L})),n.d(e,"lb",(function(){return I})),n.d(e,"mb",(function(){return B})),n.d(e,"nb",(function(){return P})),n.d(e,"U",(function(){return U})),n.d(e,"gb",(function(){return q})),n.d(e,"i",(function(){return W})),n.d(e,"j",(function(){return H})),n.d(e,"k",(function(){return G})),n.d(e,"l",(function(){return V})),n.d(e,"m",(function(){return X})),n.d(e,"n",(function(){return a})),n.d(e,"o",(function(){return J})),n.d(e,"p",(function(){return Z})),n.d(e,"q",(function(){return Q})),n.d(e,"s",(function(){return nt})),n.d(e,"t",(function(){return d})),n.d(e,"u",(function(){return rt})),n.d(e,"v",(function(){return tt})),n.d(e,"y",(function(){return it})),n.d(e,"z",(function(){return ot})),n.d(e,"A",(function(){return u})),n.d(e,"B",(function(){return at})),n.d(e,"C",(function(){return st})),n.d(e,"D",(function(){return Y})),n.d(e,"E",(function(){return ut})),n.d(e,"F",(function(){return c})),n.d(e,"G",(function(){return ct})),n.d(e,"H",(function(){return l})),n.d(e,"I",(function(){return lt})),n.d(e,"J",(function(){return ft})),n.d(e,"L",(function(){return dt})),n.d(e,"O",(function(){return pt})),n.d(e,"T",(function(){return A})),n.d(e,"V",(function(){return ht})),n.d(e,"W",(function(){return gt})),n.d(e,"X",(function(){return s})),n.d(e,"Y",(function(){return f})),n.d(e,"Z",(function(){return mt})),n.d(e,"ab",(function(){return yt})),n.d(e,"bb",(function(){return k})),n.d(e,"db",(function(){return bt})),n.d(e,"cb",(function(){return xt})),n.d(e,"eb",(function(){return _t})),n.d(e,"hb",(function(){return wt}))},,,,,,,,function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(0);function i(e,n){const i=n&&n.property?Object(r.t)(n.property):r.x;return!Object(r.F)(e)||(o=e,"function"==typeof t&&Object(r.D)(t.isBuffer)&&t.isBuffer(o))?i(JSON.parse(e)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(i(e));var o}i.responseType="json"}).call(this,n(15).Buffer)},function(t,e,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,e){var n,i,o;return e=e||{},n=JSON.stringify([1],void 0,void 0===e.indent?2:e.indent).slice(2,-3),i=""===n?1/0:void 0===e.maxLength?80:e.maxLength,o=e.replacer,function t(e,a,s){var u,c,l,f,d,h,p,g,m,v,y,b;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(y=JSON.stringify(e,o)))return y;if(p=i-a.length-s,y.length<=p&&(m=y.replace(r,(function(t,e){return e||t+" "}))).length<=p)return m;if(null!=o&&(e=JSON.parse(y),o=void 0),"object"==typeof e&&null!==e){if(g=a+n,l=[],c=0,Array.isArray(e))for(v="[",u="]",p=e.length;c<p;c++)l.push(t(e[c],g,c===p-1?0:1)||"null");else for(v="{",u="}",p=(h=Object.keys(e)).length;c<p;c++)f=h[c],d=JSON.stringify(f)+": ",void 0!==(b=t(e[f],g,d.length+(c===p-1?0:1)))&&l.push(d+b);if(l.length>0)return[v,n+l.join(",\n"+g),u].join("\n"+a)}return y}(t,"",0)}},function(t,e,n){"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var n,r="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,u=Object.keys(e).sort(i&&i(e));for(a="",n=0;n<u.length;n++){var c=u[n],l=t(e[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(t)}},,function(t,e,n){(function(n){var r;e=t.exports=h,r="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],s=e.src=[],u=e.tokens={},c=0;function l(t){u[t]=c++}l("NUMERICIDENTIFIER"),s[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",l("NUMERICIDENTIFIERLOOSE"),s[u.NUMERICIDENTIFIERLOOSE]="[0-9]+",l("NONNUMERICIDENTIFIER"),s[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",l("MAINVERSION"),s[u.MAINVERSION]="("+s[u.NUMERICIDENTIFIER]+")\\.("+s[u.NUMERICIDENTIFIER]+")\\.("+s[u.NUMERICIDENTIFIER]+")",l("MAINVERSIONLOOSE"),s[u.MAINVERSIONLOOSE]="("+s[u.NUMERICIDENTIFIERLOOSE]+")\\.("+s[u.NUMERICIDENTIFIERLOOSE]+")\\.("+s[u.NUMERICIDENTIFIERLOOSE]+")",l("PRERELEASEIDENTIFIER"),s[u.PRERELEASEIDENTIFIER]="(?:"+s[u.NUMERICIDENTIFIER]+"|"+s[u.NONNUMERICIDENTIFIER]+")",l("PRERELEASEIDENTIFIERLOOSE"),s[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[u.NUMERICIDENTIFIERLOOSE]+"|"+s[u.NONNUMERICIDENTIFIER]+")",l("PRERELEASE"),s[u.PRERELEASE]="(?:-("+s[u.PRERELEASEIDENTIFIER]+"(?:\\."+s[u.PRERELEASEIDENTIFIER]+")*))",l("PRERELEASELOOSE"),s[u.PRERELEASELOOSE]="(?:-?("+s[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[u.PRERELEASEIDENTIFIERLOOSE]+")*))",l("BUILDIDENTIFIER"),s[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+",l("BUILD"),s[u.BUILD]="(?:\\+("+s[u.BUILDIDENTIFIER]+"(?:\\."+s[u.BUILDIDENTIFIER]+")*))",l("FULL"),l("FULLPLAIN"),s[u.FULLPLAIN]="v?"+s[u.MAINVERSION]+s[u.PRERELEASE]+"?"+s[u.BUILD]+"?",s[u.FULL]="^"+s[u.FULLPLAIN]+"$",l("LOOSEPLAIN"),s[u.LOOSEPLAIN]="[v=\\s]*"+s[u.MAINVERSIONLOOSE]+s[u.PRERELEASELOOSE]+"?"+s[u.BUILD]+"?",l("LOOSE"),s[u.LOOSE]="^"+s[u.LOOSEPLAIN]+"$",l("GTLT"),s[u.GTLT]="((?:<|>)?=?)",l("XRANGEIDENTIFIERLOOSE"),s[u.XRANGEIDENTIFIERLOOSE]=s[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),s[u.XRANGEIDENTIFIER]=s[u.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),s[u.XRANGEPLAIN]="[v=\\s]*("+s[u.XRANGEIDENTIFIER]+")(?:\\.("+s[u.XRANGEIDENTIFIER]+")(?:\\.("+s[u.XRANGEIDENTIFIER]+")(?:"+s[u.PRERELEASE]+")?"+s[u.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),s[u.XRANGEPLAINLOOSE]="[v=\\s]*("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:"+s[u.PRERELEASELOOSE]+")?"+s[u.BUILD]+"?)?)?",l("XRANGE"),s[u.XRANGE]="^"+s[u.GTLT]+"\\s*"+s[u.XRANGEPLAIN]+"$",l("XRANGELOOSE"),s[u.XRANGELOOSE]="^"+s[u.GTLT]+"\\s*"+s[u.XRANGEPLAINLOOSE]+"$",l("COERCE"),s[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),a[u.COERCERTL]=new RegExp(s[u.COERCE],"g"),l("LONETILDE"),s[u.LONETILDE]="(?:~>?)",l("TILDETRIM"),s[u.TILDETRIM]="(\\s*)"+s[u.LONETILDE]+"\\s+",a[u.TILDETRIM]=new RegExp(s[u.TILDETRIM],"g");l("TILDE"),s[u.TILDE]="^"+s[u.LONETILDE]+s[u.XRANGEPLAIN]+"$",l("TILDELOOSE"),s[u.TILDELOOSE]="^"+s[u.LONETILDE]+s[u.XRANGEPLAINLOOSE]+"$",l("LONECARET"),s[u.LONECARET]="(?:\\^)",l("CARETTRIM"),s[u.CARETTRIM]="(\\s*)"+s[u.LONECARET]+"\\s+",a[u.CARETTRIM]=new RegExp(s[u.CARETTRIM],"g");l("CARET"),s[u.CARET]="^"+s[u.LONECARET]+s[u.XRANGEPLAIN]+"$",l("CARETLOOSE"),s[u.CARETLOOSE]="^"+s[u.LONECARET]+s[u.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),s[u.COMPARATORLOOSE]="^"+s[u.GTLT]+"\\s*("+s[u.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),s[u.COMPARATOR]="^"+s[u.GTLT]+"\\s*("+s[u.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),s[u.COMPARATORTRIM]="(\\s*)"+s[u.GTLT]+"\\s*("+s[u.LOOSEPLAIN]+"|"+s[u.XRANGEPLAIN]+")",a[u.COMPARATORTRIM]=new RegExp(s[u.COMPARATORTRIM],"g");l("HYPHENRANGE"),s[u.HYPHENRANGE]="^\\s*("+s[u.XRANGEPLAIN]+")\\s+-\\s+("+s[u.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),s[u.HYPHENRANGELOOSE]="^\\s*("+s[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[u.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),s[u.STAR]="(<|>)?=?\\s*\\*";for(var f=0;f<c;f++)r(f,s[f]),a[f]||(a[f]=new RegExp(s[f]));function d(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof h)return t;if("string"!=typeof t)return null;if(t.length>i)return null;if(!(e.loose?a[u.LOOSE]:a[u.FULL]).test(t))return null;try{return new h(t,e)}catch(t){return null}}function h(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof h){if(t.loose===e.loose)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof h))return new h(t,e);r("SemVer",t,e),this.options=e,this.loose=!!e.loose;var n=t.trim().match(e.loose?a[u.LOOSE]:a[u.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<o)return e}return t})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}e.parse=d,e.valid=function(t,e){var n=d(t,e);return n?n.version:null},e.clean=function(t,e){var n=d(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null},e.SemVer=h,h.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},h.prototype.toString=function(){return this.version},h.prototype.compare=function(t){return r("SemVer.compare",this.version,this.options,t),t instanceof h||(t=new h(t,this.options)),this.compareMain(t)||this.comparePre(t)},h.prototype.compareMain=function(t){return t instanceof h||(t=new h(t,this.options)),g(this.major,t.major)||g(this.minor,t.minor)||g(this.patch,t.patch)},h.prototype.comparePre=function(t){if(t instanceof h||(t=new h(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var n=this.prerelease[e],i=t.prerelease[e];if(r("prerelease compare",e,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return g(n,i)}while(++e)},h.prototype.compareBuild=function(t){t instanceof h||(t=new h(t,this.options));var e=0;do{var n=this.build[e],i=t.build[e];if(r("prerelease compare",e,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return g(n,i)}while(++e)},h.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new h(t,n).inc(e,r).version}catch(t){return null}},e.diff=function(t,e){if(b(t,e))return null;var n=d(t),r=d(e),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var a in n)if(("major"===a||"minor"===a||"patch"===a)&&n[a]!==r[a])return i+a;return o},e.compareIdentifiers=g;var p=/^[0-9]+$/;function g(t,e){var n=p.test(t),r=p.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1}function m(t,e,n){return new h(t,n).compare(new h(e,n))}function v(t,e,n){return m(t,e,n)>0}function y(t,e,n){return m(t,e,n)<0}function b(t,e,n){return 0===m(t,e,n)}function x(t,e,n){return 0!==m(t,e,n)}function _(t,e,n){return m(t,e,n)>=0}function w(t,e,n){return m(t,e,n)<=0}function O(t,e,n,r){switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t===n;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return b(t,n,r);case"!=":return x(t,n,r);case">":return v(t,n,r);case">=":return _(t,n,r);case"<":return y(t,n,r);case"<=":return w(t,n,r);default:throw new TypeError("Invalid operator: "+e)}}function E(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof E){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof E))return new E(t,e);r("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===A?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}e.rcompareIdentifiers=function(t,e){return g(e,t)},e.major=function(t,e){return new h(t,e).major},e.minor=function(t,e){return new h(t,e).minor},e.patch=function(t,e){return new h(t,e).patch},e.compare=m,e.compareLoose=function(t,e){return m(t,e,!0)},e.compareBuild=function(t,e,n){var r=new h(t,n),i=new h(e,n);return r.compare(i)||r.compareBuild(i)},e.rcompare=function(t,e,n){return m(e,t,n)},e.sort=function(t,n){return t.sort((function(t,r){return e.compareBuild(t,r,n)}))},e.rsort=function(t,n){return t.sort((function(t,r){return e.compareBuild(r,t,n)}))},e.gt=v,e.lt=y,e.eq=b,e.neq=x,e.gte=_,e.lte=w,e.cmp=O,e.Comparator=E;var A={};function k(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof k)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new k(t.raw,e);if(t instanceof E)return new k(t.value,e);if(!(this instanceof k))return new k(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function S(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n}function j(t){return!t||"x"===t.toLowerCase()||"*"===t}function D(t,e,n,r,i,o,a,s,u,c,l,f,d){return((e=j(n)?"":j(r)?">="+n+".0.0":j(i)?">="+n+"."+r+".0":">="+e)+" "+(s=j(u)?"":j(c)?"<"+(+u+1)+".0.0":j(l)?"<"+u+"."+(+c+1)+".0":f?"<="+u+"."+c+"."+l+"-"+f:"<="+s)).trim()}function C(t,e,n){for(var i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(i=0;i<t.length;i++)if(r(t[i].semver),t[i].semver!==A&&t[i].semver.prerelease.length>0){var o=t[i].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}function M(t,e,n){try{e=new k(e,n)}catch(t){return!1}return e.test(t)}function F(t,e,n,r){var i,o,a,s,u;switch(t=new h(t,r),e=new k(e,r),n){case">":i=v,o=w,a=y,s=">",u=">=";break;case"<":i=y,o=_,a=v,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(M(t,e,r))return!1;for(var c=0;c<e.set.length;++c){var l=e.set[c],f=null,d=null;if(l.forEach((function(t){t.semver===A&&(t=new E(">=0.0.0")),f=f||t,d=d||t,i(t.semver,f.semver,r)?f=t:a(t.semver,d.semver,r)&&(d=t)})),f.operator===s||f.operator===u)return!1;if((!d.operator||d.operator===s)&&o(t,d.semver))return!1;if(d.operator===u&&a(t,d.semver))return!1}return!0}E.prototype.parse=function(t){var e=this.options.loose?a[u.COMPARATORLOOSE]:a[u.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new h(n[2],this.options.loose):this.semver=A},E.prototype.toString=function(){return this.value},E.prototype.test=function(t){if(r("Comparator.test",t,this.options.loose),this.semver===A||t===A)return!0;if("string"==typeof t)try{t=new h(t,this.options)}catch(t){return!1}return O(t,this.operator,this.semver,this.options)},E.prototype.intersects=function(t,e){if(!(t instanceof E))throw new TypeError("a Comparator is required");var n;if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new k(t.value,e),M(this.value,n,e));if(""===t.operator)return""===t.value||(n=new k(this.value,e),M(t.semver,n,e));var r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=O(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=O(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||i||o&&a||s||u},e.Range=k,k.prototype.format=function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range},k.prototype.toString=function(){return this.range},k.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var n=e?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];t=t.replace(n,D),r("hyphen replace",t),t=t.replace(a[u.COMPARATORTRIM],"$1$2$3"),r("comparator trim",t,a[u.COMPARATORTRIM]),t=(t=(t=t.replace(a[u.TILDETRIM],"$1~")).replace(a[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=e?a[u.COMPARATORLOOSE]:a[u.COMPARATOR],o=t.split(" ").map((function(t){return function(t,e){return r("comp",t,e),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){r("caret",t,e);var n=e.loose?a[u.CARETLOOSE]:a[u.CARET];return t.replace(n,(function(e,n,i,o,a){var s;return r("caret",t,e,n,i,o,a),j(n)?s="":j(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":j(o)?s="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),s="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),r("caret return",s),s}))}(t,e)})).join(" ")}(t,e),r("caret",t),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){var n=e.loose?a[u.TILDELOOSE]:a[u.TILDE];return t.replace(n,(function(e,n,i,o,a){var s;return r("tilde",t,e,n,i,o,a),j(n)?s="":j(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":j(o)?s=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":a?(r("replaceTilde pr",a),s=">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0"):s=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",r("tilde return",s),s}))}(t,e)})).join(" ")}(t,e),r("tildes",t),t=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return function(t,e){t=t.trim();var n=e.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return t.replace(n,(function(n,i,o,a,s,u){r("xRange",t,n,i,o,a,s,u);var c=j(o),l=c||j(a),f=l||j(s),d=f;return"="===i&&d&&(i=""),u=e.includePrerelease?"-0":"",c?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(l&&(a=0),s=0,">"===i?(i=">=",l?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",l?o=+o+1:a=+a+1),n=i+o+"."+a+"."+s+u):l?n=">="+o+".0.0"+u+" <"+(+o+1)+".0.0"+u:f&&(n=">="+o+"."+a+".0"+u+" <"+o+"."+(+a+1)+".0"+u),r("xRange return",n),n}))}(t,e)})).join(" ")}(t,e),r("xrange",t),t=function(t,e){return r("replaceStars",t,e),t.trim().replace(a[u.STAR],"")}(t,e),r("stars",t),t}(t,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(t){return!!t.match(i)}))),o=o.map((function(t){return new E(t,this.options)}),this)},k.prototype.intersects=function(t,e){if(!(t instanceof k))throw new TypeError("a Range is required");return this.set.some((function(n){return S(n,e)&&t.set.some((function(t){return S(t,e)&&n.every((function(n){return t.every((function(t){return n.intersects(t,e)}))}))}))}))},e.toComparators=function(t,e){return new k(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))},k.prototype.test=function(t){if(!t)return!1;if("string"==typeof t)try{t=new h(t,this.options)}catch(t){return!1}for(var e=0;e<this.set.length;e++)if(C(this.set[e],t,this.options))return!0;return!1},e.satisfies=M,e.maxSatisfying=function(t,e,n){var r=null,i=null;try{var o=new k(e,n)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(r&&-1!==i.compare(t)||(i=new h(r=t,n)))})),r},e.minSatisfying=function(t,e,n){var r=null,i=null;try{var o=new k(e,n)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(r&&1!==i.compare(t)||(i=new h(r=t,n)))})),r},e.minVersion=function(t,e){t=new k(t,e);var n=new h("0.0.0");if(t.test(n))return n;if(n=new h("0.0.0-0"),t.test(n))return n;n=null;for(var r=0;r<t.set.length;++r){t.set[r].forEach((function(t){var e=new h(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!v(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}))}if(n&&t.test(n))return n;return null},e.validRange=function(t,e){try{return new k(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,n){return F(t,e,"<",n)},e.gtr=function(t,e,n){return F(t,e,">",n)},e.outside=F,e.prerelease=function(t,e){var n=d(t,e);return n&&n.prerelease.length?n.prerelease:null},e.intersects=function(t,e,n){return t=new k(t,n),e=new k(e,n),t.intersects(e)},e.coerce=function(t,e){if(t instanceof h)return t;"number"==typeof t&&(t=String(t));if("string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=a[u.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a[u.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;a[u.COERCERTL].lastIndex=-1}else n=t.match(a[u.COERCE]);if(null===n)return null;return d(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),e)}}).call(this,n(27))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e[0],version:e[1]}}},,function(t,e,n){"use strict";(function(t){
  /*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <http://feross.org>
   * @license  MIT
   */
  var r=n(29),i=n(30),o=n(31);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=d(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|h(e.length);return 0===(t=s(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=s(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e){var n=e.length<0?0:0|h(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return P(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(c(t,o+d)!==c(e,d)){f=!1;break}if(f)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function x(t,e,n,r){return q(P(e,t.length-n),t,n,r)}function _(t,e,n,r){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return _(t,e,n,r)}function O(t,e,n,r){return q(U(e),t,n,r)}function E(t,e,n,r){return q(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=S));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=t.slice(e,n),f=0;f<s;++f)if(c[f]!==l[f]){o=c[f],a=l[f];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function j(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function C(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=B(t[o]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function F(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function T(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function z(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(t,e,n,r,o){return o||z(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,o){return o||z(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||F(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||F(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||F(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||F(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||F(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||F(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||F(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||F(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||F(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return $(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return $(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=u.isBuffer(t)?t:P(new u(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var I=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(28))},function(t){t.exports=JSON.parse('{"a":"5.8.1"}')},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return N})),n.d(r,"deepClone",(function(){return T})),n.d(r,"getValueByPointer",(function(){return $})),n.d(r,"applyOperation",(function(){return L})),n.d(r,"applyPatch",(function(){return I})),n.d(r,"applyReducer",(function(){return B})),n.d(r,"validator",(function(){return P})),n.d(r,"validate",(function(){return U})),n.d(r,"_areEquals",(function(){return q}));var i={};n.r(i),n.d(i,"unobserve",(function(){return G})),n.d(i,"observe",(function(){return V})),n.d(i,"generate",(function(){return X})),n.d(i,"compare",(function(){return Z}));var o={};n.r(o),n.d(o,"aggregate",(function(){return Xi})),n.d(o,"bin",(function(){return Zi})),n.d(o,"collect",(function(){return to})),n.d(o,"compare",(function(){return eo})),n.d(o,"countpattern",(function(){return ro})),n.d(o,"cross",(function(){return oo})),n.d(o,"density",(function(){return lo})),n.d(o,"dotbin",(function(){return mo})),n.d(o,"expression",(function(){return vo})),n.d(o,"extent",(function(){return bo})),n.d(o,"facet",(function(){return wo})),n.d(o,"field",(function(){return Eo})),n.d(o,"filter",(function(){return ko})),n.d(o,"flatten",(function(){return So})),n.d(o,"fold",(function(){return jo})),n.d(o,"formula",(function(){return Do})),n.d(o,"generate",(function(){return Co})),n.d(o,"impute",(function(){return No})),n.d(o,"joinaggregate",(function(){return To})),n.d(o,"kde",(function(){return zo})),n.d(o,"key",(function(){return $o})),n.d(o,"load",(function(){return Io})),n.d(o,"lookup",(function(){return Po})),n.d(o,"multiextent",(function(){return Uo})),n.d(o,"multivalues",(function(){return Wo})),n.d(o,"params",(function(){return Yo})),n.d(o,"pivot",(function(){return Go})),n.d(o,"prefacet",(function(){return Xo})),n.d(o,"project",(function(){return Jo})),n.d(o,"proxy",(function(){return Zo})),n.d(o,"quantile",(function(){return Ko})),n.d(o,"relay",(function(){return ea})),n.d(o,"sample",(function(){return na})),n.d(o,"sequence",(function(){return ra})),n.d(o,"sieve",(function(){return ia})),n.d(o,"subflow",(function(){return xo})),n.d(o,"timeunit",(function(){return Es})),n.d(o,"tupleindex",(function(){return Ss})),n.d(o,"values",(function(){return js})),n.d(o,"window",(function(){return Ns}));var a={};n.r(a),n.d(a,"bound",(function(){return Ah})),n.d(a,"identifier",(function(){return jh})),n.d(a,"mark",(function(){return Dh})),n.d(a,"overlap",(function(){return Ch})),n.d(a,"render",(function(){return Lh})),n.d(a,"viewlayout",(function(){return ap}));var s={};n.r(s),n.d(s,"interpolate",(function(){return sm})),n.d(s,"interpolateArray",(function(){return Kg})),n.d(s,"interpolateBasis",(function(){return Bg})),n.d(s,"interpolateBasisClosed",(function(){return Pg})),n.d(s,"interpolateDate",(function(){return em})),n.d(s,"interpolateDiscrete",(function(){return av})),n.d(s,"interpolateHue",(function(){return sv})),n.d(s,"interpolateNumber",(function(){return nm})),n.d(s,"interpolateNumberArray",(function(){return Zg})),n.d(s,"interpolateObject",(function(){return rm})),n.d(s,"interpolateRound",(function(){return um})),n.d(s,"interpolateString",(function(){return am})),n.d(s,"interpolateTransformCss",(function(){return dv})),n.d(s,"interpolateTransformSvg",(function(){return hv})),n.d(s,"interpolateZoom",(function(){return mv})),n.d(s,"interpolateRgb",(function(){return Gg})),n.d(s,"interpolateRgbBasis",(function(){return Xg})),n.d(s,"interpolateRgbBasisClosed",(function(){return Jg})),n.d(s,"interpolateHsl",(function(){return yv})),n.d(s,"interpolateHslLong",(function(){return bv})),n.d(s,"interpolateLab",(function(){return Bv})),n.d(s,"interpolateHcl",(function(){return Uv})),n.d(s,"interpolateHclLong",(function(){return qv})),n.d(s,"interpolateCubehelix",(function(){return Kv})),n.d(s,"interpolateCubehelixLong",(function(){return ty})),n.d(s,"piecewise",(function(){return Jm})),n.d(s,"quantize",(function(){return ey}));var u={};n.r(u),n.d(u,"axisticks",(function(){return my})),n.d(u,"datajoin",(function(){return vy})),n.d(u,"encode",(function(){return xy})),n.d(u,"legendentries",(function(){return jy})),n.d(u,"linkpath",(function(){return Ty})),n.d(u,"pie",(function(){return Iy})),n.d(u,"scale",(function(){return qy})),n.d(u,"sortitems",(function(){return Gy})),n.d(u,"stack",(function(){return Xy})),n.d(u,"validTicks",(function(){return hy}));var c={};n.r(c),n.d(c,"contour",(function(){return vb})),n.d(c,"geojson",(function(){return xb})),n.d(c,"geopath",(function(){return Fw})),n.d(c,"geopoint",(function(){return Nw})),n.d(c,"geoshape",(function(){return Tw})),n.d(c,"graticule",(function(){return Lw})),n.d(c,"heatmap",(function(){return Iw})),n.d(c,"isocontour",(function(){return ab})),n.d(c,"kde2d",(function(){return hb})),n.d(c,"projection",(function(){return Pw}));var l={};n.r(l),n.d(l,"force",(function(){return LO}));var f={};n.r(f),n.d(f,"nest",(function(){return ZO})),n.d(f,"pack",(function(){return AE})),n.d(f,"partition",(function(){return CE})),n.d(f,"stratify",(function(){return LE})),n.d(f,"tree",(function(){return JE})),n.d(f,"treelinks",(function(){return QE})),n.d(f,"treemap",(function(){return aA}));var d={};n.r(d),n.d(d,"loess",(function(){return cA})),n.d(d,"regression",(function(){return fA}));var h={};n.r(h),n.d(h,"voronoi",(function(){return NA}));var p={};n.r(p),n.d(p,"wordcloud",(function(){return XA}));var g={};n.r(g),n.d(g,"crossfilter",(function(){return rk})),n.d(g,"resolvefilter",(function(){return ok}));var m={};n.r(m),n.d(m,"version",(function(){return ak.a})),n.d(m,"Dataflow",(function(){return Mr})),n.d(m,"EventStream",(function(){return At})),n.d(m,"Parameters",(function(){return vt})),n.d(m,"Pulse",(function(){return xr})),n.d(m,"MultiPulse",(function(){return Ar})),n.d(m,"Operator",(function(){return _t})),n.d(m,"Transform",(function(){return Tr})),n.d(m,"changeset",(function(){return gt})),n.d(m,"ingest",(function(){return ct})),n.d(m,"isTuple",(function(){return at})),n.d(m,"definition",(function(){return $r})),n.d(m,"transform",(function(){return Lr})),n.d(m,"transforms",(function(){return zr})),n.d(m,"tupleid",(function(){return st})),n.d(m,"scale",(function(){return Km})),n.d(m,"scheme",(function(){return fy})),n.d(m,"interpolate",(function(){return sy})),n.d(m,"interpolateColors",(function(){return iy})),n.d(m,"interpolateRange",(function(){return ry})),n.d(m,"quantizeInterpolator",(function(){return oy})),n.d(m,"projection",(function(){return jw})),n.d(m,"View",(function(){return oM})),n.d(m,"expressionFunction",(function(){return CC})),n.d(m,"formatLocale",(function(){return ig})),n.d(m,"timeFormatLocale",(function(){return dr})),n.d(m,"parse",(function(){return BT})),n.d(m,"runtime",(function(){return UC})),n.d(m,"runtimeContext",(function(){return WC})),n.d(m,"bandwidthNRD",(function(){return ni})),n.d(m,"bin",(function(){return ri})),n.d(m,"bootstrapCI",(function(){return ai})),n.d(m,"dotbin",(function(){return si})),n.d(m,"quantiles",(function(){return ti})),n.d(m,"quartiles",(function(){return ei})),n.d(m,"random",(function(){return ii})),n.d(m,"setRandom",(function(){return oi})),n.d(m,"randomLCG",(function(){return ui})),n.d(m,"randomInteger",(function(){return ci})),n.d(m,"randomKDE",(function(){return yi})),n.d(m,"randomLogNormal",(function(){return Oi})),n.d(m,"sampleLogNormal",(function(){return bi})),n.d(m,"densityLogNormal",(function(){return xi})),n.d(m,"cumulativeLogNormal",(function(){return _i})),n.d(m,"quantileLogNormal",(function(){return wi})),n.d(m,"randomMixture",(function(){return Ei})),n.d(m,"randomNormal",(function(){return vi})),n.d(m,"sampleNormal",(function(){return hi})),n.d(m,"densityNormal",(function(){return pi})),n.d(m,"cumulativeNormal",(function(){return gi})),n.d(m,"quantileNormal",(function(){return mi})),n.d(m,"randomUniform",(function(){return Di})),n.d(m,"sampleUniform",(function(){return Ai})),n.d(m,"densityUniform",(function(){return ki})),n.d(m,"cumulativeUniform",(function(){return Si})),n.d(m,"quantileUniform",(function(){return ji})),n.d(m,"regressionLinear",(function(){return Ti})),n.d(m,"regressionLog",(function(){return Ri})),n.d(m,"regressionExp",(function(){return zi})),n.d(m,"regressionPow",(function(){return $i})),n.d(m,"regressionQuad",(function(){return Li})),n.d(m,"regressionPoly",(function(){return Ii})),n.d(m,"regressionLoess",(function(){return Pi})),n.d(m,"sampleCurve",(function(){return Hi})),n.d(m,"timeUnits",(function(){return ma})),n.d(m,"timeFloor",(function(){return Aa})),n.d(m,"utcFloor",(function(){return Ca})),n.d(m,"timeUnitSpecifier",(function(){return is})),n.d(m,"timeFormat",(function(){return os})),n.d(m,"utcFormat",(function(){return as})),n.d(m,"timeInterval",(function(){return Xa})),n.d(m,"timeOffset",(function(){return Qa})),n.d(m,"timeSequence",(function(){return es})),n.d(m,"utcInterval",(function(){return Ja})),n.d(m,"utcOffset",(function(){return Ka})),n.d(m,"utcSequence",(function(){return ns})),n.d(m,"timeBin",(function(){return Os})),n.d(m,"accessor",(function(){return et.f})),n.d(m,"accessorName",(function(){return et.h})),n.d(m,"accessorFields",(function(){return et.g})),n.d(m,"id",(function(){return et.w})),n.d(m,"identity",(function(){return et.x})),n.d(m,"zero",(function(){return et.jb})),n.d(m,"one",(function(){return et.N})),n.d(m,"truthy",(function(){return et.fb})),n.d(m,"falsy",(function(){return et.r})),n.d(m,"logger",(function(){return et.K})),n.d(m,"None",(function(){return et.d})),n.d(m,"Error",(function(){return et.b})),n.d(m,"Warn",(function(){return et.e})),n.d(m,"Info",(function(){return et.c})),n.d(m,"Debug",(function(){return et.a})),n.d(m,"mergeConfig",(function(){return et.M})),n.d(m,"writeConfig",(function(){return et.ib})),n.d(m,"panLinear",(function(){return et.P})),n.d(m,"panLog",(function(){return et.Q})),n.d(m,"panPow",(function(){return et.R})),n.d(m,"panSymlog",(function(){return et.S})),n.d(m,"zoomLinear",(function(){return et.kb})),n.d(m,"zoomLog",(function(){return et.lb})),n.d(m,"zoomPow",(function(){return et.mb})),n.d(m,"zoomSymlog",(function(){return et.nb})),n.d(m,"quarter",(function(){return et.U})),n.d(m,"utcquarter",(function(){return et.gb})),n.d(m,"array",(function(){return et.i})),n.d(m,"clampRange",(function(){return et.j})),n.d(m,"compare",(function(){return et.k})),n.d(m,"constant",(function(){return et.l})),n.d(m,"debounce",(function(){return et.m})),n.d(m,"error",(function(){return et.n})),n.d(m,"extend",(function(){return et.o})),n.d(m,"extent",(function(){return et.p})),n.d(m,"extentIndex",(function(){return et.q})),n.d(m,"fastmap",(function(){return et.s})),n.d(m,"field",(function(){return et.t})),n.d(m,"flush",(function(){return et.u})),n.d(m,"hasOwnProperty",(function(){return et.v})),n.d(m,"inherits",(function(){return et.y})),n.d(m,"inrange",(function(){return et.z})),n.d(m,"isArray",(function(){return et.A})),n.d(m,"isBoolean",(function(){return et.B})),n.d(m,"isDate",(function(){return et.C})),n.d(m,"isFunction",(function(){return et.D})),n.d(m,"isNumber",(function(){return et.E})),n.d(m,"isObject",(function(){return et.F})),n.d(m,"isRegExp",(function(){return et.G})),n.d(m,"isString",(function(){return et.H})),n.d(m,"key",(function(){return et.I})),n.d(m,"lerp",(function(){return et.J})),n.d(m,"merge",(function(){return et.L})),n.d(m,"pad",(function(){return et.O})),n.d(m,"peek",(function(){return et.T})),n.d(m,"repeat",(function(){return et.V})),n.d(m,"span",(function(){return et.W})),n.d(m,"splitAccessPath",(function(){return et.X})),n.d(m,"stringValue",(function(){return et.Y})),n.d(m,"toBoolean",(function(){return et.Z})),n.d(m,"toDate",(function(){return et.ab})),n.d(m,"toNumber",(function(){return et.bb})),n.d(m,"toString",(function(){return et.db})),n.d(m,"toSet",(function(){return et.cb})),n.d(m,"truncate",(function(){return et.eb})),n.d(m,"visitArray",(function(){return et.hb})),n.d(m,"loader",(function(){return pr})),n.d(m,"read",(function(){return hr})),n.d(m,"inferType",(function(){return Pt})),n.d(m,"inferTypes",(function(){return Ut})),n.d(m,"typeParsers",(function(){return Lt})),n.d(m,"format",(function(){return pe})),n.d(m,"formats",(function(){return ge})),n.d(m,"responseType",(function(){return me})),n.d(m,"Bounds",(function(){return _u})),n.d(m,"Gradient",(function(){return ju})),n.d(m,"GroupItem",(function(){return Cu})),n.d(m,"ResourceLoader",(function(){return Nu})),n.d(m,"Item",(function(){return Du})),n.d(m,"Scenegraph",(function(){return hd})),n.d(m,"Handler",(function(){return wd})),n.d(m,"Renderer",(function(){return Ad})),n.d(m,"CanvasHandler",(function(){return jd})),n.d(m,"CanvasRenderer",(function(){return Nd})),n.d(m,"SVGHandler",(function(){return Ld})),n.d(m,"SVGRenderer",(function(){return Gd})),n.d(m,"SVGStringRenderer",(function(){return ah})),n.d(m,"RenderType",(function(){return hh})),n.d(m,"renderModule",(function(){return gh})),n.d(m,"intersect",(function(){return mh})),n.d(m,"Marks",(function(){return ad})),n.d(m,"boundClip",(function(){return _h})),n.d(m,"boundContext",(function(){return Il})),n.d(m,"boundStroke",(function(){return zl})),n.d(m,"boundItem",(function(){return sd})),n.d(m,"boundMark",(function(){return cd})),n.d(m,"pathCurves",(function(){return Cc})),n.d(m,"pathSymbols",(function(){return Gc})),n.d(m,"pathRectangle",(function(){return ul})),n.d(m,"pathTrail",(function(){return cl})),n.d(m,"pathParse",(function(){return Nc})),n.d(m,"pathRender",(function(){return Wc})),n.d(m,"point",(function(){return _d})),n.d(m,"domCreate",(function(){return md})),n.d(m,"domFind",(function(){return vd})),n.d(m,"domChild",(function(){return yd})),n.d(m,"domClear",(function(){return bd})),n.d(m,"openTag",(function(){return Pd})),n.d(m,"closeTag",(function(){return Ud})),n.d(m,"font",(function(){return td})),n.d(m,"fontFamily",(function(){return Kf})),n.d(m,"fontSize",(function(){return Gf})),n.d(m,"lineHeight",(function(){return Xf})),n.d(m,"multiLineOffset",(function(){return Zf})),n.d(m,"textMetrics",(function(){return Uf})),n.d(m,"resetSVGClipId",(function(){return xf})),n.d(m,"sceneEqual",(function(){return Oh})),n.d(m,"pathEqual",(function(){return Eh})),n.d(m,"sceneToJSON",(function(){return fd})),n.d(m,"sceneFromJSON",(function(){return dd})),n.d(m,"intersectPath",(function(){return Wl})),n.d(m,"intersectPoint",(function(){return Hl})),n.d(m,"intersectRule",(function(){return Gl})),n.d(m,"intersectBoxLine",(function(){return Vl})),n.d(m,"sceneZOrder",(function(){return ef})),n.d(m,"sceneVisit",(function(){return nf})),n.d(m,"scenePickVisit",(function(){return rf}));var v={};n.r(v),n.d(v,"INVALID_SPEC",(function(){return V$})),n.d(v,"FIT_NON_SINGLE",(function(){return X$})),n.d(v,"CANNOT_FIX_RANGE_STEP_WITH_FIT",(function(){return J$})),n.d(v,"cannotProjectOnChannelWithoutField",(function(){return Z$})),n.d(v,"nearestNotSupportForContinuous",(function(){return Q$})),n.d(v,"selectionNotSupported",(function(){return K$})),n.d(v,"selectionNotFound",(function(){return tL})),n.d(v,"SCALE_BINDINGS_CONTINUOUS",(function(){return eL})),n.d(v,"NO_INIT_SCALE_BINDINGS",(function(){return nL})),n.d(v,"noSuchRepeatedValue",(function(){return rL})),n.d(v,"columnsNotSupportByRowCol",(function(){return iL})),n.d(v,"CONCAT_CANNOT_SHARE_AXIS",(function(){return oL})),n.d(v,"REPEAT_CANNOT_SHARE_AXIS",(function(){return aL})),n.d(v,"unrecognizedParse",(function(){return sL})),n.d(v,"differentParse",(function(){return uL})),n.d(v,"invalidTransformIgnored",(function(){return cL})),n.d(v,"NO_FIELDS_NEEDS_AS",(function(){return lL})),n.d(v,"encodingOverridden",(function(){return fL})),n.d(v,"projectionOverridden",(function(){return dL})),n.d(v,"primitiveChannelDef",(function(){return hL})),n.d(v,"invalidFieldType",(function(){return pL})),n.d(v,"nonZeroScaleUsedWithLengthMark",(function(){return gL})),n.d(v,"invalidFieldTypeForCountAggregate",(function(){return mL})),n.d(v,"invalidAggregate",(function(){return vL})),n.d(v,"missingFieldType",(function(){return yL})),n.d(v,"droppingColor",(function(){return bL})),n.d(v,"emptyFieldDef",(function(){return xL})),n.d(v,"latLongDeprecated",(function(){return _L})),n.d(v,"LINE_WITH_VARYING_SIZE",(function(){return wL})),n.d(v,"incompatibleChannel",(function(){return OL})),n.d(v,"invalidEncodingChannel",(function(){return EL})),n.d(v,"facetChannelShouldBeDiscrete",(function(){return AL})),n.d(v,"facetChannelDropped",(function(){return kL})),n.d(v,"discreteChannelCannotEncode",(function(){return SL})),n.d(v,"BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL",(function(){return jL})),n.d(v,"lineWithRange",(function(){return DL})),n.d(v,"orientOverridden",(function(){return CL})),n.d(v,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return ML})),n.d(v,"cannotUseScalePropertyWithNonColor",(function(){return FL})),n.d(v,"unaggregateDomainHasNoEffectForRawField",(function(){return NL})),n.d(v,"unaggregateDomainWithNonSharedDomainOp",(function(){return TL})),n.d(v,"unaggregatedDomainWithLogScale",(function(){return RL})),n.d(v,"cannotApplySizeToNonOrientedMark",(function(){return zL})),n.d(v,"rangeStepDropped",(function(){return $L})),n.d(v,"scaleTypeNotWorkWithChannel",(function(){return LL})),n.d(v,"scaleTypeNotWorkWithFieldDef",(function(){return IL})),n.d(v,"scalePropertyNotWorkWithScaleType",(function(){return BL})),n.d(v,"scaleTypeNotWorkWithMark",(function(){return PL})),n.d(v,"mergeConflictingProperty",(function(){return UL})),n.d(v,"mergeConflictingDomainProperty",(function(){return qL})),n.d(v,"independentScaleMeansIndependentGuide",(function(){return WL})),n.d(v,"domainSortDropped",(function(){return HL})),n.d(v,"UNABLE_TO_MERGE_DOMAINS",(function(){return YL})),n.d(v,"MORE_THAN_ONE_SORT",(function(){return GL})),n.d(v,"INVALID_CHANNEL_FOR_AXIS",(function(){return VL})),n.d(v,"cannotStackRangedMark",(function(){return XL})),n.d(v,"cannotStackNonLinearScale",(function(){return JL})),n.d(v,"stackNonSummativeAggregate",(function(){return ZL})),n.d(v,"invalidTimeUnit",(function(){return QL})),n.d(v,"dayReplacedWithDate",(function(){return KL})),n.d(v,"droppedDay",(function(){return tI})),n.d(v,"errorBarCenterAndExtentAreNotNeeded",(function(){return eI})),n.d(v,"errorBarCenterIsUsedWithWrongExtent",(function(){return nI})),n.d(v,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return rI})),n.d(v,"errorBarCenterIsNotNeeded",(function(){return iI})),n.d(v,"errorBand1DNotSupport",(function(){return oI})),n.d(v,"channelRequiredForBinned",(function(){return aI})),n.d(v,"domainRequiredForThresholdScale",(function(){return sI}));var y={};n.r(y),n.d(y,"symbols",(function(){return FH})),n.d(y,"gradient",(function(){return NH})),n.d(y,"labels",(function(){return TH})),n.d(y,"getFirstConditionValue",(function(){return zH}));var b={};n.r(b),n.d(b,"compile",(function(){return oV})),n.d(b,"extractTransforms",(function(){return sV})),n.d(b,"normalize",(function(){return hU})),n.d(b,"version",(function(){return uV}));var x={};n.r(x),n.d(x,"dark",(function(){return dV})),n.d(x,"excel",(function(){return hV})),n.d(x,"fivethirtyeight",(function(){return pV})),n.d(x,"ggplot2",(function(){return gV})),n.d(x,"latimes",(function(){return yV})),n.d(x,"quartz",(function(){return bV})),n.d(x,"vox",(function(){return xV})),n.d(x,"urbaninstitute",(function(){return wV})),n.d(x,"version",(function(){return OV}));function _(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function w(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}
  /*!
   * https://github.com/Starcounter-Jack/JSON-Patch
   * (c) 2017 Joachim Wester
   * MIT license
   */
  var O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=Object.prototype.hasOwnProperty;function A(t,e){return E.call(t,e)}function k(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);e=[];for(var r in t)A(t,r)&&e.push(r);return e}function S(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function j(t){for(var e,n=0,r=t.length;n<r;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function D(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function C(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function M(t,e){var n=[t];for(var r in e){var i="object"==typeof e[r]?JSON.stringify(e[r],null,2):e[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var F=function(t){function e(e,n,r,i,o){var a=this.constructor,s=t.call(this,M(e,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=M(e,{name:n,index:r,operation:i,tree:o}),s}return O(e,t),e}(Error),N=F,T=S,R={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=$(n,this.path);r&&(r=S(r));var i=L(n,{op:"remove",path:this.from}).removed;return L(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=$(n,this.from);return L(n,{op:"add",path:this.path,value:S(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:q(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},z={add:function(t,e,n){return j(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:R.move,copy:R.copy,test:R.test,_get:R._get};function $(t,e){if(""==e)return t;var n={op:"_get",path:e};return L(t,n),n.value}function L(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):P(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=$(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=q(t,e.value),!1===a.test)throw new N("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new N("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}r||(t=S(t));var s=(e.path||"").split("/"),u=t,c=1,l=s.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof n?n:P;;){if(d=s[c],i&&"__proto__"==d)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,c).join("/"):c==l-1&&(f=e.path),void 0!==f&&h(e,0,t,f)),c++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!j(d))throw new N("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);j(d)&&(d=~~d)}if(c>=l){if(n&&"add"===e.op&&d>u.length)throw new N("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=z[e.op].call(e,u,d,t)).test)throw new N("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(d&&-1!=d.indexOf("~")&&(d=C(d)),c>=l){if(!1===(a=R[e.op].call(e,u,d,t)).test)throw new N("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}u=u[d]}}function I(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new N("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=S(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=L(t,e[a],n,!0,i,a),t=o[a].newDocument;return o.newDocument=t,o}function B(t,e,n){var r=L(t,e);if(!1===r.test)throw new N("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return r.newDocument}function P(t,e,n,r){if("object"!=typeof t||null===t||Array.isArray(t))throw new N("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!R[t.op])throw new N("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!=typeof t.path)throw new N("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new N('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!=typeof t.from)throw new N("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&function t(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return!0}else if("object"==typeof e){var i=k(e),o=i.length;for(n=0;n<o;n++)if(t(e[i[n]]))return!0}return!1}(t.value))throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new N("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==r)throw new N("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=U([{op:"_get",path:t.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new N("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function U(t,e,n){try{if(!Array.isArray(t))throw new N("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)I(S(e),S(t),n||!0);else{n=n||P;for(var r=0;r<t.length;r++)n(t[r],r,e,void 0)}}catch(t){if(t instanceof N)return t;throw t}}function q(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,r,i,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((r=t.length)!=e.length)return!1;for(n=r;0!=n--;)if(!q(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((r=s.length)!==Object.keys(e).length)return!1;for(n=r;0!=n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=r;0!=n--;)if(!q(t[i=s[n]],e[i]))return!1;return!0}return t!=t&&e!=e}
  /*!
   * https://github.com/Starcounter-Jack/JSON-Patch
   * (c) 2017 Joachim Wester
   * MIT license
   */
  var W=new WeakMap,H=function(t){this.observers=new Map,this.obj=t},Y=function(t,e){this.callback=t,this.observer=e};function G(t,e){e.unobserve()}function V(t,e){var n,r=function(t){return W.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new H(t),W.set(t,r);if(n)return n;if(n={},r.value=S(t),e){n.callback=e,n.next=null;var o=function(){X(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=t,n.unobserve=function(){X(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new Y(e,n)),n}function X(t,e){void 0===e&&(e=!1);var n=W.get(t.object);J(n.value,t.object,t.patches,"",e),t.patches.length&&I(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function J(t,e,n,r,i){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var o=k(e),a=k(t),s=!1,u=a.length-1;u>=0;u--){var c=t[f=a[u]];if(!A(e,f)||void 0===e[f]&&void 0!==c&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+D(f),value:S(c)}),n.push({op:"remove",path:r+"/"+D(f)}),s=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var l=e[f];"object"==typeof c&&null!=c&&"object"==typeof l&&null!=l?J(c,l,n,r+"/"+D(f),i):c!==l&&(!0,i&&n.push({op:"test",path:r+"/"+D(f),value:S(c)}),n.push({op:"replace",path:r+"/"+D(f),value:S(l)}))}}if(s||o.length!=a.length)for(u=0;u<o.length;u++){var f;A(t,f=o[u])||void 0===e[f]||n.push({op:"add",path:r+"/"+D(f),value:S(e[f])})}}}function Z(t,e,n){void 0===n&&(n=!1);var r=[];return J(t,e,r,"",n),r}Object.assign({},r,i,{JsonPatchError:F,deepClone:S,escapePathComponent:D,unescapePathComponent:C});var Q=n(9),K=n.n(Q),tt=n(12),et=n(0);function nt(t){var e=t||et.x,n=[],r={};return n.add=function(t){var i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=function(t){var i,o=e(t);return r[o]&&(r[o]=0,(i=n.indexOf(t))>=0&&n.splice(i,1)),n},n}var rt=async function(t,e){try{await e(t)}catch(e){t.error(e)}},it=Symbol("vega_id"),ot=1;function at(t){return!(!t||!st(t))}function st(t){return t[it]}function ut(t,e){return t[it]=e,t}function ct(t){var e=t===Object(t)?t:{data:t};return st(e)?e:ut(e,ot++)}function lt(t){return ft(t,ct({}))}function ft(t,e){for(var n in t)e[n]=t[n];return e}function dt(t,e){return ut(e,st(t))}function ht(t,e){return t?e?(n,r)=>t(n,r)||st(e(n))-st(e(r)):(e,n)=>t(e,n)||st(e)-st(n):null}function pt(t){return t&&t.constructor===gt}function gt(){var t=[],e=[],n=[],r=[],i=[],o=!1;return{constructor:gt,insert:function(e){for(var n=Object(et.i)(e),r=0,i=n.length;r<i;++r)t.push(n[r]);return this},remove:function(t){for(var n=Object(et.D)(t)?r:e,i=Object(et.i)(t),o=0,a=i.length;o<a;++o)n.push(i[o]);return this},modify:function(t,e,r){var o={field:e,value:Object(et.l)(r)};return Object(et.D)(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode:function(t,e){return Object(et.D)(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},reflow:function(){return o=!0,this},pulse:function(a,s){var u,c,l,f,d,h,p={},g={};for(u=0,c=s.length;u<c;++u)p[st(s[u])]=1;for(u=0,c=e.length;u<c;++u)p[st(d=e[u])]=-1;for(u=0,c=r.length;u<c;++u)f=r[u],s.forEach((function(t){f(t)&&(p[st(t)]=-1)}));for(u=0,c=t.length;u<c;++u)h=st(d=t[u]),p[h]?p[h]=1:a.add.push(ct(t[u]));for(u=0,c=s.length;u<c;++u)d=s[u],p[st(d)]<0&&a.rem.push(d);function m(t,e,n){n?t[e]=n(t):a.encode=e,o||(g[st(t)]=t)}for(u=0,c=n.length;u<c;++u)d=(l=n[u]).tuple,f=l.field,(h=p[st(d)])>0&&(m(d,f,l.value),a.modifies(f));for(u=0,c=i.length;u<c;++u)l=i[u],f=l.filter,s.forEach((function(t){f(t)&&p[st(t)]>0&&m(t,l.field,l.value)})),a.modifies(l.field);if(o)a.mod=e.length||r.length?s.filter((function(t){return p[st(t)]>0})):s.slice();else for(h in g)a.mod.push(g[h]);return a}}}var mt="_:mod:_";function vt(){Object.defineProperty(this,mt,{writable:!0,value:{}})}var yt=vt.prototype;yt.set=function(t,e,n,r){var i=this,o=i[t],a=i[mt];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=Object(et.A)(n)?1+n.length:-1),i},yt.modified=function(t,e){var n,r=this[mt];if(!arguments.length){for(n in r)if(r[n])return!0;return!1}if(Object(et.A)(t)){for(n=0;n<t.length;++n)if(r[t[n]])return!0;return!1}return null!=e&&e>=0?e+1<r[t]||!!r[e+":"+t]:!!r[t]},yt.clear=function(){return this[mt]={},this};var bt=0,xt=new vt;function _t(t,e,n,r){this.id=++bt,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}var wt=_t.prototype;function Ot(t){return function(e){var n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}wt.targets=function(){return this._targets||(this._targets=nt(et.w))},wt.set=function(t){return this.value!==t?(this.value=t,1):0},wt.skip=Ot(1),wt.modified=Ot(2),wt.parameters=function(t,e,n){e=!1!==e;var r,i,o,a,s=this,u=s._argval=s._argval||new vt,c=s._argops=s._argops||[],l=[];function f(t,n,r){r instanceof _t?(r!==s&&(e&&r.targets().add(s),l.push(r)),c.push({op:r,name:t,index:n})):u.set(t,n,r)}for(r in t)if(i=t[r],"pulse"===r)Object(et.i)(i).forEach((function(t){t instanceof _t?t!==s&&(t.targets().add(s),l.push(t)):Object(et.n)("Pulse parameters must be operator instances.")})),s.source=i;else if(Object(et.A)(i))for(u.set(r,-1,Array(o=i.length)),a=0;a<o;++a)f(r,a,i[a]);else f(r,-1,i);return this.marshall().clear(),n&&(c.initonly=!0),l},wt.marshall=function(t){var e,n,r,i,o,a=this._argval||xt,s=this._argops;if(s){for(n=0,r=s.length;n<r;++n)o=(i=(e=s[n]).op).modified()&&i.stamp===t,a.set(e.name,e.index,i.value,o);if(s.initonly){for(n=0;n<r;++n)(e=s[n]).op.targets().remove(this);this._argops=null,this._update=null}}return a},wt.evaluate=function(t){var e=this._update;if(e){var n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},wt.run=function(t){return t.stamp<this.stamp?t.StopPropagation:(this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t);var e};var Et=0;function At(t,e,n){this.id=++Et,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function kt(t,e,n){return new At(t,e,n)}var St=At.prototype;St._filter=et.fb,St._apply=et.x,St.targets=function(){return this._targets||(this._targets=nt(et.w))},St.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},St.receive=function(t){if(this._filter(t)){for(var e=this.value=this._apply(t),n=this._targets,r=n?n.length:0,i=0;i<r;++i)n[i].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},St.filter=function(t){var e=kt(t);return this.targets().add(e),e},St.apply=function(t){var e=kt(null,t);return this.targets().add(e),e},St.merge=function(){var t=kt();this.targets().add(t);for(var e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},St.throttle=function(t){var e=-1;return this.filter((function(){var n=Date.now();return n-e>t?(e=n,1):0}))},St.debounce=function(t){var e=kt();return this.targets().add(kt(null,null,Object(et.m)(t,(function(t){var n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},St.between=function(t,e){var n=!1;return t.targets().add(kt(null,null,(function(){n=!0}))),e.targets().add(kt(null,null,(function(){n=!1}))),this.filter((function(){return n}))};const jt=/^([A-Za-z]+:)?\/\//,Dt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ct=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Mt="file://";async function Ft(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function Nt(t,e){e=Object(et.o)({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=Dt.test(t.replace(Ct,""));null!=t&&"string"==typeof t&&s||Object(et.n)("Sanitize failure, invalid URI: "+Object(et.Y)(t));const u=jt.test(t);return(a=e.baseURL)&&!u&&(t.startsWith("/")||"/"===a[a.length-1]||(t="/"+t),t=a+t),o=(i=t.startsWith(Mt))||"file"===e.mode||"http"!==e.mode&&!u&&n,i?t=t.slice(Mt.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),r}function Tt(t){return t?function(e){return new Promise((function(n,r){t.readFile(e,(function(t,e){t?r(t):n(e)}))}))}:Rt}async function Rt(){Object(et.n)("No file system access.")}function zt(t){return t?async function(e,n){const r=Object(et.o)({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?Object(et.D)(o[i])?o[i]():o.text():Object(et.n)(o.status+""+o.statusText)}:$t}async function $t(){Object(et.n)("No HTTP fetch method available.")}var Lt={boolean:et.Z,integer:et.bb,number:et.bb,date:et.ab,string:et.db,unknown:et.x},It=[function(t){return"true"===t||"false"===t||!0===t||!1===t},function(t){return qt(t)&&Number.isInteger(+t)},qt,function(t){return!Number.isNaN(Date.parse(t))}],Bt=["boolean","integer","number","date"];function Pt(t,e){if(!t||!t.length)return"unknown";var n,r,i,o,a=0,s=t.length,u=It.length,c=It.map((function(t,e){return e+1}));for(r=0,s=t.length;r<s;++r)for(n=e?t[r][e]:t[r],i=0;i<u;++i)if(c[i]&&(null!=(o=n)&&o==o)&&!It[i](n)&&(c[i]=0,++a===It.length))return"string";return a=c.reduce((function(t,e){return 0===t?e:t}),0)-1,Bt[a]}function Ut(t,e){return e.reduce((function(e,n){return e[n]=Pt(t,n),e}),{})}function qt(t){return!(Number.isNaN(+t)||t instanceof Date)}var Wt={},Ht={},Yt=34,Gt=10,Vt=13;function Xt(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Jt(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function Zt(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Qt(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Zt(-e,6):e>9999?"+"+Zt(e,6):Zt(e,4))+"-"+Zt(t.getUTCMonth()+1,2)+"-"+Zt(t.getUTCDate(),2)+(o?"T"+Zt(n,2)+":"+Zt(r,2)+":"+Zt(i,2)+"."+Zt(o,3)+"Z":i?"T"+Zt(n,2)+":"+Zt(r,2)+":"+Zt(i,2)+"Z":r||n?"T"+Zt(n,2)+":"+Zt(r,2)+"Z":"")}var Kt=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,c=!1;function l(){if(u)return Ht;if(c)return c=!1,Wt;var e,r,i=a;if(t.charCodeAt(i)===Yt){for(;a++<o&&t.charCodeAt(a)!==Yt||t.charCodeAt(++a)===Yt;);return(e=a)>=o?u=!0:(r=t.charCodeAt(a++))===Gt?c=!0:r===Vt&&(c=!0,t.charCodeAt(a)===Gt&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if((r=t.charCodeAt(e=a++))===Gt)c=!0;else if(r===Vt)c=!0,t.charCodeAt(a)===Gt&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===Gt&&--o,t.charCodeAt(o-1)===Vt&&--o;(r=l())!==Ht;){for(var f=[];r!==Wt&&r!==Ht;)f.push(r),r=l();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?Qt(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Xt(t);return function(r,i){return e(n(r),i,t)}}(t,e):Xt(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Jt(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Jt(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}};function te(t){const e=function(e,n){const r={delimiter:t};return ee(e,n?Object(et.o)(n,r):r)};return e.responseType="text",e}function ee(t,e){return e.header&&(t=e.header.map(et.Y).join(e.delimiter)+"\n"+t),Kt(e.delimiter).parse(t+"")}ee.responseType="text";var ne=n(8),re=function(t){return t},ie=function(t){if(null==t)return re;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var u=2,c=t.length,l=new Array(c);for(l[0]=(e+=t[0])*r+o,l[1]=(n+=t[1])*i+a;u<c;)l[u]=t[u],++u;return l}},oe=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},ae=function(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return se(t,e)}))}:se(t,e)};function se(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=ue(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function ue(t,e){var n=ie(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&oe(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function u(t){return t.map(s)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=u(e.arcs);break;case"MultiPolygon":n=e.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(e)}var ce=function(t,e){var n={},r={},i={},o=[],a=-1;function s(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),s=a[0],u=a[1];if(n=i[s])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var c=o===n?n:n.concat(o);r[c.start=n.start]=i[c.end=o.end]=c}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=s,o=i[s]){delete i[o.end];var l=o===n?n:o.concat(n);r[l.start=o.start]=i[l.end=n.end]=l}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=s]=i[n.end=u]=n})),s(i,r),s(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o},le=function(t){return ue(t,fe.apply(this,arguments))};function fe(t,e,n){var r,i,o;if(arguments.length>1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function s(t){t.forEach(a)}function u(t){t.forEach(s)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":u(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(u)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:ce(t,r)}}const de={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function he(t,e){let n,r,i,o;return t=Object(ne.a)(t,e),e&&e.feature?(n=ae,i=e.feature):e&&e.mesh?(n=le,i=e.mesh,o=de[e.filter]):Object(et.n)("Missing TopoJSON feature or mesh parameter."),(r=(r=t.objects[i])?n(t,r,o):Object(et.n)("Invalid TopoJSON object: "+i))&&r.features||[r]}he.responseType="json";const pe={dsv:ee,csv:te(","),tsv:te("\t"),json:ne.a,topojson:he};function ge(t,e){return arguments.length>1?(pe[t]=e,this):Object(et.v)(pe,t)?pe[t]:null}function me(t){const e=ge(t);return e&&e.responseType||"text"}var ve=new Date,ye=new Date;function be(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return be((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return ve.setTime(+e),ye.setTime(+r),t(ve),t(ye),Math.floor(n(ve,ye))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var xe=6e4,_e=6048e5;function we(t){return be((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/_e}))}var Oe=we(0),Ee=we(1),Ae=we(2),ke=we(3),Se=we(4),je=we(5),De=we(6),Ce=(Oe.range,Ee.range,Ae.range,ke.range,Se.range,je.range,De.range,be((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Me=Ce;Ce.range;function Fe(t){return be((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*xe)/_e}))}var Ne=Fe(0),Te=Fe(1),Re=Fe(2),ze=Fe(3),$e=Fe(4),Le=Fe(5),Ie=Fe(6),Be=(Ne.range,Te.range,Re.range,ze.range,$e.range,Le.range,Ie.range,be((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*xe)/864e5}),(function(t){return t.getDate()-1}))),Pe=Be,Ue=(Be.range,be((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));Ue.every=function(t){return isFinite(t=Math.floor(t))&&t>0?be((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var qe=Ue,We=(Ue.range,be((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));We.every=function(t){return isFinite(t=Math.floor(t))&&t>0?be((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var He=We;We.range;function Ye(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ge(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ve(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Xe,Je,Ze,Qe,Ke,tn={"-":"",_:" ",0:"0"},en=/^\s*\d+/,nn=/^%/,rn=/[\\^$*+?|[\]().{}]/g;function on(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function an(t){return t.replace(rn,"\\$&")}function sn(t){return new RegExp("^(?:"+t.map(an).join("|")+")","i")}function un(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function cn(t,e,n){var r=en.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ln(t,e,n){var r=en.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function fn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function dn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function hn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function pn(t,e,n){var r=en.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function gn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mn(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function vn(t,e,n){var r=en.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function yn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function bn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function xn(t,e,n){var r=en.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function _n(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function wn(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function On(t,e,n){var r=en.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function En(t,e,n){var r=en.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function An(t,e,n){var r=en.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kn(t,e,n){var r=nn.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Sn(t,e,n){var r=en.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jn(t,e,n){var r=en.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Dn(t,e){return on(t.getDate(),e,2)}function Cn(t,e){return on(t.getHours(),e,2)}function Mn(t,e){return on(t.getHours()%12||12,e,2)}function Fn(t,e){return on(1+Pe.count(qe(t),t),e,3)}function Nn(t,e){return on(t.getMilliseconds(),e,3)}function Tn(t,e){return Nn(t,e)+"000"}function Rn(t,e){return on(t.getMonth()+1,e,2)}function zn(t,e){return on(t.getMinutes(),e,2)}function $n(t,e){return on(t.getSeconds(),e,2)}function Ln(t){var e=t.getDay();return 0===e?7:e}function In(t,e){return on(Ne.count(qe(t)-1,t),e,2)}function Bn(t,e){var n=t.getDay();return t=n>=4||0===n?$e(t):$e.ceil(t),on($e.count(qe(t),t)+(4===qe(t).getDay()),e,2)}function Pn(t){return t.getDay()}function Un(t,e){return on(Te.count(qe(t)-1,t),e,2)}function qn(t,e){return on(t.getFullYear()%100,e,2)}function Wn(t,e){return on(t.getFullYear()%1e4,e,4)}function Hn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+on(e/60|0,"0",2)+on(e%60,"0",2)}function Yn(t,e){return on(t.getUTCDate(),e,2)}function Gn(t,e){return on(t.getUTCHours(),e,2)}function Vn(t,e){return on(t.getUTCHours()%12||12,e,2)}function Xn(t,e){return on(1+Me.count(He(t),t),e,3)}function Jn(t,e){return on(t.getUTCMilliseconds(),e,3)}function Zn(t,e){return Jn(t,e)+"000"}function Qn(t,e){return on(t.getUTCMonth()+1,e,2)}function Kn(t,e){return on(t.getUTCMinutes(),e,2)}function tr(t,e){return on(t.getUTCSeconds(),e,2)}function er(t){var e=t.getUTCDay();return 0===e?7:e}function nr(t,e){return on(Oe.count(He(t)-1,t),e,2)}function rr(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Se(t):Se.ceil(t),on(Se.count(He(t),t)+(4===He(t).getUTCDay()),e,2)}function ir(t){return t.getUTCDay()}function or(t,e){return on(Ee.count(He(t)-1,t),e,2)}function ar(t,e){return on(t.getUTCFullYear()%100,e,2)}function sr(t,e){return on(t.getUTCFullYear()%1e4,e,4)}function ur(){return"+0000"}function cr(){return"%"}function lr(t){return+t}function fr(t){return Math.floor(+t/1e3)}function dr(t){return Xe=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=sn(i),l=un(i),f=sn(o),d=un(o),h=sn(a),p=un(a),g=sn(s),m=un(s),v=sn(u),y=un(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Dn,e:Dn,f:Tn,H:Cn,I:Mn,j:Fn,L:Nn,m:Rn,M:zn,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:lr,s:fr,S:$n,u:Ln,U:In,V:Bn,w:Pn,W:Un,x:null,X:null,y:qn,Y:Wn,Z:Hn,"%":cr},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Yn,e:Yn,f:Zn,H:Gn,I:Vn,j:Xn,L:Jn,m:Qn,M:Kn,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:lr,s:fr,S:tr,u:er,U:nr,V:rr,w:ir,W:or,x:null,X:null,y:ar,Y:sr,Z:ur,"%":cr},_={a:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:bn,e:bn,f:An,H:_n,I:_n,j:xn,L:En,m:yn,M:wn,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:vn,Q:Sn,s:jn,S:On,u:ln,U:fn,V:dn,w:cn,W:hn,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:gn,Y:pn,Z:mn,"%":kn};function w(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=tn[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function O(t,e){return function(n){var r,i,o=Ve(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(!e||"Z"in o||(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Ge(Ve(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ee.ceil(r):Ee(r),r=Me.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Ye(Ve(o.y,0,1))).getDay(),r=i>4||0===i?Te.ceil(r):Te(r),r=Pe.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Ge(Ve(o.y,0,1)).getUTCDay():Ye(Ve(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ge(o)):Ye(o)}}function E(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in tn?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return(b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=O(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=O(t+="",!0);return e.toString=function(){return t},e}})}(t),Je=Xe.format,Ze=Xe.parse,Qe=Xe.utcFormat,Ke=Xe.utcParse,Xe}dr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var hr=function(t,e,n){const r=ge((e=e||{}).type||"json");return r||Object(et.n)("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n){if(!t.length)return;n=n||Ze;var r,i,o,a,s,u,c,l=t.columns||Object.keys(t[0]);"auto"===e&&(e=Ut(t,l));for(l=Object.keys(e),r=l.map((function(t){var r,i,o=e[t];if(o&&(0===o.indexOf("date:")||0===o.indexOf("utc:")))return("'"===(i=(r=o.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?Ke(i):n(i);if(!Lt[o])throw Error("Illegal format pattern: "+t+":"+o);return Lt[o]})),a=0,u=t.length,c=l.length;a<u;++a)for(i=t[a],s=0;s<c;++s)o=l[s],i[o]=r[s](i[o])}(t,e.parse,n),Object(et.v)(t,"columns")&&delete t.columns,t};var pr=function(t,e){return function(n){return{options:n||{},sanitize:Nt,load:Ft,fileAccess:!!e,file:Tt(e),http:zt(t)}}}("undefined"!=typeof fetch&&fetch,null);const gr=hr;var mr={skip:!0};function vr(t,e,n,r,i,o){var a,s,u=Object(et.o)({},o,mr);Object(et.D)(n)||(n=Object(et.l)(n)),void 0===r?a=e=>t.touch(n(e)):Object(et.D)(r)?(s=new _t(null,r,i,!1),a=e=>{s.evaluate(e);const r=n(e),i=s.value;pt(i)?t.pulse(r,i,o):t.update(r,i,u)}):a=e=>t.update(n(e),r,u),e.apply(a)}function yr(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},s=new _t(null,function(t,e){return e=Object(et.D)(e)?e:Object(et.l)(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}var br={};function xr(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}var _r=xr.prototype;function wr(t,e){return t?function(n,r){return t(n,r)&&e(n,r)}:e}function Or(t,e){var n=[];return Object(et.hb)(t,e,(function(t){n.push(t)})),n}function Er(t,e){var n={};return t.visit(e,(function(t){n[st(t)]=1})),function(t){return n[st(t)]?null:t}}function Ar(t,e,n,r){var i,o,a,s,u,c=this,l=0;for(this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n,a=0,s=n.length;a<s;++a)if((i=n[a]).stamp===e){if(i.fields)for(u in o=c.fields||(c.fields={}),i.fields)o[u]=1;i.changed(c.ADD)&&(l|=c.ADD),i.changed(c.REM)&&(l|=c.REM),i.changed(c.MOD)&&(l|=c.MOD)}this.changes=l}_r.StopPropagation=br,_r.ADD=1,_r.REM=2,_r.MOD=4,_r.ADD_REM=3,_r.ADD_MOD=5,_r.ALL=7,_r.REFLOW=8,_r.SOURCE=16,_r.NO_SOURCE=32,_r.NO_FIELDS=64,_r.fork=function(t){return new xr(this.dataflow).init(this,t)},_r.clone=function(){var t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},_r.addAll=function(){var t=this;return this.source&&this.source.length!==this.add.length?((t=new xr(this.dataflow).init(this)).add=t.source,t):t},_r.init=function(t,e){var n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source),n},_r.runAfter=function(t){this.dataflow.runAfter(t)},_r.changed=function(t){var e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},_r.reflow=function(t){if(t)return this.fork(7).reflow();var e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,Er(this,1))),this},_r.modifies=function(t){var e=this.fields||(this.fields={});return Object(et.A)(t)?t.forEach(t=>e[t]=!0):e[t]=!0,this},_r.modified=function(t,e){var n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?Object(et.A)(t)?t.some((function(t){return n[t]})):n[t]:!!n)},_r.filter=function(t,e){var n=this;return 1&t&&(n.addF=wr(n.addF,e)),2&t&&(n.remF=wr(n.remF,e)),4&t&&(n.modF=wr(n.modF,e)),16&t&&(n.srcF=wr(n.srcF,e)),n},_r.materialize=function(t){var e=this;return 1&(t=t||7)&&e.addF&&(e.add=Or(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Or(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Or(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},_r.visit=function(t,e){var n,r,i=this,o=e;return 16&t?(Object(et.hb)(i.source,i.srcF,o),i):(1&t&&Object(et.hb)(i.add,i.addF,o),2&t&&Object(et.hb)(i.rem,i.remF,o),4&t&&Object(et.hb)(i.mod,i.modF,o),8&t&&(n=i.source)&&((r=i.add.length+i.mod.length)===n.length||(r?Object(et.hb)(n,Er(i,5),o):Object(et.hb)(n,i.srcF,o))),i)};var kr=Object(et.y)(Ar,xr);function Sr(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}kr.fork=function(t){var e=new xr(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(function(t){return e.add.push(t)})),t&e.REM&&this.visit(e.REM,(function(t){return e.rem.push(t)})),t&e.MOD&&this.visit(e.MOD,(function(t){return e.mod.push(t)}))),e},kr.changed=function(t){return this.changes&t},kr.modified=function(t){var e=this,n=e.fields;return n&&e.changes&e.MOD?Object(et.A)(t)?t.some((function(t){return n[t]})):n[t]:0},kr.filter=function(){Object(et.n)("MultiPulse does not support filtering.")},kr.materialize=function(){Object(et.n)("MultiPulse does not support materialization.")},kr.visit=function(t,e){var n=this,r=n.pulses,i=r.length,o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n};var jr={skip:!1,force:!1};function Dr(t){var e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Cr(e,0,e.length-1,t)),pop:()=>{var n,r=e.pop();return e.length?(n=e[0],e[0]=r,function(t,e,n){var r,i=e,o=t.length,a=t[e],s=1+(e<<1);for(;s<o;)(r=s+1)<o&&n(t[s],t[r])>=0&&(s=r),t[e]=t[s],s=1+((e=s)<<1);t[e]=a,Cr(t,i,e,n)}(e,0,t)):n=r,n}}}function Cr(t,e,n,r){var i,o,a;for(i=t[n];n>e&&r(i,o=t[a=n-1>>1])<0;)t[n]=o,n=a;return t[n]=i}function Mr(){this.logger(Object(et.K)()),this.logLevel(et.b),this._clock=0,this._rank=0;try{this._loader=pr()}catch(t){}this._touched=nt(et.w),this._input={},this._pulse=null,this._heap=Dr((t,e)=>t.qrank-e.qrank),this._postrun=[]}var Fr=Mr.prototype;function Nr(t){return function(){return this._log[t].apply(this,arguments)}}function Tr(t,e){_t.call(this,t,null,e)}Fr.stamp=function(){return this._clock},Fr.loader=function(t){return arguments.length?(this._loader=t,this):this._loader},Fr.cleanThreshold=1e4,Fr.add=function(t,e,n,r){var i,o=1;return t instanceof _t?i=t:t&&t.prototype instanceof _t?i=new t:Object(et.D)(t)?i=new _t(null,t):(o=0,i=new _t(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},Fr.connect=function(t,e){var n,r,i=t.rank;for(n=0,r=e.length;n<r;++n)if(i<e[n].rank)return void this.rerank(t)},Fr.rank=function(t){t.rank=++this._rank},Fr.rerank=function(t){for(var e,n,r,i=[t];i.length;)if(this.rank(e=i.pop()),n=e._targets)for(r=n.length;--r>=0;)i.push(e=n[r]),e===t&&Object(et.n)("Cycle detected in dataflow graph.")},Fr.pulse=function(t,e,n){this.touch(t,n||jr);var r=new xr(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},Fr.touch=function(t,e){var n=e||jr;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},Fr.update=function(t,e,n){var r=n||jr;return(t.set(e)||r.force)&&this.touch(t,r),this},Fr.changeset=gt,Fr.ingest=function(t,e,n){return this.pulse(t,this.changeset().insert(gr(e,n)))},Fr.parse=gr,Fr.preload=async function(t,e,n){const r=this,i=r._pending||function(t){var e,n=new Promise((function(t){e=t}));return n.requests=0,n.done=function(){0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(et.fb).insert(o.data||[])),i.done(),o},Fr.request=async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:me(e&&e.type)});try{r=gr(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},Fr.events=function(t,e,n,r){for(var i,o=this,a=kt(n,r),s=function(t){t.dataflow=o;try{a.receive(t)}catch(t){o.error(t)}finally{o.run()}},u=0,c=(i="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):Object(et.i)(t)).length;u<c;++u)i[u].addEventListener(e,s);return a},Fr.on=function(t,e,n,r,i){return(t instanceof _t?yr:vr)(this,t,e,n,r,i),this},Fr.evaluate=async function(t,e,n){const r=this,i=r.logLevel();if(r._pulse)return Sr(r);if(r._pending&&await r._pending,e&&await rt(r,e),!r._touched.length)return r.info("Dataflow invoked, but nothing to do."),r;let o,a,s,u,c=++r._clock,l=0;r._pulse=new xr(r,c,t),i>=et.c&&(s=Date.now(),r.debug("-- START PROPAGATION ("+c+") -----")),r._touched.forEach(t=>r._enqueue(t,!0)),r._touched=nt(et.w);try{for(;r._heap.size()>0;)(o=r._heap.pop()).rank===o.qrank?((a=o.run(r._getPulse(o,t))).then&&(a=await a),i>=et.a&&r.debug(o.id,a===br?"STOP":a,o),a!==br&&o._targets&&o._targets.forEach(t=>r._enqueue(t)),++l):r._enqueue(o,!0)}catch(t){r._heap.clear(),u=t}if(r._input={},r._pulse=null,i>=et.c&&(s=Date.now()-s,r.info("> Pulse "+c+": "+l+" operators; "+s+"ms")),u&&(r._postrun=[],r.error(u)),r._postrun.length){const t=r._postrun.sort((t,e)=>e.priority-t.priority);r._postrun=[];for(let e=0;e<t.length;++e)await rt(r,t[e].callback)}return n&&await rt(r,n),r},Fr.run=function(t,e,n){return this._pulse?Sr(this):(this.evaluate(t,e,n),this)},Fr.runAsync=async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},Fr.runAfter=function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},Fr._enqueue=function(t,e){var n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},Fr._getPulse=function(t,e){var n=t.source,r=this._clock;return n&&Object(et.A)(n)?new Ar(this,r,n.map(t=>t.pulse),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==br&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)},Fr.logger=function(t){return arguments.length?(this._log=t,this):this._log},Fr.error=Nr("error"),Fr.warn=Nr("warn"),Fr.info=Nr("info"),Fr.debug=Nr("debug"),Fr.logLevel=Nr("level");var Rr=Object(et.y)(Tr,_t);Rr.run=function(t){return t.stamp<this.stamp?t.StopPropagation:(this.skip()?this.skip(!1):e=this.evaluate(t),(e=e||t).then?e=e.then(t=>this.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e);var e},Rr.evaluate=function(t){var e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},Rr.transform=function(){};var zr={};function $r(t){var e=Lr(t);return e&&e.Definition||null}function Lr(t){return t=t&&t.toLowerCase(),Object(et.v)(zr,t)?zr[t]:null}function Ir(t){return t&&t.length?1===t.length?t[0]:(e=t,function(t){for(var n=e.length,r=1,i=String(e[0](t));r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function Br(t,e,n){return n||t+(e?"_"+e:"")}var Pr={values:Wr({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:Wr({name:"count",set:"cell.num"}),__count__:Wr({name:"count",set:"this.missing + this.valid"}),missing:Wr({name:"missing",set:"this.missing"}),valid:Wr({name:"valid",set:"this.valid"}),sum:Wr({name:"sum",init:"this.sum = 0;",add:"this.sum += +v;",rem:"this.sum -= v;",set:"this.sum"}),mean:Wr({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.valid ? this.mean : undefined"}),average:Wr({name:"average",set:"this.valid ? this.mean : undefined",req:["mean"],idx:1}),variance:Wr({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : undefined",req:["mean"],idx:1}),variancep:Wr({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : undefined",req:["variance"],idx:2}),stdev:Wr({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : undefined",req:["variance"],idx:2}),stdevp:Wr({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : undefined",req:["variance"],idx:2}),stderr:Wr({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : undefined",req:["variance"],idx:2}),distinct:Wr({name:"distinct",set:"cell.data.distinct(this.get)",req:["values"],idx:3}),ci0:Wr({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:Wr({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:Wr({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:Wr({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:Wr({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:Wr({name:"argmin",init:"this.argmin = undefined;",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = undefined;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:Wr({name:"argmax",init:"this.argmax = undefined;",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = undefined;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:Wr({name:"min",init:"this.min = undefined;",add:"if (v < this.min || this.min === undefined) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (Number.isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:Wr({name:"max",init:"this.max = undefined;",add:"if (v > this.max || this.max === undefined) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (Number.isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4})},Ur=Object.keys(Pr);function qr(t,e){return Pr[t](e)}function Wr(t){return function(e){var n=Object(et.o)({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function Hr(t,e){return t.idx-e.idx}function Yr(t,e){var n=e||et.x,r=function(t,e){var n,r=t.reduce((function t(n,r){function i(e){n[e]||t(n,n[e]=Pr[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),n}),t.reduce((function(t,e){return t[e.name]=e,t}),{})),i=[];for(n in r)i.push(r[n]);return i.sort(Hr)}(t,!0),i="var cell = this.cell; this.valid = 0; this.missing = 0;",o="this.cell = cell; this.init();",a="if(v==null){++this.missing; return;} if(v!==v) return; ++this.valid;",s="if(v==null){--this.missing; return;} if(v!==v) return; --this.valid;",u="var cell = this.cell;";return r.forEach((function(t){i+=t.init,a+=t.add,s+=t.rem})),t.slice().sort(Hr).forEach((function(t){u+="t["+Object(et.Y)(t.out)+"]="+t.set+";"})),u+="return t;",(o=Function("cell",o)).prototype.init=Function(i),o.prototype.add=Function("v","t",a),o.prototype.rem=Function("v","t",s),o.prototype.set=Function("t",u),o.prototype.get=n,o.fields=t.map((function(t){return t.out})),o}var Gr=function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}},Vr=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};function Xr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Jr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Zr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}var Qr=function(t){return null===t?NaN:+t};function Kr(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return Jr(t);if(e>=1)return Xr(t);var r,i=(r-1)*e,o=Math.floor(i),a=Xr(function t(e,n,r=0,i=e.length-1,o=Vr){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*c/a+l)),Math.min(i,Math.floor(n+(a-s)*c/a+l)),o)}const a=e[n];let s=r,u=i;for(Zr(e,r,n),o(e[i],a)>0&&Zr(e,r,i);s<u;){for(Zr(e,s,u),++s,--u;o(e[s],a)<0;)++s;for(;o(e[u],a)>0;)--u}0===o(e[r],a)?Zr(e,r,u):Zr(e,++u,i),u<=n&&(r=u+1),n<=u&&(i=u-1)}return e}(t,o).subarray(0,o+1));return a+(Jr(t.subarray(o+1))-a)*(i-o)}}var ti=function(t,e,n){var r=Float64Array.from(Gr(t,n));return r.sort(Vr),e.map(t=>(function(t,e,n=Qr){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}})(r,t))},ei=function(t,e){return ti(t,[.25,.5,.75],e)};var ni=function(t,e){var n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(o+=(n=e-i)*(e-(i+=n/++r)));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(o+=(n=s-i)*(s-(i+=n/++r)))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=ei(t,e),o=(i[2]-i[0])/1.34;return 1.06*(r=Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)},ri=function(t){var e,n,r,i,o,a,s,u,c=t.maxbins||20,l=t.base||10,f=Math.log(l),d=t.divide||[5,2],h=t.extent[0],p=t.extent[1],g=t.span||p-h||Math.abs(h)||1;if(t.step)e=t.step;else if(t.steps){for(o=g/c,a=0,s=t.steps.length;a<s&&t.steps[a]<o;++a);e=t.steps[Math.max(0,a-1)]}else{for(n=Math.ceil(Math.log(c)/f),r=t.minstep||0,e=Math.max(r,Math.pow(l,Math.round(Math.log(g)/f)-n));Math.ceil(g/e)>c;)e*=l;for(a=0,s=d.length;a<s;++a)(o=e/d[a])>=r&&g/o<=c&&(e=o)}return i=(o=Math.log(e))>=0?0:1+~~(-o/f),u=Math.pow(l,-i-1),(t.nice||void 0===t.nice)&&(h=h<(o=Math.floor(h/e+u)*e)?o-e:o,p=Math.ceil(p/e)*e),{start:h,stop:p===h?h+e:p,step:e}},ii=Math.random;function oi(t){ii=t}var ai=function(t,e,n,r){if(!t.length)return[void 0,void 0];var i,o,a,s,u=Float64Array.from(Gr(t,r)),c=u.length,l=e;for(a=0,s=Array(l);a<l;++a){for(i=0,o=0;o<c;++o)i+=u[~~(ii()*c)];s[a]=i/c}return s.sort(Vr),[Kr(s,n/2),Kr(s,1-n/2)]},si=function(t,e,n,r){r=r||(t=>t);let i,o=0,a=1,s=t.length,u=new Float64Array(s),c=r(t[0]),l=c,f=c+e;for(;a<s;++a){if((i=r(t[a]))>=f){for(l=(c+l)/2;o<a;++o)u[o]=l;f=i+e,c=i}l=i}for(l=(c+l)/2;o<a;++o)u[o]=l;return n?function(t,e){let n,r,i=t.length,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<i;){for(n=a+1;t[a]===t[n];)++n;if(t[a]-t[a-1]<e){for(r=a+(o+n-a-a>>1);r<a;)t[r++]=t[a];for(;r>a;)t[r--]=t[o]}o=a,a=n}return t}(u,e+e/4):u};var ui=function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},ci=function(t,e){null==e&&(e=t,t=0);var n,r,i,o={};return o.min=function(t){return arguments.length?(i=r-(n=t||0),o):n},o.max=function(t){return arguments.length?(i=(r=t||0)-n,o):r},o.sample=function(){return n+Math.floor(i*ii())},o.pdf=function(t){return t===Math.floor(t)&&t>=n&&t<r?1/i:0},o.cdf=function(t){var e=Math.floor(t);return e<n?0:e>=r?1:(e-n+1)/i},o.icdf=function(t){return t>=0&&t<=1?n-1+Math.floor(t*i):NaN},o.min(t).max(e)};const li=Math.sqrt(2*Math.PI),fi=Math.SQRT2;let di=NaN;function hi(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(di==di)i=di,di=NaN;else{do{n=(i=2*ii()-1)*i+(o=2*ii()-1)*o}while(0===n||n>1);i*=r=Math.sqrt(-2*Math.log(n)/n),di=o*r}return t+i*e}function pi(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*li)}function gi(t,e,n){let r,i=(t-(e=e||0))/(n=null==n?1:n),o=Math.abs(i);if(o>37)r=0;else{let t,e=Math.exp(-o*o/2);o<7.07106781186547?(r=e*(t=(t=(t=(t=(t=(t=.0352624965998911*o+.700383064443688)*o+6.37396220353165)*o+33.912866078383)*o+112.079291497871)*o+221.213596169931)*o+220.206867912376),r/=t=(t=(t=(t=(t=(t=(t=.0883883476483184*o+1.75566716318264)*o+16.064177579207)*o+86.7807322029461)*o+296.564248779674)*o+637.333633378831)*o+793.826512519948)*o+440.413735824752):r=e/(t=o+1/(t=o+2/(t=o+3/(t=o+4/(t=o+.65)))))/2.506628274631}return i>0?1-r:r}function mi(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*fi*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?e=1.6536545626831027+(e=.24015818242558962+(e=(e=(e=.00018673420803405714+(e=(e=(e=4.2347877827932404e-7+(e=(e=(e=1.0512122733215323e-9+(e=(e=(e=26335093153082323e-28+(e=(e=(e=6637638134358324e-30+(e=20972767875968562e-33+(e=(e=11157877678025181e-33+(e=128584807152564e-32+(e=(e=-364441206401782e-35)*(n-=3.125)-16850591381820166e-35)*n)*n)*n-1333171662854621e-31)*n)*n)*n-4054566272975207e-29)*n-8151934197605472e-29)*n)*n-12975133253453532e-27)*n-5415412054294628e-26)*n)*n-4.112633980346984e-9)*n-2.9070369957882005e-8)*n)*n-13654692000834679e-22)*n-13882523362786469e-21)*n)*n-.000740702534166267)*n-.006033670871430149)*n)*n:n<16?(n=Math.sqrt(n)-3.25,e=3.0838856104922208+(e=1.0052589676941592+(e=.005370914553590064+(e=(e=.002491442096107851+(e=(e=.0009532893797373805+(e=(e=24031110387097894e-21+(e=6828485145957318e-20+(e=(e=12475304481671779e-21+(e=29234449089955446e-22+(e=(e=15027403968909828e-22+(e=1.8239629214389228e-8+(e=(e=9.075656193888539e-8+(e=2.2137376921775787e-9)*n)*n-2.7517406297064545e-7)*n)*n)*n-4013867526981546e-21)*n)*n)*n-47318229009055734e-21)*n)*n)*n-.0003550375203628475)*n)*n-.0016882755560235047)*n)*n-.003751208507569241)*n)*n)*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=4.849906401408584+(e=1.0103004648645344+(e=(e=(e=7599527703001776e-20+(e=(e=4526062597223154e-21+(e=(e=2.2900482228026655e-7+(e=(e=2.914795345090108e-8+(e=(e=7.61570120807834e-9+(e=(e=1.5076572693500548e-9+(e=(e=-27109920616438573e-27)*n-2.555641816996525e-10)*n)*n-3.789465440126737e-9)*n)*n-1.496002662714924e-8)*n)*n-6.771199775845234e-8)*n)*n-9.9298272942317e-7)*n)*n-1968177810553167e-20)*n)*n-.00021503011930044477)*n-.00013871931833623122)*n)*n):e=1/0;return e*t}(2*t-1)}var vi=function(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>hi(n,r),pdf:t=>pi(t,n,r),cdf:t=>gi(t,n,r),icdf:t=>mi(t,n,r)};return i.mean(t).stdev(e)},yi=function(t,e){var n=vi(),r={},i=0;return r.data=function(n){return arguments.length?(t=n,i=n?n.length:0,r.bandwidth(e)):t},r.bandwidth=function(n){return arguments.length?(!(e=n)&&t&&(e=ni(t)),r):e},r.sample=function(){return t[~~(ii()*i)]+e*n.sample()},r.pdf=function(r){for(var o=0,a=0;a<i;++a)o+=n.pdf((r-t[a])/e);return o/e/i},r.cdf=function(r){for(var o=0,a=0;a<i;++a)o+=n.cdf((r-t[a])/e);return o/i},r.icdf=function(){throw Error("KDE icdf not supported.")},r.data(t)};function bi(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+hi()*e)}function xi(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*li*t)}function _i(t,e,n){return gi(Math.log(t),e,n)}function wi(t,e,n){return Math.exp(mi(t,e,n))}var Oi=function(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>bi(n,r),pdf:t=>xi(t,n,r),cdf:t=>_i(t,n,r),icdf:t=>wi(t,n,r)};return i.mean(t).stdev(e)},Ei=function(t,e){var n,r={},i=0;function o(t){var e,n=[],r=0;for(e=0;e<i;++e)r+=n[e]=null==t[e]?1:+t[e];for(e=0;e<i;++e)n[e]/=r;return n}return r.weights=function(t){return arguments.length?(n=o(e=t||[]),r):e},r.distributions=function(n){return arguments.length?(n?(i=n.length,t=n):(i=0,t=[]),r.weights(e)):t},r.sample=function(){for(var e=ii(),r=t[i-1],o=n[0],a=0;a<i-1;o+=n[++a])if(e<o){r=t[a];break}return r.sample()},r.pdf=function(e){for(var r=0,o=0;o<i;++o)r+=n[o]*t[o].pdf(e);return r},r.cdf=function(e){for(var r=0,o=0;o<i;++o)r+=n[o]*t[o].cdf(e);return r},r.icdf=function(){throw Error("Mixture icdf not supported.")},r.distributions(t).weights(e)};function Ai(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*ii()}function ki(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Si(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function ji(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}var Di=function(t,e){var n,r,i={min:function(t){return arguments.length?(n=t||0,i):n},max:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Ai(n,r),pdf:t=>ki(t,n,r),cdf:t=>Si(t,n,r),icdf:t=>ji(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)},Ci=function(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]};function Mi(t,e,n,r){t=t.filter(t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i}),r&&t.sort((t,n)=>e(t)-e(n));const i=new Float64Array(t.length),o=new Float64Array(t.length);let a=0;for(let r of t)i[a]=e(r),o[a]=n(r),++a;return[i,o]}function Fi(t,e,n,r){let i,o,a=-1,s=-1;for(let u of t)i=e(u,++a,t),o=n(u,a,t),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++s)}var Ni=function(t,e,n,r,i){let o=0,a=0;return Fi(t,e,n,(t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s}),1-o/a},Ti=function(t,e,n){let r=0,i=0,o=0,a=0,s=0;Fi(t,e,n,(t,e)=>{r+=t,i+=e,o+=t*e,a+=t*t,++s});const u=Ci(r/s,i/s,o/s,a/s),c=t=>u[0]+u[1]*t;return{coef:u,predict:c,rSquared:Ni(t,e,n,i/s,c)}},Ri=function(t,e,n){let r=0,i=0,o=0,a=0,s=0;Fi(t,e,n,(t,e)=>{t=Math.log(t),r+=t,i+=e,o+=t*e,a+=t*t,++s});const u=Ci(r/s,i/s,o/s,a/s),c=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:c,rSquared:Ni(t,e,n,i/s,c)}},zi=function(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;Fi(t,e,n,(t,e)=>{const n=Math.log(e),c=t*e;r+=e,o+=c,s+=t*c,i+=e*n,a+=c*n,++u});const c=Ci(o/r,i/r,a/r,s/r),l=t=>c[0]*Math.exp(c[1]*t);return c[0]=Math.exp(c[0]),{coef:c,predict:l,rSquared:Ni(t,e,n,r/u,l)}},$i=function(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;Fi(t,e,n,(t,e)=>{const n=Math.log(t),c=Math.log(e);r+=n,i+=c,o+=n*c,a+=n*n,s+=e,++u});const c=Ci(r/u,i/u,o/u,a/u),l=t=>c[0]*Math.pow(t,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:l,rSquared:Ni(t,e,n,s/u,l)}},Li=function(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0,c=0,l=0;Fi(t,e,n,(t,e)=>{const n=t*t;r+=t,i+=e,o+=n,a+=n*t,s+=n*n,u+=t*e,c+=n*e,++l});const f=o-r*r/l,d=a-o*r/l,h=s-o*o/l,p=f*h-d*d,g=((c-=o*(i/=l))*f-(u-=r*i)*d)/p,m=(u*h-c*d)/p,v=i-m*(r/l)-g*(o/l),y=t=>g*t*t+m*t+v;return{coef:[v,m,g],predict:y,rSquared:Ni(t,e,n,i,y)}},Ii=function(t,e,n,r){if(1===r)return Ti(t,e,n);if(2===r)return Li(t,e,n);const[i,o]=Mi(t,e,n),a=i.length,s=[],u=[],c=r+1;let l,f,d,h,p,g=0;for(l=0;l<a;++l)g+=o[l];for(l=0;l<c;++l){for(d=0,h=0;d<a;++d)h+=Math.pow(i[d],l)*o[d];for(s.push(h),p=new Float64Array(c),f=0;f<c;++f){for(d=0,h=0;d<a;++d)h+=Math.pow(i[d],l+f);p[f]=h}u.push(p)}u.push(s);const m=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(u),v=t=>{let e=0,n=0,r=m.length;for(;n<r;++n)e+=m[n]*Math.pow(t,n);return e};return{coef:m,predict:v,rSquared:Ni(t,e,n,g/a,v)}};var Bi=function(t,e){return Kr(t,.5,e)};var Pi=function(t,e,n,r){const[i,o]=Mi(t,e,n,!0),a=i.length,s=Math.max(2,~~(r*a)),u=new Float64Array(a),c=new Float64Array(a),l=new Float64Array(a).fill(1);for(let t=-1;++t<=2;){const e=[0,s-1];for(let t=0;t<a;++t){const n=i[t],r=e[0],a=e[1],s=n-i[r]>i[a]-n?r:a;let f=0,d=0,h=0,p=0,g=0,m=1/Math.abs(i[s]-n||1);for(let t=r;t<=a;++t){const e=i[t],r=o[t],a=Ui(Math.abs(n-e)*m)*l[t],s=e*a;f+=a,d+=s,h+=r*a,p+=r*s,g+=e*s}const[v,y]=Ci(d/f,h/f,p/f,g/f);u[t]=v+y*n,c[t]=Math.abs(o[t]-u[t]),qi(i,t+1,e)}if(2===t)break;const n=Bi(c);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r<a;++r)t=c[r]/(6*n),l[r]=t>=1?1e-12:(e=1-t*t)*e}return function(t,e){const n=t.length,r=[];for(let i,o=0,a=0,s=[];o<n;++o)i=t[o],s[0]===i?s[1]+=(e[o]-s[1])/++a:(a=0,s=[i,e[o]],r.push(s));return r}(i,u)};function Ui(t){return(t=1-t*t*t)*t*t}function qi(t,e,n){let r=t[e],i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const Wi=.1*Math.PI/180;var Hi=function(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,c=[i(o)],l=[];if(n===r){for(let t=1;t<r;++t)c.push(i(o+t/n*s));return c.push(i(a)),c}l.push(i(a));for(let t=n;--t>0;)l.push(i(o+t/n*s));let f=c[0],d=l[l.length-1];for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&Yi(f,t,d)>Wi?l.push(t):(f=d,c.push(d),l.pop()),d=l[l.length-1]}return c};function Yi(t,e,n){const r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}function Gi(t){this._key=t?Object(et.t)(t):st,this.reset()}var Vi=Gi.prototype;function Xi(t){Tr.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Vi.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Vi.add=function(t){this._add.push(t)},Vi.rem=function(t){this._rem.push(t)},Vi.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,e,n,r=this._add,i=this._rem,o=this._key,a=r.length,s=i.length,u=Array(a-s),c={};for(t=0;t<s;++t)c[o(i[t])]=1;for(t=0,e=0;t<a;++t)c[o(n=r[t])]?c[o(n)]=0:u[e++]=n;return this._rem=[],this._add=u},Vi.distinct=function(t){for(var e,n=this.values(),r=n.length,i={},o=0;--r>=0;)e=t(n[r])+"",Object(et.v)(i,e)||(i[e]=1,++o);return o},Vi.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=Object(et.q)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},Vi.argmin=function(t){return this.extent(t)[0]||{}},Vi.argmax=function(t){return this.extent(t)[1]||{}},Vi.min=function(t){var e=this.extent(t)[0];return null!=e?t(e):void 0},Vi.max=function(t){var e=this.extent(t)[1];return null!=e?t(e):void 0},Vi.quartile=function(t){return this._get===t&&this._q||(this._q=ei(this.values(),t),this._get=t),this._q},Vi.q1=function(t){return this.quartile(t)[0]},Vi.q2=function(t){return this.quartile(t)[1]},Vi.q3=function(t){return this.quartile(t)[2]},Vi.ci=function(t){return this._get===t&&this._ci||(this._ci=ai(this.values(),1e3,.05,t),this._get=t),this._ci},Vi.ci0=function(t){return this.ci(t)[0]},Vi.ci1=function(t){return this.ci(t)[1]},Xi.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ur},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};var Ji=Object(et.y)(Xi,Tr);Ji.transform=function(t,e){var n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,t=>n.add(t))):(n.value=n.value||n.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),n.changes(r)},Ji.cross=function(){var t=this,e=t.value,n=t._dnames,r=n.map((function(){return{}})),i=n.length;function o(t){var e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,u){var c,l,f=n[u],d=r[u++];for(c in d)s[f]=d[c],l=a?a+"|"+c:c,u<i?o(l,s,u):e[l]||t.cell(l,s)}("",{},0)},Ji.init=function(t){var e=this._inputs=[],n=this._outputs=[],r={};function i(t){for(var n,i=Object(et.i)(Object(et.g)(t)),o=0,a=i.length;o<a;++o)r[n=i[o]]||(r[n]=1,e.push(n))}this._dims=Object(et.i)(t.groupby),this._dnames=this._dims.map((function(t){var e=Object(et.h)(t);return i(t),n.push(e),e})),this.cellkey=t.key?t.key:Ir(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var o,a,s,u,c,l,f=t.fields||[null],d=t.ops||["count"],h=t.as||[],p=f.length,g={};for(p!==d.length&&Object(et.n)("Unmatched number of fields and aggregate ops."),l=0;l<p;++l)o=f[l],a=d[l],null==o&&"count"!==a&&Object(et.n)("Null aggregate field specified."),c=Br(a,u=Object(et.h)(o),h[l]),n.push(c),"count"!==a?((s=g[u])||(i(o),(s=g[u]=[]).field=o,this._measures.push(s)),"count"!==a&&(this._countOnly=!1),s.push(qr(a,c))):this._counts.push(c);return this._measures=this._measures.map((function(t){return Yr(t,t.field)})),{}},Ji.cellkey=Ir(),Ji.cell=function(t,e){var n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},Ji.newcell=function(t,e){var n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){var r,i=this._measures,o=i.length;for(n.agg=Array(o),r=0;r<o;++r)n.agg[r]=new i[r](n)}return n.store&&(n.data=new Gi),n},Ji.newtuple=function(t,e){var n,r,i=this._dnames,o=this._dims,a={};for(n=0,r=o.length;n<r;++n)a[i[n]]=o[n](t);return e?dt(e.tuple,a):ct(a)},Ji.add=function(t){var e,n,r,i=this.cellkey(t),o=this.cell(i,t);if(o.num+=1,!this._countOnly)for(o.store&&o.data.add(t),n=0,r=(e=o.agg).length;n<r;++n)e[n].add(e[n].get(t),t)},Ji.rem=function(t){var e,n,r,i=this.cellkey(t),o=this.cell(i,t);if(o.num-=1,!this._countOnly)for(o.store&&o.data.rem(t),n=0,r=(e=o.agg).length;n<r;++n)e[n].rem(e[n].get(t),t)},Ji.celltuple=function(t){var e,n,r,i=t.tuple,o=this._counts;for(t.store&&t.data.values(),n=0,r=o.length;n<r;++n)i[o[n]]=t.num;if(!this._countOnly)for(n=0,r=(e=t.agg).length;n<r;++n)e[n].set(i);return i},Ji.changes=function(t){var e,n,r,i,o=this._adds,a=this._mods,s=this._prev,u=this._drop,c=t.add,l=t.rem,f=t.mod;if(s)for(n in s)e=s[n],u&&!e.num||l.push(e.tuple);for(r=0,i=this._alen;r<i;++r)c.push(this.celltuple(o[r])),o[r]=null;for(r=0,i=this._mlen;r<i;++r)(0===(e=a[r]).num&&u?l:f).push(this.celltuple(e)),a[r]=null;return this._alen=this._mlen=0,this._prev=null,t};function Zi(t){Tr.call(this,null,t)}Zi.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};var Qi=Object(et.y)(Zi,Tr);Qi.transform=function(t,e){var n,r=!1!==t.interval,i=this._bins(t),o=i.start,a=i.step,s=t.as||["bin0","bin1"],u=s[0],c=s[1];return n=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(Object(et.g)(t.field))?e.ADD_MOD:e.ADD,e.visit(n,r?function(t){var e=i(t);t[u]=e,t[c]=null==e?null:o+a*(1+(e-o)/a)}:function(t){t[u]=i(t)}),e.modifies(r?s:u)},Qi._bins=function(t){if(this.value&&!t.modified())return this.value;var e,n,r=t.field,i=ri(t),o=i.start,a=i.stop,s=i.step;null!=(e=t.anchor)&&(n=e-(o+s*Math.floor((e-o)/s)),o+=n,a+=n);var u=function(t){var e=r(t);return null==e?null:(e=Math.max(o,Math.min(+e,a-s)),o+s*Math.floor(1e-14+(e-o)/s))};return u.start=o,u.stop=a,u.step=s,this.value=Object(et.f)(u,Object(et.g)(r),t.name||"bin_"+Object(et.h)(r))};var Ki=function(t,e,n){var r=t,i=e||[],o=n||[],a={},s=0;return{add:function(t){o.push(t)},remove:function(t){a[r(t)]=++s},size:function(){return i.length},data:function(t,e){return s&&(i=i.filter((function(t){return!a[r(t)]})),a={},s=0),e&&t&&i.sort(t),o.length&&(i=t?Object(et.L)(t,i,o.sort(t)):i.concat(o),o=[]),i}}};function to(t){Tr.call(this,[],t)}function eo(t){_t.call(this,null,no,t)}function no(t){return this.value&&!t.modified()?this.value:Object(et.k)(t.fields,t.orders)}function ro(t){Tr.call(this,null,t)}to.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(et.y)(to,Tr).transform=function(t,e){var n=e.fork(e.ALL),r=Ki(st,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(ht(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n},Object(et.y)(eo,_t),ro.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};var io=Object(et.y)(ro,Tr);function oo(t){Tr.call(this,null,t)}io.transform=function(t,e){function n(e){return function(n){for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],u=0,c=i.length;u<c;++u)a.test(r=i[u])||e(r)}}var r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,s=t.field,u=t.as||["text","count"],c=n((function(t){i[t]=1+(i[t]||0)})),l=n((function(t){i[t]-=1}));return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,l)),this._finish(e,u)},io._parameterCheck=function(t,e){var n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},io._finish=function(t,e){var n,r,i,o=this._counts,a=this._tuples||(this._tuples={}),s=e[0],u=e[1],c=t.fork(t.NO_SOURCE|t.NO_FIELDS);for(n in o)r=a[n],i=o[n]||0,!r&&i?(a[n]=r=ct({}),r[s]=n,r[u]=i,c.add.push(r)):0===i?(r&&c.rem.push(r),o[n]=null,a[n]=null):r[u]!==i&&(r[u]=i,c.mod.push(r));return c.modifies(e)},oo.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(et.y)(oo,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=this.value,i=t.as||["a","b"],o=i[0],a=i[1];return!r||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter")?(r&&(n.rem=r),r=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],s={},u=t.length,c=0;c<u;++c)for(s[e]=o=t[c],i=0;i<u;++i)s[n]=t[i],r(s)&&(a.push(ct(s)),(s={})[e]=o);return a}(r,o,a,t.filter||et.fb)):n.mod=r,n.source=this.value,n.modifies(i)};var ao={kde:yi,mixture:Ei,normal:vi,lognormal:Oi,uniform:Di},so="distributions",uo="function",co="field";function lo(t){Tr.call(this,null,t)}var fo=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],ho={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:fo},{name:"weights",type:"number",array:!0}]};function po(t,e){return t?t.map((function(t,n){return e[n]||Object(et.h)(t)})):null}function go(t,e,n){var r,i,o,a,s,u,c=[],l=function(t){return t(a)};if(null==e)c.push(t.map(n));else for(r={},i=0,o=t.length;i<o;++i)a=t[i],(u=r[s=e.map(l)])||(r[s]=u=[],u.dims=s,c.push(u)),u.push(n(a));return c}lo.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:fo.concat(ho)},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(et.y)(lo,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=function t(e,n){var r=e[uo];Object(et.v)(ao,r)||Object(et.n)("Unknown distribution function: "+r);var i=ao[r]();for(var o in e)o===co?i.data((e.from||n()).map(e[o])):o===so?i[o](e[o].map((function(e){return t(e,n)}))):typeof i[o]===uo&&i[o](e[o]);return i}(t.distribution,function(t){return function(){return t.materialize(t.SOURCE).source}}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200,a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&Object(et.n)("Invalid density method: "+a),t.extent||r.data||Object(et.n)("Missing density extent parameter."),a=r[a];var s=t.as||["value","density"],u=t.extent||Object(et.p)(r.data()),c=Hi(a,u,i,o).map(t=>{var e={};return e[s[0]]=t[0],e[s[1]]=t[1],ct(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n};function mo(t){Tr.call(this,null,t)}function vo(t){_t.call(this,null,yo,t),this.modified(!0)}function yo(t){var e=t.expr;return this.value&&!t.modified("expr")?this.value:Object(et.f)(n=>e(n,t),Object(et.g)(e),Object(et.h)(e))}function bo(t){Tr.call(this,[void 0,void 0],t)}function xo(t,e){_t.call(this,t),this.parent=e}mo.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},Object(et.y)(mo,Tr).transform=function(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=go(e.source,t.groupby,et.x),i=t.smooth||!1,o=t.field,a=t.step||function(t,e){return Object(et.W)(Object(et.p)(t,e))/30}(n,o),s=ht((t,e)=>o(t)-o(e)),u=t.as||"bin",c=r.length;let l,f=1/0,d=-1/0,h=0;for(;h<c;++h){const t=r[h].sort(s);l=-1;for(const e of si(t,a,i,o))e<f&&(f=e),e>d&&(d=e),t[++l][u]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(u)},Object(et.y)(vo,_t),bo.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(et.y)(bo,Tr).transform=function(t,e){var n,r=this.value,i=t.field,o=r[0],a=r[1];if(((n=e.changed()||e.modified(i.fields)||t.modified("field"))||null==o)&&(o=1/0,a=-1/0),e.visit(n?e.SOURCE:e.ADD,(function(t){var e=i(t);null!=e&&((e=+e)<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){let t=Object(et.h)(i);t&&(t=` for field "${t}"`),e.dataflow.warn(`Infinite extent${t}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]};var _o=Object(et.y)(xo,_t);function wo(t){Tr.call(this,{},t),this._keys=Object(et.s)();var e=this._targets=[];e.active=0,e.forEach=function(t){for(var n=0,r=e.active;n<r;++n)t(e[n],n,e)}}_o.connect=function(t){return this.targets().add(t),t.source=this},_o.add=function(t){this.value.add.push(t)},_o.rem=function(t){this.value.rem.push(t)},_o.mod=function(t){this.value.mod.push(t)},_o.init=function(t){this.value.init(t,t.NO_SOURCE)},_o.evaluate=function(){return this.value};var Oo=Object(et.y)(wo,Tr);function Eo(t){_t.call(this,null,Ao,t)}function Ao(t){return this.value&&!t.modified()?this.value:Object(et.A)(t.name)?Object(et.i)(t.name).map((function(t){return Object(et.t)(t)})):Object(et.t)(t.name,t.as)}function ko(t){Tr.call(this,Object(et.s)(),t)}function So(t){Tr.call(this,[],t)}function jo(t){Tr.call(this,[],t)}function Do(t){Tr.call(this,null,t)}function Co(t){Tr.call(this,[],t)}Oo.activate=function(t){this._targets[this._targets.active++]=t},Oo.subflow=function(t,e,n,r){var i,o,a=this.value,s=Object(et.v)(a,t)&&a[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(o=r||(o=this._group[t])&&o.tuple,s=(i=n.dataflow).add(new xo(n.fork(n.NO_SOURCE),this)).connect(e(i,t,o)),a[t]=s,this.activate(s)),s},Oo.transform=function(t,e){var n=e.dataflow,r=this,i=t.key,o=t.subflow,a=this._keys,s=t.modified("key");function u(t){return r.subflow(t,o,e)}return this._group=t.group||{},this._targets.active=0,e.visit(e.REM,(function(t){var e=st(t),n=a.get(e);void 0!==n&&(a.delete(e),u(n).rem(t))})),e.visit(e.ADD,(function(t){var e=i(t);a.set(st(t),e),u(e).add(t)})),s||e.modified(i.fields)?e.visit(e.MOD,(function(t){var e=st(t),n=a.get(e),r=i(t);n===r?u(r).mod(t):(a.set(e,r),u(n).rem(t),u(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(function(t){u(a.get(st(t))).mod(t)})),s&&e.visit(e.REFLOW,(function(t){var e=st(t),n=a.get(e),r=i(t);n!==r&&(a.set(e,r),u(n).rem(t),u(r).add(t))})),a.empty>n.cleanThreshold&&n.runAfter(a.clean),e},Object(et.y)(Eo,_t),ko.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(et.y)(ko,Tr).transform=function(t,e){var n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,s=i.mod,u=t.expr,c=!0;function l(e){var n=st(e),i=u(e,t),l=r.get(n);i&&l?(r.delete(n),o.push(e)):i||l?c&&i&&!l&&s.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(function(t){var e=st(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(function(e){u(e,t)?o.push(e):r.set(st(e),1)})),e.visit(e.MOD,l),t.modified()&&(c=!1,e.visit(e.REFLOW,l)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i},So.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Object(et.y)(So,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=po(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,s,u,c=r.map(e=>e(t)),l=c.reduce((t,e)=>Math.max(t,e.length),0),f=0;f<l;++f){for(s=lt(t),e=0;e<a;++e)s[i[e]]=null==(u=c[e][f])?null:u;o&&(s[o]=f),n.add.push(s)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)},jo.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},Object(et.y)(jo,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=r.map(et.h),o=t.as||["key","value"],a=o[0],s=o[1],u=r.length;return n.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,o=0;o<u;++o)(e=lt(t))[a]=i[o],e[s]=r[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)},Do.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},Object(et.y)(Do,Tr).transform=function(t,e){var n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,e=>e[r]=n(e,t))},Object(et.y)(Co,Tr).transform=function(t,e){var n,r,i,o=this.value,a=e.fork(e.ALL),s=t.size-o.length,u=t.generator;if(s>0){for(n=[];--s>=0;)n.push(i=ct(u(t))),o.push(i);a.add=a.add.length?a.materialize(a.ADD).add.concat(n):n}else r=o.slice(0,-s),a.rem=a.rem.length?a.materialize(a.REM).rem.concat(r):r,o=o.slice(-s);return a.source=this.value=o,a};var Mo={value:"value",median:Bi,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Jr,max:Xr},Fo=[];function No(t){Tr.call(this,[],t)}function To(t){Xi.call(this,t)}No.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(et.y)(No,Tr).transform=function(t,e){var n,r,i,o,a,s,u,c,l,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||Mo.value;if(null!=Mo[n])return n===Mo.value?(e=void 0!==t.value?t.value:0,function(){return e}):Mo[n];Object(et.n)("Unrecognized imputation method: "+n)}(t),p=function(t){var e=t.field;return function(t){return t?e(t):NaN}}(t),g=Object(et.h)(t.field),m=Object(et.h)(t.key),v=(t.groupby||[]).map(et.h),y=function(t,e,n,r){var i,o,a,s,u,c,l,f,d=function(t){return t(f)},h=[],p=r?r.slice():[],g={},m={};for(p.forEach((function(t,e){g[t]=e+1})),s=0,l=t.length;s<l;++s)f=t[s],c=n(f),u=g[c]||(g[c]=p.push(c)),o=(i=e?e.map(d):Fo)+"",(a=m[o])||(a=m[o]=[],h.push(a),a.values=i),a[u-1]=f;return h.domain=p,h}(e.source,t.groupby,t.key,t.keyvals),b=[],x=this.value,_=y.domain.length;for(a=0,c=y.length;a<c;++a)for(i=(n=y[a]).values,r=NaN,u=0;u<_;++u)if(null==n[u]){for(o=y.domain[u],f={_impute:!0},s=0,l=i.length;s<l;++s)f[v[s]]=i[s];f[m]=o,f[g]=Number.isNaN(r)?r=h(n,p):r,b.push(ct(f))}return b.length&&(d.add=d.materialize(d.ADD).add.concat(b)),x.length&&(d.rem=d.materialize(d.REM).rem.concat(x)),this.value=b,d},To.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Ur},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var Ro=Object(et.y)(To,Xi);function zo(t){Tr.call(this,null,t)}function $o(t){_t.call(this,null,Lo,t)}function Lo(t){return this.value&&!t.modified()?this.value:Object(et.I)(t.fields,t.flat)}function Io(t){Tr.call(this,[],t)}function Bo(t,e,n){n.forEach(ct);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.add=r.source=n,r}function Po(t){Tr.call(this,{},t)}function Uo(t){_t.call(this,null,qo,t)}function qo(t){if(this.value&&!t.modified())return this.value;var e,n,r,i=1/0,o=-1/0,a=t.extents;for(e=0,n=a.length;e<n;++e)(r=a[e])[0]<i&&(i=r[0]),r[1]>o&&(o=r[1]);return[i,o]}function Wo(t){_t.call(this,null,Ho,t)}function Ho(t){return this.value&&!t.modified()?this.value:t.values.reduce((function(t,e){return t.concat(e)}),[])}function Yo(t){Tr.call(this,null,t)}function Go(t){Xi.call(this,t)}Ro.transform=function(t,e){var n,r=this,i=t.modified();return r.value&&(i||e.modified(r._inputs,!0))?(n=r.value=i?r.init(t):{},e.visit(e.SOURCE,(function(t){r.add(t)}))):(n=r.value=r.value||this.init(t),e.visit(e.REM,(function(t){r.rem(t)})),e.visit(e.ADD,(function(t){r.add(t)}))),r.changes(),e.visit(e.SOURCE,(function(t){Object(et.o)(t,n[r.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},Ro.changes=function(){var t,e,n=this._adds,r=this._mods;for(t=0,e=this._alen;t<e;++t)this.celltuple(n[t]),n[t]=null;for(t=0,e=this._mlen;t<e;++t)this.celltuple(r[t]),r[t]=null;this._alen=this._mlen=0},zo.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(et.y)(zo,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=go(r,t.groupby,t.field),o=(t.groupby||[]).map(et.h),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",u=t.as||["value","density"],c=[];let l=t.extent,f=t.steps||t.minsteps||25,d=t.steps||t.maxsteps||200;"pdf"!==s&&"cdf"!==s&&Object(et.n)("Invalid density method: "+s),"shared"===t.resolve&&(l||(l=Object(et.p)(r,t.field)),f=d=t.steps||d),i.forEach(e=>{const n=yi(e,a)[s],r=t.counts?e.length:1,i=l||Object(et.p)(e);Hi(n,i,f,d).forEach(t=>{const n={};for(let t=0;t<o.length;++t)n[o[t]]=e.dims[t];n[u[0]]=t[0],n[u[1]]=t[1]*r,c.push(ct(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n},Object(et.y)($o,_t),Object(et.y)(Io,Tr).transform=function(t,e){const n=e.dataflow;return t.values?Bo(this,e,n.parse(t.values,t.format)):n.request(t.url,t.format).then(t=>Bo(this,e,Object(et.i)(t.data)))},Po.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(et.y)(Po,Tr).transform=function(t,e){var n,r,i=e,o=t.as,a=t.fields,s=t.index,u=t.values,c=null==t.default?null:t.default,l=t.modified(),f=l?e.SOURCE:e.ADD,d=a.length;return u?(r=u.length,d>1&&!o&&Object(et.n)('Multi-field lookup requires explicit "as" parameter.'),o&&o.length!==d*r&&Object(et.n)('The "as" parameter has too few output field names.'),o=o||u.map(et.h),n=function(t){for(var e,n,i=0,l=0;i<d;++i)if(null==(n=s.get(a[i](t))))for(e=0;e<r;++e,++l)t[o[l]]=c;else for(e=0;e<r;++e,++l)t[o[l]]=u[e](n)}):(o||Object(et.n)("Missing output field names."),n=function(t){for(var e,n=0;n<d;++n)e=s.get(a[n](t)),t[o[n]]=null==e?c:e}),l?i=e.reflow(!0):f|=a.some((function(t){return e.modified(t.fields)}))?e.MOD:0,e.visit(f,n),i.modifies(o)},Object(et.y)(Uo,_t),Object(et.y)(Wo,_t),Object(et.y)(Yo,Tr),Yo.prototype.transform=function(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)},Go.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ur,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};var Vo=Object(et.y)(Go,Xi);function Xo(t){wo.call(this,t)}function Jo(t){Tr.call(this,null,t)}function Zo(t){Tr.call(this,null,t)}Vo._transform=Vo.transform,Vo.transform=function(t,e){return this._transform(function(t,e){var n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=Object(et.g)(n).concat(Object(et.g)(r)),a=function(t,e,n){var r={},i=[];return n.visit(n.SOURCE,(function(e){var n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort((function(t,e){return(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0)})),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((function(){return i})),fields:a.map((function(t){return function(t,e,n,r){return Object(et.f)((function(r){return e(r)===t?n(r):NaN}),r,t+"")}(t,n,r,o)})),as:a.map((function(t){return t+""})),modified:t.modified.bind(t)}}(t,e),e)},Object(et.y)(Xo,wo).transform=function(t,e){var n=this,r=t.subflow,i=t.field;return(t.modified("field")||i&&e.modified(Object(et.g)(i)))&&Object(et.n)("PreFacet does not support field modification."),this._targets.active=0,e.visit(e.MOD,(function(t){var o=n.subflow(st(t),r,e,t);i?i(t).forEach((function(t){o.mod(t)})):o.mod(t)})),e.visit(e.ADD,(function(t){var o=n.subflow(st(t),r,e,t);i?i(t).forEach((function(t){o.add(ct(t))})):o.add(t)})),e.visit(e.REM,(function(t){var o=n.subflow(st(t),r,e,t);i?i(t).forEach((function(t){o.rem(t)})):o.rem(t)})),e},Jo.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(et.y)(Jo,Tr).transform=function(t,e){var n,r,i=t.fields,o=po(t.fields,t.as||[]),a=i?function(t,e){return function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,i,o)}:ft;return this.value?r=this.value:(e=e.addAll(),r=this.value={}),n=e.fork(e.NO_SOURCE),e.visit(e.REM,(function(t){var e=st(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(function(t){var e=a(t,ct({}));r[st(t)]=e,n.add.push(e)})),e.visit(e.MOD,(function(t){n.mod.push(a(t,r[st(t)]))})),n},Object(et.y)(Zo,Tr).transform=function(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};var Qo=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o};function Ko(t){Tr.call(this,null,t)}Ko.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};var ta=Object(et.y)(Ko,Tr);function ea(t){Tr.call(this,null,t)}function na(t){Tr.call(this,[],t),this.count=0}function ra(t){Tr.call(this,null,t)}function ia(t){Tr.call(this,null,t),this.modified(!0)}ta.transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const i=go(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(et.h),a=[],s=t.step||.01,u=t.probs||Qo(s/2,1-1e-14,s),c=u.length;return i.forEach(t=>{const e=ti(t,u);for(let n=0;n<c;++n){const i={};for(let e=0;e<o.length;++e)i[o[e]]=t.dims[e];i[r[0]]=u[n],i[r[1]]=e[n],a.push(ct(i))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n},Object(et.y)(ea,Tr).transform=function(t,e){var n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,t=>{var e=st(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,t=>{var e=lt(t);r[st(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{var e,i=r[st(t)];for(e in t)i[e]=t[e],n.modifies(e);n.mod.push(i)})),n},na.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(et.y)(na,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value,a=this.count,s=0,u=o.reduce((function(t,e){return t[st(e)]=1,t}),{});function c(t){var e,r;o.length<i?o.push(t):(r=~~((a+1)*ii()))<o.length&&r>=s&&(e=o[r],u[st(e)]&&n.rem.push(e),o[r]=t),++a}if(e.rem.length&&(e.visit(e.REM,(function(t){var e=st(t);u[e]&&(u[e]=-1,n.rem.push(t)),--a})),o=o.filter((function(t){return-1!==u[st(t)]}))),(e.rem.length||r)&&o.length<i&&e.source&&(s=a=o.length,e.visit(e.SOURCE,(function(t){u[st(t)]||c(t)})),s=-1),r&&o.length>i){for(var l=0,f=o.length-i;l<f;++l)u[st(o[l])]=-1,n.rem.push(o[l]);o=o.slice(f)}return e.mod.length&&e.visit(e.MOD,(function(t){u[st(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,c),(e.add.length||s<0)&&(n.add=o.filter((function(t){return!u[st(t)]}))),this.count=a,this.value=n.source=o,n},ra.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(et.y)(ra,Tr).transform=function(t,e){if(!this.value||t.modified()){var n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Qo(t.start,t.stop,t.step||1).map((function(t){var e={};return e[r]=t,ct(e)})),n.add=e.add.concat(this.value),n}},Object(et.y)(ia,Tr).transform=function(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};const oa="year",aa="quarter",sa="month",ua="week",ca="date",la="day",fa="hours",da="minutes",ha="seconds",pa="milliseconds",ga=[oa,aa,sa,ua,ca,la,fa,da,ha,pa].reduce((t,e,n)=>(t[e]=1+n,t),{});function ma(t){const e=Object(et.i)(t).slice(),n={};return e.length||Object(et.n)("Missing time unit."),e.forEach(t=>{Object(et.v)(ga,t)?n[t]=1:Object(et.n)(`Invalid time unit: ${t}.`)}),(n[ua]||n[la])&&(n[aa]||n[sa]||n[ca])&&Object(et.n)(`Incompatible time units: ${t}`),e.sort((t,e)=>ga[t]-ga[e]),e}const va=new Date;function ya(t,e,n,r){const i=e||1,o=Object(et.T)(t),a=(t,e,r)=>(function(t,e,n){return e<=1?t:n?(r,i)=>n+e*Math.floor((t(r,i)-n)/e):(n,r)=>e*Math.floor(t(n,r)/e)})(n[r||t],t===o&&i,e),s=new Date,u=Object(et.cb)(t),c=u[oa]?a(oa):Object(et.l)(2012),l=u[sa]?a(sa):u[aa]?a(aa):et.jb,f=u[ua]&&u[la]?a(la,1,ua+la):u[ua]?a(ua,1):u[la]?a(la,1):u[ca]?a(ca,1):et.N,d=u[fa]?a(fa):et.jb,h=u[da]?a(da):et.jb,p=u[ha]?a(ha):et.jb,g=u[pa]?a(pa):et.jb;return function(t){s.setTime(+t);const e=c(s);return r(e,l(s),f(s,e),d(s),h(s),p(s),g(s))}}function ba(t,e,n){return e+7*t-(n+6)%7}const xa={[oa]:t=>t.getFullYear(),[aa]:t=>3*~~(t.getMonth()/3),[sa]:t=>t.getMonth(),[ca]:t=>t.getDate(),[fa]:t=>t.getHours(),[da]:t=>t.getMinutes(),[ha]:t=>t.getSeconds(),[pa]:t=>t.getMilliseconds(),[la]:(t,e)=>ba(1,t.getDay(),Oa(e)),[ua]:(t,e)=>ba(wa(t),0,Oa(e)),[ua+la]:(t,e)=>ba(wa(t),t.getDay(),Oa(e))};function _a(t){return va.setFullYear(t),va.setMonth(0),va.setDate(1),va.setHours(0,0,0,0),va}function wa(t){return Ne.count(_a(t.getFullYear())-1,t)}function Oa(t){return _a(t).getDay()}function Ea(t,e,n,r,i,o,a){if(0<=t&&t<100){var s=new Date(-1,e,n,r,i,o,a);return s.setFullYear(t),s}return new Date(t,e,n,r,i,o,a)}function Aa(t,e){return ya(t,e||1,xa,Ea)}const ka={[oa]:t=>t.getUTCFullYear(),[aa]:t=>3*~~(t.getUTCMonth()/3),[sa]:t=>t.getUTCMonth(),[ca]:t=>t.getUTCDate(),[fa]:t=>t.getUTCHours(),[da]:t=>t.getUTCMinutes(),[ha]:t=>t.getUTCSeconds(),[pa]:t=>t.getUTCMilliseconds(),[la]:(t,e)=>ba(1,t.getUTCDay(),ja(e)),[ua]:(t,e)=>ba(Sa(t),0,ja(e)),[ua+la]:(t,e)=>ba(Sa(t),t.getUTCDay(),ja(e))};function Sa(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Oe.count(e-1,t)}function ja(t){return va.setTime(Date.UTC(t,0,1)),va.getUTCDay()}function Da(t,e,n,r,i,o,a){if(0<=t&&t<100){var s=new Date(Date.UTC(-1,e,n,r,i,o,a));return s.setUTCFullYear(n.y),s}return new Date(Date.UTC(t,e,n,r,i,o,a))}function Ca(t,e){return ya(t,e||1,ka,Da)}var Ma=be((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Fa=Ma,Na=(Ma.range,be((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*xe)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Ta=Na,Ra=(Na.range,be((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+e*xe)}),(function(t,e){return(e-t)/xe}),(function(t){return t.getMinutes()}))),za=Ra,$a=(Ra.range,be((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),La=$a,Ia=($a.range,be((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));Ia.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?be((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Ia:null};var Ba=Ia,Pa=(Ia.range,be((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),Ua=Pa,qa=(Pa.range,be((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),Wa=qa,Ha=(qa.range,be((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*xe)}),(function(t,e){return(e-t)/xe}),(function(t){return t.getUTCMinutes()}))),Ya=Ha;Ha.range;const Ga={[oa]:qe,[aa]:Fa.every(3),[sa]:Fa,[ua]:Ne,[ca]:Pe,[la]:Pe,[fa]:Ta,[da]:za,[ha]:La,[pa]:Ba},Va={[oa]:He,[aa]:Ua.every(3),[sa]:Ua,[ua]:Oe,[ca]:Me,[la]:Me,[fa]:Wa,[da]:Ya,[ha]:La,[pa]:Ba};function Xa(t){return Ga[t]}function Ja(t){return Va[t]}function Za(t,e,n){return t?t.offset(e,n):void 0}function Qa(t,e,n){return Za(Xa(t),e,n)}function Ka(t,e,n){return Za(Ja(t),e,n)}function ts(t,e,n,r){return t?t.range(e,n,r):void 0}function es(t,e,n,r){return ts(Xa(t),e,n,r)}function ns(t,e,n,r){return ts(Ja(t),e,n,r)}const rs={[oa]:"%Y ",[aa]:"Q%q ",[sa]:"%b ",[ca]:"%d ",[ua]:"W%U ",[la]:"%a ",[fa]:"%H:00",[da]:"00:%M",[ha]:":%S",[pa]:".%L",[`${oa}-${sa}`]:"%Y-%m ",[`${oa}-${sa}-${ca}`]:"%Y-%m-%d ",[`${fa}-${da}`]:"%H:%M"};function is(t,e){const n=Object(et.o)({},rs,e),r=ma(t),i=r.length;let o,a,s="",u=0;for(u=0;u<i;)for(o=r.length;o>u;--o)if(null!=n[a=r.slice(u,o).join("-")]){s+=n[a],u=o;break}return s.trim()}function os(t){return ss(Je,Xa,t)}function as(t){return ss(Qe,Ja,t)}function ss(t,e,n){return Object(et.H)(n)?t(n):function(t,e,n){n=n||{},Object(et.F)(n)||Object(et.n)(`Invalid time multi-format specifier: ${n}`);const r=e(ha),i=e(da),o=e(fa),a=e(ca),s=e(ua),u=e(sa),c=e(aa),l=e(oa),f=t(n[pa]||".%L"),d=t(n[ha]||":%S"),h=t(n[da]||"%I:%M"),p=t(n[fa]||"%I %p"),g=t(n[ca]||n[la]||"%a %d"),m=t(n[ua]||"%b %d"),v=t(n[sa]||"%B"),y=t(n[aa]||"%B"),b=t(n[oa]||"%Y");return function(t){return(r(t)<t?f:i(t)<t?d:o(t)<t?h:a(t)<t?p:u(t)<t?s(t)<t?g:m:l(t)<t?c(t)<t?v:y:b)(t)}}(t,e,n)}var us=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Vr(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var cs=Math.sqrt(50),ls=Math.sqrt(10),fs=Math.sqrt(2),ds=function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=hs(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;return r&&o.reverse(),o};function hs(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=cs?10:o>=ls?5:o>=fs?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=cs?10:o>=ls?5:o>=fs?2:1)}function ps(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=cs?i*=10:o>=ls?i*=5:o>=fs&&(i*=2),e<t?-i:i}const gs=[oa,sa,ca,fa,da,ha,pa],ms=gs.slice(0,-1),vs=ms.slice(0,-1),ys=vs.slice(0,-1),bs=ys.slice(0,-1),xs=[oa,sa],_s=[oa],ws=[[ms,1,1e3],[ms,5,5e3],[ms,15,15e3],[ms,30,3e4],[vs,1,6e4],[vs,5,3e5],[vs,15,9e5],[vs,30,18e5],[ys,1,36e5],[ys,3,108e5],[ys,6,216e5],[ys,12,432e5],[bs,1,864e5],[[oa,ua],1,6048e5],[xs,1,2592e6],[xs,3,7776e6],[_s,1,31536e6]];var Os=function(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(Object(et.W)(e))/n;let i,o,a=us(t=>t[2]).right(ws,r);return a===ws.length?(i=_s,o=ps(e[0]/31536e6,e[1]/31536e6,n)):a?(i=(a=ws[r/ws[a-1][2]<ws[a][2]/r?a-1:a])[0],o=a[1]):(i=gs,o=Math.max(ps(e[0],e[1],n),1)),{units:i,step:o}};function Es(t){Tr.call(this,null,t)}const As=["unit0","unit1"];Es.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"string",array:!0},{name:"step",type:"number",default:1},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:As}]};var ks=Object(et.y)(Es,Tr);function Ss(t){Tr.call(this,Object(et.s)(),t)}function js(t){Tr.call(this,null,t)}ks.transform=function(t,e){var n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?Ja:Xa)(o.unit).offset,s=t.as||As,u=s[0],c=s[1],l=o.start||1/0,f=o.stop||-1/0,d=o.step,h=e.ADD;return(t.modified()||e.modified(Object(et.g)(t.field)))&&(h=(e=e.reflow(!0)).SOURCE,l=1/0,f=-1/0),e.visit(h,(function(t){var e,i,s=n(t);null==s?(t[u]=null,r&&(t[c]=null)):(t[u]=e=i=o(s),r&&(t[c]=i=a(e,d)),e<l&&(l=e),i>f&&(f=i))})),o.start=l,o.stop=f,e.modifies(r?s:u)},ks._floor=function(t,e){const n="utc"===t.timezone;let{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:Os({extent:Object(et.p)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins});r=ma(r);const o=this.value||{},a=(n?Ca:Aa)(r,i);return a.unit=Object(et.T)(r),a.units=r,a.step=i,a.start=o.start,a.stop=o.stop,this.value=a},Object(et.y)(Ss,Tr).transform=function(t,e){var n=e.dataflow,r=t.field,i=this.value,o=!0;function a(t){i.set(r(t),t)}return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,a)):e.changed()?(e.visit(e.REM,(function(t){i.delete(r(t))})),e.visit(e.ADD,a)):o=!1,this.modified(o),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()},Object(et.y)(js,Tr).transform=function(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(ht(t.sort)):e.source).map(t.field))};const Ds={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{let n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{let n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){let t=Ds.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{let n=e.index,r=e.data,i=e.compare;if(t<n){for(;n+1<r.length&&!i(r[n],r[n+1]);)++n;t=n}return(1+t)/r.length}}},ntile:function(t,e){(e=+e)>0||Object(et.n)("ntile num must be greater than zero.");let n=Ds.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{let r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{let r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||Object(et.n)("nth_value nth must be greater than zero."),{next:n=>{let r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e=null;return{next:n=>{let r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e=null,n=-1;return{next:r=>{let i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};var Cs=Object.keys(Ds);function Ms(t){let e=this,n=Object(et.i)(t.ops),r=Object(et.i)(t.fields),i=Object(et.i)(t.params),o=Object(et.i)(t.as),a=e.outputs=[],s=e.windows=[],u={},c={},l=!0,f=[],d=[];function h(t){Object(et.i)(Object(et.g)(t)).forEach(t=>u[t]=1)}h(t.sort),n.forEach((function(t,e){let n=r[e],u=Object(et.h)(n),p=Br(t,u,o[e]);if(h(n),a.push(p),Object(et.v)(Ds,t))s.push(function(t,e,n,r){let i=Ds[t](e,n);return{init:i.init||et.jb,update:function(t,e){e[r]=i.next(t)}}}(t,r[e],i[e],p));else{if(null==n&&"count"!==t&&Object(et.n)("Null aggregate field specified."),"count"===t)return void f.push(p);l=!1;let e=c[u];e||((e=c[u]=[]).field=n,d.push(e)),e.push(qr(t,p))}})),(f.length||d.length)&&(e.cell=function(t,e,n){t=t.map(t=>Yr(t,t.field));let r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var s=r.data=new Gi;return r.add=function(t){if(r.num+=1,!n){s&&s.add(t);for(let e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){s&&s.rem(t);for(let e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){let i,a;for(s&&s.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,s&&s.reset();for(let t=0;t<i;++t)o[t].init()},r}(d,f,l)),e.inputs=Object.keys(u)}const Fs=Ms.prototype;function Ns(t){Tr.call(this,{},t),this._mlen=0,this._mods=[]}Fs.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()},Fs.update=function(t,e){let n,r=this.cell,i=this.windows,o=t.data,a=i&&i.length;if(r){for(n=t.p0;n<t.i0;++n)r.rem(o[n]);for(n=t.p1;n<t.i1;++n)r.add(o[n]);r.set(e)}for(n=0;n<a;++n)i[n].update(t,e)},Ns.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Cs.concat(Ur)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};var Ts=Object(et.y)(Ns,Tr);function Rs(t,e,n,r){var i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],s=t.data(n),u=s.length,c=0,l=o?us(i):null,f={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||Object(et.l)(-1)};for(e.init();c<u;++c)zs(f,a,c,u),o&&$s(f,l),e.update(f,s[c])}function zs(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function $s(t,e){var n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}Ts.transform=function(t,e){var n,r,i=this,o=i.state,a=t.modified(),s=ht(t.sort);this.stamp=e.stamp,o&&!a||(o=i.state=new Ms(t));var u=Ir(t.groupby);function c(t){return i.group(u(t))}for(a||e.modified(o.inputs)?(i.value={},e.visit(e.SOURCE,(function(t){c(t).add(t)}))):(e.visit(e.REM,(function(t){c(t).remove(t)})),e.visit(e.ADD,(function(t){c(t).add(t)}))),n=0,r=i._mlen;n<r;++n)Rs(i._mods[n],o,s,t);return i._mlen=0,i._mods=[],e.reflow(a).modifies(o.outputs)},Ts.group=function(t){var e=this.value[t];return e||((e=this.value[t]=Ki(st)).stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e};const Ls="top",Is="left",Bs="right",Ps="bottom",Us="top-left",qs="top-right",Ws="bottom-left",Hs="bottom-right",Ys="start",Gs="middle",Vs="end",Xs="x",Js="y",Zs="group",Qs="axis",Ks="title",tu="frame",eu="scope",nu="legend",ru="row-header",iu="row-footer",ou="row-title",au="column-header",su="column-footer",uu="column-title",cu="padding",lu="symbol",fu="fit",du="fit-x",hu="fit-y",pu="pad",gu="none",mu="all",vu="each",yu="flush",bu="column",xu="row";function _u(t){this.clear(),t&&this.union(t)}var wu=_u.prototype;wu.clone=function(){return new _u(this)},wu.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},wu.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},wu.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},wu.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},wu.add=function(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},wu.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},wu.round=function(){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},wu.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},wu.rotate=function(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},wu.rotatedPoints=function(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),c=e-e*s+n*u,l=n-e*u-n*s;return[s*r-u*i+c,u*r+s*i+l,s*r-u*a+c,u*r+s*a+l,s*o-u*i+c,u*o+s*i+l,s*o-u*a+c,u*o+s*a+l]},wu.union=function(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},wu.intersect=function(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},wu.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},wu.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},wu.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},wu.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},wu.width=function(){return this.x2-this.x1},wu.height=function(){return this.y2-this.y1};var Ou=0;const Eu="p_";function Au(t){return t&&t.gradient}function ku(t,e,n){let r=t.id,i=t.gradient,o="radial"===i?Eu:"";return r||(r=t.id="gradient_"+Ou++,"radial"===i?(t.x1=Su(t.x1,.5),t.y1=Su(t.y1,.5),t.r1=Su(t.r1,0),t.x2=Su(t.x2,.5),t.y2=Su(t.y2,.5),t.r2=Su(t.r2,.5),o=Eu):(t.x1=Su(t.x1,0),t.y1=Su(t.y1,0),t.x2=Su(t.x2,1),t.y2=Su(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function Su(t,e){return null!=t?t:e}var ju=function(t,e){var n,r=[];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:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}};function Du(t){this.mark=t,this.bounds=this.bounds||new _u}function Cu(t){Du.call(this,t),this.items=this.items||[]}function Mu(t,e){if("undefined"!=typeof document&&document.createElement){var n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}function Fu(){return"undefined"!=typeof Image?Image:null}function Nu(t){this._pending=0,this._loader=t||pr()}Object(et.y)(Cu,Du);var Tu=Nu.prototype;function Ru(t){t._pending+=1}function zu(t){t._pending-=1}function $u(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Lu(t){this._context=t}Tu.pending=function(){return this._pending},Tu.sanitizeURL=function(t){var e=this;return Ru(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return zu(e),t})).catch((function(){return zu(e),null}))},Tu.loadImage=function(t){var e=this,n=Fu();return Ru(e),e._loader.sanitize(t,{context:"image"}).then((function(t){var r=t.href;if(!r||!n)throw{url:r};var i=new n;return i.onload=function(){zu(e)},i.onerror=function(){zu(e)},i.src=r,i})).catch((function(t){return zu(e),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},Tu.ready=function(){var t=this;return new Promise((function(e){!function n(r){t.pending()?setTimeout((function(){n(!0)}),10):e(r)}(!1)}))},Lu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$u(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$u(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Iu=function(){};function Bu(t){this._context=t}Bu.prototype={areaStart:Iu,areaEnd:Iu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$u(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pu(t){this._context=t}Pu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$u(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Uu(t,e){this._basis=new Lu(t),this._beta=e}Uu.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var qu=function t(e){function n(t){return 1===e?new Lu(t):new Uu(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Wu(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Hu(t,e){this._context=t,this._k=(1-e)/6}Hu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Wu(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Wu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Yu=function t(e){function n(t){return new Hu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Gu(t,e){this._context=t,this._k=(1-e)/6}Gu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vu=function t(e){function n(t){return new Gu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Xu(t,e){this._context=t,this._k=(1-e)/6}Xu.prototype={areaStart:Iu,areaEnd:Iu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ju=function t(e){function n(t){return new Xu(t,e)}return n.tension=function(e){return t(+e)},n}(0),Zu=Math.abs,Qu=Math.atan2,Ku=Math.cos,tc=Math.max,ec=Math.min,nc=Math.sin,rc=Math.sqrt,ic=1e-12,oc=Math.PI,ac=oc/2,sc=2*oc;function uc(t){return t>=1?ac:t<=-1?-ac:Math.asin(t)}function cc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>ic){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>ic){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function lc(t,e){this._context=t,this._alpha=e}lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:cc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fc=function t(e){function n(t){return e?new lc(t,e):new Hu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function dc(t,e){this._context=t,this._alpha=e}dc.prototype={areaStart:Iu,areaEnd:Iu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:cc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hc=function t(e){function n(t){return e?new dc(t,e):new Xu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function pc(t,e){this._context=t,this._alpha=e}pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gc=function t(e){function n(t){return e?new pc(t,e):new Gu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function mc(t){this._context=t}mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var vc=function(t){return new mc(t)};function yc(t){this._context=t}yc.prototype={areaStart:Iu,areaEnd:Iu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function bc(t){return t<0?-1:1}function xc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(bc(o)+bc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function _c(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function wc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Oc(t){this._context=t}function Ec(t){this._context=new Ac(t)}function Ac(t){this._context=t}function kc(t){this._context=t}function Sc(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}Oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wc(this,this._t0,_c(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,wc(this,_c(this,n=xc(this,t,e)),n);break;default:wc(this,this._t0,n=xc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Ec.prototype=Object.create(Oc.prototype)).point=function(t,e){Oc.prototype.point.call(this,e,t)},Ac.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},kc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=Sc(t),i=Sc(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function jc(t,e){this._context=t,this._t=e}jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Dc={basis:{curve:function(t){return new Lu(t)}},"basis-closed":{curve:function(t){return new Bu(t)}},"basis-open":{curve:function(t){return new Pu(t)}},bundle:{curve:qu,tension:"beta",value:.85},cardinal:{curve:Yu,tension:"tension",value:0},"cardinal-open":{curve:Vu,tension:"tension",value:0},"cardinal-closed":{curve:Ju,tension:"tension",value:0},"catmull-rom":{curve:fc,tension:"alpha",value:.5},"catmull-rom-closed":{curve:hc,tension:"alpha",value:.5},"catmull-rom-open":{curve:gc,tension:"alpha",value:.5},linear:{curve:vc},"linear-closed":{curve:function(t){return new yc(t)}},monotone:{horizontal:function(t){return new Ec(t)},vertical:function(t){return new Oc(t)}},natural:{curve:function(t){return new kc(t)}},step:{curve:function(t){return new jc(t,.5)}},"step-after":{curve:function(t){return new jc(t,1)}},"step-before":{curve:function(t){return new jc(t,0)}}};function Cc(t,e,n){var r=Object(et.v)(Dc,t)&&Dc[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}var Mc={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Fc=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],Nc=function(t){var e,n,r,i,o,a,s,u,c,l,f,d=[];for(u=0,l=(e=t.slice().replace(Fc[0],"###$1").split(Fc[1]).slice(1)).length;u<l;++u){for(r=(n=e[u]).slice(1).trim().replace(Fc[2],"$1###$2").split(Fc[3]),i=[a=n.charAt(0)],c=0,f=r.length;c<f;++c)(o=+r[c])===o&&i.push(o);if(s=Mc[a.toLowerCase()],i.length-1>s)for(c=1,f=i.length;c<f;c+=s)d.push([a].concat(i.slice(c,c+s)));else d.push(i)}return d},Tc=Math.PI/180,Rc=Math.PI/2,zc=2*Math.PI,$c=Math.sqrt(3)/2,Lc={},Ic={},Bc=[].join;function Pc(t){var e=Bc.call(t);if(Ic[e])return Ic[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=c*a,f=-u*s,d=u*a,h=c*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),v=Math.sin(o),y=.5*(o-i),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),_=n+p-x*g,w=r+g+x*p,O=n+m,E=r+v,A=O+x*v,k=E-x*m;return Ic[e]=[l*_+f*w,d*_+h*w,l*A+f*k,d*A+h*k,l*O+f*E,d*O+h*E]}var Uc=["l",0,0,0,0,0,0,0];function qc(t,e,n){var r=Uc[0]=t[0];if("a"===r||"A"===r)Uc[1]=e*t[1],Uc[2]=n*t[2],Uc[3]=t[3],Uc[4]=t[4],Uc[5]=t[5],Uc[6]=e*t[6],Uc[7]=n*t[7];else if("h"===r||"H"===r)Uc[1]=e*t[1];else if("v"===r||"V"===r)Uc[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)Uc[i]=(i%2==1?e:n)*t[i];return Uc}var Wc=function(t,e,n,r,i,o){var a,s,u,c,l,f=null,d=0,h=0,p=0,g=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var m=0,v=e.length;m<v;++m){switch(a=e[m],1===i&&1===o||(a=qc(a,i,o)),a[0]){case"l":d+=a[1],h+=a[2],t.lineTo(d+n,h+r);break;case"L":d=a[1],h=a[2],t.lineTo(d+n,h+r);break;case"h":d+=a[1],t.lineTo(d+n,h+r);break;case"H":d=a[1],t.lineTo(d+n,h+r);break;case"v":h+=a[1],t.lineTo(d+n,h+r);break;case"V":h=a[1],t.lineTo(d+n,h+r);break;case"m":d+=a[1],h+=a[2],t.moveTo(d+n,h+r);break;case"M":d=a[1],h=a[2],t.moveTo(d+n,h+r);break;case"c":s=d+a[5],u=h+a[6],p=d+a[3],g=h+a[4],t.bezierCurveTo(d+a[1]+n,h+a[2]+r,p+n,g+r,s+n,u+r),d=s,h=u;break;case"C":d=a[5],h=a[6],p=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,g+r,d+n,h+r);break;case"s":s=d+a[3],u=h+a[4],p=2*d-p,g=2*h-g,t.bezierCurveTo(p+n,g+r,d+a[1]+n,h+a[2]+r,s+n,u+r),p=d+a[1],g=h+a[2],d=s,h=u;break;case"S":s=a[3],u=a[4],p=2*d-p,g=2*h-g,t.bezierCurveTo(p+n,g+r,a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],g=a[2];break;case"q":s=d+a[3],u=h+a[4],p=d+a[1],g=h+a[2],t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=s,h=u;break;case"Q":s=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],g=a[2];break;case"t":s=d+a[1],u=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,g=h):"t"===f[0]?(p=2*d-c,g=2*h-l):"q"===f[0]&&(p=2*d-p,g=2*h-g),c=p,l=g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=u,p=(d=s)+a[1],g=h+a[2];break;case"T":s=a[1],u=a[2],p=2*d-p,g=2*h-g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=s,h=u;break;case"a":Hc(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+r]),d+=a[6],h+=a[7];break;case"A":Hc(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),d=a[6],h=a[7];break;case"z":case"Z":t.closePath()}f=a}};function Hc(t,e,n,r){for(var i=function(t,e,n,r,i,o,a,s,u){var c=Bc.call(arguments);if(Lc[c])return Lc[c];var l=a*Tc,f=Math.sin(l),d=Math.cos(l),h=d*(s-t)*.5+f*(u-e)*.5,p=d*(u-e)*.5-f*(s-t)*.5,g=h*h/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(n*=g=Math.sqrt(g),r*=g);var m=d/n,v=f/n,y=-f/r,b=d/r,x=m*s+v*u,_=y*s+b*u,w=m*t+v*e,O=y*t+b*e,E=1/((w-x)*(w-x)+(O-_)*(O-_))-.25;E<0&&(E=0);var A=Math.sqrt(E);o==i&&(A=-A);var k=.5*(x+w)-A*(O-_),S=.5*(_+O)+A*(w-x),j=Math.atan2(_-S,x-k),D=Math.atan2(O-S,w-k)-j;D<0&&1===o?D+=zc:D>0&&0===o&&(D-=zc);for(var C=Math.ceil(Math.abs(D/(Rc+.001))),M=[],F=0;F<C;++F){var N=j+F*D/C,T=j+(F+1)*D/C;M[F]=[k,S,N,T,n,r,f,d]}return Lc[c]=M}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n),o=0;o<i.length;++o){var a=Pc(i[o]);t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}var Yc={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,zc)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),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),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n,i=r-.5773502691896257*n,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n,i=r-.5773502691896257*n;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=$c*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function Gc(t){return Object(et.v)(Yc,t)?Yc[t]:function(t){if(!Object(et.v)(Vc,t)){var e=Nc(t);Vc[t]={draw:function(t,n){Wc(t,e,0,0,Math.sqrt(n)/2)}}}return Vc[t]}(t)}var Vc={};var Xc=Math.PI,Jc=2*Xc,Zc=Jc-1e-6;function Qc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Kc(){return new Qc}Qc.prototype=Kc.prototype={constructor:Qc,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,c=o-t,l=a-e,f=c*c+l*l;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(l*s-u*c)>1e-6&&i){var d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Xc-Math.acos((p+f-g)/(2*m*v)))/2),b=y/v,x=y/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(e+b*l)),this._+="A"+i+","+i+",0,0,"+ +(l*d>c*h)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Jc+Jc),f>Zc?this._+="A"+n+","+n+",0,1,"+l+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Xc)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var tl=Kc;const el=.448084975506;function nl(t){return t.x}function rl(t){return t.y}function il(t){return t.width}function ol(t){return t.height}function al(t){return"function"==typeof t?t:()=>+t}function sl(t,e,n){return Math.max(e,Math.min(t,n))}var ul=function(){var t=nl,e=rl,n=il,r=ol,i=al(0),o=i,a=i,s=i,u=null;function c(c,l,f){var d,h=null!=l?l:+t.call(this,c),p=null!=f?f:+e.call(this,c),g=+n.call(this,c),m=+r.call(this,c),v=Math.min(g,m)/2,y=sl(+i.call(this,c),0,v),b=sl(+o.call(this,c),0,v),x=sl(+a.call(this,c),0,v),_=sl(+s.call(this,c),0,v);if(u||(u=d=tl()),y<=0&&b<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var w=h+g,O=p+m;u.moveTo(h+y,p),u.lineTo(w-b,p),u.bezierCurveTo(w-el*b,p,w,p+el*b,w,p+b),u.lineTo(w,O-_),u.bezierCurveTo(w,O-el*_,w-el*_,O,w-_,O),u.lineTo(h+x,O),u.bezierCurveTo(h+el*x,O,h,O-el*x,h,O-x),u.lineTo(h,p+y),u.bezierCurveTo(h,p+el*y,h+el*y,p,h+y,p),u.closePath()}if(d)return u=null,d+""||null}return c.x=function(e){return arguments.length?(t=al(e),c):t},c.y=function(t){return arguments.length?(e=al(t),c):e},c.width=function(t){return arguments.length?(n=al(t),c):n},c.height=function(t){return arguments.length?(r=al(t),c):r},c.cornerRadius=function(t,e,n,r){return arguments.length?(i=al(t),o=null!=e?al(e):i,s=null!=n?al(n):i,a=null!=r?al(r):o,c):i},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c},cl=function(){var t,e,n,r,i,o,a,s,u=null;function c(t,e,n){var r=n/2;if(i){var c=a-e,l=t-o;if(c||l){var f=Math.sqrt(c*c+l*l),d=(c/=f)*s,h=(l/=f)*s,p=Math.atan2(l,c);u.moveTo(o-d,a-h),u.lineTo(t-c*r,e-l*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,zc);u.closePath()}else i=1;o=t,a=e,s=r}function l(o){var a,s,l,f=o.length,d=!1;for(null==u&&(u=l=tl()),a=0;a<=f;++a)!(a<f&&r(s=o[a],a,o))===d&&(d=!d)&&(i=0),d&&c(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(l)return u=null,l+""||null}return l.x=function(e){return arguments.length?(t=e,l):t},l.y=function(t){return arguments.length?(e=t,l):e},l.size=function(t){return arguments.length?(n=t,l):n},l.defined=function(t){return arguments.length?(r=t,l):r},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l},ll=function(t){return function(){return t}};function fl(t){return t.innerRadius}function dl(t){return t.outerRadius}function hl(t){return t.startAngle}function pl(t){return t.endAngle}function gl(t){return t&&t.padAngle}function ml(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/rc(s*s+u*u),l=c*u,f=-c*s,d=t+l,h=e+f,p=n+l,g=r+f,m=(d+p)/2,v=(h+g)/2,y=p-d,b=g-h,x=y*y+b*b,_=i-o,w=d*g-p*h,O=(b<0?-1:1)*rc(tc(0,_*_*x-w*w)),E=(w*b-y*O)/x,A=(-w*y-b*O)/x,k=(w*b+y*O)/x,S=(-w*y+b*O)/x,j=E-m,D=A-v,C=k-m,M=S-v;return j*j+D*D>C*C+M*M&&(E=k,A=S),{cx:E,cy:A,x01:-l,y01:-f,x11:E*(i/_-1),y11:A*(i/_-1)}}function vl(t){return t[0]}function yl(t){return t[1]}var bl=function(){var t=vl,e=yl,n=ll(!0),r=null,i=vc,o=null;function a(a){var s,u,c,l=a.length,f=!1;for(null==r&&(o=i(c=tl())),s=0;s<=l;++s)!(s<l&&n(u=a[s],s,a))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(u,s,a),+e(u,s,a));if(c)return o=null,c+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:ll(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:ll(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a},xl=function(){var t=vl,e=null,n=ll(0),r=yl,i=ll(!0),o=null,a=vc,s=null;function u(u){var c,l,f,d,h,p=u.length,g=!1,m=new Array(p),v=new Array(p);for(null==o&&(s=a(h=tl())),c=0;c<=p;++c){if(!(c<p&&i(d=u[c],c,u))===g)if(g=!g)l=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=c-1;f>=l;--f)s.point(m[f],v[f]);s.lineEnd(),s.areaEnd()}g&&(m[c]=+t(d,c,u),v[c]=+n(d,c,u),s.point(e?+e(d,c,u):m[c],r?+r(d,c,u):v[c]))}if(h)return s=null,h+""||null}function c(){return bl().defined(i).curve(a).context(o)}return u.x=function(n){return arguments.length?(t="function"==typeof n?n:ll(+n),e=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),u):t},u.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:ll(+t),u):e},u.y=function(t){return arguments.length?(n="function"==typeof t?t:ll(+t),r=null,u):n},u.y0=function(t){return arguments.length?(n="function"==typeof t?t:ll(+t),u):n},u.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ll(+t),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(n)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(e).y(n)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:ll(!!t),u):i},u.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),u):a},u.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),u):o},u},_l={draw:function(t,e){var n=Math.sqrt(e/oc);t.moveTo(n,0),t.arc(0,0,n,0,sc)}},wl=(Math.sqrt(1/3),Math.sin(oc/10)/Math.sin(7*oc/10));Math.sin(sc/10),Math.cos(sc/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function Ol(t,e){return null!=t?t:e}const El=t=>t.x||0,Al=t=>t.y||0,kl=t=>!(!1===t.defined),Sl=function(){var t=fl,e=dl,n=ll(0),r=null,i=hl,o=pl,a=gl,s=null;function u(){var u,c,l,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-ac,p=o.apply(this,arguments)-ac,g=Zu(p-h),m=p>h;if(s||(s=u=tl()),d<f&&(c=d,d=f,f=c),d>ic)if(g>sc-ic)s.moveTo(d*Ku(h),d*nc(h)),s.arc(0,0,d,h,p,!m),f>ic&&(s.moveTo(f*Ku(p),f*nc(p)),s.arc(0,0,f,p,h,m));else{var v,y,b=h,x=p,_=h,w=p,O=g,E=g,A=a.apply(this,arguments)/2,k=A>ic&&(r?+r.apply(this,arguments):rc(f*f+d*d)),S=ec(Zu(d-f)/2,+n.apply(this,arguments)),j=S,D=S;if(k>ic){var C=uc(k/f*nc(A)),M=uc(k/d*nc(A));(O-=2*C)>ic?(_+=C*=m?1:-1,w-=C):(O=0,_=w=(h+p)/2),(E-=2*M)>ic?(b+=M*=m?1:-1,x-=M):(E=0,b=x=(h+p)/2)}var F=d*Ku(b),N=d*nc(b),T=f*Ku(w),R=f*nc(w);if(S>ic){var z,$=d*Ku(x),L=d*nc(x),I=f*Ku(_),B=f*nc(_);if(g<oc&&(z=function(t,e,n,r,i,o,a,s){var u=n-t,c=r-e,l=a-i,f=s-o,d=f*u-l*c;if(!(d*d<ic))return[t+(d=(l*(e-o)-f*(t-i))/d)*u,e+d*c]}(F,N,I,B,$,L,T,R))){var P=F-z[0],U=N-z[1],q=$-z[0],W=L-z[1],H=1/nc(((l=(P*q+U*W)/(rc(P*P+U*U)*rc(q*q+W*W)))>1?0:l<-1?oc:Math.acos(l))/2),Y=rc(z[0]*z[0]+z[1]*z[1]);j=ec(S,(f-Y)/(H-1)),D=ec(S,(d-Y)/(H+1))}}E>ic?D>ic?(v=ml(I,B,F,N,d,D,m),y=ml($,L,T,R,d,D,m),s.moveTo(v.cx+v.x01,v.cy+v.y01),D<S?s.arc(v.cx,v.cy,D,Qu(v.y01,v.x01),Qu(y.y01,y.x01),!m):(s.arc(v.cx,v.cy,D,Qu(v.y01,v.x01),Qu(v.y11,v.x11),!m),s.arc(0,0,d,Qu(v.cy+v.y11,v.cx+v.x11),Qu(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,D,Qu(y.y11,y.x11),Qu(y.y01,y.x01),!m))):(s.moveTo(F,N),s.arc(0,0,d,b,x,!m)):s.moveTo(F,N),f>ic&&O>ic?j>ic?(v=ml(T,R,$,L,f,-j,m),y=ml(F,N,I,B,f,-j,m),s.lineTo(v.cx+v.x01,v.cy+v.y01),j<S?s.arc(v.cx,v.cy,j,Qu(v.y01,v.x01),Qu(y.y01,y.x01),!m):(s.arc(v.cx,v.cy,j,Qu(v.y01,v.x01),Qu(v.y11,v.x11),!m),s.arc(0,0,f,Qu(v.cy+v.y11,v.cx+v.x11),Qu(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,j,Qu(y.y11,y.x11),Qu(y.y01,y.x01),!m))):s.arc(0,0,f,w,_,m):s.lineTo(T,R)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return u.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-oc/2;return[Ku(r)*n,nc(r)*n]},u.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),u):t},u.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ll(+t),u):e},u.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ll(+t),u):n},u.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ll(+t),u):r},u.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ll(+t),u):i},u.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ll(+t),u):o},u.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ll(+t),u):a},u.context=function(t){return arguments.length?(s=null==t?null:t,u):s},u}().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),jl=xl().x(El).y1(Al).y0(t=>(t.y||0)+(t.height||0)).defined(kl),Dl=xl().y(Al).x1(El).x0(t=>(t.x||0)+(t.width||0)).defined(kl),Cl=bl().x(El).y(Al).defined(kl),Ml=ul().x(El).y(Al).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>Ol(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>Ol(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>Ol(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>Ol(t.cornerRadiusBottomLeft,t.cornerRadius)||0),Fl=function(){var t=ll(_l),e=ll(64),n=null;function r(){var r;if(n||(n=r=tl()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:ll(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:ll(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type(t=>Gc(t.shape||"circle")).size(t=>Ol(t.size,64)),Nl=cl().x(El).y(Al).defined(kl).size(t=>t.size||1);function Tl(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Rl(t,e,n,r){return Ml.context(t)(e,n,r)}var zl=function(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t};var $l,Ll=zc-1e-8;function Il(t){return $l=t,Il}function Bl(){}function Pl(t,e){$l.add(t,e)}Il.beginPath=Bl,Il.closePath=Bl,Il.moveTo=Pl,Il.lineTo=Pl,Il.rect=function(t,e,n,r){Pl(t,e),Pl(t+n,e+r)},Il.quadraticCurveTo=function(t,e,n,r){Pl(t,e),Pl(n,r)},Il.bezierCurveTo=function(t,e,n,r,i,o){Pl(t,e),Pl(n,r),Pl(i,o)},Il.arc=function(t,e,n,r,i,o){if(Math.abs(i-r)>Ll)return Pl(t-n,e-n),void Pl(t+n,e+n);var a,s,u,c,l=1/0,f=-1/0,d=1/0,h=-1/0;function p(t){u=n*Math.cos(t),c=n*Math.sin(t),u<l&&(l=u),u>f&&(f=u),c<d&&(d=c),c>h&&(h=c)}if(p(r),p(i),i!==r)if((r%=zc)<0&&(r+=zc),(i%=zc)<0&&(i+=zc),i<r&&(o=!o,a=r,r=i,i=a),o)for(i-=zc,a=r-r%Rc,s=0;s<4&&a>i;++s,a-=Rc)p(a);else for(a=r-r%Rc+Rc,s=0;s<4&&a<i;++s,a+=Rc)p(a);Pl(t+l,e+d),Pl(t+f,e+h)};var Ul=(Ul=Mu(1,1))?Ul.getContext("2d"):null;const ql=new _u;function Wl(t){return function(e,n){if(!Ul)return!0;t(Ul,e),ql.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=ql;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(Ul.isPointInPath(e,t))return!0;return!1}}function Hl(t,e){return e.contains(t.x||0,t.y||0)}function Yl(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(ql.set(n,r,n+i,r+o))}function Gl(t,e){const n=t.x||0,r=t.y||0;return Vl(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function Vl(t,e,n,r,i){const{x1:o,y1:a,x2:s,y2:u}=t,c=r-e,l=i-n;let f,d,h,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-c,d=-(o-e)),1===p&&(f=c,d=s-e),2===p&&(f=-l,d=-(a-n)),3===p&&(f=l,d=u-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>m)return!1;h>g&&(g=h)}else if(f>0){if(h<g)return!1;h<m&&(m=h)}}return!0}function Xl(t,e){return null==t?e:t}var Jl=function(t,e,n){return Au(n)?function(t,e,n){const r=n.width(),i=n.height(),o=e.stops,a=o.length,s="radial"===e.gradient?t.createRadialGradient(n.x1+Xl(e.x1,.5)*r,n.y1+Xl(e.y1,.5)*i,Math.max(r,i)*Xl(e.r1,0),n.x1+Xl(e.x2,.5)*r,n.y1+Xl(e.y2,.5)*i,Math.max(r,i)*Xl(e.r2,.5)):t.createLinearGradient(n.x1+Xl(e.x1,0)*r,n.y1+Xl(e.y1,0)*i,n.x1+Xl(e.x2,1)*r,n.y1+Xl(e.y2,0)*i);for(let t=0;t<a;++t)s.addColorStop(o[t].offset,o[t].color);return s}(t,n,e.bounds):n},Zl=function(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Jl(t,e,e.fill),!0)},Ql=[],Kl=function(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Jl(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Ql),t.lineDashOffset=e.strokeDashOffset||0),!0))};function tf(t,e){return t.zindex-e.zindex||t.index-e.index}function ef(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(tf)}function nf(t,e){var n,r,i=t.items;if(i&&i.length){var o=ef(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}}function rf(t,e){var n,r,i=t.items;if(!i||!i.length)return null;var o=ef(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function of(t){return function(e,n,r){nf(n,(function(n){r&&!r.intersects(n.bounds)||af(t,e,n,n)}))}}function af(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(n.fill&&Zl(e,n,i)&&e.fill(),n.stroke&&Kl(e,n,i)&&e.stroke()))}function sf(t){return t=t||et.fb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,rf(n,(function(n){var s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0}))}}function uf(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,c=null==e?u.fill:e,l=u.stroke&&n.isPointInStroke;return l&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(c&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o))}}function cf(t){return sf(uf(t))}function lf(t,e){return"translate("+t+","+e+")"}function ff(t){return"rotate("+t+")"}function df(t){return lf(t.x||0,t.y||0)}function hf(t){return lf(t.x||0,t.y||0)+(t.angle?" "+ff(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}var pf=function(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=Tc),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",hf(n)),t("d",e(null,n))},bound:function(t,n){var r=n.x||0,i=n.y||0;return e(Il(t),n),zl(t,n).translate(r,i),n.angle&&t.rotate(n.angle*Tc,r,i),t},draw:of(r),pick:cf(r),isect:n||Wl(r)}},gf=pf("arc",(function(t,e){return Sl.context(t)(e)}));var mf=function(t,e,n){function r(t,n){t.beginPath(),e(t,n)}var i,o=uf(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Il(t),r),zl(t,r[0]))},draw:(i=r,function(t,e,n){!e.items.length||n&&!n.intersects(e.bounds)||af(i,t,e.items[0],e.items)}),pick:function(t,e,n,r,i,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(i,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,o(t,s,n,r)?s[0]:null)},isect:Hl,tip:n}},vf=mf("area",(function(t,e){var n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Dl:jl).curve(Cc(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<s&&(s=r,n=t[a]);return n}));function yf(t,e){t.beginPath(),Tl(e)?Rl(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var bf=1;function xf(){bf=1}var _f=function(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+bf++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(et.D)(r)?a.path=r(null):Tl(n)?a.path=Rl(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"},wf=.5;function Of(t,e){var n=e.stroke?wf:0;t.beginPath(),Rl(t,e,n,n)}var Ef=uf(Of);var Af={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",df(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,r=0,i=n.length;r<i;++r)t.union(n[r].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),zl(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var r=this;nf(e,(function(e){var i,o=e.x||0,a=e.y||0;t.save(),t.translate(o,a),(e.stroke||e.fill)&&(i=null==e.opacity?1:e.opacity)>0&&(Of(t,e),e.fill&&Zl(t,e,i)&&t.fill(),e.stroke&&Kl(t,e,i)&&t.stroke()),e.clip&&yf(t,e),n&&n.translate(-o,-a),nf(e,(function(e){r.draw(t,e,n)})),n&&n.translate(o,a),t.restore()}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;var a=this,s=n*t.pixelRatio,u=r*t.pixelRatio;return rf(e,(function(c){var l,f,d,h,p,g,m;if((!(g=c.bounds)||g.contains(i,o))&&(f=c.x||0,d=c.y||0,h=f+(c.width||0),p=d+(c.height||0),!(m=c.clip)||!(i<f||i>h||o<f||o>p))){if(t.save(),t.translate(f,d),f=i-f,d=o-d,!m||!Tl(c)||Ef(t,c,s,u))return!(l=rf(c,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,f,d)?a.pick(t,n,r,f,d):null})))&&!1!==e.interactive&&(c.fill||c.stroke)&&Ef(t,c,s,u)&&(l=c),t.restore(),l||null;t.restore()}}))},isect:Yl,background:function(t,e){var n=e.stroke?wf:0;t("class","background"),t("d",Rl(null,e,n,n))},foreground:function(t,e,n){t("clip-path",e.clip?_f(n,e,e):null)}};function kf(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 Sf(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 jf(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 Df(t,e){return"center"===t?e/2:"right"===t?e:0}function Cf(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Mf={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var r=kf(e,n),i=e.x||0,o=e.y||0,a=Sf(e,r),s=jf(e,r),u=!1===e.aspect?"none":"xMidYMid";i-=Df(e.align,a),o-=Cf(e.baseline,s),!r.src&&r.toDataURL?t("href",r.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",r.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",lf(i,o)),t("width",a),t("height",s),t("preserveAspectRatio",u)},bound:function(t,e){var n=e.image,r=e.x||0,i=e.y||0,o=Sf(e,n),a=jf(e,n);return r-=Df(e.align,o),i-=Cf(e.baseline,a),t.set(r,i,r+o,i+a)},draw:function(t,e,n){var r=this;nf(e,(function(e){if(!n||n.intersects(e.bounds)){var i,o,a,s,u=kf(e,r),c=e.x||0,l=e.y||0,f=Sf(e,u),d=jf(e,u);c-=Df(e.align,f),l-=Cf(e.baseline,d),!1!==e.aspect&&(o=u.width/u.height,a=e.width/e.height,o==o&&a==a&&o!==a&&(a<o?(l+=(d-(s=f/o))/2,d=s):(c+=(f-(s=d*o))/2,f=s))),(u.complete||u.toDataURL)&&(t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(u,c,l,f,d))}}))},pick:sf(),isect:et.fb,get:kf,xOffset:Df,yOffset:Cf},Ff=mf("line",(function(t,e){var n=e[0],r=n.interpolate||"linear";return Cl.curve(Cc(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function Nf(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*Tc,u=e.pathCache;u&&u.path===n||((e.pathCache=u=Nc(n)).path=n),s&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(s),Wc(t,u,0,0,o,a),t.rotate(-s),t.translate(-r,-i)):Wc(t,u,r,i,o,a)}var Tf={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",hf(e)),t("d",e.path)},bound:function(t,e){return Nf(Il(t),e)?t.set(0,0,0,0):zl(t,e,!0),e.angle&&t.rotate(e.angle*Tc,e.x||0,e.y||0),t},draw:of(Nf),pick:cf(Nf),isect:Wl(Nf)};function Rf(t,e){t.beginPath(),Rl(t,e)}var zf={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Rl(null,e))},bound:function(t,e){var n,r;return zl(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:of(Rf),pick:cf(Rf),isect:Yl};function $f(t,e,n){var r,i,o,a;return!(!e.stroke||!Kl(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Lf,If={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",df(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,r;return zl(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){nf(e,(function(e){if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&$f(t,e,r)&&t.stroke()}}))},pick:sf((function(t,e,n,r){return!!t.isPointInStroke&&($f(t,e,1)&&t.isPointInStroke(n,r))})),isect:Gl},Bf=pf("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Pf=pf("symbol",(function(t,e){return Fl.context(t)(e)}),Hl),Uf={height:Gf,measureWidth:Hf,estimateWidth:qf,width:qf,canvas:Vf};function qf(t,e){return Lf=Gf(t),Wf(Qf(t,e))}function Wf(t){return~~(.8*t.length*Lf)}function Hf(t,e){return Gf(t)<=0?0:(Ul.font=td(t),Yf(Qf(t,e)))}function Yf(t){return Ul.measureText(t).width}function Gf(t){return null!=t.fontSize?t.fontSize:11}function Vf(t){Uf.width=t&&Ul?Hf:qf}function Xf(t){return null!=t.lineHeight?t.lineHeight:Gf(t)+2}function Jf(t){return e=t.lineBreak&&t.text&&!Object(et.A)(t.text)?t.text.split(t.lineBreak):t.text,Object(et.A)(e)?e.length>1?e:e[0]:e;var e}function Zf(t){const e=Jf(t);return(Object(et.A)(e)?e.length-1:0)*Xf(t)}function Qf(t,e){return null==e?"":t.limit>0?function(t,e){var n,r=+t.limit,i=e+"";Uf.width===Hf?(Ul.font=td(t),n=Yf):(Lf=Gf(t),n=Wf);if(n(i)<r)return i;var o,a=t.ellipsis||"…",s="rtl"===t.dir,u=0,c=i.length;if(r-=n(a),s){for(;u<c;)o=u+c>>>1,n(i.slice(o))>r?u=o+1:c=o;return a+i.slice(u)}for(;u<c;)o=1+(u+c>>>1),n(i.slice(0,o))<r?u=o:c=o-1;return i.slice(0,u)+a}(t,e):e+""}function Kf(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function td(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Gf(t)+"px "+Kf(t,e)}function ed(t){var e=t.baseline,n=Gf(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}Vf(!0);var nd={left:"start",center:"middle",right:"end"},rd=new _u;function id(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-Rc,n+=i*Math.cos(e),r+=i*Math.sin(e)),rd.x1=n,rd.y1=r,rd}function od(t,e,n){var r,i=Uf.height(e),o=e.align,a=id(e),s=a.x1,u=a.y1,c=e.dx||0,l=(e.dy||0)+ed(e)-Math.round(.8*i),f=Jf(e);if(Object(et.A)(f)?(i+=Xf(e)*(f.length-1),r=f.reduce((t,n)=>Math.max(t,Uf.width(e,n)),0)):r=Uf.width(e,f),"center"===o?c-=r/2:"right"===o&&(c-=r),t.set(c+=s,l+=u,c+r,l+i),e.angle&&!n)t.rotate(e.angle*Tc,s,u);else if(2===n)return t.rotatedPoints(e.angle*Tc,s,u);return t}var ad={arc:gf,area:vf,group:Af,image:Mf,line:Ff,path:Tf,rect:zf,rule:If,shape:Bf,symbol:Pf,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+ed(e),o=id(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",nd[e.align]||"start"),u?(n=lf(a,s)+" "+ff(u),(r||i)&&(n+=" "+lf(r,i))):n=lf(a+r,s+i),t("transform",n)},bound:od,draw:function(t,e,n){nf(e,(function(e){var r,i,o,a,s,u,c,l=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===l||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=td(e),t.textAlign=e.align||"left",i=(r=id(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*Tc),i=o=0),i+=e.dx||0,o+=(e.dy||0)+ed(e),u=Jf(e),Object(et.A)(u))for(s=Xf(e),a=0;a<u.length;++a)c=Qf(e,u[a]),e.fill&&Zl(t,e,l)&&t.fillText(c,i,o),e.stroke&&Kl(t,e,l)&&t.strokeText(c,i,o),o+=s;else c=Qf(e,u),e.fill&&Zl(t,e,l)&&t.fillText(c,i,o),e.stroke&&Kl(t,e,l)&&t.strokeText(c,i,o);e.angle&&t.restore()}}))},pick:sf((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=id(e),s=a.x1,u=a.y1,c=od(rd,e,1),l=-e.angle*Tc,f=Math.cos(l),d=Math.sin(l),h=f*i-d*o+(s-f*s+d*u),p=d*i+f*o+(u-d*s-f*u);return c.contains(h,p)})),isect:function(t,e){var n=od(rd,t,2);return Vl(e,n[0],n[1],n[2],n[3])||Vl(e,n[0],n[1],n[4],n[5])||Vl(e,n[4],n[5],n[6],n[7])||Vl(e,n[2],n[3],n[6],n[7])}},trail:mf("trail",(function(t,e){return Nl.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))},sd=function(t,e,n){var r=ad[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new _u),t,n)},ud={mark:null},cd=function(t,e,n){var r,i,o,a,s=ad[t.marktype],u=s.bound,c=t.items,l=c&&c.length;if(s.nested)return l?o=c[0]:(ud.mark=t,o=ud),a=sd(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new _u,l)for(r=0,i=c.length;r<i;++r)e.union(sd(c[r],u,n));return t.bounds=e},ld=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","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"];function fd(t,e){return JSON.stringify(t,ld,e)}function dd(t){return function t(e){var n,r,i,o=e.marktype,a=e.items;if(a)for(r=0,i=a.length;r<i;++r)n=o?"mark":"group",a[r][n]=e,a[r].zindex&&(a[r][n].zdirty=!0),"group"===(o||n)&&t(a[r]);o&&cd(e);return e}("string"==typeof t?JSON.parse(t):t)}function hd(t){arguments.length?this.root=dd(t):(this.root=gd({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Cu(this.root)])}var pd=hd.prototype;function gd(t,e){return{bounds:new _u,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}}function md(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function vd(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function yd(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=md(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function bd(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function xd(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}pd.toJSON=function(t){return fd(this.root,t||0)},pd.mark=function(t,e,n){var r=gd(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r};var _d=function(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]};function wd(t,e){this._active=null,this._handlers={},this._loader=t||pr(),this._tooltip=e||Od}function Od(t,e,n,r){t.element().setAttribute("title",r||"")}var Ed=wd.prototype;function Ad(t){this._el=null,this._bgcolor=null,this._loader=new Nu(t)}Ed.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Ed.element=function(){return this._el},Ed.canvas=function(){return this._el&&this._el.firstChild},Ed.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},Ed.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Ed.on=function(){},Ed.off=function(){},Ed._handlerIndex=function(t,e,n){for(var r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},Ed.handlers=function(t){var e,n=this._handlers,r=[];if(t)r.push.apply(r,n[this.eventName(t)]);else for(e in n)r.push.apply(r,n[e]);return r},Ed.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Ed.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),r=md(null,"a");for(var i in e)r.setAttribute(i,e[i]);r.dispatchEvent(n)})).catch((function(){}))},Ed.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=ad[a.marktype]).tip){for((o=_d(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);var r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},Ed.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.x1+r[0]+n.left,a=i.y1+r[1]+n.top,s=i.width(),u=i.height();t.mark&&(t=t.mark.group);)o+=t.x||0,a+=t.y||0;return{x:o,y:a,width:s,height:u,left:o,top:a,right:o+s,bottom:a+u}}};var kd=Ad.prototype;kd.initialize=function(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},kd.element=function(){return this._el},kd.canvas=function(){return this._el&&this._el.firstChild},kd.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},kd.resize=function(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},kd.dirty=function(){},kd.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},kd._render=function(){},kd.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},kd._load=function(t,e){var n=this,r=n._loader[t](e);if(!n._ready){var i=n._call;n._ready=n._loader.ready().then((function(t){t&&i(),n._ready=null}))}return r},kd.sanitizeURL=function(t){return this._load("sanitizeURL",t)},kd.loadImage=function(t){return this._load("loadImage",t)};var Sd="mouseout";function jd(t,e){wd.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var Dd=Object(et.y)(jd,wd);function Cd(t,e,n){return function(r){var i=this._active,o=this.pickEvent(r);o===i?this.fire(t,r):(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r),this.fire(t,r))}}function Md(t){return function(e){this.fire(t,e),this._active=null}}Dd.initialize=function(t,e,n){var r=this._canvas=t&&vd(t,"canvas");if(r){var i=this;this.events.forEach((function(t){r.addEventListener(t,(function(e){Dd[t]?Dd[t].call(i,e):i.fire(t,e)}))}))}return wd.prototype.initialize.call(this,t,e,n)},Dd.canvas=function(){return this._canvas},Dd.context=function(){return this._canvas.getContext("2d")},Dd.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Dd.DOMMouseScroll=function(t){this.fire("mousewheel",t)},Dd.mousemove=Cd("mousemove","mouseover","mouseout"),Dd.dragover=Cd("dragover","dragenter","dragleave"),Dd.mouseout=Md("mouseout"),Dd.dragleave=Md("dragleave"),Dd.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},Dd.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},Dd.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},Dd.touchmove=function(t){this.fire("touchmove",t,!0)},Dd.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},Dd.fire=function(t,e,n){var r,i,o=n?this._touch:this._active,a=this._handlers[t];if(e.vegaType=t,"click"===t&&o&&o.href?this.handleHref(e,o,o.href):"mousemove"!==t&&t!==Sd||this.handleTooltip(e,o,t!==Sd),a)for(r=0,i=a.length;r<i;++r)a[r].handler.call(this._obj,e,o)},Dd.on=function(t,e){var n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(r[n]||(r[n]=[])).push({type:t,handler:e}),this},Dd.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},Dd.pickEvent=function(t){var e=_d(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},Dd.pick=function(t,e,n,r,i){var o=this.context();return ad[t.marktype].pick.call(this,o,t,e,n,r,i)};var Fd="undefined"!=typeof window&&window.devicePixelRatio||1;function Nd(t){Ad.call(this,t),this._redraw=!1,this._dirty=new _u}var Td=Object(et.y)(Nd,Ad),Rd=Ad.prototype,zd=new _u;function $d(t,e,n){return zd.set(0,0,e,n).translate(-t[0],-t[1])}function Ld(t,e){wd.call(this,t,e);var n=this;n._hrefHandler=Bd(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=Bd(n,(function(t,e){n.handleTooltip(t,e,t.type!==Sd)}))}Td.initialize=function(t,e,n,r,i,o){return this._options=o,this._canvas=Mu(1,1,o&&o.type),t&&(bd(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Rd.initialize.call(this,t,e,n,r,i)},Td.resize=function(t,e,n,r){return Rd.resize.call(this,t,e,n,r),function(t,e,n,r,i,o){var a,s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,u=t.getContext("2d"),c=s?Fd:i;for(a in t.width=e*c,t.height=n*c,o)u[a]=o[a];s&&1!==c&&(t.style.width=e+"px",t.style.height=n+"px"),u.pixelRatio=c,u.setTransform(c,0,0,c,c*r[0],c*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},Td.canvas=function(){return this._canvas},Td.context=function(){return this._canvas?this._canvas.getContext("2d"):null},Td.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=zd.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},Td._render=function(t){var e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty;return e.save(),this._redraw||o.empty()?(this._redraw=!1,o=$d(n,r,i).expand(1)):o=function(t,e,n){return e.expand(1).round(),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($d(n,r,i)),n),this.clear(-n[0],-n[1],r,i),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},Td.draw=function(t,e,n){var r=ad[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),Object(et.D)(n)?(t.beginPath(),n(t),t.clip()):yf(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},Td.clear=function(t,e,n,r){var i=this.context();i.clearRect(t,e,n,r),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(t,e,n,r))};var Id=Object(et.y)(Ld,wd);function Bd(t,e){return function(n){var r=n.target.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,e.call(t._obj,n,r)}}function Pd(t,e,n){var r,i,o="<"+t;if(e)for(r in e)null!=(i=e[r])&&(o+=" "+r+'="'+i+'"');return n&&(o+=" "+n),o+">"}function Ud(t){return"</"+t+">"}Id.initialize=function(t,e,n){var r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener("mousemove",this._tooltipHandler),r.removeEventListener(Sd,this._tooltipHandler)),this._svg=r=t&&vd(t,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener("mousemove",this._tooltipHandler),r.addEventListener(Sd,this._tooltipHandler)),wd.prototype.initialize.call(this,t,e,n)},Id.canvas=function(){return this._svg},Id.on=function(t,e){var n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){var i={type:t,handler:e,listener:Bd(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},Id.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this};var qd={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Wd={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"},Hd=Object.keys(Wd),Yd=qd.xmlns;function Gd(t){Ad.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var Vd=Object(et.y)(Gd,Ad),Xd=Ad.prototype;function Jd(t,e,n){var r,i,o;if("radial"===e.gradient){var a=yd(t,n++,"pattern",Yd);a.setAttribute("id",Eu+e.id),a.setAttribute("viewBox","0,0,1,1"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("preserveAspectRatio","xMidYMid slice"),(a=yd(a,0,"rect",Yd)).setAttribute("width","1"),a.setAttribute("height","1"),a.setAttribute("fill","url("+oh()+"#"+e.id+")"),(t=yd(t,n++,"radialGradient",Yd)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=yd(t,n++,"linearGradient",Yd)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(r=0,i=e.stops.length;r<i;++r)(o=yd(t,r,"stop",Yd)).setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return bd(t,r),n}function Zd(t,e,n){var r;return(t=yd(t,n,"clipPath",Yd)).setAttribute("id",e.id),e.path?(r=yd(t,0,"path",Yd)).setAttribute("d",e.path):((r=yd(t,0,"rect",Yd)).setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",e.width),r.setAttribute("height",e.height)),n+1}function Qd(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 Kd(t,e,n,r,i){var o,a=t._svg;if(!a&&(a=md(o=e.ownerDocument,r,Yd),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){var s=md(o,"path",Yd);s.setAttribute("class","background"),a.appendChild(s),s.__data__=t;var u=md(o,"g",Yd);a.appendChild(u),u.__data__=t}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}Vd.initialize=function(t,e,n,r){return t&&(this._svg=yd(t,0,"svg",Yd),this._svg.setAttribute("class","marks"),bd(t,1),this._root=yd(this._svg,0,"g",Yd),bd(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),Xd.initialize.call(this,t,e,n,r)},Vd.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),Xd.background.apply(this,arguments)},Vd.resize=function(t,e,n,r){return Xd.resize.call(this,t,e,n,r),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},Vd.canvas=function(){return this._svg},Vd.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in qd)t[e]=qd[e];var n=this._bgcolor?Pd("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+Ud("rect"):"";return Pd("svg",t)+n+this._svg.innerHTML+Ud("svg")},Vd._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),bd(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},Vd.updateDefs=function(){var t,e=this._svg,n=this._defs,r=n.el,i=0;for(t in n.gradient)r||(n.el=r=yd(e,0,"defs",Yd)),i=Jd(r,n.gradient[t],i);for(t in n.clipping)r||(n.el=r=yd(e,0,"defs",Yd)),i=Zd(r,n.clipping[t],i);r&&(0===i?(e.removeChild(r),n.el=null):bd(r,i))},Vd._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},Vd.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},Vd.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},Vd._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,r,i,o,a,s,u=++this._dirtyID;for(o=0,a=t.length;o<a;++o)(n=(e=t[o]).mark).marktype!==r&&(r=n.marktype,i=ad[r]),n.zdirty&&n.dirty!==u&&(this._dirtyAll=!1,Qd(e,u),n.items.forEach((function(t){t.dirty=u}))),n.zdirty||(e.exit?(i.nested&&n.items.length?(s=n.items[0])._svg&&this._update(i,s._svg,s):e._svg&&(s=e._svg.parentNode)&&s.removeChild(e._svg),e._svg=null):(e=i.nested?n.items[0]:e)._update!==u&&(e._svg&&e._svg.ownerSVGElement?this._update(i,e._svg,e):(this._dirtyAll=!1,Qd(e,u)),e._update=u));return!this._dirtyAll},Vd.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var r,i=this,o=this._svg,a=ad[e.marktype],s=!1===e.interactive?"none":null,u="g"===a.tag,c=null,l=0;function f(t){var e=i.isDirty(t),n=Kd(t,r,c,a.tag,o);e&&(i._update(a,n,t),u&&function(t,e,n){e=e.lastChild;var r,i=0;nf(n,(function(n){r=t.draw(e,n,r),++i})),bd(e,1+i)}(i,n,t)),c=n,++l}return(r=Kd(e,t,n,"g",o)).setAttribute("class",xd(e)),u||r.style.setProperty("pointer-events",s),e.clip?r.setAttribute("clip-path",_f(i,e,e.group)):r.removeAttribute("clip-path"),a.nested?e.items.length&&f(e.items[0]):nf(e,f),bd(r,l),r};var th=null,eh=null,nh={group:function(t,e,n){eh=e.__values__,th=e.childNodes[1],t.foreground(ih,n,this),th=e.childNodes[0],t.background(ih,n,this);var r=!1===n.mark.interactive?"none":null;r!==eh.events&&(th.style.setProperty("pointer-events",r),eh.events=r)},image:function(t,e,n){!1===n.smooth?(rh(e,"image-rendering","optimizeSpeed"),rh(e,"image-rendering","pixelated")):rh(e,"image-rendering",null)},text:function(t,e,n){var r,i,o,a,s=Jf(n);Object(et.A)(s)?(r=(i=s.map(t=>Qf(n,t))).join("\n"))!==eh.text&&(bd(e,0),o=e.ownerDocument,a=Xf(n),i.forEach((t,r)=>{const i=md(o,"tspan",Yd);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",a)),e.appendChild(i)}),eh.text=r):(i=Qf(n,s))!==eh.text&&(e.textContent=i,eh.text=i),rh(e,"font-family",Kf(n)),rh(e,"font-size",Gf(n)+"px"),rh(e,"font-style",n.fontStyle),rh(e,"font-variant",n.fontVariant),rh(e,"font-weight",n.fontWeight)}};function rh(t,e,n){n!==eh[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),eh[e]=n)}function ih(t,e,n){e!==eh[t]&&(null!=e?n?th.setAttributeNS(n,t,e):th.setAttribute(t,e):n?th.removeAttributeNS(n,t):th.removeAttribute(t),eh[t]=e)}function oh(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function ah(t){Ad.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}Vd._update=function(t,e,n){th=e,eh=e.__values__,t.attr(ih,n,this);var r=nh[t.type];r&&r.call(this,t,e,n),this.style(th,n)},Vd.style=function(t,e){var n,r,i,o,a;if(null!=e)for(n=0,r=Hd.length;n<r;++n)a=e[i=Hd[n]],"font"===i&&(a=Kf(e)),a!==eh[i]&&(o=Wd[i],null==a?"fill"===o?t.style.setProperty(o,"none"):t.style.removeProperty(o):(Au(a)&&(a=ku(a,this._defs.gradient,oh())),t.style.setProperty(o,a+"")),eh[i]=a)};var sh,uh=Object(et.y)(ah,Ad),ch=Ad.prototype;function lh(t,e,n,r){sh[r||t]=e}function fh(t,e,n,r){if(null==t)return"";var i,o,a,s,u,c="";for("bgrect"===n&&!1===e.interactive&&(c+="pointer-events: none; "),"image"===n&&!1===t.smooth&&(c+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(c+="font-family: "+Kf(t)+"; ",c+="font-size: "+Gf(t)+"px; ",t.fontStyle&&(c+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(c+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(c+="font-weight: "+t.fontWeight+"; ")),i=0,o=Hd.length;i<o;++i)a=Hd[i],s=Wd[a],null==(u=t[a])?"fill"===s&&(c+="fill: none; "):"transparent"!==u||"fill"!==s&&"stroke"!==s?(Au(u)&&(u=ku(u,r.gradient,"")),c+=s+": "+u+"; "):c+=s+": none; ";return c?'style="'+c.trim()+'"':null}function dh(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}uh.resize=function(t,e,n,r){ch.resize.call(this,t,e,n,r);var i=this._origin,o=this._text,a={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var s in qd)a[s]=qd[s];o.head=Pd("svg",a);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),o.bg=u?Pd("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+Ud("rect"):"",o.root=Pd("g",{transform:"translate("+i+")"}),o.foot=Ud("g")+Ud("svg"),this},uh.background=function(){var t=ch.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},uh.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},uh._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},uh.buildDefs=function(){var t,e,n,r,i,o=this._defs,a="";for(e in o.gradient){for(i=(n=o.gradient[e]).stops,"radial"===n.gradient?(a+=Pd(r="pattern",{id:Eu+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a+=Pd("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+Ud("rect"),a+=Ud(r),a+=Pd(r="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):a+=Pd(r="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<i.length;++t)a+=Pd("stop",{offset:i[t].offset,"stop-color":i[t].color})+Ud("stop");a+=Ud(r)}for(e in o.clipping)n=o.clipping[e],a+=Pd("clipPath",{id:e}),n.path?a+=Pd("path",{d:n.path})+Ud("path"):a+=Pd("rect",{x:0,y:0,width:n.width,height:n.height})+Ud("rect"),a+=Ud("clipPath");return a.length>0?Pd("defs")+a+Ud("defs"):""},uh.attributes=function(t,e){return sh={},t(lh,e,this),sh},uh.href=function(t){var e,n=this,r=t.href;if(r){if(e=n._hrefs&&n._hrefs[r])return e;n.sanitizeURL(r).then((function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[r]=t}))}return null},uh.mark=function(t){var e,n=this,r=ad[t.marktype],i=r.tag,o=this._defs,a="";function s(s){var u=n.href(s);if(u&&(a+=Pd("a",u)),e="g"!==i?fh(s,t,i,o):null,a+=Pd(i,n.attributes(r.attr,s),e),"text"===i){const t=Jf(s);if(Object(et.A)(t)){const e={x:0,dy:Xf(s)};for(let n=0;n<t.length;++n)a+=Pd("tspan",n?e:null)+dh(Qf(s,t[n]))+Ud("tspan")}else a+=dh(Qf(s,t))}else"g"===i&&(a+=Pd("path",n.attributes(r.background,s),fh(s,t,"bgrect",o))+Ud("path"),a+=Pd("g",n.attributes(r.foreground,s))+n.markGroup(s)+Ud("g"));a+=Ud(i),u&&(a+=Ud("a"))}return"g"!==i&&!1===t.interactive&&(e='style="pointer-events: none;"'),a+=Pd("g",{class:xd(t),"clip-path":t.clip?_f(n,t,t.group):null},e),r.nested?t.items&&t.items.length&&s(t.items[0]):nf(t,s),a+Ud("g")},uh.markGroup=function(t){var e=this,n="";return nf(t,(function(t){n+=e.mark(t)})),n};var hh={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},ph={};function gh(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(ph[t]=e,this):ph[t]}function mh(t,e,n){const r=[],i=(new _u).union(e),o=t.marktype;return o?vh(t,i,n,r):"group"===o?yh(t,i,n,r):Object(et.n)("Intersect scene must be mark node or group item.")}function vh(t,e,n,r){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 i=t.items,o=t.marktype,a=i.length;let s=0;if("group"===o)for(;s<a;++s)yh(i[s],e,n,r);else for(const t=ad[o].isect;s<a;++s){let n=i[s];bh(n,e,t)&&r.push(n)}}return r}function yh(t,e,n,r){n&&n(t.mark)&&bh(t,e,ad.group.isect)&&r.push(t);const i=t.items,o=i&&i.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)vh(i[t],e,n,r);e.translate(a,s)}return r}function bh(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}ph.canvas=ph.png={renderer:Nd,headless:Nd,handler:jd},ph.svg={renderer:Gd,headless:ah,handler:Ld},ph.none={};var xh=new _u,_h=function(t){var e=t.clip;if(Object(et.D)(e))e(Il(xh.clear()));else{if(!e)return;xh.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(xh)},wh=1e-9;function Oh(t,e,n){return t===e||("path"===n?Eh(t,e):t instanceof Date&&e instanceof Date?+t==+e:Object(et.E)(t)&&Object(et.E)(e)?Math.abs(t-e)<=wh:t&&e&&(Object(et.F)(t)||Object(et.F)(e))?null!=t&&null!=e&&function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Oh(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Eh(t,e){return Oh(Nc(t),Nc(e))}function Ah(t){Tr.call(this,null,t)}function kh(t,e,n){return e(t.bounds.clear(),t,n)}Object(et.y)(Ah,Tr).transform=function(t,e){var n,r=e.dataflow,i=t.mark,o=i.marktype,a=ad[o],s=a.bound,u=i.bounds;if(a.nested)i.items.length&&r.dirty(i.items[0]),u=kh(i,s),i.items.forEach((function(t){t.bounds.clear().union(u)}));else if(o===Zs||t.modified())switch(e.visit(e.MOD,(function(t){r.dirty(t)})),u.clear(),i.items.forEach((function(t){u.union(kh(t,s))})),i.role){case Qs:case nu:case Ks:e.reflow()}else n=e.changed(e.REM),e.visit(e.ADD,(function(t){u.union(kh(t,s))})),e.visit(e.MOD,(function(t){n=n||u.alignsWith(t.bounds),r.dirty(t),u.union(kh(t,s))})),n&&(u.clear(),i.items.forEach((function(t){u.union(t.bounds)})));return _h(i),e.modifies("bounds")};var Sh=":vega_identifier:";function jh(t){Tr.call(this,0,t)}function Dh(t){Tr.call(this,null,t)}function Ch(t){Tr.call(this,null,t)}jh.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(et.y)(jh,Tr).transform=function(t,e){var n=function(t){var e=t._signals[Sh];e||(t._signals[Sh]=e=t.add(0));return e}(e.dataflow),r=n.value,i=t.as;return e.visit(e.ADD,(function(t){t[i]||(t[i]=++r)})),n.set(this.value=r),e},Object(et.y)(Dh,Tr).transform=function(t,e){var n=this.value;n||((n=e.dataflow.scenegraph().mark(t.markdef,function(t){var e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index)).group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);var r=n.marktype===Zs?Cu:Du;return e.visit(e.ADD,(function(t){r.call(t,n)})),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e};var Mh=Object(et.y)(Ch,Tr),Fh={parity:function(t){return t.filter((t,e)=>e%2?t.opacity=0:1)},greedy:function(t,e){var n;return t.filter((t,r)=>r&&Nh(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1))}};function Nh(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function Th(t,e){for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(Nh(o,n=t[r].bounds,e))return!0}function Rh(t){var e=t.bounds;return e.width()>1&&e.height()>1}function zh(t){return t.forEach(t=>t.opacity=1),t}function $h(t,e){return t.reflow(e.modified()).modifies("opacity")}function Lh(t){Tr.call(this,null,t)}Mh.transform=function(t,e){var n,r,i,o=Fh[t.method]||Fh.parity,a=e.materialize(e.SOURCE).source,s=t.separation||0;if(a&&a.length){if(!t.method)return t.modified("method")&&(zh(a),e=$h(e,t)),e;if(t.sort&&(a=a.slice().sort(t.sort)),n=zh(a=a.filter(Rh)),e=$h(e,t),n.length>=3&&Th(n,s)){do{n=o(n,s)}while(n.length>=3&&Th(n,s));n.length<3&&!Object(et.T)(a).opacity&&(n.length>1&&(Object(et.T)(n).opacity=0),Object(et.T)(a).opacity=1)}var u,c,l,f,d;return t.boundScale&&t.boundTolerance>=0&&(u=t.boundScale,c=t.boundOrient,l=+t.boundTolerance,f=u.range(),d=new _u,c===Ls||c===Ps?d.set(f[0],-1/0,f[1],1/0):d.set(-1/0,f[0],1/0,f[1]),d.expand(l||1),r=t=>d.encloses(t.bounds),a.forEach(t=>{r(t)||(t.opacity=0)})),i=n[0].mark.bounds.clear(),a.forEach(t=>{t.opacity&&i.union(t.bounds)}),e}},Object(et.y)(Lh,Tr).transform=function(t,e){var n=e.dataflow;if(e.visit(e.ALL,(function(t){n.dirty(t)})),e.fields&&e.fields.zindex){var r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}};const Ih=new _u;function Bh(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Ph(t){var e=t.items[0].datum.orient;return e===Is||e===Bs}function Uh(t,e,n,r){var i,o,a=e.items[0],s=a.datum,u=s.orient,c=null!=s.translate?s.translate:.5,l=function(t){var e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[l[2]].items[0],v=a.titlePadding,y=a.bounds,b=m&&Zf(m),x=0,_=0;switch(Ih.clear().union(y),y.clear(),(i=l[0])>-1&&y.union(a.items[i].bounds),(i=l[1])>-1&&y.union(a.items[i].bounds),u){case Ls:x=h||0,_=-d,o=Math.max(p,Math.min(g,-y.y1)),m&&(o=qh(t,m,o,v,b,0,-1,y)),y.add(0,-o).add(f,0);break;case Is:x=-d,_=h||0,o=Math.max(p,Math.min(g,-y.x1)),m&&(o=qh(t,m,o,v,b,1,-1,y)),y.add(-o,0).add(0,f);break;case Bs:x=n+d,_=h||0,o=Math.max(p,Math.min(g,y.x2)),m&&(o=qh(t,m,o,v,b,1,1,y)),y.add(0,0).add(o,f);break;case Ps:x=h||0,_=r+d,o=Math.max(p,Math.min(g,y.y2)),m&&(o=qh(t,m,o,v,0,0,1,y)),y.add(0,0).add(f,o);break;default:x=a.x,_=a.y}return zl(y.translate(x,_),a),Bh(a,"x",x+c)|Bh(a,"y",_+c)&&(a.bounds=Ih,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function qh(t,e,n,r,i,o,a,s){var u=e.bounds,c=0,l=0;return e.auto?(t.dirty(e),n+=r,o?c=(e.x||0)-(e.x=a*(n+i)):l=(e.y||0)-(e.y=a*(n+i)),e.mark.bounds.clear().union(u.translate(-c,-l)),t.dirty(e),o?(s.add(0,u.y1).add(0,u.y2),n+=u.width()):(s.add(u.x1,0).add(u.x2,0),n+=u.height())):s.union(u),n}function Wh(t){return(new _u).set(0,0,t.width||0,t.height||0)}function Hh(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function Yh(t,e,n){var r=Object(et.F)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function Gh(t){return t<0?Math.ceil(-t):0}function Vh(t,e,n){var r,i,o,a,s,u,c,l,f,d,h,p=!n.nodirty,g=n.bounds===yu?Wh:Hh,m=Ih.set(0,0,0,0),v=Yh(n.align,bu),y=Yh(n.align,xu),b=Yh(n.padding,bu),x=Yh(n.padding,xu),_=n.columns||e.length,w=_<0?1:Math.ceil(e.length/_),O=e.length,E=Array(O),A=Array(_),k=0,S=Array(O),j=Array(w),D=0,C=Array(O),M=Array(O),F=Array(O);for(i=0;i<_;++i)A[i]=0;for(i=0;i<w;++i)j[i]=0;for(i=0;i<O;++i)u=e[i],s=F[i]=g(u),u.x=u.x||0,C[i]=0,u.y=u.y||0,M[i]=0,o=i%_,a=~~(i/_),k=Math.max(k,c=Math.ceil(s.x2)),D=Math.max(D,l=Math.ceil(s.y2)),A[o]=Math.max(A[o],c),j[a]=Math.max(j[a],l),E[i]=b+Gh(s.x1),S[i]=x+Gh(s.y1),p&&t.dirty(e[i]);for(i=0;i<O;++i)i%_==0&&(E[i]=0),i<_&&(S[i]=0);if(v===vu)for(o=1;o<_;++o){for(h=0,i=o;i<O;i+=_)h<E[i]&&(h=E[i]);for(i=o;i<O;i+=_)E[i]=h+A[o-1]}else if(v===mu){for(h=0,i=0;i<O;++i)i%_&&h<E[i]&&(h=E[i]);for(i=0;i<O;++i)i%_&&(E[i]=h+k)}else for(v=!1,o=1;o<_;++o)for(i=o;i<O;i+=_)E[i]+=A[o-1];if(y===vu)for(a=1;a<w;++a){for(h=0,r=(i=a*_)+_;i<r;++i)h<S[i]&&(h=S[i]);for(i=a*_;i<r;++i)S[i]=h+j[a-1]}else if(y===mu){for(h=0,i=_;i<O;++i)h<S[i]&&(h=S[i]);for(i=_;i<O;++i)S[i]=h+D}else for(y=!1,a=1;a<w;++a)for(r=(i=a*_)+_;i<r;++i)S[i]+=j[a-1];for(f=0,i=0;i<O;++i)f=E[i]+(i%_?f:0),C[i]+=f-e[i].x;for(o=0;o<_;++o)for(d=0,i=o;i<O;i+=_)d+=S[i],M[i]+=d-e[i].y;if(v&&Yh(n.center,bu)&&w>1)for(i=0;i<O;++i)(f=(s=v===mu?k:A[i%_])-F[i].x2-e[i].x-C[i])>0&&(C[i]+=f/2);if(y&&Yh(n.center,xu)&&1!==_)for(i=0;i<O;++i)(d=(s=y===mu?D:j[~~(i/_)])-F[i].y2-e[i].y-M[i])>0&&(M[i]+=d/2);for(i=0;i<O;++i)m.union(F[i].translate(C[i],M[i]));switch(f=Yh(n.anchor,Xs),d=Yh(n.anchor,Js),Yh(n.anchor,bu)){case Vs:f-=m.width();break;case Gs:f-=m.width()/2}switch(Yh(n.anchor,xu)){case Vs:d-=m.height();break;case Gs:d-=m.height()/2}for(f=Math.round(f),d=Math.round(d),m.clear(),i=0;i<O;++i)e[i].mark.bounds.clear();for(i=0;i<O;++i)(u=e[i]).x+=C[i]+=f,u.y+=M[i]+=d,m.union(u.mark.bounds.union(u.bounds.translate(C[i],M[i]))),p&&t.dirty(u);return m}function Xh(t,e,n){var r,i,o,a,s,u,c,l=function(t){for(var e,n,r=t.items,i=r.length,o=0,a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};o<i;++o)if(n=(e=r[o]).items,e.marktype===Zs)switch(e.role){case Qs:case nu:case Ks:break;case ru:a.rowheaders.push(...n);break;case iu:a.rowfooters.push(...n);break;case au:a.colheaders.push(...n);break;case su:a.colfooters.push(...n);break;case ou:a.rowtitle=n[0];break;case uu:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=l.marks,d=n.bounds===yu?Jh:Zh,h=n.offset,p=n.columns||f.length,g=p<0?1:Math.ceil(f.length/p),m=g*p;const v=Vh(t,f,n);l.rowheaders&&(u=Yh(n.headerBand,xu,null),r=tp(t,l.rowheaders,f,p,g,-Yh(h,"rowHeader"),Qh,0,d,"x1",0,p,1,u)),l.colheaders&&(u=Yh(n.headerBand,bu,null),i=tp(t,l.colheaders,f,p,p,-Yh(h,"columnHeader"),Qh,1,d,"y1",0,1,p,u)),l.rowfooters&&(u=Yh(n.footerBand,xu,null),o=tp(t,l.rowfooters,f,p,g,Yh(h,"rowFooter"),Kh,0,d,"x2",p-1,p,1,u)),l.colfooters&&(u=Yh(n.footerBand,bu,null),a=tp(t,l.colfooters,f,p,p,Yh(h,"columnFooter"),Kh,1,d,"y2",m-p,1,p,u)),l.rowtitle&&(s=Yh(n.titleAnchor,xu),c=Yh(h,"rowTitle"),c=s===Vs?o+c:r-c,u=Yh(n.titleBand,xu,.5),ep(t,l.rowtitle,c,0,v,u)),l.coltitle&&(s=Yh(n.titleAnchor,bu),c=Yh(h,"columnTitle"),c=s===Vs?a+c:i-c,u=Yh(n.titleBand,bu,.5),ep(t,l.coltitle,c,1,v,u))}function Jh(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function Zh(t,e){return t.bounds[e]}function Qh(t,e){return Math.floor(Math.min(t,e))}function Kh(t,e){return Math.ceil(Math.max(t,e))}function tp(t,e,n,r,i,o,a,s,u,c,l,f,d,h){var p,g,m,v,y,b,x,_,w,O=n.length,E=0,A=0;if(!O)return E;for(p=l;p<O;p+=f)n[p]&&(E=a(E,u(n[p],c)));if(!e.length)return E;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),E+=o,g=0,v=e.length;g<v;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=l,g=0,v=e.length;g<v;++g,p+=f){for(y=(b=e[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=E):(_=E,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,t.dirty(b),A=a(A,y[c])}return A}function ep(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function np(t,e,n,r,i,o,a){const s=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),u=(f=t,d=s("offset",0),h=-1/0,f.forEach(t=>{null!=t.offset&&(h=Math.max(h,t.offset))}),h>-1/0?h:d),c=s("anchor",Ys),l=c===Vs?1:c===Gs?.5:0;var f,d,h;const p={align:vu,bounds:s("bounds",yu),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case Is:p.anchor={x:Math.floor(r.x1)-u,column:Vs,y:l*(a||r.height()+2*r.y1),row:c};break;case Bs:p.anchor={x:Math.ceil(r.x2)+u,y:l*(a||r.height()+2*r.y1),row:c};break;case Ls:p.anchor={y:Math.floor(i.y1)-u,row:Vs,x:l*(o||i.width()+2*i.x1),column:c};break;case Ps:p.anchor={y:Math.ceil(i.y2)+u,x:l*(o||i.width()+2*i.x1),column:c};break;case Us:p.anchor={x:u,y:u};break;case qs:p.anchor={x:o-u,y:u,column:Vs};break;case Ws:p.anchor={x:u,y:a-u,row:Vs};break;case Hs:p.anchor={x:o-u,y:a-u,column:Vs,row:Vs}}return p}function rp(t,e){var n,r,i,o,a=e.items[0],s=a.datum,u=a.orient,c=a.bounds,l=a.x,f=a.y;return a._bounds?a._bounds.clear().union(c):a._bounds=c.clone(),c.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,u=e.titlePadding||0,c=r-a.x,l=r-a.y;switch(a.orient){case Is:i+=Math.ceil(a.bounds.width())+u;break;case Bs:case Ps:break;default:o+=a.bounds.height()+u}switch((i||o)&&op(t,n,i,o),a.orient){case Is:l+=ip(e,n,a,s,1,1);break;case Bs:c+=ip(e,n,a,Vs,0,0)+u,l+=ip(e,n,a,s,1,1);break;case Ps:c+=ip(e,n,a,s,0,0),l+=ip(e,n,a,Vs,-1,0,1)+u;break;default:c+=ip(e,n,a,s,0,0)}(c||l)&&op(t,a,c,l),(c=Math.round(a.bounds.x1-r))<0&&(op(t,n,-c,0),op(t,a,-c,0))}else(i||o)&&op(t,n,i,o)}(t,a,a.items[0].items[0]),c=function(t,e){return t.items.forEach(t=>e.union(t.bounds)),e.x1=t.padding,e.y1=t.padding,e}(a,c),n=2*a.padding,r=2*a.padding,c.empty()||(n=Math.ceil(c.width()+n),r=Math.ceil(c.height()+r)),s.type===lu&&(i=a.items[0].items[0].items[0].items,o=i.reduce((function(t,e){return t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t}),{}),i.forEach((function(t){t.width=o[t.column],t.height=t.bounds.y2-t.y}))),u!==gu&&(a.x=l=0,a.y=f=0),a.width=n,a.height=r,zl(c.set(l,f,l+n,f+r),a),a.mark.bounds.clear().union(c),a}function ip(t,e,n,r,i,o,a){const s="symbol"!==t.datum.type,u=n.datum.vgrad,c=(!s||!o&&u||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,l=u&&o?c:0,f=u&&o?0:c,d=i<=0?0:Zf(n);return Math.round(r===Ys?l:r===Vs?f-d:.5*(c-d))}function op(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function ap(t){Tr.call(this,null,t)}Object(et.y)(ap,Tr).transform=function(t,e){var n=e.dataflow;return t.mark.items.forEach((function(e){t.layout&&Xh(n,e,t.layout),function(t,e,n){var r,i,o,a,s,u=e.items,c=Math.max(0,e.width||0),l=Math.max(0,e.height||0),f=(new _u).set(0,0,c,l),d=f.clone(),h=f.clone(),p=[];for(a=0,s=u.length;a<s;++a)switch((i=u[a]).role){case Qs:(Ph(i)?d:h).union(Uh(t,i,c,l));break;case Ks:r=i;break;case nu:p.push(rp(t,i));break;case tu:case eu:case ru:case iu:case ou:case au:case su:case uu:d.union(i.bounds),h.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach(t=>{(o=t.orient||Bs)!==gu&&(e[o]||(e[o]=[])).push(t)});for(let r in e){const i=e[r];Vh(t,i,np(i,r,n.legends,d,h,c,l))}p.forEach(e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&n.autosize.type===fu)switch(e.orient){case Is:case Bs:f.add(r.x1,0).add(r.x2,0);break;case Ls:case Ps:f.add(0,r.y1).add(0,r.y2)}else f.union(r)})}f.union(d).union(h),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],s=a.frame,u=a.orient,c=a.anchor,l=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===Is||u===Bs?r:n,g=0,m=0,v=0,y=0,b=0;if(s!==Zs?u===Is?(g=i.y2,p=i.y1):u===Bs?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===Is&&(g=r,p=0),o=c===Ys?g:c===Vs?p:(g+p)/2,h&&h.text){switch(u){case Ls:case Ps:b=d.bounds.height()+f;break;case Is:y=d.bounds.width()+f;break;case Bs:y=-d.bounds.width()-f}Ih.clear().union(h.bounds),Ih.translate(y-(h.x||0),b-(h.y||0)),Bh(h,"x",y)|Bh(h,"y",b)&&(t.dirty(h),h.bounds.clear().union(Ih),h.mark.bounds.clear().union(Ih),t.dirty(h)),Ih.clear().union(h.bounds)}else Ih.clear();switch(Ih.union(d.bounds),u){case Ls:m=o,v=i.y1-Ih.height()-l;break;case Is:m=i.x1-Ih.width()-l,v=o;break;case Bs:m=i.x2+Ih.width()+l,v=o;break;case Ps:m=o,v=i.y2+l;break;default:m=a.x,v=a.y}return Bh(a,"x",m)|Bh(a,"y",v)&&(Ih.translate(m,v),t.dirty(a),a.bounds.clear().union(Ih),e.bounds.clear().union(Ih),t.dirty(a)),a.bounds}(t,r,c,l,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){var i=r.autosize||{},o=i.type,a=t._width,s=t._height,u=t.padding();if(t._autosize<1||!o)return;var c=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),f=Math.max(0,Math.ceil(n.x2-c)),d=Math.max(0,e.height||0),h=Math.max(0,Math.ceil(-n.y1)),p=Math.max(0,Math.ceil(n.y2-d));i.contains===cu&&(a-=u.left+u.right,s-=u.top+u.bottom);o===gu?(l=0,h=0,c=a,d=s):o===fu?(c=Math.max(0,a-l-f),d=Math.max(0,s-h-p)):o===du?(c=Math.max(0,a-l-f),s=d+h+p):o===hu?(a=c+l+f,d=Math.max(0,s-h-p)):o===pu&&(a=c+l+f,s=d+h+p);t._resizeView(a,s,c,d,[l,h],i.resize)}(t,e,f,n)}(n,e,t)})),t.modified()&&e.reflow(),e};var sp=function(t,e,n){var r=t-e+2*n;return t?r>0?r:1:0};const up="identity",cp="linear",lp="log",fp="pow",dp="sqrt",hp="symlog",pp="time",gp="utc",mp="sequential",vp="diverging",yp="quantile",bp="quantize",xp="threshold",_p="ordinal",wp="point",Op="band",Ep="bin-ordinal";function Ap(t){return t===yp}function kp(t){return function(t){return t&&t.startsWith(mp)}(t)||function(t){return t&&t.startsWith(vp)}(t)}function Sp(t){return t===lp||t.endsWith("-log")}function jp(t){switch(t){case cp:case lp:case fp:case dp:case hp:case pp:case gp:case mp:return!0}return!1}function Dp(t){return t===Ep||t===_p||t===Op||t===wp}function Cp(t){return t===Ep||t===yp||t===bp||t===xp}var Mp=function(t){return function(e){var n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}},Fp=function(t){return function(e){var n,r,i,o,a=t.range(),s=e[0],u=e[1],c=-1;for(u<s&&(r=s,s=u,u=r),i=0,o=a.length;i<o;++i)a[i]>=s&&a[i]<=u&&(c<0&&(c=i),n=i);if(!(c<0))return s=t.invertExtent(a[c]),u=t.invertExtent(a[n]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}},Np=us(Vr),Tp=Np.right,Rp=Np.left,zp=Tp;function $p(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Lp(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Ip=Symbol("implicit");function Bp(){var t=new Map,e=[],n=[],r=Ip;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Ip)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Bp(e,n).unknown(r)},$p.apply(i,arguments),i}function Pp(){var t,e,n=Bp().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,s=0,u=0,c=.5;function l(){var n=r().length,l=o[1]<o[0],f=o[l-0],d=o[1-l],h=sp(n,s,u);t=(d-f)/(h||1),a&&(t=Math.floor(t)),f+=(d-f-t*(n-s))*c,e=t*(1-s),a&&(f=Math.round(f),e=Math.round(e));var p=Qo(n).map((function(e){return f+t*e}));return i(l?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),l()):r()},n.range=function(t){return arguments.length?(o=[+t[0],+t[1]],l()):o.slice()},n.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,l()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,l()):a},n.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,l()):s},n.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),l()):s},n.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),l()):u},n.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),l()):c},n.invertRange=function(t){if(null!=t[0]&&null!=t[1]){var n,a,s,u=+t[0],c=+t[1],l=o[1]<o[0],f=l?i().reverse():i(),d=f.length-1;if(u==u&&c==c&&(c<u&&(s=u,u=c,c=s),!(c<f[0]||u>o[1-l])))return n=Math.max(0,Tp(f,u)-1),a=u===c?n:Tp(f,c)-1,u-f[n]>e+1e-10&&++n,l&&(s=n,n=d-a,a=d-s),n>a?void 0:r().slice(n,a+1)}},n.invert=function(t){var e=n.invertRange([t,t]);return e?e[0]:e},n.copy=function(){return Pp().domain(r()).range(o).round(a).paddingInner(s).paddingOuter(u).align(c)},l()}var Up=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qp(t){if(!(e=Up.exec(t)))throw new Error("invalid format: "+t);var e;return new Wp({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Wp(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}qp.prototype=Wp.prototype,Wp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Hp,Yp,Gp,Vp,Xp=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},Jp=function(t){return(t=Xp(Math.abs(t)))?t[1]:NaN},Zp=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t},Qp=function(t,e){var n=Xp(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Kp={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Qp(100*t,e)},r:Qp,s:function(t,e){var n=Xp(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Hp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Xp(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},tg=function(t){return t},eg=Array.prototype.map,ng=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],rg=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?tg:(e=eg.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?tg:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(eg.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=qp(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Kp[y]||(void 0===m&&(m=12),v=!0,y="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?o:/[%p]/.test(y)?u:"",_=Kp[y],w=/[defgprs%]/.test(y);function O(t){var i,o,u,d=b,O=x;if("c"===y)O=_(t)+O,t="";else{var E=(t=+t)<0;if(t=isNaN(t)?l:_(Math.abs(t),m),v&&(t=Zp(t)),E&&0==+t&&(E=!1),d=(E?"("===f?f:c:"-"===f||"("===f?"":f)+d,O=("s"===y?ng[8+Hp/3]:"")+O+(E&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){O=(46===u?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var A=d.length+t.length+O.length,k=A<p?new Array(p-A+1).join(e):"";switch(g&&h&&(t=r(k+t,k.length?p-O.length:1/0),k=""),n){case"<":t=d+t+O+k;break;case"=":t=d+k+t+O;break;case"^":t=k.slice(0,A=k.length>>1)+d+t+O+k.slice(A);break;default:t=k+d+t+O}return s(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n=f(((t=qp(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Jp(e)/3))),i=Math.pow(10,-r),o=ng[8+r/3];return function(t){return n(i*t)+o}}}};function ig(t){return Yp=rg(t),Gp=Yp.format,Vp=Yp.formatPrefix,Yp}ig({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var og=function(t,e,n,r){var i,o=ps(t,e,n);switch((r=qp(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Jp(e)/3)))-Jp(Math.abs(t)))}(o,a))||(r.precision=i),Vp(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Jp(e)-Jp(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-Jp(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return Gp(r)},ag=Array.prototype.map;function sg(t){return ag.call(t,(function(t){return+t}))}var ug=Array.prototype.slice;var cg=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function lg(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fg(){}var dg="\\s*([+-]?\\d+)\\s*",hg="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",pg="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gg=/^#([0-9a-f]{3,8})$/,mg=new RegExp("^rgb\\("+[dg,dg,dg]+"\\)$"),vg=new RegExp("^rgb\\("+[pg,pg,pg]+"\\)$"),yg=new RegExp("^rgba\\("+[dg,dg,dg,hg]+"\\)$"),bg=new RegExp("^rgba\\("+[pg,pg,pg,hg]+"\\)$"),xg=new RegExp("^hsl\\("+[hg,pg,pg]+"\\)$"),_g=new RegExp("^hsla\\("+[hg,pg,pg,hg]+"\\)$"),wg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Og(){return this.rgb().formatHex()}function Eg(){return this.rgb().formatRgb()}function Ag(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gg.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kg(e):3===n?new Cg(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new Cg(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new Cg(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=mg.exec(t))?new Cg(e[1],e[2],e[3],1):(e=vg.exec(t))?new Cg(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yg.exec(t))?Sg(e[1],e[2],e[3],e[4]):(e=bg.exec(t))?Sg(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xg.exec(t))?Tg(e[1],e[2]/100,e[3]/100,1):(e=_g.exec(t))?Tg(e[1],e[2]/100,e[3]/100,e[4]):wg.hasOwnProperty(t)?kg(wg[t]):"transparent"===t?new Cg(NaN,NaN,NaN,0):null}function kg(t){return new Cg(t>>16&255,t>>8&255,255&t,1)}function Sg(t,e,n,r){return r<=0&&(t=e=n=NaN),new Cg(t,e,n,r)}function jg(t){return t instanceof fg||(t=Ag(t)),t?new Cg((t=t.rgb()).r,t.g,t.b,t.opacity):new Cg}function Dg(t,e,n,r){return 1===arguments.length?jg(t):new Cg(t,e,n,null==r?1:r)}function Cg(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Mg(){return"#"+Ng(this.r)+Ng(this.g)+Ng(this.b)}function Fg(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ng(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Tg(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $g(t,e,n,r)}function Rg(t){if(t instanceof $g)return new $g(t.h,t.s,t.l,t.opacity);if(t instanceof fg||(t=Ag(t)),!t)return new $g;if(t instanceof $g)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new $g(a,s,u,t.opacity)}function zg(t,e,n,r){return 1===arguments.length?Rg(t):new $g(t,e,n,null==r?1:r)}function $g(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Lg(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ig(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}cg(fg,Ag,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Og,formatHex:Og,formatHsl:function(){return Rg(this).formatHsl()},formatRgb:Eg,toString:Eg}),cg(Cg,Dg,lg(fg,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Cg(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Cg(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mg,formatHex:Mg,formatRgb:Fg,toString:Fg})),cg($g,zg,lg(fg,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $g(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $g(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Cg(Lg(t>=240?t-240:t+120,i,r),Lg(t,i,r),Lg(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Bg=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Ig((n-r/e)*e,a,i,o,s)}},Pg=function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Ig((n-r/e)*e,i,o,a,s)}},Ug=function(t){return function(){return t}};function qg(t,e){return function(n){return t+n*e}}function Wg(t,e){var n=e-t;return n?qg(t,n>180||n<-180?n-360*Math.round(n/360):n):Ug(isNaN(t)?e:t)}function Hg(t){return 1==(t=+t)?Yg:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ug(isNaN(e)?n:e)}}function Yg(t,e){var n=e-t;return n?qg(t,n):Ug(isNaN(t)?e:t)}var Gg=function t(e){var n=Hg(e);function r(t,e){var r=n((t=Dg(t)).r,(e=Dg(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Yg(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Vg(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=Dg(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var Xg=Vg(Bg),Jg=Vg(Pg),Zg=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Qg(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Kg=function(t,e){return(Qg(e)?Zg:tm)(t,e)};function tm(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=sm(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var em=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},nm=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},rm=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=sm(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},im=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,om=new RegExp(im.source,"g");var am=function(t,e){var n,r,i,o=im.lastIndex=om.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=im.exec(t))&&(r=om.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:nm(n,r)})),o=om.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},sm=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?Ug(e):("number"===r?nm:"string"===r?(n=Ag(e))?(e=n,Gg):am:e instanceof Ag?Gg:e instanceof Date?em:Qg(e)?Zg:Array.isArray(e)?tm:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?rm:nm)(t,e)},um=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},cm=function(t){return function(){return t}},lm=function(t){return+t},fm=[0,1];function dm(t){return t}function hm(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:cm(isNaN(e)?NaN:.5)}function pm(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=hm(i,r),o=n(a,o)):(r=hm(r,i),o=n(o,a)),function(t){return o(r(t))}}function gm(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=hm(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=zp(t,e,1,r)-1;return o[n](i[n](e))}}function mm(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function vm(){var t,e,n,r,i,o,a=fm,s=fm,u=sm,c=dm;function l(){var t,e,n,u=Math.min(a.length,s.length);return c!==dm&&(t=a[0],e=a[u-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),r=u>2?gm:pm,i=o=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),nm)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,lm),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=um,l()},f.clamp=function(t){return arguments.length?(c=!!t||dm,l()):c!==dm},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ym(){return vm()(dm,dm)}function bm(t){var e=t.domain;return t.ticks=function(t){var n=e();return ds(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return og(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),o=0,a=i.length-1,s=i[o],u=i[a];return u<s&&(r=s,s=u,u=r,r=o,o=a,a=r),(r=hs(s,u,n))>0?r=hs(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=hs(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,e(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,e(i)),t},t}var xm=function(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t};function _m(t){return Math.log(t)}function wm(t){return Math.exp(t)}function Om(t){return-Math.log(-t)}function Em(t){return-Math.exp(-t)}function Am(t){return isFinite(t)?+("1e"+t):t<0?0:t}function km(t){return function(e){return-t(-e)}}function Sm(t){var e,n,r=t(_m,wm),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Am:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=km(e),n=km(n),t(Om,Em)):t(_m,wm),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(d=s,s=u,u=d);var c,l,f,d=e(s),h=e(u),p=null==t?10:+t,g=[];if(!(o%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),s>0){for(;d<=h;++d)for(l=1,c=n(d);l<o;++l)if(!((f=c*l)<s)){if(f>u)break;g.push(f)}}else for(;d<=h;++d)for(l=o-1,c=n(d);l>=1;--l)if(!((f=c*l)<s)){if(f>u)break;g.push(f)}2*g.length<p&&(g=ds(s,u,p))}else g=ds(d,h,Math.min(h-d,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Gp(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(xm(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function jm(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Dm(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Cm(t){return t<0?-t*t:t*t}function Mm(t){var e=t(dm,dm),n=1;function r(){return 1===n?t(dm,dm):.5===n?t(Dm,Cm):t(jm(n),jm(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},bm(e)}function Fm(){var t=Mm(vm());return t.copy=function(){return mm(t,Fm()).exponent(t.exponent())},$p.apply(t,arguments),t}function Nm(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Tm(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Rm(t){var e=1,n=t(Nm(e),Tm(e));return n.constant=function(n){return arguments.length?t(Nm(e=+n),Tm(e)):e},bm(n)}var zm=1e3,$m=60*zm,Lm=60*$m,Im=24*Lm,Bm=7*Im,Pm=30*Im,Um=365*Im;function qm(t){return new Date(t)}function Wm(t){return t instanceof Date?+t:+new Date(+t)}function Hm(t,e,n,r,i,o,a,s,u){var c=ym(),l=c.invert,f=c.domain,d=u(".%L"),h=u(":%S"),p=u("%I:%M"),g=u("%I %p"),m=u("%a %d"),v=u("%b %d"),y=u("%B"),b=u("%Y"),x=[[a,1,zm],[a,5,5*zm],[a,15,15*zm],[a,30,30*zm],[o,1,$m],[o,5,5*$m],[o,15,15*$m],[o,30,30*$m],[i,1,Lm],[i,3,3*Lm],[i,6,6*Lm],[i,12,12*Lm],[r,1,Im],[r,2,2*Im],[n,1,Bm],[e,1,Pm],[e,3,3*Pm],[t,1,Um]];function _(s){return(a(s)<s?d:o(s)<s?h:i(s)<s?p:r(s)<s?g:e(s)<s?n(s)<s?m:v:t(s)<s?y:b)(s)}function w(e,n,r){if(null==e&&(e=10),"number"==typeof e){var i,o=Math.abs(r-n)/e,a=us((function(t){return t[2]})).right(x,o);return a===x.length?(i=ps(n/Um,r/Um,e),e=t):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max(ps(n,r,e),1),e=s),e.every(i)}return e}return c.invert=function(t){return new Date(l(t))},c.domain=function(t){return arguments.length?f(Array.from(t,Wm)):f().map(qm)},c.ticks=function(t){var e,n=f(),r=n[0],i=n[n.length-1],o=i<r;return o&&(e=r,r=i,i=e),e=(e=w(t,r,i))?e.range(r,i+1):[],o?e.reverse():e},c.tickFormat=function(t,e){return null==e?_:u(e)},c.nice=function(t){var e=f();return(t=w(t,e[0],e[e.length-1]))?f(xm(e,t)):c},c.copy=function(){return mm(c,Hm(t,e,n,r,i,o,a,s,u))},c}function Ym(){var t,e,n,r,i,o=0,a=1,s=dm,u=!1;function c(e){return isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function l(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),c):[s(0),s(1)]}}return c.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),c):[o,a]},c.clamp=function(t){return arguments.length?(u=!!t,c):u},c.interpolator=function(t){return arguments.length?(s=t,c):s},c.range=l(sm),c.rangeRound=l(um),c.unknown=function(t){return arguments.length?(i=t,c):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),c}}function Gm(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Vm(){var t=bm(Ym()(dm));return t.copy=function(){return Gm(t,Vm())},Lp.apply(t,arguments)}function Xm(){var t=Mm(Ym());return t.copy=function(){return Gm(t,Xm()).exponent(t.exponent())},Lp.apply(t,arguments)}function Jm(t,e){for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function Zm(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=dm,d=!1;function h(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*t<l*e?r:i),f(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=Jm(t,[n,r,i]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,u,c]=a,t=o(s=+s),e=o(u=+u),n=o(c=+c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,h):[s,u,c]},h.clamp=function(t){return arguments.length?(d=!!t,h):d},h.interpolator=function(t){return arguments.length?(f=t,h):f},h.range=p(sm),h.rangeRound=p(um),h.unknown=function(t){return arguments.length?(a=t,h):a},function(a){return o=a,t=a(s),e=a(u),n=a(c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,h}}function Qm(){var t=Mm(Zm());return t.copy=function(){return Gm(t,Qm()).exponent(t.exponent())},Lp.apply(t,arguments)}function Km(t,e){return arguments.length>1?(tv[t]=function(t,e){return function(){var n=e();return n.invertRange||(n.invertRange=n.invert?Mp(n):n.invertExtent?Fp(n):void 0),n.type=t,n}}(t,e),this):Object(et.v)(tv,t)?tv[t]:void 0}var tv={[up]:function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,lm),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,lm):[0,1],bm(r)},[cp]:function t(){var e=ym();return e.copy=function(){return mm(e,t())},$p.apply(e,arguments),bm(e)},[lp]:function t(){var e=Sm(vm()).domain([1,10]);return e.copy=function(){return mm(e,t()).base(e.base())},$p.apply(e,arguments),e},[fp]:Fm,[dp]:function(){return Fm.apply(null,arguments).exponent(.5)},[hp]:function t(){var e=Rm(vm());return e.copy=function(){return mm(e,t()).constant(e.constant())},$p.apply(e,arguments)},[pp]:function(){return $p.apply(Hm(qe,Fa,Ne,Pe,Ta,za,La,Ba,Je).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},[gp]:function(){return $p.apply(Hm(He,Ua,Oe,Me,Wa,Ya,La,Ba,Qe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},[mp]:Vm,[mp+"-"+cp]:Vm,[mp+"-"+lp]:function t(){var e=Sm(Ym()).domain([1,10]);return e.copy=function(){return Gm(e,t()).base(e.base())},Lp.apply(e,arguments)},[mp+"-"+fp]:Xm,[mp+"-"+dp]:function(){return Xm.apply(null,arguments).exponent(.5)},[mp+"-"+hp]:function t(){var e=Rm(Ym());return e.copy=function(){return Gm(e,t()).constant(e.constant())},Lp.apply(e,arguments)},[vp+"-"+cp]:function t(){var e=bm(Zm()(dm));return e.copy=function(){return Gm(e,t())},Lp.apply(e,arguments)},[vp+"-"+lp]:function t(){var e=Sm(Zm()).domain([.1,1,10]);return e.copy=function(){return Gm(e,t()).base(e.base())},Lp.apply(e,arguments)},[vp+"-"+fp]:Qm,[vp+"-"+dp]:function(){return Qm.apply(null,arguments).exponent(.5)},[vp+"-"+hp]:function t(){var e=Rm(Zm());return e.copy=function(){return Gm(e,t()).constant(e.constant())},Lp.apply(e,arguments)},[yp]:function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=Kr(n,t/e);return a}function a(t){return isNaN(t=+t)?e:r[zp(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(Vr),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},$p.apply(a,arguments)},[bp]:function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return t<=t?a[zp(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},$p.apply(bm(s),arguments)},[xp]:function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[zp(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},$p.apply(o,arguments)},[Ep]:function t(){var e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(zp(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=sg(t),r):e.slice()},r.range=function(t){return arguments.length?(n=ug.call(t),r):n.slice()},r.tickFormat=function(t,n){return og(e[0],Object(et.T)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r},[_p]:Bp,[Op]:Pp,[wp]:function(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(Pp().paddingInner(1))}};for(var ev in tv)Km(ev,tv[ev]);var nv,rv,iv,ov,av=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},sv=function(t,e){var n=Wg(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},uv=180/Math.PI,cv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},lv=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*uv,skewX:Math.atan(u)*uv,scaleX:a,scaleY:s}};function fv(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:nm(t,i)},{i:u-2,x:nm(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:nm(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:nm(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:nm(t,n)},{i:s-2,x:nm(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var dv=fv((function(t){return"none"===t?cv:(nv||(nv=document.createElement("DIV"),rv=document.documentElement,iv=document.defaultView),nv.style.transform=t,t=iv.getComputedStyle(rv.appendChild(nv),null).getPropertyValue("transform"),rv.removeChild(nv),t=t.slice(7,-1).split(","),lv(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),hv=fv((function(t){return null==t?cv:(ov||(ov=document.createElementNS("http://www.w3.org/2000/svg","g")),ov.setAttribute("transform",t),(t=ov.transform.baseVal.consolidate())?(t=t.matrix,lv(t.a,t.b,t.c,t.d,t.e,t.f)):cv)}),", ",")",")"),pv=Math.SQRT2;function gv(t){return((t=Math.exp(t))+1/t)/2}var mv=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],c=e[2],l=s-i,f=u-o,d=l*l+f*f;if(d<1e-12)r=Math.log(c/a)/pv,n=function(t){return[i+t*l,o+t*f,a*Math.exp(pv*t*r)]};else{var h=Math.sqrt(d),p=(c*c-a*a+4*d)/(2*a*2*h),g=(c*c-a*a-4*d)/(2*c*2*h),m=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/pv,n=function(t){var e,n=t*r,s=gv(m),u=a/(2*h)*(s*(e=pv*n+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[i+u*l,o+u*f,a*s/gv(pv*n+m)]}}return n.duration=1e3*r,n};function vv(t){return function(e,n){var r=t((e=zg(e)).h,(n=zg(n)).h),i=Yg(e.s,n.s),o=Yg(e.l,n.l),a=Yg(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var yv=vv(Wg),bv=vv(Yg),xv=Math.PI/180,_v=180/Math.PI,wv=.96422,Ov=1,Ev=.82521,Av=4/29,kv=6/29,Sv=3*kv*kv,jv=kv*kv*kv;function Dv(t){if(t instanceof Mv)return new Mv(t.l,t.a,t.b,t.opacity);if(t instanceof Lv)return Iv(t);t instanceof Cg||(t=jg(t));var e,n,r=Rv(t.r),i=Rv(t.g),o=Rv(t.b),a=Fv((.2225045*r+.7168786*i+.0606169*o)/Ov);return r===i&&i===o?e=n=a:(e=Fv((.4360747*r+.3850649*i+.1430804*o)/wv),n=Fv((.0139322*r+.0971045*i+.7141733*o)/Ev)),new Mv(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Cv(t,e,n,r){return 1===arguments.length?Dv(t):new Mv(t,e,n,null==r?1:r)}function Mv(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Fv(t){return t>jv?Math.pow(t,1/3):t/Sv+Av}function Nv(t){return t>kv?t*t*t:Sv*(t-Av)}function Tv(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Rv(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function zv(t){if(t instanceof Lv)return new Lv(t.h,t.c,t.l,t.opacity);if(t instanceof Mv||(t=Dv(t)),0===t.a&&0===t.b)return new Lv(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*_v;return new Lv(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function $v(t,e,n,r){return 1===arguments.length?zv(t):new Lv(t,e,n,null==r?1:r)}function Lv(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Iv(t){if(isNaN(t.h))return new Mv(t.l,0,0,t.opacity);var e=t.h*xv;return new Mv(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Bv(t,e){var n=Yg((t=Cv(t)).l,(e=Cv(e)).l),r=Yg(t.a,e.a),i=Yg(t.b,e.b),o=Yg(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function Pv(t){return function(e,n){var r=t((e=$v(e)).h,(n=$v(n)).h),i=Yg(e.c,n.c),o=Yg(e.l,n.l),a=Yg(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}cg(Mv,Cv,lg(fg,{brighter:function(t){return new Mv(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Mv(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Cg(Tv(3.1338561*(e=wv*Nv(e))-1.6168667*(t=Ov*Nv(t))-.4906146*(n=Ev*Nv(n))),Tv(-.9787684*e+1.9161415*t+.033454*n),Tv(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),cg(Lv,$v,lg(fg,{brighter:function(t){return new Lv(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Lv(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Iv(this).rgb()}}));var Uv=Pv(Wg),qv=Pv(Yg),Wv=-.29227,Hv=-.90649,Yv=1.97294,Gv=Yv*Hv,Vv=1.78277*Yv,Xv=1.78277*Wv- -.14861*Hv;function Jv(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Zv)return new Zv(t.h,t.s,t.l,t.opacity);t instanceof Cg||(t=jg(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Xv*r+Gv*e-Vv*n)/(Xv+Gv-Vv),o=r-i,a=(Yv*(n-i)-Wv*o)/Hv,s=Math.sqrt(a*a+o*o)/(Yv*i*(1-i)),u=s?Math.atan2(a,o)*_v-120:NaN;return new Zv(u<0?u+360:u,s,i,t.opacity)}(t):new Zv(t,e,n,null==r?1:r)}function Zv(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Qv(t){return function e(n){function r(e,r){var i=t((e=Jv(e)).h,(r=Jv(r)).h),o=Yg(e.s,r.s),a=Yg(e.l,r.l),s=Yg(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}cg(Zv,Jv,lg(fg,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Zv(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Zv(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*xv,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Cg(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(Wv*r+Hv*i)),255*(e+n*(Yv*r)),this.opacity)}}));var Kv=Qv(Wg),ty=Qv(Yg),ey=function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n};const ny=["clamp","base","constant","exponent"];function ry(t,e){var n=e[0],r=Object(et.T)(e)-n;return function(e){return t(n+e*r)}}function iy(t,e,n){return Jm(sy(e||"rgb",n),t)}function oy(t,e){for(var n=new Array(e),r=e+1,i=0;i<e;)n[i]=t(++i/r);return n}function ay(t,e,n){var r,i,o,a=n-e;return a&&Number.isFinite(a)?(r=(i=t.type).indexOf("-"),i=r<0?i:i.slice(r+1),o=Km(i)().domain([e,n]).range([0,1]),ny.forEach(e=>t[e]?o[e](t[e]()):0),o):Object(et.l)(.5)}function sy(t,e){var n=s[function(t){return"interpolate"+t.toLowerCase().split("-").map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function uy(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function cy(t,e){for(let n in t)fy(n,e(t[n]))}const ly={};function fy(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(ly[t]=e,this):ly[t]}function dy(t,e,n){var r;return Object(et.E)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,~~(Object(et.W)(t.domain())/n)||1))),Object(et.F)(e)&&(r=e.step,e=e.interval),Object(et.H)(e)&&(e=t.type===pp?Xa(e):t.type==gp?Ja(e):Object(et.n)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function hy(t,e,n){var r=t.range(),i=Math.floor(r[0]),o=Math.ceil(Object(et.T)(r));if(i>o&&(r=o,o=i,i=r),e=e.filter((function(e){return e=t(e),i<=e&&e<=o})),n>0&&e.length>1){for(var a=[e[0],Object(et.T)(e)];e.length>n&&e.length>=3;)e=e.filter((function(t,e){return!(e%2)}));e.length<3&&(e=a)}return e}function py(t,e){return t.bins?hy(t,t.bins):t.ticks?t.ticks(e):t.domain()}function gy(t,e,n,r,i){var o,a,s=t.type,u=s===pp||r===pp?os(n):s===gp||r===gp?as(n):t.tickFormat?t.tickFormat(e,n):n?Gp(n):String;if(Sp(s)){var c=function(t){var e=qp(t||",");if(null==e.precision){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1}return function(t,e){return function(n){var r,i,o=t(n),a=o.indexOf(e);if(a<0)return o;for(i=(r=function(t,e){var n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if((n=t.charCodeAt(r))>=48&&n<=57)return r+1}(o,a))<o.length?o.slice(r):"";--r>a;)if("0"!==o[r]){++r;break}return o.slice(0,r)+i}}(Gp(e),Gp(".1f")(1)[1])}return Gp(e)}(n);u=i||t.bins?c:(o=u,a=c,t=>o(t)?a(t):"")}return u}function my(t){Tr.call(this,null,t)}function vy(t){Tr.call(this,null,t)}function yy(){return ct({})}function by(t){return t.exit}function xy(t){Tr.call(this,null,t)}cy({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},uy),cy({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},t=>iy(uy(t))),Object(et.y)(my,Tr).transform=function(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,i=t.scale,o=dy(i,null==t.count?t.values?t.values.length:10:t.count,t.minstep),a=t.format||gy(i,o,t.formatSpecifier,t.formatType,!!t.values),s=t.values?hy(i,t.values,o):py(i,o);return r&&(n.rem=r),r=s.map((function(t,e){return ct({index:e/(s.length-1||1),value:t,label:a(t)})})),t.extra&&r.length&&r.push(ct({index:-1,extra:{value:r[0].value},label:""})),n.source=r,n.add=r,this.value=r,n},Object(et.y)(vy,Tr).transform=function(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||yy,o=t.key||st,a=this.value;return Object(et.A)(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&Object(et.n)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=Object(et.s)().test(by),a.lookup=function(t){return a.get(o(t))}),e.visit(e.ADD,(function(t){var e=o(t),n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(a.set(e,n=i(t)),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(function(t){var e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(function(t){var e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),t.clean&&a.empty>n.cleanThreshold&&n.runAfter(a.clean),r},Object(et.y)(xy,Tr).transform=function(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(Object(et.A)(o)){if(!n.changed()&&!o.every((function(t){return i[t]})))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||et.r,u=i.enter||et.r,c=i.exit||et.r,l=(o&&!a?i[o]:s)||et.r;if(e.changed(e.ADD)&&(e.visit(e.ADD,(function(e){u(e,t),s(e,t)})),n.modifies(u.output),n.modifies(s.output),l!==et.r&&l!==s&&(e.visit(e.ADD,(function(e){l(e,t)})),n.modifies(l.output))),e.changed(e.REM)&&c!==et.r&&(e.visit(e.REM,(function(e){c(e,t)})),n.modifies(c.output)),a||l!==et.r){var f=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(f,(function(e){var i=u(e,t)||r;(l(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)):e.visit(f,(function(e){(l(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(l.output)}return n.changed()?n:e.StopPropagation};var _y="symbol",wy="discrete";const Oy={[yp]:"quantiles",[bp]:"thresholds",[xp]:"domain"},Ey={[yp]:"quantiles",[bp]:"domain"};function Ay(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=Object(et.T)(t),e}(t.bins):Oy[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[Oy[t.type]]()):py(t,e)}function ky(t,e,n,r,i,o){const a=Ey[t.type]&&i!==pp&&i!==gp?function(t,e){var n,r=t[Ey[t.type]](),i=r.length,o=i>1?r[1]-r[0]:r[0];for(n=1;n<i;++n)o=Math.min(o,r[n]-r[n-1]);return og(0,o,30,e)}(t,r):gy(t,e,r,i,o);return n===_y&&function(t){return Oy[t.type]||t.bins}(t)?function(t){return function(e,n,r){var i=r[n+1]||r.max||1/0,o=Sy(e,t),a=Sy(i,t);return o&&a?o+"–"+a:a?"< "+a:"≥ "+o}}(a):n===wy?function(t){return function(e,n){return n?t(e):null}}(a):function(t){return function(e){return t(e)}}(a)}function Sy(t,e){return Number.isFinite(t)?e(t):null}function jy(t){Tr.call(this,[],t)}Object(et.y)(jy,Tr).transform=function(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,s=e.fork(e.NO_SOURCE|e.NO_FIELDS),u=this.value,c=t.type||_y,l=t.scale,f=+t.limit,d=dy(l,null==t.count?5:t.count,t.minstep),h=t.format||ky(l,d,c,t.formatSpecifier,t.formatType,!!t.values),p=t.values||Ay(l,d);return u&&(s.rem=u),c===_y?(f&&p.length>f?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),u=p.slice(0,f-1),a=!0):u=p,Object(et.D)(i=t.size)?(t.values||0!==l(u[0])||(u=u.slice(1)),o=u.reduce((function(e,n){return Math.max(e,i(n,t))}),0)):i=Object(et.l)(o=i||8),u=u.map((function(e,n){return ct({index:n,label:h(e,n,p),value:e,offset:o,size:i(e,t)})})),a&&(a=p[u.length],u.push(ct({index:u.length,label:`…${p.length-u.length} entries`,value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=l.domain(),r=ay(l,n[0],Object(et.T)(n)),p.length<3&&!t.values&&n[0]!==Object(et.T)(n)&&(p=[n[0],Object(et.T)(n)]),u=p.map((function(t,e){return ct({index:e,label:h(t,e,p),value:t,perc:r(t)})}))):(i=p.length-1,r=function(t){var e=t.domain(),n=e.length-1,r=+e[0],i=+Object(et.T)(e),o=i-r;if(t.type===xp){var a=n?o/n:.1;o=(i+=a)-(r-=a)}return function(t){return(t-r)/o}}(l),u=p.map((function(t,e){return ct({index:e,label:h(t,e,p),value:t,perc:e?r(t):0,perc2:e===i?1:r(p[e+1])})}))),s.source=u,s.add=u,this.value=u,s};var Dy=Object(et.s)({line:Ry,"line-radial":function(t,e,n,r){return Ry(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},arc:zy,"arc-radial":function(t,e,n,r){return zy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},curve:$y,"curve-radial":function(t,e,n,r){return $y(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},"orthogonal-horizontal":function(t,e,n,r){return"M"+t+","+e+"V"+r+"H"+n},"orthogonal-vertical":function(t,e,n,r){return"M"+t+","+e+"H"+n+"V"+r},"orthogonal-radial":function(t,e,n,r){var i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(u?1:0)+" "+e*a+","+e*s+"L"+r*a+","+r*s},"diagonal-horizontal":function(t,e,n,r){var i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":function(t,e,n,r){var i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":function(t,e,n,r){var i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=(e+r)/2;return"M"+e*i+","+e*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function Cy(t){return t.source.x}function My(t){return t.source.y}function Fy(t){return t.target.x}function Ny(t){return t.target.y}function Ty(t){Tr.call(this,{},t)}function Ry(t,e,n,r){return"M"+t+","+e+"L"+n+","+r}function zy(t,e,n,r){var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r}function $y(t,e,n,r){var i=n-t,o=r-e,a=.2*(i+o),s=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(r-a)+" "+n+","+r}function Ly(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Iy(t){Tr.call(this,null,t)}Ty.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Object(et.y)(Ty,Tr).transform=function(t,e){var n=t.sourceX||Cy,r=t.sourceY||My,i=t.targetX||Fy,o=t.targetY||Ny,a=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",c=Dy.get(u+"-"+s)||Dy.get(u);return c||Object(et.n)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(function(t){t[a]=c(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)},Iy.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(et.y)(Iy,Tr).transform=function(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],u=t.field||et.N,c=t.startAngle||0,l=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(u),h=d.length,p=c,g=(l-c)/Ly(d),m=Qo(h);for(t.sort&&m.sort((function(t,e){return d[t]-d[e]})),n=0;n<h;++n)i=d[m[n]],(r=f[m[n]])[a]=p,r[s]=p+=i*g;return this.value=d,e.reflow(t.modified()).modifies(o)};var By=5;function Py(t){return jp(t)&&t!==mp}var Uy=Object(et.cb)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function qy(t){Tr.call(this,null,t),this.modified(!0)}function Wy(t,e,n){Sp(t)&&(Math.abs(e.reduce((function(t,e){return t+(e<0?-1:e>0?1:0)}),0))!==e.length&&n.warn("Log scale domain includes zero: "+Object(et.Y)(e)));return e}function Hy(t,e,n){return Object(et.D)(t)&&(e||n)?ry(t,Yy(e||[0,1],n)):t}function Yy(t,e){return e?t.slice().reverse():t}function Gy(t){Tr.call(this,null,t)}Object(et.y)(qy,Tr).transform=function(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if(n===mp)return mp+"-"+cp;(function(t){const e=t.type;return jp(e)&&e!==pp&&e!==gp&&(t.scheme||t.range&&t.range.length&&t.range.every(et.H))})(t)&&(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0,r=2===e?mp+"-":3===e?vp+"-":"");return(r+n||cp).toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=Km(i)()),t)if(!Uy[i]){if("padding"===i&&Py(r.type))continue;Object(et.D)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==Op&&t!==wp&&Object(et.n)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===wp?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*sp(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i,o=e.schemeExtent;Object(et.A)(e.scheme)?i=iy(e.scheme,e.interpolate,e.interpolateGamma):(r=e.scheme.toLowerCase(),(i=fy(r))||Object(et.n)(`Unrecognized scheme name: ${e.scheme}`));return n=t===xp?n+1:t===Ep?n-1:t===yp||t===bp?+e.schemeCount||By:n,kp(t)?Hy(i,o,e.reverse):Object(et.D)(i)?oy(Hy(i,o),n):t===_p?i:i.slice(0,n)}(r,e,n),Object(et.D)(o))){if(t.interpolator)return t.interpolator(o);Object(et.n)(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&kp(r))return t.interpolator(iy(Yy(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(sy(e.interpolate,e.interpolateGamma)):Object(et.D)(t.round)?t.round(i):Object(et.D)(t.rangeRound)&&t.interpolate(i?um:sm);o&&t.range(Yy(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!Object(et.A)(r)){let e=t.domain(),n=e[0],i=Object(et.T)(e),o=null==r.start?n:r.start,a=null==r.stop?i:r.stop,s=r.step;s||Object(et.n)("Scale bins parameter missing step property."),o<n&&(o=s*Math.ceil(n/s)),a>i&&(a=s*Math.floor(i/s)),r=Qo(o,a+s/2,s)}r?t.bins=r:t.bins&&delete t.bins;t.type===Ep&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){var r=function(t,e,n){return e?(t.domain(Wy(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,s=t.type,u=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===cp||e===fp||e===dp)}(t);if(!a)return 0;Py(s)&&e.padding&&a[0]!==Object(et.T)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(Object(et.T)(n)-n[0]),s=a/(a-2*r),u=t===lp?Object(et.lb)(e,null,s):t===dp?Object(et.mb)(e,null,s,.5):t===fp?Object(et.mb)(e,null,s,i||1):t===hp?Object(et.nb)(e,null,s,o||1):Object(et.kb)(e,null,s);return(e=e.slice())[0]=u[0],e[e.length-1]=u[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));(u||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid&&(((o=e.domainMid)<a[0]||o>a[i])&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(i,0,o)));t.domain(Wy(s,a,n)),s===_p&&t.unknown(e.domainImplicit?Ip:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&dy(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)},Object(et.y)(Gy,Tr).transform=function(t,e){var n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(ht(t.sort)),this.modified(n),e};var Vy=["y0","y1"];function Xy(t){Tr.call(this,null,t)}function Jy(t,e,n,r,i){for(var o,a=(e-t.sum)/2,s=t.length,u=0;u<s;++u)(o=t[u])[r]=a,o[i]=a+=Math.abs(n(o))}function Zy(t,e,n,r,i){for(var o,a=1/t.sum,s=0,u=t.length,c=0,l=0;c<u;++c)(o=t[c])[r]=s,o[i]=s=a*(l+=Math.abs(n(o)))}function Qy(t,e,n,r,i){for(var o,a,s=0,u=0,c=t.length,l=0;l<c;++l)(o=+n(a=t[l]))<0?(a[r]=u,a[i]=u+=o):(a[r]=s,a[i]=s+=o)}function Ky(){}Xy.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:Vy}]},Object(et.y)(Xy,Tr).transform=function(t,e){var n,r,i,o,a=t.as||Vy,s=a[0],u=a[1],c=ht(t.sort),l=t.field||et.N,f="center"===t.offset?Jy:"normalize"===t.offset?Zy:Qy;for(n=function(t,e,n,r){var i,o,a,s,u,c,l,f,d,h=[],p=function(t){return t(u)};if(null==e)h.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)u=t[o],c=e.map(p),(l=i[c])||(i[c]=l=[],h.push(l)),l.push(u);for(c=0,d=0,s=h.length;c<s;++c){for(l=h[c],o=0,f=0,a=l.length;o<a;++o)f+=Math.abs(r(l[o]));l.sum=f,f>d&&(d=f),n&&l.sort(n)}return h.max=d,h}(e.source,t.groupby,c,l),r=0,i=n.length,o=n.max;r<i;++r)f(n[r],o,l,s,u);return e.reflow(t.modified()).modifies(a)};const tb=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];var eb=function(){var t=1,e=1,n=a;function r(t,e){return e.map(e=>i(t,e))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,c,l,f,d=new Array,h=new Array;a=s=-1,c=n[0]>=r,tb[c<<1].forEach(p);for(;++a<t-1;)u=c,c=n[a+1]>=r,tb[u|c<<1].forEach(p);tb[c<<0].forEach(p);for(;++s<e-1;){for(a=-1,c=n[s*t+t]>=r,l=n[s*t]>=r,tb[c<<1|l<<2].forEach(p);++a<t-1;)u=c,c=n[s*t+t+a+1]>=r,f=l,l=n[s*t+a+1]>=r,tb[u|c<<1|l<<2|f<<3].forEach(p);tb[c|l<<3].forEach(p)}a=-1,l=n[s*t]>=r,tb[l<<2].forEach(p);for(;++a<t-1;)f=l,l=n[s*t+a+1]>=r,tb[l<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],c=o(r),l=o(u);(e=h[c])?(n=d[l])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(u),i(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(u),h[e.end=l]=e):(e=d[l])?(n=h[c])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(u),i(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(r),d[e.start=c]=e):d[c]=h[l]={start:c,end:l,ring:[r,u]}}tb[l<<3].forEach(p)}(r,i,(function(t){n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==nb((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((function(n){var o,a=n[0],s=n[1],u=0|a,c=0|s,l=r[c*t+u];a>0&&a<t&&u===a&&(o=r[c*t+u-1],n[0]=a+(i-o)/(l-o)-.5),s>0&&s<e&&c===s&&(o=r[(c-1)*t+u],n[1]=s+(i-o)/(l-o)-.5)}))}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.ceil(n[0]),o=Math.ceil(n[1]);return i>0&&o>0||Object(et.n)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:Ky,r):n===a},r};function nb(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=rb(t,e[r]))return n;return 0}function rb(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],c=u[0],l=u[1],f=t[s],d=f[0],h=f[1];if(ib(u,f,e))return 0;l>r!=h>r&&n<(d-c)*(r-l)/(h-l)+c&&(i=-i)}return i}function ib(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}var ob=function(t,e,n){return function(r){var i=Object(et.p)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=e?ps(o,a,t):s/(t+1);return Qo(u,a,u)}};function ab(t){Tr.call(this,null,t)}function sb(t,e){const n=t.x1||0,r=t.y1||0,i=null!=e?e:t.scale||1;function o(t){t.forEach(a)}function a(t){t.forEach(s)}function s(t){t[0]=(t[0]-n)*i,t[1]=(t[1]-r)*i}return function(t){return t.coordinates.forEach(o),t}}function ub(t,e,n){const r=t>=0?t:ni(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function cb(t){return Object(et.D)(t)?t:Object(et.l)(+t)}ab.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Object(et.y)(ab,Tr).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||et.x,o=eb().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=ob(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map(t=>Xr(e(t).values)))}(r,i,t),s=null===t.as?null:t.as||"contour",u=[];return r.forEach(e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,Object(et.A)(a)?a:a(n.values));if(t.scale||n.x1||n.y1||n.scale){var c=t.scale;r.forEach(sb(n,Object(et.D)(c)?c(e,t):c))}r.forEach(t=>{u.push(ft(e,ct(null!=s?{[s]:t}:t)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n};var lb=function(){var t=t=>t[0],e=t=>t[1],n=et.N,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const c=ub(r[0],s,t)>>a,l=ub(r[1],s,e)>>a,f=c?c+2:0,d=l?l+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let v=g;s.forEach(r=>{const i=f+(+t(r)>>a),o=d+(+e(r)>>a);i>=0&&i<h&&o>=0&&o<p&&(g[i+o*h]+=+n(r))}),c>0&&l>0?(fb(h,p,g,m,c),db(h,p,m,g,l),fb(h,p,g,m,c),db(h,p,m,g,l),fb(h,p,g,m,c),db(h,p,m,g,l)):c>0?(fb(h,p,g,m,c),fb(h,p,m,g,c),fb(h,p,g,m,c),v=m):l>0&&(db(h,p,g,m,l),db(h,p,m,g,l),db(h,p,g,m,l),v=m);let y=u?Math.pow(2,-2*a):1/Ly(v);for(let t=0,e=h*p;t<e;++t)v[t]*=y;return{values:v,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(i>>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=cb(e),s):t},s.y=function(t){return arguments.length?(e=cb(t),s):e},s.weight=function(t){return arguments.length?(n=cb(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);return e>=0||e>=0||Object(et.n)("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||Object(et.n)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=Object(et.i)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&Object(et.n)("invalid bandwidth"),r=t,s):r},s};function fb(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+i;++e)e<t&&(s+=n[e+a*t]),e>=i&&(e>=o&&(s-=n[e-o+a*t]),r[e-i+a*t]=s/Math.min(e+1,t-1+o-e,o))}function db(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<t;++a)for(let s=0,u=0;s<e+i;++s)s<e&&(u+=n[a+s*t]),s>=i&&(s>=o&&(u-=n[a+(s-o)*t]),r[a+(s-i)*t]=u/Math.min(s+1,e-1+o-s,o))}function hb(t){Tr.call(this,null,t)}hb.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};var pb=Object(et.y)(hb,Tr);const gb=["x","y","weight","size","cellSize","bandwidth"];function mb(t,e){return gb.forEach(n=>null!=e[n]?t[n](e[n]):0),t}function vb(t){Tr.call(this,null,t)}pb.transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,s,u=[],c=t=>t(o);if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],a=e.map(c),(s=n[a])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(et.h),a=mb(lb(),t),s=t.as||"grid";return n=i.map(e=>ct(function(t,e){for(let n=0;n<o.length;++n)t[o[n]]=e[n];return t}({[s]:a(e,t.counts)},e.dims))),this.value&&(r.rem=this.value),this.value=r.source=r.add=n,r},vb.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},Object(et.y)(vb,Tr).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=eb().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||ob(t.count||10,t.nice,!!a),u=t.size;return a||(a=e.materialize(e.SOURCE).source,r=sb(n=mb(lb(),t)(a,!0)),u=[n.width,n.height],a=n.values),s=Object(et.A)(s)?s:s(a),a=o.size(u)(a,s),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(ct),i};var yb="Feature",bb="FeatureCollection";function xb(t){Tr.call(this,null,t)}xb.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},Object(et.y)(xb,Tr).transform=function(t,e){var n,r=this._features,i=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],u=t.geojson||!o&&et.x,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(Object(et.g)(u))||a&&e.modified(Object(et.g)(a))||s&&e.modified(Object(et.g)(s)),this.value&&!n||(c=e.SOURCE,this._features=r=[],this._points=i=[]),u&&e.visit(c,(function(t){r.push(u(t))})),a&&s&&(e.visit(c,(function(t){var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])})),r=r.concat({type:yb,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:bb,features:r}};var _b=function(t){return t};function wb(t,e){t&&Eb.hasOwnProperty(t.type)&&Eb[t.type](t,e)}var Ob={Feature:function(t,e){wb(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)wb(n[r].geometry,e)}},Eb={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ab(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ab(n[r],e,0)},Polygon:function(t,e){kb(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)kb(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)wb(n[r],e)}};function Ab(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function kb(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Ab(t[n],e,1);e.polygonEnd()}var Sb=function(t,e){t&&Ob.hasOwnProperty(t.type)?Ob[t.type](t,e):wb(t,e)},jb=function(){return new Db};function Db(){this.reset()}Db.prototype={constructor:Db,reset:function(){this.s=this.t=0},add:function(t){Mb(Cb,t,this.t),Mb(this,Cb.s,this.s),this.s?this.t+=Cb.t:this.s=Cb.t},valueOf:function(){return this.s}};var Cb=new Db;function Mb(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var Fb=1e-6,Nb=Math.PI,Tb=Nb/2,Rb=Nb/4,zb=2*Nb,$b=180/Nb,Lb=Nb/180,Ib=Math.abs,Bb=Math.atan,Pb=Math.atan2,Ub=Math.cos,qb=Math.ceil,Wb=Math.exp,Hb=(Math.floor,Math.log),Yb=Math.pow,Gb=Math.sin,Vb=Math.sign||function(t){return t>0?1:t<0?-1:0},Xb=Math.sqrt,Jb=Math.tan;function Zb(t){return t>1?0:t<-1?Nb:Math.acos(t)}function Qb(t){return t>1?Tb:t<-1?-Tb:Math.asin(t)}function Kb(){}var tx,ex,nx,rx,ix=jb(),ox=jb(),ax={point:Kb,lineStart:Kb,lineEnd:Kb,polygonStart:function(){ax.lineStart=sx,ax.lineEnd=lx},polygonEnd:function(){ax.lineStart=ax.lineEnd=ax.point=Kb,ix.add(Ib(ox)),ox.reset()},result:function(){var t=ix/2;return ix.reset(),t}};function sx(){ax.point=ux}function ux(t,e){ax.point=cx,tx=nx=t,ex=rx=e}function cx(t,e){ox.add(rx*t-nx*e),nx=t,rx=e}function lx(){cx(tx,ex)}var fx=ax,dx=1/0,hx=dx,px=-dx,gx=px;var mx,vx,yx,bx,xx={point:function(t,e){t<dx&&(dx=t);t>px&&(px=t);e<hx&&(hx=e);e>gx&&(gx=e)},lineStart:Kb,lineEnd:Kb,polygonStart:Kb,polygonEnd:Kb,result:function(){var t=[[dx,hx],[px,gx]];return px=gx=-(hx=dx=1/0),t}},_x=0,wx=0,Ox=0,Ex=0,Ax=0,kx=0,Sx=0,jx=0,Dx=0,Cx={point:Mx,lineStart:Fx,lineEnd:Rx,polygonStart:function(){Cx.lineStart=zx,Cx.lineEnd=$x},polygonEnd:function(){Cx.point=Mx,Cx.lineStart=Fx,Cx.lineEnd=Rx},result:function(){var t=Dx?[Sx/Dx,jx/Dx]:kx?[Ex/kx,Ax/kx]:Ox?[_x/Ox,wx/Ox]:[NaN,NaN];return _x=wx=Ox=Ex=Ax=kx=Sx=jx=Dx=0,t}};function Mx(t,e){_x+=t,wx+=e,++Ox}function Fx(){Cx.point=Nx}function Nx(t,e){Cx.point=Tx,Mx(yx=t,bx=e)}function Tx(t,e){var n=t-yx,r=e-bx,i=Xb(n*n+r*r);Ex+=i*(yx+t)/2,Ax+=i*(bx+e)/2,kx+=i,Mx(yx=t,bx=e)}function Rx(){Cx.point=Mx}function zx(){Cx.point=Lx}function $x(){Ix(mx,vx)}function Lx(t,e){Cx.point=Ix,Mx(mx=yx=t,vx=bx=e)}function Ix(t,e){var n=t-yx,r=e-bx,i=Xb(n*n+r*r);Ex+=i*(yx+t)/2,Ax+=i*(bx+e)/2,kx+=i,Sx+=(i=bx*t-yx*e)*(yx+t),jx+=i*(bx+e),Dx+=3*i,Mx(yx=t,bx=e)}var Bx=Cx;function Px(t){this._context=t}Px.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,zb)}},result:Kb};var Ux,qx,Wx,Hx,Yx,Gx=jb(),Vx={point:Kb,lineStart:function(){Vx.point=Xx},lineEnd:function(){Ux&&Jx(qx,Wx),Vx.point=Kb},polygonStart:function(){Ux=!0},polygonEnd:function(){Ux=null},result:function(){var t=+Gx;return Gx.reset(),t}};function Xx(t,e){Vx.point=Jx,qx=Hx=t,Wx=Yx=e}function Jx(t,e){Hx-=t,Yx-=e,Gx.add(Xb(Hx*Hx+Yx*Yx)),Hx=t,Yx=e}var Zx=Vx;function Qx(){this._string=[]}function Kx(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Qx.prototype={_radius:4.5,_circle:Kx(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Kx(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var t_=function(t,e){var n,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Sb(t,n(r))),r.result()}return o.area=function(t){return Sb(t,n(fx)),fx.result()},o.measure=function(t){return Sb(t,n(Zx)),Zx.result()},o.bounds=function(t){return Sb(t,n(xx)),xx.result()},o.centroid=function(t){return Sb(t,n(Bx)),Bx.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,_b):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Qx):new Px(e=t),"function"!=typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)},e_=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Kb,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},n_=function(t,e){return Ib(t[0]-e[0])<Fb&&Ib(t[1]-e[1])<Fb};function r_(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var i_=function(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(n_(r,a)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else s.push(n=new r_(r,t,null,!0)),u.push(n.o=new r_(r,null,n,!1)),s.push(n=new r_(a,t,null,!1)),u.push(n.o=new r_(a,null,n,!0))}})),s.length){for(u.sort(e),o_(s),o_(u),o=0,a=u.length;o<a;++o)u[o].e=n=!n;for(var c,l,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=c.length;o<a;++o)i.point((l=c[o])[0],l[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(c=d.p.z,o=c.length-1;o>=0;--o)i.point((l=c[o])[0],l[1]);else r(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function o_(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function a_(t){return[Pb(t[1],t[0]),Qb(t[2])]}function s_(t){var e=t[0],n=t[1],r=Ub(n);return[r*Ub(e),r*Gb(e),Gb(n)]}function u_(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function c_(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function l_(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function f_(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function d_(t){var e=Xb(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var h_=jb();function p_(t){return Ib(t[0])<=Nb?t[0]:Vb(t[0])*((Ib(t[0])+Nb)%zb-Nb)}var g_=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var m_,v_;1===(m_=g_).length&&(v_=m_,m_=function(t,e){return g_(v_(t),e)});var y_=Array.prototype,b_=(y_.slice,y_.map,function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o});Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var x_=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var __=function(t,e,n,r){return function(i){var o,a,s,u=e(i),c=e_(),l=e(c),f=!1,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,a=x_(a);var t=function(t,e){var n=p_(e),r=e[1],i=Gb(r),o=[Gb(n),-Ub(n),0],a=0,s=0;h_.reset(),1===i?r=Tb+Fb:-1===i&&(r=-Tb-Fb);for(var u=0,c=t.length;u<c;++u)if(f=(l=t[u]).length)for(var l,f,d=l[f-1],h=p_(d),p=d[1]/2+Rb,g=Gb(p),m=Ub(p),v=0;v<f;++v,h=b,g=_,m=w,d=y){var y=l[v],b=p_(y),x=y[1]/2+Rb,_=Gb(x),w=Ub(x),O=b-h,E=O>=0?1:-1,A=E*O,k=A>Nb,S=g*_;if(h_.add(Pb(S*E*Gb(A),m*w+S*Ub(A))),a+=k?O+E*zb:O,k^h>=n^b>=n){var j=c_(s_(d),s_(y));d_(j);var D=c_(o,j);d_(D);var C=(k^O>=0?-1:1)*Qb(D[2]);(r>C||r===C&&(j[0]||j[1]))&&(s+=k^O>=0?1:-1)}}return(a<-Fb||a<Fb&&h_<-Fb)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),i_(a,O_,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function g(){d.point=p,u.lineStart()}function m(){d.point=h,u.lineEnd()}function v(t,e){s.push([t,e]),l.point(t,e)}function y(){l.lineStart(),s=[]}function b(){v(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,u=l.clean(),d=c.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&u){if((e=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else h>1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(w_))}return d}};function w_(t){return t.length>1}function O_(t,e){return((t=t.x)[0]<0?t[1]-Tb-Fb:Tb-t[1])-((e=e.x)[0]<0?e[1]-Tb-Fb:Tb-e[1])}var E_=__((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Nb:-Nb,u=Ib(o-n);Ib(u-Nb)<Fb?(t.point(n,r=(r+a)/2>0?Tb:-Tb),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=Nb&&(Ib(n-i)<Fb&&(n-=i*Fb),Ib(o-s)<Fb&&(o-=s*Fb),r=function(t,e,n,r){var i,o,a=Gb(t-n);return Ib(a)>Fb?Bb((Gb(e)*(o=Ub(r))*Gb(n)-Gb(r)*(i=Ub(e))*Gb(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Tb,r.point(-Nb,i),r.point(0,i),r.point(Nb,i),r.point(Nb,0),r.point(Nb,-i),r.point(0,-i),r.point(-Nb,-i),r.point(-Nb,0),r.point(-Nb,i);else if(Ib(t[0]-e[0])>Fb){var o=t[0]<e[0]?Nb:-Nb;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-Nb,-Tb]);var A_=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function k_(t,e){return[Ib(t)>Nb?t+Math.round(-t/zb)*zb:t,e]}function S_(t,e,n){return(t%=zb)?e||n?A_(D_(t),C_(e,n)):D_(t):e||n?C_(e,n):k_}function j_(t){return function(e,n){return[(e+=t)>Nb?e-zb:e<-Nb?e+zb:e,n]}}function D_(t){var e=j_(t);return e.invert=j_(-t),e}function C_(t,e){var n=Ub(t),r=Gb(t),i=Ub(e),o=Gb(e);function a(t,e){var a=Ub(e),s=Ub(t)*a,u=Gb(t)*a,c=Gb(e),l=c*n+s*r;return[Pb(u*i-l*o,s*n-c*r),Qb(l*i+u*o)]}return a.invert=function(t,e){var a=Ub(e),s=Ub(t)*a,u=Gb(t)*a,c=Gb(e),l=c*i-u*o;return[Pb(u*i+c*o,s*n+l*r),Qb(l*n-s*r)]},a}k_.invert=k_;var M_=function(t){function e(e){return(e=t(e[0]*Lb,e[1]*Lb))[0]*=$b,e[1]*=$b,e}return t=S_(t[0]*Lb,t[1]*Lb,t.length>2?t[2]*Lb:0),e.invert=function(e){return(e=t.invert(e[0]*Lb,e[1]*Lb))[0]*=$b,e[1]*=$b,e},e};function F_(t,e,n,r,i,o){if(n){var a=Ub(e),s=Gb(e),u=r*n;null==i?(i=e+r*zb,o=e-u/2):(i=N_(a,i),o=N_(a,o),(r>0?i<o:i>o)&&(i+=r*zb));for(var c,l=i;r>0?l>o:l<o;l-=u)c=a_([a,-s*Ub(l),-s*Gb(l)]),t.point(c[0],c[1])}}function N_(t,e){(e=s_(e))[0]-=t,d_(e);var n=Zb(-e[1]);return((-e[2]<0?-n:n)+zb-Fb)%zb}var T_=function(t){var e=Ub(t),n=6*Lb,r=e>0,i=Ib(e)>Fb;function o(t,n){return Ub(t)*Ub(n)>e}function a(t,n,r){var i=[1,0,0],o=c_(s_(t),s_(n)),a=u_(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=c_(i,o),d=f_(i,c);l_(d,f_(o,l));var h=f,p=u_(d,h),g=u_(h,h),m=p*p-g*(u_(d,d)-1);if(!(m<0)){var v=Xb(m),y=f_(h,(-p-v)/g);if(l_(y,d),y=a_(y),!r)return y;var b,x=t[0],_=n[0],w=t[1],O=n[1];_<x&&(b=x,x=_,_=b);var E=_-x,A=Ib(E-Nb)<Fb;if(!A&&O<w&&(b=w,w=O,O=b),A||E<Fb?A?w+O>0^y[1]<(Ib(y[0]-x)<Fb?w:O):w<=y[1]&&y[1]<=O:E>Nb^(x<=y[0]&&y[0]<=_)){var k=f_(h,(-p+v)/g);return l_(k,d),[y,a_(k)]}}}function s(e,n){var i=r?t:Nb-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return __(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?Nb:-Nb),d):0;if(!e&&(c=u=g)&&t.lineStart(),g!==u&&(!(h=a(e,p))||n_(e,h)||n_(p,h))&&(p[0]+=Fb,p[1]+=Fb,g=o(p[0],p[1])),g!==u)l=0,g?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(i&&e&&r^g){var v;m&n||!(v=a(p,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&n_(e,p)||t.point(p[0],p[1]),e=p,u=g,n=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){F_(o,t,n,i,e,r)}),r?[0,-t]:[-Nb,t-Nb])},R_=function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,d=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<l&&(l=a)}else if(f>0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<l&&(l=a)}if(a=r-u,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<l&&(l=a)}else if(d>0){if(a>l)return;a>c&&(c=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>l)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<l&&(l=a)}return c>0&&(t[0]=s+c*f,t[1]=u+c*d),l<1&&(e[0]=s+l*f,e[1]=u+l*d),!0}}}}},z_=1e9,$_=-z_;function L_(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return Ib(r[0]-t)<Fb?i>0?0:3:Ib(r[0]-n)<Fb?i>0?2:1:Ib(r[1]-e)<Fb?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,c,l,f,d,h,p,g,m,v,y,b=a,x=e_(),_={point:w,lineStart:function(){_.point=O,c&&c.push(l=[]);v=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(O(f,d),h&&m&&x.rejoin(),u.push(x.result()));_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],c=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,a,s=c[n],u=1,l=s.length,f=s[0],d=f[0],h=f[1];u<l;++u)o=d,a=h,f=s[u],d=f[0],h=f[1],a<=r?h>r&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,i=(u=x_(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&i_(u,s,e,o,a),a.polygonEnd());b=a,u=c=l=null}};function w(t,e){i(t,e)&&b.point(t,e)}function O(o,a){var s=i(o,a);if(c&&l.push([o,a]),v)f=o,d=a,h=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max($_,Math.min(z_,p)),g=Math.max($_,Math.min(z_,g))],x=[o=Math.max($_,Math.min(z_,o)),a=Math.max($_,Math.min(z_,a))];R_(u,x,t,e,n,r)?(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1):s&&(b.lineStart(),b.point(o,a),y=!1)}p=o,g=a,m=s}return _}}function I_(t){return function(e){var n=new B_;for(var r in t)n[r]=t[r];return n.stream=e,n}}function B_(){}function P_(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Sb(n,t.stream(xx)),e(xx.result()),null!=r&&t.clipExtent(r),t}function U_(t,e,n){return P_(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function q_(t,e,n){return U_(t,[[0,0],e],n)}function W_(t,e,n){return P_(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function H_(t,e,n){return P_(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}B_.prototype={constructor:B_,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Y_=16,G_=Ub(30*Lb),V_=function(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,d,h,p,g,m){var v=c-r,y=l-i,b=v*v+y*y;if(b>4*e&&g--){var x=a+d,_=s+h,w=u+p,O=Xb(x*x+_*_+w*w),E=Qb(w/=O),A=Ib(Ib(w)-1)<Fb||Ib(o-f)<Fb?(o+f)/2:Pb(_,x),k=t(A,E),S=k[0],j=k[1],D=S-r,C=j-i,M=y*D-v*C;(M*M/b>e||Ib((v*D+y*C)/b-.5)>.3||a*d+s*h+u*p<G_)&&(n(r,i,o,a,s,u,S,j,A,x/=O,_/=O,w,g,m),m.point(S,j),n(S,j,A,x,_,w,c,l,f,d,h,p,g,m))}}return function(e){var r,i,o,a,s,u,c,l,f,d,h,p,g={point:m,lineStart:v,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){l=NaN,g.point=y,e.lineStart()}function y(r,i){var o=s_([r,i]),a=t(r,i);n(l,f,c,d,h,p,l=a[0],f=a[1],c=r,d=o[0],h=o[1],p=o[2],Y_,e),e.point(l,f)}function b(){g.point=m,e.lineEnd()}function x(){v(),g.point=_,g.lineEnd=w}function _(t,e){y(r=t,e),i=l,o=f,a=d,s=h,u=p,g.point=y}function w(){n(l,f,c,d,h,p,i,o,r,a,s,u,Y_,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return I_({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var X_=I_({point:function(t,e){this.stream.point(t*Lb,e*Lb)}});function J_(t,e,n){function r(r,i){return[e+t*r,n-t*i]}return r.invert=function(r,i){return[(r-e)/t,(n-i)/t]},r}function Z_(t,e,n,r){var i=Ub(r),o=Gb(r),a=i*t,s=o*t,u=i/t,c=o/t,l=(o*n-i*e)/t,f=(o*e+i*n)/t;function d(t,r){return[a*t-s*r+e,n-s*t-a*r]}return d.invert=function(t,e){return[u*t-c*e+l,f-c*t-u*e]},d}function Q_(t){return K_((function(){return t}))()}function K_(t){var e,n,r,i,o,a,s,u,c,l,f=150,d=480,h=250,p=0,g=0,m=0,v=0,y=0,b=0,x=null,_=E_,w=null,O=_b,E=.5;function A(t){return u(t[0]*Lb,t[1]*Lb)}function k(t){return(t=u.invert(t[0],t[1]))&&[t[0]*$b,t[1]*$b]}function S(){var t=Z_(f,0,0,b).apply(null,e(p,g)),r=(b?Z_:J_)(f,d-t[0],h-t[1],b);return n=S_(m,v,y),s=A_(e,r),u=A_(n,s),a=V_(s,E),j()}function j(){return c=l=null,A}return A.stream=function(t){return c&&l===t?c:c=X_(function(t){return I_({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(O(l=t)))))},A.preclip=function(t){return arguments.length?(_=t,x=void 0,j()):_},A.postclip=function(t){return arguments.length?(O=t,w=r=i=o=null,j()):O},A.clipAngle=function(t){return arguments.length?(_=+t?T_(x=t*Lb):(x=null,E_),j()):x*$b},A.clipExtent=function(t){return arguments.length?(O=null==t?(w=r=i=o=null,_b):L_(w=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),j()):null==w?null:[[w,r],[i,o]]},A.scale=function(t){return arguments.length?(f=+t,S()):f},A.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],S()):[d,h]},A.center=function(t){return arguments.length?(p=t[0]%360*Lb,g=t[1]%360*Lb,S()):[p*$b,g*$b]},A.rotate=function(t){return arguments.length?(m=t[0]%360*Lb,v=t[1]%360*Lb,y=t.length>2?t[2]%360*Lb:0,S()):[m*$b,v*$b,y*$b]},A.angle=function(t){return arguments.length?(b=t%360*Lb,S()):b*$b},A.precision=function(t){return arguments.length?(a=V_(s,E=t*t),j()):Xb(E)},A.fitExtent=function(t,e){return U_(A,t,e)},A.fitSize=function(t,e){return q_(A,t,e)},A.fitWidth=function(t,e){return W_(A,t,e)},A.fitHeight=function(t,e){return H_(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&k,S()}}function tw(t){var e=0,n=Nb/3,r=K_(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Lb,n=t[1]*Lb):[e*$b,n*$b]},i}function ew(t,e){var n=Gb(t),r=(n+Gb(e))/2;if(Ib(r)<Fb)return function(t){var e=Ub(t);function n(t,n){return[t*e,Gb(n)/e]}return n.invert=function(t,n){return[t/e,Qb(n*e)]},n}(t);var i=1+n*(2*r-n),o=Xb(i)/r;function a(t,e){var n=Xb(i-2*r*Gb(e))/r;return[n*Gb(t*=r),o-n*Ub(t)]}return a.invert=function(t,e){var n=o-e;return[Pb(t,Ib(n))/r*Vb(n),Qb((i-(t*t+n*n)*r*r)/(2*r))]},a}var nw=function(){return tw(ew).scale(155.424).center([0,33.6442])},rw=function(){return nw().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function iw(t){return function(e,n){var r=Ub(e),i=Ub(n),o=t(r*i);return[o*i*Gb(e),o*Gb(n)]}}function ow(t){return function(e,n){var r=Xb(e*e+n*n),i=t(r),o=Gb(i),a=Ub(i);return[Pb(e*o,r*a),Qb(r&&n*o/r)]}}var aw=iw((function(t){return Xb(2/(1+t))}));aw.invert=ow((function(t){return 2*Qb(t/2)}));var sw=iw((function(t){return(t=Zb(t))&&t/Gb(t)}));sw.invert=ow((function(t){return t}));function uw(t,e){return[t,Hb(Jb((Tb+e)/2))]}uw.invert=function(t,e){return[t,2*Bb(Wb(e))-Tb]};function cw(t){var e,n,r,i=Q_(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,c=null;function l(){var o=Nb*a(),s=i(M_(i.rotate()).invert([0,0]));return u(null==c?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===uw?[[Math.max(s[0]-o,c),e],[Math.min(s[0]+o,n),r]]:[[c,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),l()):a()},i.translate=function(t){return arguments.length?(s(t),l()):s()},i.center=function(t){return arguments.length?(o(t),l()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=n=r=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),l()):null==c?null:[[c,e],[n,r]]},l()}function lw(t){return Jb((Tb+t)/2)}function fw(t,e){var n=Ub(t),r=t===e?Gb(t):Hb(n/Ub(e))/Hb(lw(e)/lw(t)),i=n*Yb(lw(t),r)/r;if(!r)return uw;function o(t,e){i>0?e<-Tb+Fb&&(e=-Tb+Fb):e>Tb-Fb&&(e=Tb-Fb);var n=i/Yb(lw(e),r);return[n*Gb(r*t),i-n*Ub(r*t)]}return o.invert=function(t,e){var n=i-e,o=Vb(r)*Xb(t*t+n*n);return[Pb(t,Ib(n))/r*Vb(n),2*Bb(Yb(i/o,1/r))-Tb]},o}function dw(t,e){return[t,e]}dw.invert=dw;function hw(t,e){var n=Ub(t),r=t===e?Gb(t):(n-Ub(e))/(e-t),i=n/r+t;if(Ib(r)<Fb)return dw;function o(t,e){var n=i-e,o=r*t;return[n*Gb(o),i-n*Ub(o)]}return o.invert=function(t,e){var n=i-e;return[Pb(t,Ib(n))/r*Vb(n),i-Vb(r)*Xb(t*t+n*n)]},o}var pw=1.340264,gw=-.081106,mw=893e-6,vw=.003796,yw=Xb(3)/2;function bw(t,e){var n=Qb(yw*Gb(e)),r=n*n,i=r*r*r;return[t*Ub(n)/(yw*(pw+3*gw*r+i*(7*mw+9*vw*r))),n*(pw+gw*r+i*(mw+vw*r))]}bw.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(pw+gw*i+o*(mw+vw*i))-e)/(pw+3*gw*i+o*(7*mw+9*vw*i)))*r)*i*i,!(Ib(n)<1e-12));++a);return[yw*t*(pw+3*gw*i+o*(7*mw+9*vw*i))/Ub(r),Qb(Gb(r)/yw)]};function xw(t,e){var n=Ub(e),r=Ub(t)*n;return[n*Gb(t)/r,Gb(e)/r]}xw.invert=ow(Bb);function _w(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?_b:I_({point:function(i,o){this.stream.point(i*t+n,o*e+r)}})}function ww(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}ww.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Ib(n)>Fb&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function Ow(t,e){return[Ub(e)*Gb(t),Gb(e)]}Ow.invert=ow(Qb);function Ew(t,e){var n=Ub(e),r=1+Ub(t)*n;return[n*Gb(t)/r,Gb(e)/r]}Ew.invert=ow((function(t){return 2*Bb(t)}));function Aw(t,e){return[Hb(Jb((Tb+e)/2)),-t]}Aw.invert=function(t,e){return[-e,2*Bb(Wb(t))-Tb]};var kw=t_(),Sw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function jw(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(Cw[t]=function(t,e){return function n(){var r=e();return r.type=t,r.path=t_().projection(r),r.copy=r.copy||function(){var t=n();return Sw.forEach((function(e){r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},r}}(t,e),this):Cw[t]||null}function Dw(t){return t&&t.path||kw}var Cw={albers:rw,albersusa:function(){var t,e,n,r,i,o,a=rw(),s=nw().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=nw().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){o=[t,e]}};function l(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,l}return l.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},l.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),u.precision(t),f()):a.precision()},l.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),u.scale(t),l.translate(a.translate())):a.scale()},l.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],l=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,l-.238*e],[o+.455*e,l+.238*e]]).stream(c),r=s.translate([o-.307*e,l+.201*e]).clipExtent([[o-.425*e+Fb,l+.12*e+Fb],[o-.214*e-Fb,l+.234*e-Fb]]).stream(c),i=u.translate([o-.205*e,l+.212*e]).clipExtent([[o-.214*e+Fb,l+.166*e+Fb],[o-.115*e-Fb,l+.234*e-Fb]]).stream(c),f()},l.fitExtent=function(t,e){return U_(l,t,e)},l.fitSize=function(t,e){return q_(l,t,e)},l.fitWidth=function(t,e){return W_(l,t,e)},l.fitHeight=function(t,e){return H_(l,t,e)},l.scale(1070)},azimuthalequalarea:function(){return Q_(aw).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return Q_(sw).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return tw(fw).scale(109.5).parallels([30,30])},conicequalarea:nw,conicequidistant:function(){return tw(hw).scale(131.154).center([0,13.9389])},equalEarth:function(){return Q_(bw).scale(177.158)},equirectangular:function(){return Q_(dw).scale(152.63)},gnomonic:function(){return Q_(xw).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a=1,s=0,u=0,c=1,l=1,f=_b,d=null,h=_b;function p(){return r=i=null,o}return o={stream:function(t){return r&&i===t?r:r=f(h(i=t))},postclip:function(r){return arguments.length?(h=r,d=t=e=n=null,p()):h},clipExtent:function(r){return arguments.length?(h=null==r?(d=t=e=n=null,_b):L_(d=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==d?null:[[d,t],[e,n]]},scale:function(t){return arguments.length?(f=_w((a=+t)*c,a*l,s,u),p()):a},translate:function(t){return arguments.length?(f=_w(a*c,a*l,s=+t[0],u=+t[1]),p()):[s,u]},reflectX:function(t){return arguments.length?(f=_w(a*(c=t?-1:1),a*l,s,u),p()):c<0},reflectY:function(t){return arguments.length?(f=_w(a*c,a*(l=t?-1:1),s,u),p()):l<0},fitExtent:function(t,e){return U_(o,t,e)},fitSize:function(t,e){return q_(o,t,e)},fitWidth:function(t,e){return W_(o,t,e)},fitHeight:function(t,e){return H_(o,t,e)}}},mercator:function(){return cw(uw).scale(961/zb)},naturalEarth1:function(){return Q_(ww).scale(175.295)},orthographic:function(){return Q_(Ow).scale(249.5).clipAngle(90+Fb)},stereographic:function(){return Q_(Ew).scale(250).clipAngle(142)},transversemercator:function(){var t=cw(Aw),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(var Mw in Cw)jw(Mw,Cw[Mw]);function Fw(t){Tr.call(this,null,t)}function Nw(t){Tr.call(this,null,t)}function Tw(t){Tr.call(this,null,t)}function Rw(t,e,n){var r=b_(t,e-Fb,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function zw(t,e,n){var r=b_(t,e-Fb,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function $w(){var t,e,n,r,i,o,a,s,u,c,l,f,d=10,h=d,p=90,g=360,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return b_(qb(r/p)*p,n,p).map(l).concat(b_(qb(s/g)*g,a,g).map(f)).concat(b_(qb(e/d)*d,t,d).filter((function(t){return Ib(t%p)>Fb})).map(u)).concat(b_(qb(o/h)*h,i,h).filter((function(t){return Ib(t%g)>Fb})).map(c))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(m)):[[r,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),v.precision(m)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],v):[d,h]},v.precision=function(d){return arguments.length?(m=+d,u=Rw(o,i,90),c=zw(e,t,m),l=Rw(s,a,90),f=zw(r,n,m),v):m},v.extentMajor([[-180,-90+Fb],[180,90-Fb]]).extentMinor([[-180,-80-Fb],[180,80+Fb]])}function Lw(t){Tr.call(this,[],t),this.generator=$w()}function Iw(t){Tr.call(this,null,t)}function Bw(t){if(!Object(et.D)(t))return!1;const e=Object(et.cb)(Object(et.g)(t));return e.$x||e.$y||e.$value||e.$max}function Pw(t){Tr.call(this,null,t),this.modified(!0)}function Uw(t,e,n){Object(et.D)(t[e])&&t[e](n)}Fw.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(et.y)(Fw,Tr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||et.x,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=Dw(t.projection),n.materialize().reflow()):a=i===et.x||e.modified(i.fields)?n.ADD_MOD:n.ADD;var s=function(t,e){var n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,(function(t){t[o]=r(i(t))})),r.pointRadius(s),n.modifies(o)},Nw.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(et.y)(Nw,Tr).transform=function(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],u=a[1];function c(t){var e=r([i(t),o(t)]);e?(t[s]=e[0],t[u]=e[1]):(t[s]=void 0,t[u]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,c)),e.modifies(a)},Tw.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(et.y)(Tw,Tr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){var r=null==n?function(n){return t(e(n))}:function(r){var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=function(e){return t.context(e),r},r}(Dw(t.projection),t.field||Object(et.t)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(function(t){t[i]=r})),n.modifies(i)},Lw.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(et.y)(Lw,Tr).transform=function(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(var o in t)Object(et.D)(i[o])&&i[o](t[o]);return n=i(),r.length?e.mod.push(dt(r[0],n)):e.add.push(ct(n)),r[0]=n,e},Iw.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(et.y)(Iw,Tr).transform=function(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||et.x,o=function(t,e){let n;Object(et.D)(t)?(n=n=>t(n,e)).dep=Bw(t):t?n=Object(et.l)(t):(n=t=>t.$value/t.$max||0).dep=!0;return n}(t.opacity,t),a=function(t,e){let n;Object(et.D)(t)?(n=n=>Dg(t(n,e))).dep=Bw(t):n=Object(et.l)(Dg(t||"#888"));return n}(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:r?Xr(n.map(t=>Xr(i(t).values))):0};return n.forEach(t=>{const e=i(t),n=Object(et.o)({},t,u);r||(n.$max=Xr(e.values||[])),t[s]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,s=t.y1||0,u=t.x2||i,c=t.y2||o,l=t.values,f=l?t=>l[t]:et.jb,d=Mu(u-a,c-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,c-s),g=p.data;for(let t=s,o=0;t<c;++t){e.$y=t-s;for(let s=a,c=t*i;s<u;++s,o+=4){e.$x=s-a,e.$value=f(s+c);const t=n(e);g[o+0]=t.r,g[o+1]=t.g,g[o+2]=t.b,g[o+3]=~~(255*r(e))}}return h.putImageData(p,0,0),d}(e,n,a.dep?a:Object(et.l)(a(n)),o.dep?o:Object(et.l)(o(n)))}),e.reflow(!0).modifies(s)},Object(et.y)(Pw,Tr).transform=function(t,e){var n=this.value;return!n||t.modified("type")?(this.value=n=function(t){var e=jw((t||"mercator").toLowerCase());e||Object(et.n)("Unrecognized projection type: "+t);return e()}(t.type),Sw.forEach((function(e){null!=t[e]&&Uw(n,e,t[e])}))):Sw.forEach((function(e){t.modified(e)&&Uw(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){var n=function(t){return 1===(t=Object(et.i)(t)).length?t[0]:{type:bb,features:t.reduce((t,e)=>t.concat(function(t){return t.type===bb?t.features:Object(et.i)(t).filter(t=>null!=t).map(t=>t.type===yb?t:{type:yb,geometry:t})}(e)),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)};function qw(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,f,d,h=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(o=(g+v)/2))?g=o:v=o,(l=n>=(a=(m+y)/2))?m=a:y=a,i=h,!(h=h[f=l<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,h.data),u=+t._y.call(null,h.data),e===s&&n===u)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+v)/2))?g=o:v=o,(l=n>=(a=(m+y)/2))?m=a:y=a}while((f=l<<1|c)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,t}var Ww=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function Hw(t){return t[0]}function Yw(t){return t[1]}function Gw(t,e,n){var r=new Vw(null==e?Hw:e,null==n?Yw:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Vw(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Xw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Jw=Gw.prototype=Vw.prototype;Jw.copy=function(){var t,e,n=new Vw(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Xw(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Xw(e));return n},Jw.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return qw(this.cover(e,n),e,n,t)},Jw.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>l&&(l=r),i<c&&(c=i),i>f&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;n<o;++n)qw(this,a[n],s[n],t[n]);return this},Jw.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},Jw.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Jw.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Jw.find=function(t,e,n){var r,i,o,a,s,u,c,l=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new Ww(g,l,f,d,h)),null==n?n=1/0:(l=t-n,f=e-n,d=t+n,h=e+n,n*=n);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>d||(o=u.y0)>h||(a=u.x1)<l||(s=u.y1)<f))if(g.length){var m=(i+a)/2,v=(o+s)/2;p.push(new Ww(g[3],m,v,a,s),new Ww(g[2],i,v,m,s),new Ww(g[1],m,o,a,v),new Ww(g[0],i,o,m,v)),(c=(e>=v)<<1|t>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var _=Math.sqrt(n=x);l=t-_,f=e-_,d=t+_,h=e+_,r=g.data}}return r},Jw.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,f,d,h=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!h)return this;if(h.length)for(;;){if((c=o>=(s=(p+m)/2))?p=s:m=s,(l=a>=(u=(g+v)/2))?g=u:v=u,e=h,!(h=h[f=l<<1|c]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},Jw.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Jw.root=function(){return this._root},Jw.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Jw.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new Ww(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,l=(i+a)/2;(n=u[3])&&s.push(new Ww(n,c,l,o,a)),(n=u[2])&&s.push(new Ww(n,r,l,c,a)),(n=u[1])&&s.push(new Ww(n,c,i,o,l)),(n=u[0])&&s.push(new Ww(n,r,i,c,l))}return this},Jw.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Ww(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,f=(s+c)/2;(o=i[0])&&n.push(new Ww(o,a,s,l,f)),(o=i[1])&&n.push(new Ww(o,l,s,u,f)),(o=i[2])&&n.push(new Ww(o,a,f,l,c)),(o=i[3])&&n.push(new Ww(o,l,f,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Jw.x=function(t){return arguments.length?(this._x=t,this):this._x},Jw.y=function(t){return arguments.length?(this._y=t,this):this._y};var Zw=function(t){return function(){return t}},Qw=function(){return 1e-6*(Math.random()-.5)};function Kw(t){return t.x+t.vx}function tO(t){return t.y+t.vy}function eO(t){return t.index}function nO(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}var rO={value:function(){}};function iO(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new oO(r)}function oO(t){this._=t}function aO(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function sO(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function uO(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=rO,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}oO.prototype=iO.prototype={constructor:oO,on:function(t,e){var n,r=this._,i=aO(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=uO(r[n],t.name,e);else if(null==e)for(n in r)r[n]=uO(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=sO(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new oO(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var cO,lO,fO=iO,dO=0,hO=0,pO=0,gO=1e3,mO=0,vO=0,yO=0,bO="object"==typeof performance&&performance.now?performance:Date,xO="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function _O(){return vO||(xO(wO),vO=bO.now()+yO)}function wO(){vO=0}function OO(){this._call=this._time=this._next=null}function EO(t,e,n){var r=new OO;return r.restart(t,e,n),r}function AO(){vO=(mO=bO.now())+yO,dO=hO=0;try{!function(){_O(),++dO;for(var t,e=cO;e;)(t=vO-e._time)>=0&&e._call.call(null,t),e=e._next;--dO}()}finally{dO=0,function(){var t,e,n=cO,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:cO=e);lO=t,SO(r)}(),vO=0}}function kO(){var t=bO.now(),e=t-mO;e>gO&&(yO-=e,mO=t)}function SO(t){dO||(hO&&(hO=clearTimeout(hO)),t-vO>24?(t<1/0&&(hO=setTimeout(AO,t-bO.now()-yO)),pO&&(pO=clearInterval(pO))):(pO||(mO=bO.now(),pO=setInterval(kO,gO)),dO=1,xO(AO)))}function jO(t){return t.x}function DO(t){return t.y}OO.prototype=EO.prototype={constructor:OO,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?_O():+n)+(null==e?0:+e),this._next||lO===this||(lO?lO._next=this:cO=this,lO=this),this._call=t,this._time=n,SO()},stop:function(){this._call&&(this._call=null,this._time=1/0,SO())}};var CO=10,MO=Math.PI*(3-Math.sqrt(5)),FO=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=EO(l),c=fO("tick","end");function l(){f(),c.call("tick",e),n<r&&(u.stop(),c.call("end",e))}function f(r){var u,c,l=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<l;++u)null==(c=t[u]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=CO*Math.sqrt(n),o=n*MO;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function h(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),d(),e={tick:f,restart:function(){return u.restart(l),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(h),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,h(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c<l;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}},NO={center:function(t,e){var n;function r(){var r,i,o=n.length,a=0,s=0;for(r=0;r<o;++r)a+=(i=n[r]).x,s+=i.y;for(a=a/o-t,s=s/o-e,r=0;r<o;++r)(i=n[r]).x-=a,i.y-=s}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},collide:function(t){var e,n,r=1,i=1;function o(){for(var t,o,s,u,c,l,f,d=e.length,h=0;h<i;++h)for(o=Gw(e,Kw,tO).visitAfter(a),t=0;t<d;++t)s=e[t],l=n[s.index],f=l*l,u=s.x+s.vx,c=s.y+s.vy,o.visit(p);function p(t,e,n,i,o){var a=t.data,d=t.r,h=l+d;if(!a)return e>u+h||i<u-h||n>c+h||o<c-h;if(a.index>s.index){var p=u-a.x-a.vx,g=c-a.y-a.vy,m=p*p+g*g;m<h*h&&(0===p&&(m+=(p=Qw())*p),0===g&&(m+=(g=Qw())*g),m=(h-(m=Math.sqrt(m)))/m*r,s.vx+=(p*=m)*(h=(d*=d)/(f+d)),s.vy+=(g*=m)*h,a.vx-=p*(h=1-h),a.vy-=g*h)}}}function a(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Zw(null==t?1:+t)),o.initialize=function(t){e=t,s()},o.iterations=function(t){return arguments.length?(i=+t,o):i},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:Zw(+e),s(),o):t},o},nbody:function(){var t,e,n,r,i=Zw(-30),o=1,a=1/0,s=.81;function u(r){var i,o=t.length,a=Gw(t,jO,DO).visitAfter(l);for(n=r,i=0;i<o;++i)e=t[i],a.visit(f)}function c(){if(t){var e,n,o=t.length;for(r=new Array(o),e=0;e<o;++e)n=t[e],r[n.index]=+i(n,e,t)}}function l(t){var e,n,i,o,a,s=0,u=0;if(t.length){for(i=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,i+=n*e.x,o+=n*e.y);t.x=i/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=r[e.data.index]}while(e=e.next)}t.value=s}function f(t,i,u,c){if(!t.value)return!0;var l=t.x-e.x,f=t.y-e.y,d=c-i,h=l*l+f*f;if(d*d/s<h)return h<a&&(0===l&&(h+=(l=Qw())*l),0===f&&(h+=(f=Qw())*f),h<o&&(h=Math.sqrt(o*h)),e.vx+=l*t.value*n/h,e.vy+=f*t.value*n/h),!0;if(!(t.length||h>=a)){(t.data!==e||t.next)&&(0===l&&(h+=(l=Qw())*l),0===f&&(h+=(f=Qw())*f),h<o&&(h=Math.sqrt(o*h)));do{t.data!==e&&(d=r[t.data.index]*n/h,e.vx+=l*d,e.vy+=f*d)}while(t=t.next)}}return u.initialize=function(e){t=e,c()},u.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zw(+t),c(),u):i},u.distanceMin=function(t){return arguments.length?(o=t*t,u):Math.sqrt(o)},u.distanceMax=function(t){return arguments.length?(a=t*t,u):Math.sqrt(a)},u.theta=function(t){return arguments.length?(s=t*t,u):Math.sqrt(s)},u},link:function(t){var e,n,r,i,o,a=eO,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},u=Zw(30),c=1;function l(r){for(var i=0,a=t.length;i<c;++i)for(var s,u,l,f,d,h,p,g=0;g<a;++g)u=(s=t[g]).source,f=(l=s.target).x+l.vx-u.x-u.vx||Qw(),d=l.y+l.vy-u.y-u.vy||Qw(),f*=h=((h=Math.sqrt(f*f+d*d))-n[g])/h*r*e[g],d*=h,l.vx-=f*(p=o[g]),l.vy-=d*p,u.vx+=f*(p=1-p),u.vy+=d*p}function f(){if(r){var s,u,c=r.length,l=t.length,f=new Map(r.map((t,e)=>[a(t,e,r),t]));for(s=0,i=new Array(c);s<l;++s)(u=t[s]).index=s,"object"!=typeof u.source&&(u.source=nO(f,u.source)),"object"!=typeof u.target&&(u.target=nO(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(s=0,o=new Array(l);s<l;++s)u=t[s],o[s]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(l),d(),n=new Array(l),h()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function h(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+u(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t){r=t,f()},l.links=function(e){return arguments.length?(t=e,f(),l):t},l.id=function(t){return arguments.length?(a=t,l):a},l.iterations=function(t){return arguments.length?(c=+t,l):c},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:Zw(+t),d(),l):s},l.distance=function(t){return arguments.length?(u="function"==typeof t?t:Zw(+t),h(),l):u},l},x:function(t){var e,n,r,i=Zw(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Zw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zw(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:Zw(+e),a(),o):t},o},y:function(t){var e,n,r,i=Zw(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Zw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zw(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:Zw(+e),a(),o):t},o}},TO="forces",RO=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],zO=["static","iterations"],$O=["x","y","vx","vy"];function LO(t){Tr.call(this,null,t)}LO.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:$O}]};var IO=Object(et.y)(LO,Tr);function BO(t,e,n,r){var i,o,a,s,u=Object(et.i)(e.forces);for(i=0,o=RO.length;i<o;++i)(a=RO[i])!==TO&&e.modified(a)&&t[a](e[a]);for(i=0,o=u.length;i<o;++i)s=TO+i,(a=n||e.modified(TO,i)?UO(u[i]):r&&PO(u[i],r)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;i<o;++i)t.force(TO+i,null);return t.numForces=u.length,t}function PO(t,e){var n,r;for(n in t)if(Object(et.D)(r=t[n])&&e.modified(Object(et.g)(r)))return 1;return 0}function UO(t){var e,n;for(n in Object(et.v)(NO,t.force)||Object(et.n)("Unrecognized force: "+t.force),e=NO[t.force](),t)Object(et.D)(e[n])&&qO(e[n],t[n],t);return e}function qO(t,e,n){t(Object(et.D)(e)?function(t){return e(t,n)}:e)}IO.transform=function(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(RO),s=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&BO(i,t,0,e)):(this.value=i=function(t,e){var n=FO(t),r=!1,i=n.stop,o=n.restart;return n.stopped=function(){return r},n.restart=function(){return r=!1,o()},n.stop=function(){return r=!0,i()},BO(n,e,!0).on("end",(function(){r=!0}))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,function(){n.touch(r).run()})),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(zO)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),t.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},IO.finish=function(t,e){for(var n,r=e.dataflow,i=this._argops,o=0,a=i.length;o<a;++o)if((n=i[o]).name===TO&&"link"===n.op._argval.force)for(var s,u=n.op._argops,c=0,l=u.length;c<l;++c)if("links"===u[c].name&&(s=u[c].op.source)){r.pulse(s,r.changeset().reflow());break}return e.reflow(t.modified()).modifies($O)};var WO=function(t,e,n){var r={};return t.each((function(t){var i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t};function HO(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function YO(t,e){var n,r,i,o,a,s=new JO(t),u=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=GO);n=c.pop();)if(u&&(n.value=+n.data.value),(i=e(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)c.push(r=n.children[o]=new JO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(XO)}function GO(t){return t.children}function VO(t){t.data=t.data.data}function XO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function JO(t){this.data=t,this.depth=this.height=0,this.parent=null}function ZO(t){Tr.call(this,null,t)}function QO(t){return t.values}function KO(){var t,e=[];return t={entries:t=>(function t(n,r){if(++r>e.length)return n;var i,o=[];for(i in n)o.push({key:i,values:t(n[i],r)});return o})(function t(n,r){if(r>=e.length)return n;for(var i,o,a,s=-1,u=n.length,c=e[r++],l={},f={};++s<u;)(a=l[i=c(o=n[s])+""])?a.push(o):l[i]=[o];for(i in l)f[i]=t(l[i],r);return f}(t,0),0),key:n=>(e.push(n),t)}}function tE(t){Tr.call(this,null,t)}function eE(t,e){return t.parent===e.parent?1:2}JO.prototype=YO.prototype={constructor:JO,count:function(){return this.eachAfter(HO)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(t){for(var e,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return YO(this).eachBefore(VO)}},ZO.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},Object(et.y)(ZO,Tr).transform=function(t,e){e.source||Object(et.n)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(t=>{t.children&&at(t.data)&&i.rem.push(t.data)}),this.value=o=YO({values:Object(et.i)(t.keys).reduce((t,e)=>(t.key(e),t),KO()).entries(i.source)},QO),n&&o.each(t=>{t.children&&(t=ct(t.data),i.add.push(t),i.source.push(t))}),WO(o,st,st)),i.source.root=o,i},Object(et.y)(tE,Tr).transform=function(t,e){e.source&&e.source.root||Object(et.n)(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(ht(t.sort,t=>t.data)),function(t,e,n){for(var r,i=0,o=e.length;i<o;++i)(r=e[i])in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?eE:et.N);try{this.value=n(i)}catch(t){Object(et.n)(t)}return i.each((function(t){!function(t,e,n){for(var r=t.data,i=0,o=e.length-1;i<o;++i)r[n[i]]=t[e[i]];r[n[o]]=t.children?t.children.length:0}(t,r,o)})),e.reflow(t.modified()).modifies(o).modifies("leaf")};var nE=Array.prototype.slice;var rE=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(nE.call(t))).length,o=[];r<i;)e=t[r],n&&aE(n,e)?++r:(n=uE(o=iE(o,e)),r=0);return n};function iE(t,e){var n,r;if(sE(e,t))return[e];for(n=0;n<t.length;++n)if(oE(e,t[n])&&sE(cE(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(oE(cE(t[n],t[r]),e)&&oE(cE(t[n],e),t[r])&&oE(cE(t[r],e),t[n])&&sE(lE(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function oE(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function aE(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function sE(t,e){for(var n=0;n<e.length;++n)if(!aE(t,e[n]))return!1;return!0}function uE(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return cE(t[0],t[1]);case 3:return lE(t[0],t[1],t[2])}var e}function cE(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,c=a-r,l=s-i,f=Math.sqrt(u*u+c*c);return{x:(n+o+u/f*l)/2,y:(r+a+c/f*l)/2,r:(f+i+s)/2}}function lE(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,c=n.x,l=n.y,f=n.r,d=r-a,h=r-c,p=i-s,g=i-l,m=u-o,v=f-o,y=r*r+i*i-o*o,b=y-a*a-s*s+u*u,x=y-c*c-l*l+f*f,_=h*p-d*g,w=(p*x-g*b)/(2*_)-r,O=(g*m-p*v)/_,E=(h*b-d*x)/(2*_)-i,A=(d*v-h*m)/_,k=O*O+A*A-1,S=2*(o+w*O+E*A),j=w*w+E*E-o*o,D=-(k?(S+Math.sqrt(S*S-4*k*j))/(2*k):j/S);return{x:r+w+O*D,y:i+E+A*D,r:D}}function fE(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function dE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function hE(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function pE(t){this._=t,this.next=null,this.previous=null}function gE(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,s,u,c,l,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;fE(n,e,r=t[2]),e=new pE(e),n=new pE(n),r=new pE(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(s=3;s<i;++s){fE(e._,n._,r=t[s]),r=new pE(r),u=n.next,c=e.previous,l=n._.r,f=e._.r;do{if(l<=f){if(dE(u._,r._)){n=u,e.next=n,n.previous=e,--s;continue t}l+=u._.r,u=u.next}else{if(dE(c._,r._)){(e=c).next=n,n.previous=e,--s;continue t}f+=c._.r,c=c.previous}}while(u!==c.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,o=hE(e);(r=r.next)!==n;)(a=hE(r))<o&&(e=r,o=a);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=rE(e),s=0;s<i;++s)(e=t[s]).x-=r.x,e.y-=r.y;return r.r}function mE(t){return null==t?null:vE(t)}function vE(t){if("function"!=typeof t)throw new Error;return t}function yE(){return 0}var bE=function(t){return function(){return t}};function xE(t){return Math.sqrt(t.value)}function _E(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function wE(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,s=t(n)*e||0;if(s)for(i=0;i<a;++i)r[i].r+=s;if(o=gE(r),s)for(i=0;i<a;++i)r[i].r-=s;n.r=o+s}}}function OE(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}var EE=["x","y","r","depth","children"];function AE(t){tE.call(this,t)}AE.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:EE.length,default:EE}]};var kE=Object(et.y)(AE,tE);kE.layout=function(){var t=null,e=1,n=1,r=yE;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(_E(t)).eachAfter(wE(r,.5)).eachBefore(OE(1)):i.eachBefore(_E(xE)).eachAfter(wE(yE,1)).eachAfter(wE(r,i.r/Math.min(e,n))).eachBefore(OE(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=mE(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:bE(+t),i):r},i},kE.params=["radius","size","padding"],kE.fields=EE;var SE=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},jE=function(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*c},DE=["x0","y0","x1","y1","depth","children"];function CE(t){tE.call(this,t)}CE.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:DE.length,default:DE}]};var ME=Object(et.y)(CE,tE);ME.layout=function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&jE(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a<i&&(i=a=(i+a)/2),s<o&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(SE),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},ME.params=["size","round","padding"],ME.fields=DE;var FE="$",NE={depth:-1},TE={};function RE(t){return t.id}function zE(t){return t.parentId}var $E=function(){var t=RE,e=zE;function n(n){var r,i,o,a,s,u,c,l=n.length,f=new Array(l),d={};for(i=0;i<l;++i)r=n[i],s=f[i]=new JO(r),null!=(u=t(r,i,n))&&(u+="")&&(d[c=FE+(s.id=u)]=c in d?TE:s);for(i=0;i<l;++i)if(s=f[i],null!=(u=e(n[i],i,n))&&(u+="")){if(!(a=d[FE+u]))throw new Error("missing: "+u);if(a===TE)throw new Error("ambiguous: "+u);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=NE,o.eachBefore((function(t){t.depth=t.parent.depth+1,--l})).eachBefore(XO),o.parent=null,l>0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=vE(e),n):t},n.parentId=function(t){return arguments.length?(e=vE(t),n):e},n};function LE(t){Tr.call(this,null,t)}function IE(t,e){return t.parent===e.parent?1:2}function BE(t){var e=t.children;return e?e[0]:t.t}function PE(t){var e=t.children;return e?e[e.length-1]:t.t}function UE(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function qE(t,e,n){return t.a.parent===e.parent?t.a:n}function WE(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}LE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},Object(et.y)(LE,Tr).transform=function(t,e){e.source||Object(et.n)("Stratify transform requires an upstream data source.");var n=this.value,r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!this.value||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?WO($E().id(t.key).parentId(t.parentKey)(i.source),t.key,et.fb):WO($E()([{}]),t.key,t.key)),i.source.root=this.value=n,i},WE.prototype=Object.create(JO.prototype);function HE(t,e){return t.parent===e.parent?1:2}function YE(t,e){return t+e.x}function GE(t,e){return Math.max(t,e.y)}var VE={tidy:function(){var t=IE,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new WE(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new WE(r[i],i)),n.parent=e;return(a.parent=new WE(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>l.x&&(l=t),t.depth>f.depth&&(f=t)}));var d=c===l?1:t(c,l)/2,h=d-c.x,p=e/(l.x+d+h),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,d=u.m;s=PE(s),o=BE(o),s&&o;)u=BE(u),(a=PE(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(UE(qE(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,d+=u.m,l+=a.m;s&&!PE(a)&&(a.t=s,a.m+=f-l),o&&!BE(u)&&(u.t=o,u.m+=c-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=HE,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(YE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(GE,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},XE=["x","y","depth","children"];function JE(t){tE.call(this,t)}JE.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:XE.length,default:XE}]};var ZE=Object(et.y)(JE,tE);function QE(t){Tr.call(this,[],t)}ZE.layout=function(t){var e=t||"tidy";if(Object(et.v)(VE,e))return VE[e]();Object(et.n)("Unrecognized Tree layout method: "+e)},ZE.params=["size","nodeSize"],ZE.fields=XE,QE.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(et.y)(QE,Tr).transform=function(t,e){var n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||Object(et.n)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(function(t){o[st(t)]=1})),r.each((function(t){var e=t.data,n=t.parent&&t.parent.data;n&&o[st(e)]&&o[st(n)]&&i.add.push(ct({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(function(t){o[st(t)]=1})),n.forEach((function(t){(o[st(t.source)]||o[st(t.target)])&&i.mod.push(t)}))),i};var KE=function(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*c},tA=(1+Math.sqrt(5))/2;function eA(t,e,n,r,i,o){for(var a,s,u,c,l,f,d,h,p,g,m,v=[],y=e.children,b=0,x=0,_=y.length,w=e.value;b<_;){u=i-n,c=o-r;do{l=y[x++].value}while(!l&&x<_);for(f=d=l,m=l*l*(g=Math.max(c/u,u/c)/(w*t)),p=Math.max(d/m,m/f);x<_;++x){if(l+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),m=l*l*g,(h=Math.max(d/m,m/f))>p){l-=s;break}p=h}v.push(a={value:l,dice:u<c,children:y.slice(b,x)}),a.dice?jE(a,n,r,i,w?r+=c*l/w:o):KE(a,n,r,w?n+=u*l/w:i,o),w-=l,b=x}return v}var nA=function t(e){function n(t,n,r,i,o){eA(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(tA),rA=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,d=a.length,h=t.value;++f<d;){for(u=(s=a[f]).children,c=s.value=0,l=u.length;c<l;++c)s.value+=u[c].value;s.dice?jE(s,n,r,i,r+=(o-r)*s.value/h):KE(s,n,r,n+=(i-n)*s.value/h,o),h-=s.value}else t._squarify=a=eA(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(tA),iA={binary:function(t,e,n,r,i){var o,a,s=t.children,u=s.length,c=new Array(u+1);for(c[0]=a=o=0;o<u;++o)c[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var l=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}var f=c[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;c[g]<d?h=g+1:p=g}d-c[h-1]<c[h]-d&&e+1<h&&--h;var m=c[h]-f,v=r-m;if(a-i>u-o){var y=(i*v+a*m)/r;t(e,h,m,i,o,y,u),t(h,n,v,y,o,a,u)}else{var b=(o*v+u*m)/r;t(e,h,m,i,o,a,b),t(h,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)},dice:jE,slice:KE,slicedice:function(t,e,n,r,i){(1&t.depth?KE:jE)(t,e,n,r,i)},squarify:nA,resquarify:rA},oA=["x0","y0","x1","y1","depth","children"];function aA(t){tE.call(this,t)}aA.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:oA.length,default:oA}]};var sA=Object(et.y)(aA,tE);sA.layout=function(){var t=function(){var t=nA,e=!1,n=1,r=1,i=[0],o=yE,a=yE,s=yE,u=yE,c=yE;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(SE),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<l&&(l=d=(l+d)/2),e.x0=r,e.y0=l,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=o(e)/2,r+=c(e)-n,l+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=u(e)-n)<l&&(l=d=(l+d)/2),t(e,r,l,f,d))}return l.round=function(t){return arguments.length?(e=!!t,l):e},l.size=function(t){return arguments.length?(n=+t[0],r=+t[1],l):[n,r]},l.tile=function(e){return arguments.length?(t=vE(e),l):t},l.padding=function(t){return arguments.length?l.paddingInner(t).paddingOuter(t):l.paddingInner()},l.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:bE(+t),l):o},l.paddingOuter=function(t){return arguments.length?l.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):l.paddingTop()},l.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:bE(+t),l):a},l.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:bE(+t),l):s},l.paddingBottom=function(t){return arguments.length?(u="function"==typeof t?t:bE(+t),l):u},l.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:bE(+t),l):c},l}();return t.ratio=function(e){var n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=function(e){Object(et.v)(iA,e)?t.tile(iA[e]):Object(et.n)("Unrecognized Treemap layout method: "+e)},t},sA.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],sA.fields=oA;var uA=function(t,e){var n,r,i,o,a,s,u=[],c=function(t){return t(o)};if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(c)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u};function cA(t){Tr.call(this,null,t)}cA.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(et.y)(cA,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=uA(r,t.groupby),o=(t.groupby||[]).map(et.h),a=o.length,s=t.as||[Object(et.h)(t.x),Object(et.h)(t.y)],u=[];i.forEach(e=>{Pi(e,t.x,t.y,t.bandwidth||.3).forEach(t=>{const n={};for(let t=0;t<a;++t)n[o[t]]=e.dims[t];n[s[0]]=t[0],n[s[1]]=t[1],u.push(ct(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n};const lA={linear:Ti,log:Ri,exp:zi,pow:$i,quad:Li,poly:Ii};function fA(t){Tr.call(this,null,t)}fA.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(lA)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},Object(et.y)(fA,Tr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=uA(r,t.groupby),o=(t.groupby||[]).map(et.h),a=t.method||"linear",s=t.order||3,u=function(t,e){return"poly"===t?e:"quad"===t?2:1}(a,s),c=t.as||[Object(et.h)(t.x),Object(et.h)(t.y)],l=lA[a],f=[];let d=t.extent;Object(et.v)(lA,a)||Object(et.n)("Invalid regression method: "+a),null!=d&&"log"===a&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(n=>{if(n.length<=u)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,t.x,t.y,s);if(t.params)return void f.push(ct({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const i=d||Object(et.p)(n,t.x),h=t=>{const e={};for(let t=0;t<o.length;++t)e[o[t]]=n.dims[t];e[c[0]]=t[0],e[c[1]]=t[1],f.push(ct(e))};"linear"===a?i.forEach(t=>h([t,r.predict(t)])):Hi(r.predict,i,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n};const dA=Math.pow(2,-52),hA=new Uint32Array(512);class pA{static from(t,e=wA,n=OA){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new pA(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,c=-1/0;for(let e=0;e<o;e++){const n=t[2*e],r=t[2*e+1];n<a&&(a=n),r<s&&(s=r),n>u&&(u=n),r>c&&(c=r),this._ids[e]=e}const l=(a+u)/2,f=(s+c)/2;let d,h,p,g=1/0;for(let e=0;e<o;e++){const n=gA(l,f,t[2*e],t[2*e+1]);n<g&&(d=e,g=n)}const m=t[2*d],v=t[2*d+1];g=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=gA(m,v,t[2*e],t[2*e+1]);n<g&&n>0&&(h=e,g=n)}let y=t[2*h],b=t[2*h+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===h)continue;const n=bA(m,v,y,b,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let _=t[2*p],w=t[2*p+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];xA(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vA(m,v,y,b,_,w)){const t=h,e=y,n=b;h=p,y=_,b=w,p=t,_=e,w=n}const O=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,d=.5/(a*c-s*u);return{x:t+(c*l-s*f)*d,y:e+(a*f-u*l)*d}}(m,v,y,b,_,w);this._cx=O.x,this._cy=O.y;for(let e=0;e<o;e++)this._dists[e]=gA(t[2*e],t[2*e+1],O.x,O.y);xA(this._ids,this._dists,0,o-1),this._hullStart=d;let E=3;n[d]=e[p]=h,n[h]=e[d]=p,n[p]=e[h]=d,r[d]=0,r[h]=1,r[p]=2,i.fill(-1),i[this._hashKey(m,v)]=d,i[this._hashKey(y,b)]=h,i[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let o,a,s=0;s<this._ids.length;s++){const u=this._ids[s],c=t[2*u],l=t[2*u+1];if(s>0&&Math.abs(c-o)<=dA&&Math.abs(l-a)<=dA)continue;if(o=c,a=l,u===d||u===h||u===p)continue;let f=0;for(let t=0,e=this._hashKey(c,l);t<this._hashSize&&(-1===(f=i[(e+t)%this._hashSize])||f===n[f]);t++);let g,m=f=e[f];for(;g=n[m],!vA(c,l,t[2*m],t[2*m+1],t[2*g],t[2*g+1]);)if((m=g)===f){m=-1;break}if(-1===m)continue;let v=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(v+2),r[m]=v,E++;let y=n[m];for(;g=n[y],vA(c,l,t[2*y],t[2*y+1],t[2*g],t[2*g+1]);)v=this._addTriangle(y,u,g,r[u],-1,r[y]),r[u]=this._legalize(v+2),n[y]=y,E--,y=g;if(m===f)for(;vA(c,l,t[2*(g=e[m])],t[2*g+1],t[2*m],t[2*m+1]);)v=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(v+2),r[g]=v,n[m]=m,E--,m=g;this._hullStart=e[u]=m,n[m]=e[y]=u,n[u]=y,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(E);for(let t=0,e=this._hullStart;t<E;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=hA[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],d=e[t],h=e[c],p=e[l];if(yA(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const s=u+(a+1)%3;i<hA.length&&(hA[i++]=s)}else{if(0===i)break;t=hA[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function gA(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function mA(t,e,n,r,i,o){const a=(r-e)*(i-t),s=(n-t)*(o-e);return Math.abs(a-s)>=33306690738754716e-32*Math.abs(a+s)?a-s:0}function vA(t,e,n,r,i,o){return(mA(i,o,t,e,n,r)||mA(t,e,n,r,i,o)||mA(n,r,i,o,t,e))<0}function yA(t,e,n,r,i,o,a,s){const u=t-a,c=e-s,l=n-a,f=r-s,d=i-a,h=o-s,p=l*l+f*f,g=d*d+h*h;return u*(f*g-p*h)-c*(l*g-p*d)+(u*u+c*c)*(l*h-f*d)<0}function bA(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,d=.5/(a*c-s*u),h=(c*l-s*f)*d,p=(a*f-u*l)*d;return h*h+p*p}function xA(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;_A(t,n+r>>1,i),e[t[n]]>e[t[r]]&&_A(t,n,r),e[t[i]]>e[t[r]]&&_A(t,i,r),e[t[n]]>e[t[i]]&&_A(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]<s);do{o--}while(e[t[o]]>s);if(o<i)break;_A(t,i,o)}t[n+1]=t[o],t[o]=a,r-i+1>=o-n?(xA(t,e,i,r),xA(t,e,n,o-1)):(xA(t,e,n,o-1),xA(t,e,i,r))}}function _A(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function wA(t){return t[0]}function OA(t){return t[1]}const EA=1e-6;class AA{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>EA||Math.abs(this._y1-i)>EA)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class kA{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class SA{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,o=0,a=0,s=n.length;o<s;o+=3,a+=2){const s=2*n[o],u=2*n[o+1],c=2*n[o+2],l=t[s],f=t[s+1],d=t[u],h=t[u+1],p=t[c],g=t[c+1],m=d-l,v=h-f,y=p-l,b=g-f,x=m*m+v*v,_=y*y+b*b,w=2*(m*b-v*y);if(w)if(Math.abs(w)<1e-8)e=(l+p)/2,r=(f+g)/2;else{const t=1/w;e=l+(b*x-v*_)*t,r=f+(m*_-y*x)*t}else e=(l+p)/2-1e8*b,r=(f+g)/2+1e8*y;i[a]=e,i[a+1]=r}let o,a,s,u=e[e.length-1],c=4*u,l=t[2*u],f=t[2*u+1];r.fill(0);for(let n=0;n<e.length;++n)o=c,a=l,s=f,c=4*(u=e[n]),l=t[2*u],f=t[2*u+1],r[o+2]=r[c]=s-f,r[o+3]=r[c+1]=l-a}render(t){const e=null==t?t=new AA:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),a=2*Math.floor(r/3),s=o[i],u=o[i+1],c=o[a],l=o[a+1];this._renderSegment(s,u,c,l,t)}let s,u=i[i.length-1];for(let e=0;e<i.length;++e){s=u,u=i[e];const n=2*Math.floor(r[u]/3),c=o[n],l=o[n+1],f=4*s,d=this._project(c,l,a[f+2],a[f+3]);d&&this._renderSegment(c,l,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new AA:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new AA:void 0,r=this._clip(t);if(null===r)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(yield t)}}cellPolygon(t){const e=new kA;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let o;const a=this._regioncode(t,e),s=this._regioncode(n,r);0===a&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(e[2*n],e[2*n+1]),i[s=s%3==2?s-2:s+1]!==t)break;s=r[s]}while(s!==o&&-1!==s);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,o,a,s,u=null,c=e[n-2],l=e[n-1],f=this._regioncode(c,l);for(let d=0;d<n;d+=2)if(r=c,i=l,c=e[d],l=e[d+1],o=f,f=this._regioncode(c,l),0===o&&0===f)a=s,s=0,u?u.push(c,l):u=[c,l];else{let e,n,d,h,p;if(0===o){if(null===(e=this._clipSegment(r,i,c,l,o,f)))continue;[n,d,h,p]=e}else{if(null===(e=this._clipSegment(c,l,r,i,f,o)))continue;[h,p,n,d]=e,a=s,s=this._edgecode(n,d),a&&s&&this._edge(t,a,s,u,u.length),u?u.push(n,d):u=[n,d]}a=s,s=this._edgecode(h,p),a&&s&&this._edge(t,a,s,u,u.length),u?u.push(h,p):u=[h,p]}if(u)a=s,s=this._edgecode(u[0],u[1]),a&&s&&this._edge(t,a,s,u,u.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return u}_clipSegment(t,e,n,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;let a,s,u=i||o;8&u?(a=t+(n-t)*(this.ymax-e)/(r-e),s=this.ymax):4&u?(a=t+(n-t)*(this.ymin-e)/(r-e),s=this.ymin):2&u?(s=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=s,i=this._regioncode(t,e)):(n=a,r=s,o=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,r))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],i,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}r[i]===n&&r[i+1]===o||!this.contains(t,n,o)||(r.splice(i,0,n,o),i+=2)}if(r.length>4)for(let t=0;t<r.length;t+=2){const e=(t+2)%r.length,n=(t+4)%r.length;(r[t]===r[e]&&r[e]===r[n]||r[t+1]===r[e+1]&&r[e+1]===r[n+1])&&(r.splice(e,2),t-=2)}return i}_project(t,e,n,r){let i,o,a,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(a=this.ymin,o=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(a=this.ymax,o=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=i)*r)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const jA=2*Math.PI;function DA(t){return t[0]}function CA(t){return t[1]}function MA(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class FA{constructor(t){this._delaunator=new pA(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],o=2*e[t+2];if((n[o]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.sqrt((r[3]-r[1])**2+(r[2]-r[0])**2);for(let t=0,n=e.length/2;t<n;++t){const n=MA(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new pA(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==o[e]||(o[e]=t)}for(let t=0,e=r.length;t<e;++t)a[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new SA(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o}=this;if(this.collinear){const e=this.collinear.indexOf(t);return e>0&&(yield this.collinear[e-1]),void(e<this.collinear.length-1&&(yield this.collinear[e+1]))}const a=e[t];if(-1===a)return;let s=a,u=-1;do{if(yield u=o[s],o[s=s%3==2?s-2:s+1]!==t)return;if(-1===(s=i[s])){const e=n[(r[t]+1)%n.length];return void(e!==u&&(yield e))}}while(s!==a)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=(e-u[2*t])**2+(n-u[2*t+1])**2;const f=r[t];let d=f;do{let r=s[d];const f=(e-u[2*r])**2+(n-u[2*r+1])**2;if(f<l&&(l=f,c=r),s[d=d%3==2?d-2:d+1]!==t)break;if(-1===(d=a[d])){if((d=i[(o[t]+1)%i.length])!==r&&(e-u[2*d])**2+(n-u[2*d+1])**2<l)return d;break}}while(d!==f);return c}render(t){const e=null==t?t=new AA:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,o=r.length;e<o;++e){const o=r[e];if(o<e)continue;const a=2*i[e],s=2*i[o];t.moveTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e=2){const n=null==t?t=new AA:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],o=r[n+1];t.moveTo(i+e,o),t.arc(i,o,e,0,jA)}return n&&n.value()}renderHull(t){const e=null==t?t=new AA:void 0,{hull:n,points:r}=this,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<o;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new kA;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new AA:void 0,{points:r,triangles:i}=this,o=2*i[t*=3],a=2*i[t+1],s=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new kA;return this.renderTriangle(t,e),e.value()}}function NA(t){Tr.call(this,null,t)}FA.from=function(t,e=DA,n=CA,r){return new FA("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){const i=t[a];o[2*a]=e.call(r,i,a,t),o[2*a+1]=n.call(r,i,a,t)}return o}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}(t,e,n,r)))},NA.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const TA=Object(et.y)(NA,Tr),RA=[-1e5,-1e5,1e5,1e5];function zA(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}TA.transform=function(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:RA;const o=this.value=FA.from(r,t.x,t.y).voronoi(i);for(let t=0,e=r.length;t<e;++t){const e=o.cellPolygon(t);r[t][n]=e?zA(e):null}return e.reflow(t.modified()).modifies(n)};var $A=Math.PI/180,LA=64,IA=2048,BA=function(){var t,e,n,r,i,o,a,s=[256,256],u=WA,c=[],l=Math.random,f={};function d(t,e,n){for(var r,i,o,a,c,f=e.x,d=e.y,h=Math.sqrt(s[0]*s[0]+s[1]*s[1]),p=u(s),g=l()<.5?1:-1,m=-g;(r=p(m+=g))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=h));)if(e.x=f+i,e.y=d+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1]||n&&UA(e,t,s[0])||n&&(c=n,!((a=e).x+a.x1>c[0].x&&a.x+a.x0<c[1].x&&a.y+a.y1>c[0].y&&a.y+a.y0<c[1].y)))){for(var v,y=e.sprite,b=e.width>>5,x=s[0]>>5,_=e.x-(b<<4),w=127&_,O=32-w,E=e.y1-e.y0,A=(e.y+e.y0)*x+(_>>5),k=0;k<E;k++){v=0;for(var S=0;S<=b;S++)t[A+S]|=v<<O|(S<b?(v=y[k*b+S])>>>w:0);A+=x}return e.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(LA<<5)/e,t.height=IA/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Mu()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),h=null,p=c.length,g=-1,m=[],v=c.map((function(s){return{text:t(s),font:e(s),style:r(s),weight:i(s),rotate:o(s),size:~~n(s),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}})).sort((function(t,e){return e.size-t.size}));++g<p;){var y=v[g];y.x=s[0]*(l()+.5)>>1,y.y=s[1]*(l()+.5)>>1,PA(u,y,v,g),y.hasText&&d(f,y,h)&&(m.push(y),h?qA(h,y):h=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=s[0]>>1,y.y-=s[1]>>1)}return m},f.words=function(t){return arguments.length?(c=t,f):c},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=HA(t),f):e},f.fontStyle=function(t){return arguments.length?(r=HA(t),f):r},f.fontWeight=function(t){return arguments.length?(i=HA(t),f):i},f.rotate=function(t){return arguments.length?(o=HA(t),f):o},f.text=function(e){return arguments.length?(t=HA(e),f):t},f.spiral=function(t){return arguments.length?(u=YA[t]||t,f):u},f.fontSize=function(t){return arguments.length?(n=HA(t),f):n},f.padding=function(t){return arguments.length?(a=HA(t),f):a},f.random=function(t){return arguments.length?(l=t,f):l},f};function PA(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(LA<<5)/o,IA/o);var a,s,u,c,l,f=0,d=0,h=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,u=e.size<<1,e.rotate){var g=Math.sin(e.rotate*$A),m=Math.cos(e.rotate*$A),v=a*m,y=a*g,b=u*m,x=u*g;a=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,u=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=LA<<5&&(f=0,d+=h,h=0),d+u>=IA)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),e.rotate&&i.rotate(e.rotate*$A),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=u,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=u>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(LA<<5)/o,IA/o).data,w=[];--r>=0;)if((e=n[r]).hasText){for(s=(a=e.width)>>5,u=e.y1-e.y0,c=0;c<u*s;c++)w[c]=0;if(null==(f=e.xoff))return;d=e.yoff;var O=0,E=-1;for(l=0;l<u;l++){for(c=0;c<a;c++){var A=s*l+(c>>5),k=_[(d+l)*(LA<<5)+(f+c)<<2]?1<<31-c%32:0;w[A]|=k,O|=k}O?E=l:(e.y0++,u--,l--,d++)}e.y1=e.y0+E,e.sprite=w.slice(0,(e.y1-e.y0)*s)}}}function UA(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,u=32-s,c=t.y1-t.y0,l=(t.y+t.y0)*n+(a>>5),f=0;f<c;f++){r=0;for(var d=0;d<=o;d++)if((r<<u|(d<o?(r=i[f*o+d])>>>s:0))&e[l+d])return!0;l+=n}return!1}function qA(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function WA(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function HA(t){return"function"==typeof t?t:function(){return t}}var YA={archimedean:WA,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}},GA=["x","y","font","fontSize","fontStyle","fontWeight","angle"],VA=["text","font","rotate","fontSize","fontStyle","fontWeight"];function XA(t){Tr.call(this,BA(),t)}function JA(t){return new Uint8Array(t)}function ZA(t){return new Uint16Array(t)}function QA(t){return new Uint32Array(t)}function KA(t,e,n){var r=(e<257?JA:e<65537?ZA:QA)(t);return n&&r.set(n),r}XA.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:GA}]},Object(et.y)(XA,Tr).transform=function(t,e){!t.size||t.size[0]&&t.size[1]||Object(et.n)("Wordcloud size dimensions must be non-zero.");var n=t.modified();if(n||e.changed(e.ADD_REM)||VA.some((function(n){var r=t[n];return Object(et.D)(r)&&e.modified(r.fields)}))){var r,i=e.materialize(e.SOURCE).source,o=this.value,a=t.as||GA,s=t.fontSize||14;if(Object(et.D)(s)?r=t.fontSizeRange:s=Object(et.l)(s),r){var u=s,c=Km("sqrt")().domain(Object(et.p)(i,u)).range(r);s=function(t){return c(u(t))}}i.forEach((function(t){t[a[0]]=NaN,t[a[1]]=NaN,t[a[3]]=0}));for(var l,f,d=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(ii).layout(),h=o.size(),p=h[0]>>1,g=h[1]>>1,m=0,v=d.length;m<v;++m)(f=(l=d[m]).datum)[a[0]]=l.x+p,f[a[1]]=l.y+g,f[a[2]]=l.font,f[a[3]]=l.size,f[a[4]]=l.style,f[a[5]]=l.weight,f[a[6]]=l.rotate;return e.reflow(n).modifies(a)}};var tk=function(t,e,n){var r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd:function(t,e){var n,i=this.bisect(this.range,t.value),o=t.index,a=i[0],s=i[1],u=o.length;for(n=0;n<a;++n)e[o[n]]|=r;for(n=s;n<u;++n)e[o[n]]|=r;return this}}},ek=function(t,e){return Array.from(e,e=>t[e])};function nk(){var t=QA(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];var a,s,u,c=n,l=i.length,f=Array(l),d=QA(l);for(u=0;u<l;++u)f[u]=r(i[u]),d[u]=u;if(f=function(t,e){return t.sort.call(e,(function(e,n){var r=t[e],i=t[n];return r<i?-1:r>i?1:0})),ek(t,e)}(f,d),c)a=e,s=t,e=Array(c+l),t=QA(c+l),function(t,e,n,r,i,o,a,s,u){var c,l=0,f=0;for(c=0;l<r&&f<a;++c)e[l]<i[f]?(s[c]=e[l],u[c]=n[l++]):(s[c]=i[f],u[c]=o[f++]+t);for(;l<r;++l,++c)s[c]=e[l],u[c]=n[l];for(;f<a;++f,++c)s[c]=i[f],u[c]=o[f]+t}(o,a,s,c,f,d,l,e,t);else{if(o>0)for(u=0;u<l;++u)d[u]+=o;e=f,t=d}return n=c+l,{index:d,value:f}},remove:function(r,i){var o,a,s,u=n;for(a=0;!i[t[a]]&&a<u;++a);for(s=a;a<u;++a)i[o=t[a]]||(t[s]=o,e[s]=e[a],++s);n=u-r},bisect:function(t,r){var i;return r?i=r.length:(r=e,i=n),[Rp(r,t[0],0,i),Tp(r,t[1],0,i)]},reindex:function(e){for(var r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:function(){return t},size:function(){return n}}}function rk(t){var e,n,r,i,o;Tr.call(this,(e=8,n=[],r=QA(0),i=KA(0,e),o=KA(0,e),{data:function(){return n},seen:function(){return t=r,e=n.length,r=t.length>=e?t:((i=i||new t.constructor(e)).set(t),i);var t,e,i},add:function(t){for(var e,r=0,i=n.length,o=t.length;r<o;++r)(e=t[r])._index=i++,n.push(e)},remove:function(t,e){var r,a,s,u=n.length,c=Array(u-t),l=n;for(a=0;!e[a]&&a<u;++a)c[a]=n[a],l[a]=a;for(s=a;a<u;++a)r=n[a],e[a]?l[a]=-1:(l[a]=s,i[s]=i[a],o[s]=o[a],c[s]=r,r._index=s++),i[a]=0;return n=c,l},size:function(){return n.length},curr:function(){return i},prev:function(){return o},reset:function(t){o[t]=i[t]},all:function(){return e<257?255:e<65537?65535:4294967295},set:function(t,e){i[t]|=e},clear:function(t,e){i[t]&=~e},resize:function(t,n){(t>i.length||n>e)&&(e=Math.max(n,e),i=KA(t,e,i),o=KA(t,e))}}),t),this._indices=null,this._dims=null}rk.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};var ik=Object(et.y)(rk,Tr);function ok(t){Tr.call(this,null,t)}ik.transform=function(t,e){return this._dims?t.modified("fields")||t.fields.some((function(t){return e.modified(t.fields)}))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},ik.init=function(t,e){for(var n,r,i=t.fields,o=t.query,a=this._indices={},s=this._dims=[],u=o.length,c=0;c<u;++c)r=a[n=i[c].fname]||(a[n]=nk()),s.push(tk(r,c,o[c]));return this.eval(t,e)},ik.reinit=function(t,e){var n,r,i,o,a,s,u,c,l,f=e.materialize().fork(),d=t.fields,h=t.query,p=this._indices,g=this._dims,m=this.value,v=m.curr(),y=m.prev(),b=m.all(),x=f.rem=f.add,_=f.mod,w=h.length,O={};if(y.set(v),e.rem.length&&(a=this.remove(t,e,f)),e.add.length&&m.add(e.add),e.mod.length)for(s={},u=0,c=(o=e.mod).length;u<c;++u)s[o[u]._index]=1;for(u=0;u<w;++u)l=d[u],(!g[u]||t.modified("fields",u)||e.modified(l.fields))&&((n=O[i=l.fname])||(p[i]=r=nk(),O[i]=n=r.insert(l,e.source,0)),g[u]=tk(r,u,h[u]).onAdd(n,v));for(u=0,c=m.data().length;u<c;++u)a[u]||(y[u]!==v[u]?x.push(u):s[u]&&v[u]!==b&&_.push(u));return m.mask=(1<<w)-1,f},ik.eval=function(t,e){var n=e.materialize().fork(),r=this._dims.length,i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},ik.insert=function(t,e,n){var r,i,o,a=e.add,s=this.value,u=this._dims,c=this._indices,l=t.fields,f={},d=n.add,h=s.size(),p=h+a.length,g=u.length;s.resize(p,g),s.add(a);var m=s.curr(),v=s.prev(),y=s.all();for(r=0;r<g;++r)o=f[i=l[r].fname]||(f[i]=c[i].insert(l[r],a,h)),u[r].onAdd(o,m);for(;h<p;++h)v[h]=y,m[h]!==y&&d.push(h)},ik.modify=function(t,e){var n,r,i,o=e.mod,a=this.value,s=a.curr(),u=a.all(),c=t.mod;for(n=0,r=c.length;n<r;++n)s[i=c[n]._index]!==u&&o.push(i)},ik.remove=function(t,e,n){var r,i,o,a,s=this._indices,u=this.value,c=u.curr(),l=u.prev(),f=u.all(),d={},h=n.rem,p=e.rem;for(r=0,i=p.length;r<i;++r)d[o=p[r]._index]=1,l[o]=a=c[o],c[o]=f,a!==f&&h.push(o);for(o in s)s[o].remove(i,d);return this.reindex(e,i,d),d},ik.reindex=function(t,e,n){var r=this._indices,i=this.value;t.runAfter((function(){var t=i.remove(e,n);for(var o in r)r[o].reindex(t)}))},ik.update=function(t,e,n){var r,i,o=this._dims,a=t.query,s=e.stamp,u=o.length,c=0;for(n.filters=0,i=0;i<u;++i)t.modified("query",i)&&(r=i,++c);if(1===c)c=o[r].one,this.incrementOne(o[r],a[r],n.add,n.rem);else for(i=0,c=0;i<u;++i)t.modified("query",i)&&(c|=o[i].one,this.incrementAll(o[i],a[i],s,n.add),n.rem=n.add);return c},ik.incrementAll=function(t,e,n,r){var i,o,a,s=this.value,u=s.seen(),c=s.curr(),l=s.prev(),f=t.index(),d=t.bisect(t.range),h=t.bisect(e),p=h[0],g=h[1],m=d[0],v=d[1],y=t.one;if(p<m)for(i=p,o=Math.min(m,g);i<o;++i)u[a=f[i]]!==n&&(l[a]=c[a],u[a]=n,r.push(a)),c[a]^=y;else if(p>m)for(i=m,o=Math.min(p,v);i<o;++i)u[a=f[i]]!==n&&(l[a]=c[a],u[a]=n,r.push(a)),c[a]^=y;if(g>v)for(i=Math.max(p,v),o=g;i<o;++i)u[a=f[i]]!==n&&(l[a]=c[a],u[a]=n,r.push(a)),c[a]^=y;else if(g<v)for(i=Math.max(m,g),o=v;i<o;++i)u[a=f[i]]!==n&&(l[a]=c[a],u[a]=n,r.push(a)),c[a]^=y;t.range=e.slice()},ik.incrementOne=function(t,e,n,r){var i,o,a,s=this.value.curr(),u=t.index(),c=t.bisect(t.range),l=t.bisect(e),f=l[0],d=l[1],h=c[0],p=c[1],g=t.one;if(f<h)for(i=f,o=Math.min(h,d);i<o;++i)s[a=u[i]]^=g,n.push(a);else if(f>h)for(i=h,o=Math.min(f,p);i<o;++i)s[a=u[i]]^=g,r.push(a);if(d>p)for(i=Math.max(f,p),o=d;i<o;++i)s[a=u[i]]^=g,n.push(a);else if(d<p)for(i=Math.max(h,d),o=p;i<o;++i)s[a=u[i]]^=g,r.push(a);t.range=e.slice()},ok.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},Object(et.y)(ok,Tr).transform=function(t,e){var n=~(t.ignore||0),r=t.filter,i=r.mask;if(0==(i&n))return e.StopPropagation;var o=e.fork(e.ALL),a=r.data(),s=r.curr(),u=r.prev(),c=function(t){return s[t]&n?null:a[t]};return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,(function(t){var e=s[t]&n;return!e&&e^u[t]&n?a[t]:null})),o.filter(o.REM,(function(t){var e=s[t]&n;return e&&!(e^e^u[t]&n)?a[t]:null}))):(o.filter(o.ADD,c),o.filter(o.REM,(function(t){return(s[t]&n)===i?a[t]:null}))),o.filter(o.SOURCE,(function(t){return c(t._index)}))};var ak=n(16),sk=function(t){var e=t._signals.cursor;e||(t._signals.cursor=e=t.add({user:"default",item:null})),t.on(t.events("view","mousemove"),e,(function(t,n){var r=e.value,i=r?Object(et.H)(r)?r:r.user:"default",o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(t){var e=t.cursor,n=this.value;return Object(et.H)(e)||(n=e.item,e=e.user),function(t){"undefined"!=typeof document&&document.body&&(document.body.style.cursor=t)}(e&&"default"!==e?e:n||e),n}),{cursor:e})};function uk(t,e){var n=t._runtime.data;return Object(et.v)(n,e)||Object(et.n)("Unrecognized data set: "+e),n[e]}function ck(t,e){pt(e)||Object(et.n)("Second argument to changes must be a changeset.");var n=uk(this,t);return n.modified=!0,this.pulse(n.input,e)}function lk(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function fk(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function dk(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}var hk=function(t,e,n){var r,i,o,a=t._renderer,s=a&&a.canvas();return s&&(o=dk(t),i=e.changedTouches?e.changedTouches[0]:e,(r=_d(i,s))[0]-=o[0],r[1]-=o[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){var r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;Object(et.H)(t)&&(t=i(t));for(var e=n.slice();t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Object(et.l)(t),item:Object(et.l)(e||{}),group:i,xy:o,x:function(t){return o(t)[0]},y:function(t){return o(t)[1]}}}(t,n,r),e};const pk="view",gk="timer",mk="window",vk={trap:!1};function yk(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||Object(et.F)(r)&&!r[n])||(t.warn(`Blocked ${e} ${n} event listener.`),!1)}function bk(t){return t.item}function xk(t){return t.item.mark.source}function _k(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}var wk=function(t,e,n){var r=document.createElement(t);for(var i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r},Ok="vega-bind",Ek="vega-bind-name",Ak="vega-bind-radio",kk="vega-option-",Sk=function(t,e,n){if(e){var r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:function(e){e!==t.signal(r.signal)&&t.runAsync(null,(function(){i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=Object(et.m)(r.debounce,i.update))),function(t,e,n,r){var i=wk("div",{class:Ok});i.appendChild(wk("span",{class:Ek},n.name||n.signal)),e.appendChild(i);var o=jk;switch(n.input){case"checkbox":o=Dk;break;case"select":o=Ck;break;case"radio":o=Mk;break;case"range":o=Fk}o(t,i,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,(function(){i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0),i}};function jk(t,e,n,r){var i=wk("input");for(var o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(function(){t.update(i.value)})),t.elements=[i],t.set=function(t){i.value=t}}function Dk(t,e,n,r){var i={type:"checkbox",name:n.signal};r&&(i.checked=!0);var o=wk("input",i);e.appendChild(o),o.addEventListener("change",(function(){t.update(o.checked)})),t.elements=[o],t.set=function(t){o.checked=!!t||null}}function Ck(t,e,n,r){var i=wk("select",{name:n.signal});n.options.forEach((function(t){var e={value:t};Nk(t,r)&&(e.selected=!0),i.appendChild(wk("option",e,t+""))})),e.appendChild(i),i.addEventListener("change",(function(){t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=function(t){for(var e=0,r=n.options.length;e<r;++e)if(Nk(n.options[e],t))return void(i.selectedIndex=e)}}function Mk(t,e,n,r){var i=wk("span",{class:Ak});e.appendChild(i),t.elements=n.options.map((function(e){var o=kk+n.signal+"-"+e,a={id:o,type:"radio",name:n.signal,value:e};Nk(e,r)&&(a.checked=!0);var s=wk("input",a);return s.addEventListener("change",(function(){t.update(e)})),i.appendChild(s),i.appendChild(wk("label",{for:o},e+"")),s})),t.set=function(e){for(var n=t.elements,r=0,i=n.length;r<i;++r)Nk(n[r].value,e)&&(n[r].checked=!0)}}function Fk(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;var i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||ps(o,i,100),s=wk("input",{type:"range",name:n.signal,min:o,max:i,step:a});s.value=r;var u=wk("label",{},+r);function c(){u.textContent=s.value,t.update(+s.value)}e.appendChild(s),e.appendChild(u),s.addEventListener("input",c),s.addEventListener("change",c),t.elements=[s],t.set=function(t){s.value=t,u.textContent=t}}function Nk(t,e){return t===e||t+""==e+""}var Tk=function(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,lk(t),fk(t),dk(t),i,o).background(t._background)},Rk=function(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null};function zk(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}var $k=async function(t,e,n,r){const i=gh(e),o=i&&i.headless;return o||Object(et.n)("Unrecognized renderer type: "+e),await t.runAsync(),Tk(t,null,null,o,n,r).renderAsync(t._scenegraph.root)};var Lk,Ik,Bk,Pk,Uk,qk="RawCode",Wk="Literal",Hk="Property",Yk="Identifier",Gk="ArrayExpression",Vk="BinaryExpression",Xk="CallExpression",Jk="ConditionalExpression",Zk="LogicalExpression",Qk="MemberExpression",Kk="ObjectExpression",tS="UnaryExpression";function eS(t){this.type=t}eS.prototype.visit=function(t){var e,n,r;if(t(this))return 1;for(n=0,r=(e=function(t){switch(t.type){case Gk:return t.elements;case Vk:case Zk:return[t.left,t.right];case Xk:var e=t.arguments.slice();return e.unshift(t.callee),e;case Jk:return[t.test,t.consequent,t.alternate];case Qk:return[t.object,t.property];case Kk:return t.properties;case Hk:return[t.key,t.value];case tS:return[t.argument];case Yk:case Wk:case qk:default:return[]}}(this)).length;n<r;++n)if(e[n].visit(t))return 1};var nS=1,rS=2,iS=3,oS=4,aS=5,sS=6,uS=7,cS=8;(Lk={})[nS]="Boolean",Lk[rS]="<end>",Lk[iS]="Identifier",Lk[oS]="Keyword",Lk[aS]="Null",Lk[sS]="Numeric",Lk[uS]="Punctuator",Lk[cS]="String",Lk[9]="RegularExpression";var lS="ArrayExpression",fS="BinaryExpression",dS="CallExpression",hS="ConditionalExpression",pS="Identifier",gS="Literal",mS="LogicalExpression",vS="MemberExpression",yS="ObjectExpression",bS="Property",xS="UnaryExpression",_S="Unexpected token %0",wS="Unexpected number",OS="Unexpected string",ES="Unexpected identifier",AS="Unexpected reserved word",kS="Unexpected end of input",SS="Invalid regular expression",jS="Invalid regular expression: missing /",DS="Octal literals are not allowed in strict mode.",CS="Duplicate data property in object literal not allowed in strict mode",MS="ILLEGAL",FS="Disabled.",NS=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),TS=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function RS(t,e){if(!t)throw new Error("ASSERT: "+e)}function zS(t){return t>=48&&t<=57}function $S(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function LS(t){return"01234567".indexOf(t)>=0}function IS(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function BS(t){return 10===t||13===t||8232===t||8233===t}function PS(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&NS.test(String.fromCharCode(t))}function US(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&TS.test(String.fromCharCode(t))}var qS={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function WS(){for(var t;Bk<Pk&&(IS(t=Ik.charCodeAt(Bk))||BS(t));)++Bk}function HS(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)Bk<Pk&&$S(Ik[Bk])?(r=Ik[Bk++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):sj({},_S,MS);return String.fromCharCode(i)}function YS(){var t,e,n,r;for(e=0,"}"===(t=Ik[Bk])&&sj({},_S,MS);Bk<Pk&&$S(t=Ik[Bk++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&sj({},_S,MS),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function GS(){var t,e;for(t=Ik.charCodeAt(Bk++),e=String.fromCharCode(t),92===t&&(117!==Ik.charCodeAt(Bk)&&sj({},_S,MS),++Bk,(t=HS("u"))&&"\\"!==t&&PS(t.charCodeAt(0))||sj({},_S,MS),e=t);Bk<Pk&&US(t=Ik.charCodeAt(Bk));)++Bk,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==Ik.charCodeAt(Bk)&&sj({},_S,MS),++Bk,(t=HS("u"))&&"\\"!==t&&US(t.charCodeAt(0))||sj({},_S,MS),e+=t);return e}function VS(){var t,e;return t=Bk,{type:1===(e=92===Ik.charCodeAt(Bk)?GS():function(){var t,e;for(t=Bk++;Bk<Pk;){if(92===(e=Ik.charCodeAt(Bk)))return Bk=t,GS();if(!US(e))break;++Bk}return Ik.slice(t,Bk)}()).length?iS:qS.hasOwnProperty(e)?oS:"null"===e?aS:"true"===e||"false"===e?nS:iS,value:e,start:t,end:Bk}}function XS(){var t,e,n,r,i=Bk,o=Ik.charCodeAt(Bk),a=Ik[Bk];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Bk,{type:uS,value:String.fromCharCode(o),start:i,end:Bk};default:if(61===(t=Ik.charCodeAt(Bk+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Bk+=2,{type:uS,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:Bk};case 33:case 61:return Bk+=2,61===Ik.charCodeAt(Bk)&&++Bk,{type:uS,value:Ik.slice(i,Bk),start:i,end:Bk}}}return">>>="===(r=Ik.substr(Bk,4))?{type:uS,value:r,start:i,end:Bk+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:uS,value:n,start:i,end:Bk+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:uS,value:e,start:i,end:Bk+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?(++Bk,{type:uS,value:a,start:i,end:Bk}):void sj({},_S,MS)}function JS(){var t,e,n;if(RS(zS((n=Ik[Bk]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=Bk,t="","."!==n){if(t=Ik[Bk++],n=Ik[Bk],"0"===t){if("x"===n||"X"===n)return++Bk,function(t){for(var e="";Bk<Pk&&$S(Ik[Bk]);)e+=Ik[Bk++];return 0===e.length&&sj({},_S,MS),PS(Ik.charCodeAt(Bk))&&sj({},_S,MS),{type:sS,value:parseInt("0x"+e,16),start:t,end:Bk}}(e);if(LS(n))return function(t){for(var e="0"+Ik[Bk++];Bk<Pk&&LS(Ik[Bk]);)e+=Ik[Bk++];return(PS(Ik.charCodeAt(Bk))||zS(Ik.charCodeAt(Bk)))&&sj({},_S,MS),{type:sS,value:parseInt(e,8),octal:!0,start:t,end:Bk}}(e);n&&zS(n.charCodeAt(0))&&sj({},_S,MS)}for(;zS(Ik.charCodeAt(Bk));)t+=Ik[Bk++];n=Ik[Bk]}if("."===n){for(t+=Ik[Bk++];zS(Ik.charCodeAt(Bk));)t+=Ik[Bk++];n=Ik[Bk]}if("e"===n||"E"===n)if(t+=Ik[Bk++],"+"!==(n=Ik[Bk])&&"-"!==n||(t+=Ik[Bk++]),zS(Ik.charCodeAt(Bk)))for(;zS(Ik.charCodeAt(Bk));)t+=Ik[Bk++];else sj({},_S,MS);return PS(Ik.charCodeAt(Bk))&&sj({},_S,MS),{type:sS,value:parseFloat(t),start:e,end:Bk}}function ZS(){var t,e,n,r;return Uk=null,WS(),t=Bk,e=function(){var t,e,n,r;for(RS("/"===(t=Ik[Bk]),"Regular expression literal must start with a slash"),e=Ik[Bk++],n=!1,r=!1;Bk<Pk;)if(e+=t=Ik[Bk++],"\\"===t)BS((t=Ik[Bk++]).charCodeAt(0))&&sj({},jS),e+=t;else if(BS(t.charCodeAt(0)))sj({},jS);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||sj({},jS),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";Bk<Pk&&US((t=Ik[Bk]).charCodeAt(0));)++Bk,"\\"===t&&Bk<Pk?sj({},_S,MS):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&sj({},SS,n),{value:n,literal:e}}(),r=function(t,e){var n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(t,e){if(parseInt(e,16)<=1114111)return"x";sj({},SS)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){sj({},SS)}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:Bk}}function QS(){var t;return WS(),Bk>=Pk?{type:rS,start:Bk,end:Bk}:PS(t=Ik.charCodeAt(Bk))?VS():40===t||41===t||59===t?XS():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(RS("'"===(t=Ik[Bk])||'"'===t,"String literal must starts with a quote"),e=Bk,++Bk;Bk<Pk;){if((n=Ik[Bk++])===t){t="";break}if("\\"===n)if((n=Ik[Bk++])&&BS(n.charCodeAt(0)))"\r"===n&&"\n"===Ik[Bk]&&++Bk;else switch(n){case"u":case"x":"{"===Ik[Bk]?(++Bk,i+=YS()):i+=HS(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:LS(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),Bk<Pk&&LS(Ik[Bk])&&(o=!0,r=8*r+"01234567".indexOf(Ik[Bk++]),"0123".indexOf(n)>=0&&Bk<Pk&&LS(Ik[Bk])&&(r=8*r+"01234567".indexOf(Ik[Bk++]))),i+=String.fromCharCode(r)):i+=n}else{if(BS(n.charCodeAt(0)))break;i+=n}}return""!==t&&sj({},_S,MS),{type:cS,value:i,octal:o,start:e,end:Bk}}():46===t?zS(Ik.charCodeAt(Bk+1))?JS():XS():zS(t)?JS():XS()}function KS(){var t;return Bk=(t=Uk).end,Uk=QS(),Bk=t.end,t}function tj(){var t;t=Bk,Uk=QS(),Bk=t}function ej(t,e,n){var r=new eS("||"===t||"&&"===t?mS:fS);return r.operator=t,r.left=e,r.right=n,r}function nj(t,e){var n=new eS(dS);return n.callee=t,n.arguments=e,n}function rj(t){var e=new eS(pS);return e.name=t,e}function ij(t){var e=new eS(gS);return e.value=t.value,e.raw=Ik.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function oj(t,e,n){var r=new eS(vS);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function aj(t,e,n){var r=new eS(bS);return r.key=e,r.value=n,r.kind=t,r}function sj(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(function(t,e){return RS(e<r.length,"Message reference must be in range"),r[e]}));throw(n=new Error(i)).index=Bk,n.description=i,n}function uj(t){t.type===rS&&sj(t,kS),t.type===sS&&sj(t,wS),t.type===cS&&sj(t,OS),t.type===iS&&sj(t,ES),t.type===oS&&sj(t,AS),sj(t,_S,t.value)}function cj(t){var e=KS();e.type===uS&&e.value===t||uj(e)}function lj(t){return Uk.type===uS&&Uk.value===t}function fj(t){return Uk.type===oS&&Uk.value===t}function dj(){var t=[];for(Bk=Uk.start,cj("[");!lj("]");)lj(",")?(KS(),t.push(null)):(t.push(Ej()),lj("]")||cj(","));return KS(),function(t){var e=new eS(lS);return e.elements=t,e}(t)}function hj(){var t;return Bk=Uk.start,(t=KS()).type===cS||t.type===sS?(t.octal&&sj(t,DS),ij(t)):rj(t.value)}function pj(){var t,e,n;return Bk=Uk.start,(t=Uk).type===iS?(n=hj(),cj(":"),aj("init",n,Ej())):t.type!==rS&&t.type!==uS?(e=hj(),cj(":"),aj("init",e,Ej())):void uj(t)}function gj(){var t,e,n=[],r={},i=String;for(Bk=Uk.start,cj("{");!lj("}");)e="$"+((t=pj()).key.type===pS?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?sj({},CS):r[e]=!0,n.push(t),lj("}")||cj(",");return cj("}"),function(t){var e=new eS(yS);return e.properties=t,e}(n)}var mj={if:1,this:1};function vj(){var t,e,n;if(lj("("))return function(){var t;return cj("("),t=Aj(),cj(")"),t}();if(lj("["))return dj();if(lj("{"))return gj();if(t=Uk.type,Bk=Uk.start,t===iS||mj[Uk.value])n=rj(KS().value);else if(t===cS||t===sS)Uk.octal&&sj(Uk,DS),n=ij(KS());else{if(t===oS)throw new Error(FS);t===nS?((e=KS()).value="true"===e.value,n=ij(e)):t===aS?((e=KS()).value=null,n=ij(e)):lj("/")||lj("/=")?(n=ij(ZS()),tj()):uj(KS())}return n}function yj(){var t=[];if(cj("("),!lj(")"))for(;Bk<Pk&&(t.push(Ej()),!lj(")"));)cj(",");return cj(")"),t}function bj(){var t;return Bk=Uk.start,function(t){return t.type===iS||t.type===oS||t.type===nS||t.type===aS}(t=KS())||uj(t),rj(t.value)}function xj(){var t;return cj("["),t=Aj(),cj("]"),t}function _j(){var t=function(){var t;for(t=vj();;)if(lj("."))cj("."),t=oj(".",t,bj());else if(lj("("))t=nj(t,yj());else{if(!lj("["))break;t=oj("[",t,xj())}return t}();if(Uk.type===uS&&(lj("++")||lj("--")))throw new Error(FS);return t}function wj(){var t,e,n,r,i;if(Uk.type!==uS&&Uk.type!==oS)e=_j();else{if(lj("++")||lj("--"))throw new Error(FS);if(lj("+")||lj("-")||lj("~")||lj("!"))t=KS(),e=wj(),n=t.value,r=e,(i=new eS(xS)).operator=n,i.argument=r,i.prefix=!0,e=i;else{if(fj("delete")||fj("void")||fj("typeof"))throw new Error(FS);e=_j()}}return e}function Oj(t){var e=0;if(t.type!==uS&&t.type!==oS)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function Ej(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,c;if(t=Uk,u=wj(),0===(i=Oj(r=Uk)))return u;for(r.prec=i,KS(),e=[t,Uk],o=[u,r,a=wj()];(i=Oj(Uk))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=ej(s,u,a),o.push(n);(r=KS()).prec=i,o.push(r),e.push(Uk),n=wj(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=ej(o[c-1].value,o[c-2],n),c-=2;return n}(),lj("?")&&(KS(),e=Ej(),cj(":"),t=function(t,e,n){var r=new eS(hS);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,Ej())),t}function Aj(){var t=Ej();if(lj(","))throw new Error(FS);return t}var kj=function(t){Bk=0,Pk=(Ik=t).length,Uk=null,tj();var e=Aj();if(Uk.type!==rS)throw new Error("Unexpect token after expression.");return e},Sj={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"},jj=function(t){function e(e,n,r){return function(i){return function(e,n,r,i){var o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}}var n="new Date";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&Object(et.n)("Missing arguments to clamp function."),e.length>3&&Object(et.n)("Too many arguments to clamp function.");var n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),split:e("split","String"),replace:e("replace","String"),trim:e("trim","String",0),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&Object(et.n)("Missing arguments to if function."),e.length>3&&Object(et.n)("Too many arguments to if function.");var n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}};const Dj="intersect",Cj="union",Mj="vlMulti",Fj="or",Nj="and";var Tj="E",Rj="R",zj="R-E",$j="R-LE",Lj="R-RE",Ij="index:unit";function Bj(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,s=0;s<a;++s)if((r=i[s]).getter=et.t.getter||Object(et.t)(r.field),n=r.getter(t),Object(et.C)(n)&&(n=Object(et.bb)(n)),Object(et.C)(o[s])&&(o[s]=Object(et.bb)(o[s])),Object(et.C)(o[s][0])&&(o[s]=o[s].map(et.bb)),r.type===Tj){if(Object(et.A)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(r.type===Rj){if(!Object(et.z)(n,o[s]))return!1}else if(r.type===Lj){if(!Object(et.z)(n,o[s],!0,!1))return!1}else if(r.type===zj){if(!Object(et.z)(n,o[s],!1,!1))return!1}else if(r.type===$j&&!Object(et.z)(n,o[s],!1,!0))return!1;return!0}var Pj={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((function(t){return e.indexOf(t)>=0})):e},R_union:function(t,e){var n=Object(et.bb)(e[0]),r=Object(et.bb)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=Object(et.bb)(e[0]),r=Object(et.bb)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};const Uj=":",qj="@";function Wj(t,e,n,r){e[0].type!==Wk&&Object(et.n)("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&Object(et.T)(e).value,a=qj+"unit",s=Uj+i;o!==Dj||Object(et.v)(r,a)||(r[a]=n.getData(i).indataRef(n,"unit")),Object(et.v)(r,s)||(r[s]=n.getData(i).tuplesRef())}function Hj(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Yj(t){const e=Dg(t);return.2126*Hj(e.r)+.7152*Hj(e.g)+.0722*Hj(e.b)}function Gj(t){const e=this.context.data[t];return e?e.values.value:[]}const Vj={};function Xj(t,e,n){let r=t+":"+n,i=Vj[r];return i&&i[0]===e||(Vj[r]=i=[e,e(n)]),i[1]}function Jj(t,e){return Xj("timeFormat",os,e)(t)}var Zj=new Date(2e3,0,1);function Qj(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(Zj.setYear(2e3),Zj.setMonth(t),Zj.setDate(e),Jj(Zj,n)):""}function Kj(t,e){let n;return Object(et.D)(t)?t:Object(et.H)(t)?(n=e.scales[t])&&n.value:void 0}var tD,eD,nD,rD,iD,oD=jb(),aD=jb(),sD={point:Kb,lineStart:Kb,lineEnd:Kb,polygonStart:function(){oD.reset(),sD.lineStart=uD,sD.lineEnd=cD},polygonEnd:function(){var t=+oD;aD.add(t<0?zb+t:t),this.lineStart=this.lineEnd=this.point=Kb},sphere:function(){aD.add(zb)}};function uD(){sD.point=lD}function cD(){fD(tD,eD)}function lD(t,e){sD.point=fD,tD=t,eD=e,nD=t*=Lb,rD=Ub(e=(e*=Lb)/2+Rb),iD=Gb(e)}function fD(t,e){var n=(t*=Lb)-nD,r=n>=0?1:-1,i=r*n,o=Ub(e=(e*=Lb)/2+Rb),a=Gb(e),s=iD*a,u=rD*o+s*Ub(i),c=s*r*Gb(i);oD.add(Pb(c,u)),nD=t,rD=o,iD=a}var dD,hD,pD,gD,mD,vD,yD,bD,xD,_D,wD=jb(),OD={point:ED,lineStart:kD,lineEnd:SD,polygonStart:function(){OD.point=jD,OD.lineStart=DD,OD.lineEnd=CD,wD.reset(),sD.polygonStart()},polygonEnd:function(){sD.polygonEnd(),OD.point=ED,OD.lineStart=kD,OD.lineEnd=SD,oD<0?(dD=-(pD=180),hD=-(gD=90)):wD>Fb?gD=90:wD<-Fb&&(hD=-90),_D[0]=dD,_D[1]=pD},sphere:function(){dD=-(pD=180),hD=-(gD=90)}};function ED(t,e){xD.push(_D=[dD=t,pD=t]),e<hD&&(hD=e),e>gD&&(gD=e)}function AD(t,e){var n=s_([t*Lb,e*Lb]);if(bD){var r=c_(bD,n),i=c_([r[1],-r[0],0],r);d_(i),i=a_(i);var o,a=t-mD,s=a>0?1:-1,u=i[0]*$b*s,c=Ib(a)>180;c^(s*mD<u&&u<s*t)?(o=i[1]*$b)>gD&&(gD=o):c^(s*mD<(u=(u+360)%360-180)&&u<s*t)?(o=-i[1]*$b)<hD&&(hD=o):(e<hD&&(hD=e),e>gD&&(gD=e)),c?t<mD?MD(dD,t)>MD(dD,pD)&&(pD=t):MD(t,pD)>MD(dD,pD)&&(dD=t):pD>=dD?(t<dD&&(dD=t),t>pD&&(pD=t)):t>mD?MD(dD,t)>MD(dD,pD)&&(pD=t):MD(t,pD)>MD(dD,pD)&&(dD=t)}else xD.push(_D=[dD=t,pD=t]);e<hD&&(hD=e),e>gD&&(gD=e),bD=n,mD=t}function kD(){OD.point=AD}function SD(){_D[0]=dD,_D[1]=pD,OD.point=ED,bD=null}function jD(t,e){if(bD){var n=t-mD;wD.add(Ib(n)>180?n+(n>0?360:-360):n)}else vD=t,yD=e;sD.point(t,e),AD(t,e)}function DD(){sD.lineStart()}function CD(){jD(vD,yD),sD.lineEnd(),Ib(wD)>Fb&&(dD=-(pD=180)),_D[0]=dD,_D[1]=pD,bD=null}function MD(t,e){return(e-=t)<0?e+360:e}function FD(t,e){return t[0]-e[0]}function ND(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var TD,RD,zD,$D,LD,ID,BD,PD,UD,qD,WD,HD,YD,GD,VD,XD,JD={sphere:Kb,point:ZD,lineStart:KD,lineEnd:nC,polygonStart:function(){JD.lineStart=rC,JD.lineEnd=iC},polygonEnd:function(){JD.lineStart=KD,JD.lineEnd=nC}};function ZD(t,e){t*=Lb;var n=Ub(e*=Lb);QD(n*Ub(t),n*Gb(t),Gb(e))}function QD(t,e,n){++TD,zD+=(t-zD)/TD,$D+=(e-$D)/TD,LD+=(n-LD)/TD}function KD(){JD.point=tC}function tC(t,e){t*=Lb;var n=Ub(e*=Lb);GD=n*Ub(t),VD=n*Gb(t),XD=Gb(e),JD.point=eC,QD(GD,VD,XD)}function eC(t,e){t*=Lb;var n=Ub(e*=Lb),r=n*Ub(t),i=n*Gb(t),o=Gb(e),a=Pb(Xb((a=VD*o-XD*i)*a+(a=XD*r-GD*o)*a+(a=GD*i-VD*r)*a),GD*r+VD*i+XD*o);RD+=a,ID+=a*(GD+(GD=r)),BD+=a*(VD+(VD=i)),PD+=a*(XD+(XD=o)),QD(GD,VD,XD)}function nC(){JD.point=ZD}function rC(){JD.point=oC}function iC(){aC(HD,YD),JD.point=ZD}function oC(t,e){HD=t,YD=e,t*=Lb,e*=Lb,JD.point=aC;var n=Ub(e);GD=n*Ub(t),VD=n*Gb(t),XD=Gb(e),QD(GD,VD,XD)}function aC(t,e){t*=Lb;var n=Ub(e*=Lb),r=n*Ub(t),i=n*Gb(t),o=Gb(e),a=VD*o-XD*i,s=XD*r-GD*o,u=GD*i-VD*r,c=Xb(a*a+s*s+u*u),l=Qb(c),f=c&&-l/c;UD+=f*a,qD+=f*s,WD+=f*u,RD+=l,ID+=l*(GD+(GD=r)),BD+=l*(VD+(VD=i)),PD+=l*(XD+(XD=o)),QD(GD,VD,XD)}function sC(t,e){return function(n,r,i){if(n){const e=Kj(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const uC=sC("area",(function(t){return aD.reset(),Sb(t,sD),2*aD})),cC=sC("bounds",(function(t){var e,n,r,i,o,a,s;if(gD=pD=-(dD=hD=1/0),xD=[],Sb(t,OD),n=xD.length){for(xD.sort(FD),e=1,o=[r=xD[0]];e<n;++e)ND(r,(i=xD[e])[0])||ND(r,i[1])?(MD(r[0],i[1])>MD(r[0],r[1])&&(r[1]=i[1]),MD(i[0],r[1])>MD(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=MD(r[1],i[0]))>a&&(a=s,dD=i[0],pD=r[1])}return xD=_D=null,dD===1/0||hD===1/0?[[NaN,NaN],[NaN,NaN]]:[[dD,hD],[pD,gD]]})),lC=sC("centroid",(function(t){TD=RD=zD=$D=LD=ID=BD=PD=UD=qD=WD=0,Sb(t,JD);var e=UD,n=qD,r=WD,i=e*e+n*n+r*r;return i<1e-12&&(e=ID,n=BD,r=PD,RD<Fb&&(e=zD,n=$D,r=LD),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[Pb(n,e)*$b,Qb(r/Xb(i))*$b]}));function fC(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function dC(t,e){return t===e||t!=t&&e!=e||(Object(et.A)(t)?!(!Object(et.A)(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!dC(t[n],e[n]))return!1;return!0}(t,e):!(!Object(et.F)(t)||!Object(et.F)(e))&&hC(t,e))}function hC(t,e){for(let n in t)if(!dC(t[n],e[n]))return!1;return!0}function pC(t){return e=>hC(t,e)}const gC={};function mC(t){return t.data}function vC(t,e){const n=Gj.call(e,t);return n.root&&n.root.lookup||gC}const yC="undefined"!=typeof window&&window||null;const bC=":",xC="@",_C="%";function wC(t,e,n,r){e[0].type!==Wk&&Object(et.n)("First argument to data functions must be a string literal.");const i=e[0].value,o=bC+i;if(!Object(et.v)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(t){}}function OC(t,e,n,r){if(e[0].type===Wk)EC(n,r,e[0].value);else if(e[0].type===Yk)for(t in n.scales)EC(n,r,t)}function EC(t,e,n){const r=_C+n;if(!Object(et.v)(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}const AC={random:function(){return ii()},cumulativeNormal:gi,cumulativeLogNormal:_i,cumulativeUniform:Si,densityNormal:pi,densityLogNormal:xi,densityUniform:ki,quantileNormal:mi,quantileLogNormal:wi,quantileUniform:ji,sampleNormal:hi,sampleLogNormal:bi,sampleUniform:Ai,isArray:et.A,isBoolean:et.B,isDate:et.C,isDefined:function(t){return void 0!==t},isNumber:et.E,isObject:et.F,isRegExp:et.G,isString:et.H,isTuple:at,isValid:function(t){return null!=t&&t==t},toBoolean:et.Z,toDate:et.ab,toNumber:et.bb,toString:et.db,flush:et.u,lerp:et.J,merge:function(){var t=[].slice.call(arguments);return t.unshift({}),et.o.apply(null,t)},pad:et.O,peek:et.T,span:et.W,inrange:et.z,truncate:et.eb,rgb:Dg,lab:Cv,hcl:$v,hsl:zg,luminance:Yj,contrast:function(t,e){const n=Yj(t),r=Yj(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Qo,format:function(t,e){return Xj("format",Gp,e)(t)},utcFormat:function(t,e){return Xj("utcFormat",as,e)(t)},utcParse:function(t,e){return Xj("utcParse",Ke,e)(t)},utcOffset:Ka,utcSequence:ns,timeFormat:Jj,timeParse:function(t,e){return Xj("timeParse",Ze,e)(t)},timeOffset:Qa,timeSequence:es,timeUnitSpecifier:is,monthFormat:function(t){return Qj(t,1,"%B")},monthAbbrevFormat:function(t){return Qj(t,1,"%b")},dayFormat:function(t){return Qj(0,2+t,"%A")},dayAbbrevFormat:function(t){return Qj(0,2+t,"%a")},quarter:et.U,utcquarter:et.gb,warn:function(){return fC(this.context.dataflow,"warn",arguments)},info:function(){return fC(this.context.dataflow,"info",arguments)},debug:function(){return fC(this.context.dataflow,"debug",arguments)},extent:et.p,inScope:function(t){let e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];const[r,i]=t,o=(new _u).set(r[0],r[1],i[0],i[1]);return mh(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=Object(et.i)(t.marktype),r=Object(et.i)(t.markname);e=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return e}(e))},clampRange:et.j,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){return yC?yC.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){return yC?[yC.innerWidth,yC.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return sp(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(et.fb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Wc(n,e=e||Nc(t)):t}},panLinear:et.P,panLog:et.Q,panPow:et.R,panSymlog:et.S,zoomLinear:et.kb,zoomLog:et.lb,zoomPow:et.mb,zoomSymlog:et.nb,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){let a,s,u=this.context.dataflow,c=this.context.data[t],l=c.input,f=c.changes,d=u.stamp();if(!1===u._trigger||!(l.value.length||e||r))return 0;if((!f||f.stamp<d)&&(c.changes=f=u.changeset(),f.stamp=d,u.runAfter((function(){c.modified=!0,u.pulse(l,f).run()}),!0,1)),n&&(a=!0===n?et.fb:Object(et.A)(n)||at(n)?n:pC(n),f.remove(a)),e&&f.insert(e),r&&(a=pC(r),l.value.some(a)?f.remove(a):f.insert(r)),i)for(s in o)f.modify(i,s,o[s]);return 1}},kC=["view","item","group","xy","x","y"],SC="event.vega.",jC="this.",DC={};function CC(t,e,n){return 1===arguments.length?AC[t]:(AC[t]=e,n&&(DC[t]=n),FC&&(FC.functions[t]=jC+t),this)}CC("bandwidth",(function(t,e){const n=Kj(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),OC),CC("copy",(function(t,e){const n=Kj(t,(e||this).context);return n?n.copy():void 0}),OC),CC("domain",(function(t,e){const n=Kj(t,(e||this).context);return n?n.domain():[]}),OC),CC("range",(function(t,e){const n=Kj(t,(e||this).context);return n&&n.range?n.range():[]}),OC),CC("invert",(function(t,e,n){const r=Kj(t,(n||this).context);return r?Object(et.A)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),OC),CC("scale",(function(t,e,n){const r=Kj(t,(n||this).context);return r&&void 0!==e?r(e):void 0}),OC),CC("gradient",(function(t,e,n,r,i){t=Kj(t,(i||this).context);const o=ju(e,n);let a=t.domain(),s=a[0],u=Object(et.T)(a),c=et.x;return u-s?c=ay(t,s,u):t=(t.interpolator?Km("sequential")().interpolator(t.interpolator()):Km("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(s!==(a=t.ticks(+r||15))[0]&&a.unshift(s),u!==Object(et.T)(a)&&a.push(u)),a.forEach(e=>o.stop(c(e),t(e))),o}),OC),CC("geoArea",uC,OC),CC("geoBounds",cC,OC),CC("geoCentroid",lC,OC),CC("geoShape",(function(t,e,n){const r=Kj(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),OC),CC("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==Wk&&Object(et.n)("First argument to indata must be a string literal."),e[1].type!==Wk&&Object(et.n)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a=xC+o;Object(et.v)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),CC("data",Gj,wC),CC("treePath",(function(t,e,n){const r=vC(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(mC):void 0}),wC),CC("treeAncestors",(function(t,e){const n=vC(t,this)[e];return n?n.ancestors().map(mC):void 0}),wC),CC("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,s,u=this.context.data[t],c=u?u.values.value:[],l=u?u[Ij]&&u[Ij].value:void 0,f=n===Dj,d=c.length,h=0;h<d;++h)if(r=c[h],l&&f){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(s=Bj(e,r),i[a]=s?-1:++o,s&&1===l.size)return!0;if(!s&&o===l.get(a).count)return!1}else if(f^(s=Bj(e,r)))return s;return d&&f}),Wj),CC("vlSelectionResolve",(function(t,e,n){for(var r,i,o,a,s,u,c,l,f,d,h,p=this.context.data[t],g=p?p.values.value:[],m={},v={},y={},b=g.length,x=0;x<b;++x){for(a=(r=g[x]).unit,i=r.fields,o=r.values,d=0,h=i.length;d<h;++d)s=i[d],c=(u=m[s.field]||(m[s.field]={}))[a]||(u[a]=[]),y[s.field]=l=s.type.charAt(0),f=Pj[l+"_union"],u[a]=f(c,Object(et.i)(o[d]));n&&(c=v[a]||(v[a]=[])).push(Object(et.i)(o).reduce((t,e,n)=>(t[i[n].field]=e,t),{}))}return e=e||Cj,Object.keys(m).forEach((function(t){m[t]=Object.keys(m[t]).map(e=>m[t][e]).reduce((n,r)=>void 0===n?r:Pj[y[t]+"_"+e](n,r))})),g=Object.keys(v),n&&g.length&&(m[Mj]=e===Cj?{[Fj]:g.reduce((t,e)=>(t.push.apply(t,v[e]),t),[])}:{[Nj]:g.map(t=>({[Fj]:v[t]}))}),m}),Wj);const MC={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(t){return"_["+Object(et.Y)("$"+t)+"]"},functions:function(t){const e=jj(t);kC.forEach(t=>e[t]=SC+t);for(let t in AC)e[t]=jC+t;return e},constants:Sj,visitors:DC};var FC=function(t){var e=(t=t||{}).whitelist?Object(et.cb)(t.whitelist):{},n=t.blacklist?Object(et.cb)(t.blacklist):{},r=t.constants||Sj,i=(t.functions||jj)(f),o=t.globalvar,a=t.fieldvar,s={},u={},c=0,l=Object(et.D)(o)?o:function(t){return o+'["'+t+'"]'};function f(t){if(Object(et.H)(t))return t;var e=d[t.type];return null==e&&Object(et.n)("Unsupported type: "+t.type),e(t)}var d={Literal:function(t){return t.raw},Identifier:function(t){var i=t.name;return c>0?i:Object(et.v)(n,i)?Object(et.n)("Illegal identifier: "+i):Object(et.v)(r,i)?r[i]:Object(et.v)(e,i)?i:(s[i]=1,l(i))},MemberExpression:function(t){var e=!t.computed,n=f(t.object);e&&(c+=1);var r=f(t.property);return n===a&&(u[function(t){var e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&Object(et.n)("Illegal callee type: "+t.callee.type);var e=t.callee.name,n=t.arguments,r=Object(et.v)(i,e)&&i[e];return r||Object(et.n)("Unrecognized function: "+e),Object(et.D)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(f).join(",")+"]"},BinaryExpression:function(t){return"("+f(t.left)+t.operator+f(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+f(t.argument)+")"},ConditionalExpression:function(t){return"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")"},LogicalExpression:function(t){return"("+f(t.left)+t.operator+f(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(f).join(",")+"}"},Property:function(t){c+=1;var e=f(t.key);return c-=1,e+":"+f(t.value)}};function h(t){var e={code:f(t),globals:Object.keys(s),fields:Object.keys(u)};return s={},u={},e}return h.functions=i,h.constants=r,h}(MC);function NC(t,e,n){";"!==e[e.length-1]&&(e="return("+e+");");var r=Function.apply(null,t.concat(e));return n&&n.functions?r.bind(n.functions):r}function TC(t,e){return NC(["event"],t,e)}function RC(t,e){return NC(["item","_"],t,e)}function zC(t,e,n){var r,i;for(r in n=n||{},t)i=t[r],n[r]=Object(et.A)(i)?i.map((function(t){return $C(t,e,n)})):$C(i,e,n);return n}function $C(t,e,n){if(!t||!Object(et.F)(t))return t;for(var r,i=0,o=LC.length;i<o;++i)if(r=LC[i],Object(et.v)(t,r.key))return r.parse(t,e,n);return t}var LC=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||Object(et.n)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){var n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=Object(et.I)(t.$key,t.$flat))}},{key:"$expr",parse:function(t,e,n){t.$params&&zC(t.$params,e,n);var r="e:"+t.$expr+"_"+t.$name;return e.fn[r]||(e.fn[r]=Object(et.f)(function(t,e){return NC(["datum","_"],t,e)}(t.$expr,e),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;var n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=Object(et.t)(t.$field,t.$name))}},{key:"$encode",parse:function(t,e){var n,r,i=t.$encode,o={};for(n in i)r=i[n],o[n]=Object(et.f)(RC(r.$expr,e),r.$fields),o[n].output=r.$output;return o}},{key:"$compare",parse:function(t,e){var n="c:"+t.$compare+"_"+t.$order,r=Object(et.i)(t.$compare).map((function(t){return t&&t.$tupleid?st:t}));return e.fn[n]||(e.fn[n]=Object(et.k)(r,t.$order))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,i){var o=UC(n,e.fork()),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a}}},{key:"$tupleid",parse:function(){return st}}];function IC(t){return(t+"").toLowerCase()}var BC=function(t,e){"operator"!==IC(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?function(t,e){return NC(["_"],t,e)}(t.update,e):null)};var PC=function(t,e){var n=Object(et.F)(n=t.source)?n.$ref:n,r=e.get(n),i=null,o=t.update,a=void 0;r||Object(et.n)("Source not defined: "+t.source),i=t.target&&t.target.$expr?TC(t.target.$expr,e):e.get(t.target),o&&o.$expr&&(o.$params&&(a=zC(o.$params,e)),o=function(t,e){return NC(["_","event"],t,e)}(o.$expr,e)),e.update(t,r,i,o,a)},UC=function(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),n.forEach((function(t){BC(t,e)})),n.forEach((function(t){!function(t,e){if(t.params){var n=e.get(t.id);n||Object(et.n)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(zC(t.params,e),t.react,t.initonly))}}(t,e)})),(t.streams||[]).forEach((function(t){!function(t,e){var n,r=null!=t.filter?TC(t.filter,e):void 0,i=null!=t.stream?e.get(t.stream):void 0;t.source?i=e.events(t.source,t.type,r):t.merge&&(i=(n=t.merge.map(e.get.bind(e)))[0].merge.apply(n[0],n.slice(1))),t.between&&(n=t.between.map(e.get.bind(e)),i=i.between(n[0],n[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&Object(et.n)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),e.stream(t,i)}(t,e)})),(t.updates||[]).forEach((function(t){PC(t,e)})),e.resolve()},qC={skip:!0};var WC=function(t,e,n){return new HC(t,e,n)};function HC(t,e,n){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function YC(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}HC.prototype=YC.prototype={fork:function(){var t=new YC(this);return(this.subcontext||(this.subcontext=[])).push(t),t},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n,r=this,i=r.dataflow;if(r.set(t.id,e),"collect"===IC(t.type)&&(n=t.value)&&(n.$ingest?i.ingest(e,n.$ingest,n.$format):n.$request?i.preload(e,n.$request,n.$format):i.pulse(e,i.changeset().insert(n))),t.root&&(r.root=e),t.parent){var o=r.get(t.parent.$ref);o?(i.connect(o,[e]),e.targets().add(o)):(r.unresolved=r.unresolved||[]).push((function(){o=r.get(t.parent.$ref),i.connect(o,[e]),e.targets().add(o)}))}if(t.signal&&(r.signals[t.signal]=e),t.scale&&(r.scales[t.scale]=e),t.data)for(var a in t.data)n=r.data[a]||(r.data[a]={}),t.data[a].forEach((function(t){n[t]=e}))},resolve:function(){return(this.unresolved||[]).forEach((function(t){t()})),delete this.unresolved,this},operator:function(t,e){this.add(t,this.dataflow.add(t.value,e))},transform:function(t,e){this.add(t,this.dataflow.add(this.transforms[IC(e)]))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((function(n){var i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((function(n){var r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((function(e){return e.getState(t)}))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((function(t){n.update(e.signals[t],i[t],qC)})),Object.keys(r||{}).forEach((function(t){n.pulse(e.data[t].input,n.changeset().remove(et.fb).insert(r[t]))})),(t.subcontext||[]).forEach((function(t,n){var r=e.subcontext[n];r&&r.setState(t)}))}};var GC=function(t,e,n){return UC(e,WC(t,zr,n||AC))};var VC="width",XC="height",JC="padding",ZC={skip:!0};function QC(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===JC?r.left+r.right:0)}function KC(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===JC?r.top+r.bottom:0)}function tM(t,e){return e.modified&&Object(et.A)(e.input.value)&&t.indexOf("_:vega:_")}function eM(t,e){return!("parent"===t||e instanceof zr.proxy)}var nM=function(t,e,n,r){var i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":Object(et.A)(t)?rM(t):Object(et.F)(t)&&!Object(et.C)(t)?(e=t,Object.keys(e).map((function(t){var n=e[t];return t+": "+(Object(et.A)(n)?rM(n):iM(n))})).join("\n")):t+"";var e}(r))};function rM(t){return"["+t.map(iM).join(", ")+"]"}function iM(t){return Object(et.A)(t)?"[…]":Object(et.F)(t)&&!Object(et.C)(t)?"{…}":t}function oM(t,e){e=e||{},Mr.call(this),e.loader&&this.loader(e.loader),e.logger&&this.logger(e.logger),null!=e.logLevel&&this.logLevel(e.logLevel),this._el=null,this._elBind=null,this._renderType=e.renderer||hh.Canvas,this._scenegraph=new hd;var n=this._scenegraph.root;this._renderer=null,this._tooltip=e.tooltip||nM,this._redraw=!0,this._handler=(new jd).scene(n),this._preventDefault=!1,this._timers=[],this._eventListeners=[],this._resizeListeners=[],this._eventConfig=function(t){const e=Object(et.o)({defaults:{}},t),n=(t,e)=>{e.forEach(e=>{Object(et.A)(t[e])&&(t[e]=Object(et.cb)(t[e]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig);var r=GC(this,t,e.functions);this._runtime=r,this._signals=r.signals,this._bind=(t.bindings||[]).map((function(t){return{state:null,param:Object(et.o)({},t)}})),r.root&&r.root.set(n),n.source=r.data.root.input,this.pulse(r.data.root.input,this.changeset().insert(n.items)),this._background=e.background||r.background||null,this._width=this.width(),this._height=this.height(),this._viewWidth=QC(this,this._width),this._viewHeight=KC(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function(t){var e=t._signals,n=e[VC],r=e[XC],i=e[JC];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(function(e){t._width=e.size,t._viewWidth=QC(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(function(e){t._height=e.size,t._viewHeight=KC(t,e.size),o()}),{size:r});var a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(this),sk(this),e.hover&&this.hover(),e.container&&this.initialize(e.container,e.bind)}var aM=Object(et.y)(oM,Mr);function sM(t,e){return Object(et.v)(t._signals,e)?t._signals[e]:Object(et.n)("Unrecognized signal name: "+Object(et.Y)(e))}function uM(t,e){var n=(t._targets||[]).filter((function(t){var n=t._update;return n&&n.handler===e}));return n.length?n[0]:null}function cM(t,e,n,r){var i=uM(n,r);return i||((i=Rk(this,(function(){r(e,n.value)}))).handler=r,t.on(n,null,i)),t}function lM(t,e,n){var r=uM(e,n);return r&&e._targets.remove(r),t}aM.evaluate=async function(t,e,n){if(await Mr.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=dk(r=this),o=lk(r),a=fk(r),r._renderer.background(r._background),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach((function(t){try{t(o,a)}catch(t){r.error(t)}}))),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}var r,i,o,a;return n&&rt(this,n),this},aM.dirty=function(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},aM.container=function(){return this._el},aM.scenegraph=function(){return this._scenegraph},aM.origin=function(){return this._origin.slice()},aM.signal=function(t,e,n){var r=sM(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},aM.background=function(t){return arguments.length?(this._background=t,this._resize=1,this):this._background},aM.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},aM.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},aM.padding=function(t){return arguments.length?this.signal("padding",t):this.signal("padding")},aM.autosize=function(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},aM.renderer=function(t){return arguments.length?(gh(t)||Object(et.n)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},aM.tooltip=function(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},aM.loader=function(t){return arguments.length?(t!==this._loader&&(Mr.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},aM.resize=function(){return this._autosize=1,this.touch(sM(this,"autosize"))},aM._resetRenderer=function(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},aM._resizeView=function(t,e,n,r,i,o){this.runAfter((function(a){var s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(VC,n,ZC),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(XC,r,ZC),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter(t=>t.resize())}),!1,1)},aM.addEventListener=function(t,e,n){var r=e;return n&&!1===n.trap||((r=Rk(this,e)).raw=e),this._handler.on(t,r),this},aM.removeEventListener=function(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},aM.addResizeListener=function(t){var e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},aM.removeResizeListener=function(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},aM.addSignalListener=function(t,e){return cM(this,t,sM(this,t),e)},aM.removeSignalListener=function(t,e){return lM(this,sM(this,t),e)},aM.addDataListener=function(t,e){return cM(this,t,uk(this,t).values,e)},aM.removeDataListener=function(t,e){return lM(this,uk(this,t).values,e)},aM.preventDefault=function(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},aM.timer=function(t,e){this._timers.push(function(t,e,n){var r=new OO,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?_O():+n,r.restart((function o(a){a+=i,r.restart(o,i+=e,n),t(a)}),e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},aM.events=function(t,e,n){var r,i=this,o=new At(n),a=function(n,r){i.runAsync(null,()=>{t===pk&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(hk(i,n,r))})};if(t===gk)yk(i,"timer",e)&&i.timer(a,e);else if(t===pk)yk(i,"view",e)&&i.addEventListener(e,a,vk);else if(t===mk?yk(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&yk(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var s=0,u=r.length;s<u;++s)r[s].addEventListener(e,a);i._eventListeners.push({type:e,sources:r,handler:a})}else i.warn("Can not resolve event source: "+t);return o},aM.finalize=function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},aM.hover=function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",bk),xk,_k(t)),this.on(this.events("view","mouseout",bk),xk,_k(e)),this},aM.data=function(t,e){return arguments.length<2?uk(this,t).values.value:ck.call(this,t,gt().remove(et.fb).insert(e))},aM.change=ck,aM.insert=function(t,e){return ck.call(this,t,gt().insert(e))},aM.remove=function(t,e){return ck.call(this,t,gt().remove(e))},aM.scale=function(t){var e=this._runtime.scales;return Object(et.v)(e,t)||Object(et.n)("Unrecognized scale or projection: "+t),e[t].value},aM.initialize=function(t,e){var n,r,i=this,o=i._renderType,a=i._eventConfig.bind,s=gh(o);return t=i._el=t?zk(i,t):null,s||i.error("Unrecognized renderer type: "+o),n=s.handler||jd,r=t?s.renderer:s.headless,i._renderer=r?Tk(i,i._renderer,t,r):null,i._handler=function(t,e,n,r){var i=new r(t.loader(),Rk(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,dk(t),t);return e&&e.handlers().forEach((function(t){i.on(t.type,t.handler)})),i}(i,i._handler,t,n),i._redraw=!0,t&&"none"!==a&&(e=e?i._elBind=zk(i,e):t.appendChild(wk("div",{class:"vega-bindings"})),i._bind.forEach((function(t){t.param.element&&"container"!==a&&(t.element=zk(i,t.param.element))})),i._bind.forEach((function(t){Sk(i,t.element||e,t)}))),i},aM.toImageURL=async function(t,e){t!==hh.Canvas&&t!==hh.SVG&&t!==hh.PNG&&Object(et.n)("Unrecognized image type: "+t);const n=await $k(this,t,e);return t===hh.SVG?(r=n.svg(),i=new Blob([r],{type:"image/svg+xml"}),window.URL.createObjectURL(i)):n.canvas().toDataURL("image/png");var r,i},aM.toCanvas=async function(t,e){return(await $k(this,hh.Canvas,t,e)).canvas()},aM.toSVG=async function(t){return(await $k(this,hh.SVG,t)).svg()},aM.getState=function(t){return this._runtime.getState(t||{data:tM,signals:eM,recurse:!0})},aM.setState=function(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},t=>{t._trigger=!0}),this};var fM=function(t,e){return t=t||e.autosize,Object(et.F)(t)?t:{type:t||"pad"}},dM=function(t,e){return t=t||e.padding,Object(et.F)(t)?{top:hM(t.top),bottom:hM(t.bottom),left:hM(t.left),right:hM(t.right)}:{top:n=hM(t),bottom:n,left:n,right:n};var n};function hM(t){return+t||0}var pM=["value","update","init","react","bind"];function gM(t,e){Object(et.n)(t+' for "outer" push: '+Object(et.Y)(e))}var mM=function(t,e){var n=t.name;if("outer"===t.push)e.signals[n]||gM("No prior signal definition",n),pM.forEach((function(e){void 0!==t[e]&&gM("Invalid property ",e)}));else{var r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}},vM=function(t,e,n){var r,i,o={};try{t=Object(et.H)(t)?t:Object(et.Y)(t)+"",r=kj(t)}catch(e){Object(et.n)("Expression parse error: "+t)}return r.visit((function(t){if(t.type===Xk){var n=t.callee.name,r=MC.visitors[n];r&&r(n,t.arguments,e,o)}})),(i=FC(r)).globals.forEach((function(t){var n="$"+t;!Object(et.v)(o,n)&&e.getSignal(t)&&(o[n]=e.signalRef(t))})),{$expr:n?n+"return("+i.code+");":i.code,$fields:i.fields,$params:o}};function yM(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function bM(t,e,n,r){return new yM(t,e,n,r)}function xM(t,e){return bM("operator",t,e)}function _M(t){var e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function wM(t,e){return e?{$field:t,$name:e}:{$field:t}}var OM=wM("key");function EM(t,e){return{$compare:t,$order:e}}var AM="descending";function kM(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}var SM="scope",jM="view";function DM(t){return t&&t.signal}function CM(t){if(DM(t))return!0;if(Object(et.F)(t))for(var e in t)if(CM(t[e]))return!0;return!1}function MM(t,e){return null!=t?t:e}function FM(t){return t&&t.signal||t}var NM="timer";function TM(t,e){return(t.merge?RM:t.stream?zM:t.type?$M:Object(et.n)("Invalid stream specification: "+Object(et.Y)(t)))(t,e)}function RM(t,e){var n=LM({merge:t.merge.map(t=>TM(t,e))},t,e);return e.addStream(n).id}function zM(t,e){var n=LM({stream:TM(t.stream,e)},t,e);return e.addStream(n).id}function $M(t,e){var n,r,i;return t.type===NM?(n=e.event(NM,t.throttle),t={between:t.between,filter:t.filter}):n=e.event((i=t.source)===SM?jM:i||jM,t.type),r=LM({stream:n},t,e),1===Object.keys(r).length?n:e.addStream(r).id}function LM(t,e,n){var r,i,o,a,s=e.between;return s&&(2!==s.length&&Object(et.n)('Stream "between" parameter must have 2 entries: '+Object(et.Y)(e)),t.between=[TM(s[0],n),TM(s[1],n)]),s=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&s.push((r=e.marktype,i=e.markname,o=e.markrole,(a="event.item")+(r&&"*"!==r?"&&"+a+".mark.marktype==='"+r+"'":"")+(o?"&&"+a+".mark.role==='"+o+"'":"")+(i?"&&"+a+".mark.name==='"+i+"'":""))),e.source===SM&&s.push("inScope(event.item)"),s.length&&(t.filter=vM("("+s.join(")&&(")+")").$expr),null!=(s=e.throttle)&&(t.throttle=+s),null!=(s=e.debounce)&&(t.debounce=+s),e.consume&&(t.consume=!0),t}var IM,BM,PM=function(t,e,n){return IM=e||UM,BM=n||QM,tF(t.trim()).map(eF)},UM="view",qM="[",WM="]",HM="{",YM="}",GM=":",VM=",",XM="@",JM=">",ZM=/[[\]{}]/,QM={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function KM(t,e,n,r,i){for(var o,a=0,s=t.length;e<s;++e){if(o=t[e],!a&&o===n)return e;i&&i.indexOf(o)>=0?--a:r&&r.indexOf(o)>=0&&++a}return e}function tF(t){for(var e=[],n=0,r=t.length,i=0;i<r;)i=KM(t,i,VM,qM+HM,WM+YM),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function eF(t){return"["===t[0]?function(t){var e,n,r=t.length,i=1;if((i=KM(t,i,WM,qM,WM))===r)throw"Empty between selector: "+t;if(2!==(e=tF(t.substring(1,i))).length)throw"Between selector must have two elements: "+t;if((t=t.slice(i+1).trim())[0]!==JM)throw"Expected '>' after between selector: "+t;if(e=e.map(eF),(n=eF(t.slice(1).trim())).between)return{between:e,stream:n};n.between=e;return n}(t):function(t){var e,n,r={source:IM},i=[],o=[0,0],a=0,s=0,u=t.length,c=0;if(t[u-1]===YM){if(!((c=t.lastIndexOf(HM))>=0))throw"Unmatched right brace: "+t;try{o=function(t){var e=t.split(VM);if(!t.length||e.length>2)throw t;return e.map((function(e){var n=+e;if(n!=n)throw t;return n}))}(t.substring(c+1,u-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,c).trim(),u=t.length,c=0}if(!u)throw t;t[0]===XM&&(a=++c);(e=KM(t,c,GM))<u&&(i.push(t.substring(s,e).trim()),s=c=++e);if((c=KM(t,c,qM))===u)i.push(t.substring(s,u).trim());else if(i.push(t.substring(s,c).trim()),n=[],(s=++c)===u)throw"Unmatched left bracket: "+t;for(;c<u;){if((c=KM(t,c,WM))===u)throw"Unmatched left bracket: "+t;if(n.push(t.substring(s,c).trim()),c<u-1&&t[++c]!==qM)throw"Expected left bracket: "+t;s=++c}if(!(u=i.length)||ZM.test(i[u-1]))throw"Invalid event selector: "+t;u>1?(r.type=i[1],a?r.markname=i[0].slice(1):(l=i[0],BM[l]?r.marktype=i[0]:r.source=i[0])):r.type=i[0];var l;"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);o[0]&&(r.throttle=o[0]);o[1]&&(r.debounce=o[1]);return r}(t)}var nF=function(t,e,n){var r=t.events,i=t.update,o=t.encode,a=[],s={target:n};r||Object(et.n)("Signal update missing events specification."),Object(et.H)(r)&&(r=PM(r,e.isSubscope()?SM:jM)),r=Object(et.i)(r).filter(t=>t.signal||t.scale?(a.push(t),0):1),a.length>1&&(a=[rF(a)]),r.length&&a.push(r.length>1?{merge:r}:r[0]),null!=o&&(i&&Object(et.n)("Signal encode and update are mutually exclusive."),i="encode(item(),"+Object(et.Y)(o)+")"),s.update=Object(et.H)(i)?vM(i,e,"var datum=event.item&&event.item.datum;"):null!=i.expr?vM(i.expr,e,"var datum=event.item&&event.item.datum;"):null!=i.value?i.value:null!=i.signal?{$expr:"_.value",$params:{value:e.signalRef(i.signal)}}:Object(et.n)("Invalid signal update specification."),t.force&&(s.options={force:!0}),a.forEach((function(t){e.addUpdate(Object(et.o)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):TM(t,e)}}(t,e),s))}))};function rF(t){return{signal:"["+t.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function iF(t){return function(e,n,r){return bM(t,n,e||void 0,r)}}var oF=iF("aggregate"),aF=iF("axisticks"),sF=iF("bound"),uF=iF("collect"),cF=iF("compare"),lF=iF("datajoin"),fF=iF("encode"),dF=iF("expression"),hF=(iF("extent"),iF("facet")),pF=iF("field"),gF=iF("key"),mF=iF("legendentries"),vF=iF("load"),yF=iF("mark"),bF=iF("multiextent"),xF=iF("multivalues"),_F=iF("overlap"),wF=iF("params"),OF=iF("prefacet"),EF=iF("projection"),AF=iF("proxy"),kF=iF("relay"),SF=iF("render"),jF=iF("scale"),DF=iF("sieve"),CF=iF("sortitems"),MF=iF("viewlayout"),FF=iF("values"),NF=0,TF={min:"min",max:"max",count:"sum"};function RF(t,e){var n=t.type||"linear";(function(t){switch(t){case up:case cp:case lp:case fp:case dp:case hp:case pp:case gp:case mp:case yp:case bp:case xp:case _p:case wp:case Op:case Ep:return!0}return!1})(n)||Object(et.n)("Unrecognized scale type: "+Object(et.Y)(n)),e.addScale(t.name,{type:n,domain:void 0})}function zF(t,e){var n,r,i=e.getScale(t.name).params;for(n in i.domain=BF(t.domain,t,e),null!=t.range&&(i.range=function t(e,n,r){var i=e.range,o=n.config.range;if(i.signal)return n.signalRef(i.signal);if(Object(et.H)(i)){if(o&&Object(et.v)(o,i))return e=Object(et.o)({},e,{range:o[i]}),t(e,n,r);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=Dp(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(et.n)("Unrecognized scale range value: "+Object(et.Y)(i))}else{if(i.scheme)return r.scheme=Object(et.A)(i.scheme)?LF(i.scheme,n):$F(i.scheme,n),i.extent&&(r.schemeExtent=LF(i.extent,n)),void(i.count&&(r.schemeCount=$F(i.count,n)));if(i.step)return void(r.rangeStep=$F(i.step,n));if(Dp(e.type)&&!Object(et.A)(i))return BF(i,e,n);Object(et.A)(i)||Object(et.n)("Unsupported range type: "+Object(et.Y)(i))}return i.map(t=>(Object(et.A)(t)?LF:$F)(t,n))}(t,e,i)),null!=t.interpolate&&function(t,e){e.interpolate=$F(t.type||t),null!=t.gamma&&(e.interpolateGamma=$F(t.gamma))}(t.interpolate,i),null!=t.nice&&(i.nice=(r=t.nice,Object(et.F)(r)?{interval:$F(r.interval),step:$F(r.step)}:$F(r))),null!=t.bins&&(i.bins=function(t,e){return t.signal||Object(et.A)(t)?LF(t,e):e.objectProperty(t)}(t.bins,e)),t)Object(et.v)(i,n)||"name"===n||(i[n]=$F(t[n],e))}function $F(t,e){return Object(et.F)(t)?t.signal?e.signalRef(t.signal):Object(et.n)("Unsupported object: "+Object(et.Y)(t)):t}function LF(t,e){return t.signal?e.signalRef(t.signal):t.map(t=>$F(t,e))}function IF(t){Object(et.n)("Can not find data set: "+Object(et.Y)(t))}function BF(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(Object(et.A)(t)?PF:t.fields?qF:UF)(t,e,n);null==e.domainMin&&null==e.domainMax||Object(et.n)("No scale domain defined for domainMin/domainMax to override.")}function PF(t,e,n){return t.map((function(t){return $F(t,n)}))}function UF(t,e,n){var r=n.getData(t.data);return r||IF(t.data),Dp(e.type)?r.valuesRef(n,t.field,HF(t.sort,!1)):Ap(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function qF(t,e,n){var r=t.data,i=t.fields.reduce((function(t,e){return e=Object(et.H)(e)?{data:r,field:e}:Object(et.A)(e)||e.signal?function(t,e){var n="_:vega:_"+NF++,r=uF({});if(Object(et.A)(t))r.value={$ingest:t};else if(t.signal){var i="setdata("+Object(et.Y)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,DF({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t}),[]);return(Dp(e.type)?WF:Ap(e.type)?YF:GF)(t,n,i)}function WF(t,e,n){var r,i,o,a,s,u=HF(t.sort,!0);return r=n.map((function(t){var n=e.getData(t.data);return n||IF(t.data),n.countsRef(e,t.field,u)})),i={groupby:OM,pulse:r},u&&(o=u.op||"count",s=u.field?kM(o,u.field):"count",i.ops=[TF[o]],i.fields=[e.fieldRef(s)],i.as=[s]),o=e.add(oF(i)),a=e.add(uF({pulse:_M(o)})),s=e.add(FF({field:OM,sort:e.sortRef(u),pulse:_M(a)})),_M(s)}function HF(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!TF[t.op]&&Object(et.n)("Multiple domain scales can not be sorted using "+t.op):Object(et.n)("No field provided for sort aggregate op: "+t.op):Object(et.F)(t)?t.field="key":t={field:"key"}),t}function YF(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||IF(t.data),n.domainRef(e,t.field)}));return _M(e.add(xF({values:r})))}function GF(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||IF(t.data),n.extentRef(e,t.field)}));return _M(e.add(bF({extents:r})))}function VF(t,e,n){return Object(et.A)(t)?t.map((function(t){return VF(t,e,n)})):Object(et.F)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:Object(et.n)("Unsupported parameter object: "+Object(et.Y)(t)):t}const XF="vertical",JF="start",ZF="end",QF="value",KF="guide-label",tN="group-title",eN="group-subtitle",nN="symbol",rN="gradient",iN="discrete",oN=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],aN={name:1,style:1,interactive:1},sN={value:0},uN={value:1};var cN=Object(et.cb)(["rule"]),lN=Object(et.cb)(["group","image","rect"]),fN=function(t,e){var n="";return cN[e]?n:(t.x2&&(t.x?(lN[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(lN[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;"),n)},dN=function(t,e,n,r){var i=vM(t,e);return i.$fields.forEach((function(t){r[t]=1})),Object(et.o)(n,i.$params),i.$expr},hN=function(t,e,n,r){return function t(e,n,r,i){var o,a,s;if(e.signal)o="datum",s=dN(e.signal,n,r,i);else if(e.group||e.parent){for(a=Math.max(1,e.level||1),o="item";a-- >0;)o+=".mark.group";e.parent?(s=e.parent,o+=".datum"):s=e.group}else e.datum?(o="datum",s=e.datum):Object(et.n)("Invalid field reference: "+Object(et.Y)(e));e.signal||(Object(et.H)(s)?(i[s]=1,s=Object(et.X)(s).map(et.Y).join("][")):s=t(s,n,r,i));return o+"["+s+"]"}(Object(et.F)(t)?t:{datum:t},e,n,r)};var pN=function(t,e,n,r){return Object(et.F)(t)?"("+vN(null,t,e,n,r)+")":t},gN=function(t,e,n,r,i){var o,a,s,u=mN(t.scale,n,r,i);return null!=t.range?(a=u+".range()",e=0===(o=+t.range)?a+"[0]":"($="+a+","+(1===o?"$[$.length-1]":"$[0]+"+o+"*($[$.length-1]-$[0])")+")"):(void 0!==e&&(e=u+"("+e+")"),t.band&&(s=function(t,e){if(!Object(et.H)(t))return-1;var n=e.scaleType(t);return"band"===n||"point"===n?1:0}(t.scale,n))&&(a=u+".bandwidth",o=t.band.signal?a+"()*"+pN(t.band,n,r,i):a+"()"+(1===(o=+t.band)?"":"*"+o),s<0&&(o="("+a+"?"+o+":0)"),e=(e?e+"+":"")+o,t.extra&&(e="(datum.extra?"+u+"(datum.extra.value):"+e+")")),null==e&&(e="0")),e};function mN(t,e,n,r){var i;if(Object(et.H)(t))i=_C+t,Object(et.v)(n,i)||(n[i]=e.scaleRef(t)),i=Object(et.Y)(i);else{for(i in e.scales)n[_C+i]=e.scaleRef(i);i=Object(et.Y)(_C)+"+"+(t.signal?"("+dN(t.signal,e,n,r)+")":hN(t,e,n,r))}return"_["+i+"]"}var vN=function(t,e,n,r,i){if(null!=e.gradient)return function(t,e,n,r){return"this.gradient("+mN(t.gradient,e,n,r)+","+Object(et.Y)(t.start)+","+Object(et.Y)(t.stop)+","+Object(et.Y)(t.count)+")"}(e,n,r,i);var o=e.signal?dN(e.signal,n,r,i):e.color?function(t,e,n,r){function i(t,i,o,a){return"this."+t+"("+[vN(null,i,e,n,r),vN(null,o,e,n,r),vN(null,a,e,n,r)].join(",")+").toString()"}return t.c?i("hcl",t.h,t.c,t.l):t.h||t.s?i("hsl",t.h,t.s,t.l):t.l||t.a?i("lab",t.l,t.a,t.b):t.r||t.g||t.b?i("rgb",t.r,t.g,t.b):null}(e.color,n,r,i):null!=e.field?hN(e.field,n,r,i):void 0!==e.value?Object(et.Y)(e.value):void 0;return null!=e.scale&&(o=gN(e,o,n,r,i)),void 0===o&&(o=null),null!=e.exponent&&(o="Math.pow("+o+","+pN(e.exponent,n,r,i)+")"),null!=e.mult&&(o+="*"+pN(e.mult,n,r,i)),null!=e.offset&&(o+="+"+pN(e.offset,n,r,i)),e.round&&(o="Math.round("+o+")"),o},yN=function(t,e,n){const r=t+"["+Object(et.Y)(e)+"]";return`$=${n};if(${r}!==$)${r}=$,m=1;`},bN=function(t,e,n,r,i){var o="";return e.forEach((function(e){var a=vN(t,e,n,r,i);o+=e.test?dN(e.test,n,r,i)+"?"+a+":":a})),":"===Object(et.T)(o)&&(o+="null"),yN("o",t,o)};function xN(t,e,n,r){var i,o,a,s={},u="var o=item,datum=o.datum,m=0,$;";for(i in t)o=t[i],Object(et.A)(o)?u+=bN(i,o,r,n,s):(a=vN(i,o,r,n,s),u+=yN("o",i,a));return u+=fN(t,e),{$expr:u+="return m;",$fields:Object.keys(s),$output:Object.keys(t)}}var _N="mark",wN="frame",ON="title-text",EN="title-subtitle";function AN(t){return Object(et.F)(t)&&!Object(et.A)(t)?Object(et.o)({},t):{value:t}}function kN(t,e,n,r){return null!=n?(Object(et.F)(n)&&!Object(et.A)(n)?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function SN(t,e,n){for(let n in e)kN(t,n,e[n]);for(let e in n)kN(t,e,n[e],"update")}function jN(t,e,n){for(var r in e)n&&Object(et.v)(n,r)||(t[r]=Object(et.o)(t[r]||{},e[r]));return t}function DN(t,e,n,r,i,o){var a,s;for(s in(o=o||{}).encoders={$encode:a={}},t=function(t,e,n,r,i){var o,a,s,u={},c={};"legend"!=n&&0!==String(n).indexOf("axis")||(n=null);for(a in s=n===wN?i.group:n===_N?Object(et.o)({},i.mark,i[e]):null)MN(a,t)||("fill"===a||"stroke"===a)&&(MN("fill",t)||MN("stroke",t))||CN(u,a,s[a]);for(a in Object(et.i)(r).forEach((function(e){var n=i.style&&i.style[e];for(var r in n)MN(r,t)||CN(u,r,n[r])})),t=Object(et.o)({},t),u)(s=u[a]).signal?(o=o||{})[a]=s:c[a]=s;t.enter=Object(et.o)(c,t.enter),o&&(t.update=Object(et.o)(o,t.update));return t}(t,e,n,r,i.config))a[s]=xN(t[s],e,o,i);return o}function CN(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}function MN(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}var FN=function(t,e,n,r,i,o,a){return{type:t,name:a?a.name:void 0,role:e,style:a&&a.style||n,key:r,from:i,interactive:!(!a||!a.interactive),encode:jN(o,a,aN)}};function NN(t,e){const n=(n,r)=>MM(t[n],MM(e[n],r));return n.isVertical=n=>XF===MM(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>MM(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>MM(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>MM(t.columns,MM(e.columns,+n.isVertical(!0))),n}function TN(t,e){var n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function RN(t,e,n){return`item.anchor === "${JF}" ? ${t} : item.anchor === "${ZF}" ? ${e} : ${n}`}const zN=RN(Object(et.Y)("left"),Object(et.Y)("right"),Object(et.Y)("center"));var $N="group",LN="text",IN=function(t,e,n,r){var i,o,a,s,u,c,l=NN(t,n),f=l.isVertical(),d=l.gradientThickness(),h=l.gradientLength();return f?(a=[0,1],s=[0,0],u=d,c=h):(a=[0,0],s=[1,0],u=h,c=d),SN(i={enter:o={opacity:sN,x:sN,y:sN,width:AN(u),height:AN(c)},update:Object(et.o)({},o,{opacity:uN,fill:{gradient:e,start:a,stop:s}}),exit:{opacity:sN}},{stroke:l("gradientStrokeColor"),strokeWidth:l("gradientStrokeWidth")},{opacity:l("gradientOpacity")}),FN("rect","legend-gradient",null,void 0,void 0,i,r)},BN=function(t,e,n,r,i){var o,a,s,u,c,l,f=NN(t,n),d=f.isVertical(),h=f.gradientThickness(),p=f.gradientLength(),g="";return d?(s="y",c="y2",u="x",l="width",g="1-"):(s="x",c="x2",u="y",l="height"),(a={opacity:sN,fill:{scale:e,field:QF}})[s]={signal:g+"datum.perc",mult:p},a[u]=sN,a[c]={signal:g+"datum.perc2",mult:p},a[l]=AN(h),SN(o={enter:a,update:Object(et.o)({},a,{opacity:uN}),exit:{opacity:sN}},{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),FN("rect","legend-band",null,QF,i,o,r)};var PN=function(t,e,n,r){var i,o,a,s,u,c=NN(t,e),l=c.isVertical(),f=AN(c.gradientThickness()),d=c.gradientLength(),h=c("labelOverlap"),p=c("labelSeparation"),g="";return SN(i={enter:o={opacity:sN},update:a={opacity:uN,text:{field:"label"}},exit:{opacity:sN}},{fill:c("labelColor"),fillOpacity:c("labelOpacity"),font:c("labelFont"),fontSize:c("labelFontSize"),fontStyle:c("labelFontStyle"),fontWeight:c("labelFontWeight"),limit:MM(t.labelLimit,e.gradientLabelLimit)}),l?(o.align={value:"left"},o.baseline=a.baseline={signal:'datum.perc<=0?"bottom":datum.perc>=1?"top":"middle"'},s="y",u="x",g="1-"):(o.align=a.align={signal:'datum.perc<=0?"left":datum.perc>=1?"right":"center"'},o.baseline={value:"top"},s="x",u="y"),o[s]=a[s]={signal:g+"datum.perc",mult:d},o[u]=a[u]=f,f.offset=MM(t.labelOffset,e.gradientLabelOffset)||0,t=FN(LN,"legend-label",KF,QF,r,i,n),h&&(t.overlap={separation:p,method:h,order:"datum.index"}),t},UN=function(t,e,n,r,i,o,a,s){return{type:$N,name:n,role:t,style:e,from:r,interactive:i||!1,encode:o,marks:a,layout:s}},qN=function(t,e,n,r,i){var o,a,s,u,c,l,f,d=NN(t,e),h=n.entries,p=!(!h||!h.interactive),g=h?h.name:void 0,m=d("clipHeight"),v=d("symbolOffset"),y={data:"value"},b={},x=`${i} ? datum.offset : datum.size`,_=m?AN(m):{field:"size"},w="datum.index",O=`max(1, ${i})`;_.mult=.5,b={enter:o={opacity:sN,x:{signal:x,mult:.5,offset:v},y:_},update:a={opacity:uN,x:o.x,y:o.y},exit:{opacity:sN}};var E=null,A=null;return t.fill||(E=e.symbolBaseFillColor,A=e.symbolBaseStrokeColor),SN(b,{fill:d("symbolFillColor",E),shape:d("symbolType"),size:d("symbolSize"),stroke:d("symbolStrokeColor",A),strokeDash:d("symbolDash"),strokeDashOffset:d("symbolDashOffset"),strokeWidth:d("symbolStrokeWidth")},{opacity:d("symbolOpacity")}),oN.forEach((function(e){t[e]&&(a[e]=o[e]={scale:t[e],field:QF})})),u=FN("symbol","legend-symbol",null,QF,y,b,n.symbols),m&&(u.clip=!0),(s=AN(v)).offset=d("labelOffset"),SN(b={enter:o={opacity:sN,x:{signal:x,offset:s},y:_},update:a={opacity:uN,text:{field:"label"},x:o.x,y:o.y},exit:{opacity:sN}},{align:d("labelAlign"),baseline:d("labelBaseline"),fill:d("labelColor"),fillOpacity:d("labelOpacity"),font:d("labelFont"),fontSize:d("labelFontSize"),fontStyle:d("labelFontStyle"),fontWeight:d("labelFontWeight"),limit:d("labelLimit")}),c=FN(LN,"legend-label",KF,QF,y,b,n.labels),b={enter:{noBound:{value:!m},width:sN,height:m?AN(m):sN,opacity:sN},exit:{opacity:sN},update:a={opacity:uN,row:{signal:null},column:{signal:null}}},d.isVertical(!0)?(l=`ceil(item.mark.items.length / ${O})`,a.row.signal=`${w}%${l}`,a.column.signal=`floor(${w} / ${l})`,f={field:["row",w]}):(a.row.signal=`floor(${w} / ${O})`,a.column.signal=`${w} % ${O}`,f={field:w}),a.column.signal=`${i}?${a.column.signal}:${w}`,(t=UN("scope",null,g,r={facet:{data:r,name:"value",groupby:"index"}},p,jN(b,h,aN),[u,c])).sort=f,t};const WN='item.orient === "left"',HN='item.orient === "right"',YN=`(${WN} || ${HN})`,GN=`datum.vgrad && ${YN}`,VN=RN('"top"','"bottom"','"middle"'),XN=`datum.vgrad && ${HN} ? (${RN('"right"','"left"','"center"')}) : (${YN} && !(datum.vgrad && ${WN})) ? "left" : ${zN}`,JN=`item._anchor || (${YN} ? "middle" : "start")`,ZN=`${GN} ? (${WN} ? -90 : 90) : 0`,QN=`${YN} ? (datum.vgrad ? (${HN} ? "bottom" : "top") : ${VN}) : "top"`;var KN=function(t,e){var n;return Object(et.F)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+tT(t.path)+")":t.sphere&&(n="geoShape("+tT(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t};function tT(t){return Object(et.F)(t)&&t.signal?t.signal:Object(et.Y)(t)}var eT=function(t){var e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===$N?"scope":e||_N:e},nT=function(t){return{marktype:t.type,name:t.name||void 0,role:t.role||eT(t),zindex:+t.zindex||void 0}},rT=function(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t},iT=function(t,e){var n=$r(t.type);n||Object(et.n)("Unrecognized transform type: "+Object(et.Y)(t.type));var r=bM(n.type.toLowerCase(),null,oT(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r};function oT(t,e,n){var r,i,o,a={};for(i=0,o=t.params.length;i<o;++i)a[(r=t.params[i]).name]=aT(r,e,n);return a}function aT(t,e,n){var r=t.type,i=e[t.name];return"index"===r?function(t,e,n){Object(et.H)(e.from)||Object(et.n)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==i?"param"===r?function(t,e,n){var r=e[t.name];return t.array?(Object(et.A)(r)||Object(et.n)("Expected an array of sub-parameters. Instead: "+Object(et.Y)(r)),r.map((function(e){return uT(t,e,n)}))):uT(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!DM(i)?i.map((function(e){return sT(t,e,n)})):sT(t,i,n):void(t.required&&Object(et.n)("Missing required "+Object(et.Y)(e.type)+" parameter: "+Object(et.Y)(t.name)))}function sT(t,e,n){var r=t.type;if(DM(e))return cT(r)?Object(et.n)("Expression references can not be signals."):lT(r)?n.fieldRef(e):fT(r)?n.compareRef(e):n.signalRef(e.signal);var i,o=t.expr||lT(r);return o&&((i=e)&&i.expr)?n.exprRef(e.expr,e.as):o&&function(t){return t&&t.field}(e)?wM(e.field,e.as):cT(r)?vM(e,n):function(t){return"data"===t}(r)?_M(n.getData(e).values):lT(r)?wM(e):fT(r)?n.compareRef(e):e}function uT(t,e,n){var r,i,o,a,s;for(a=0,s=t.params.length;a<s;++a){for(o in(i=t.params[a]).key)if(i.key[o]!==e[o]){i=null;break}if(i)break}return i||Object(et.n)("Unsupported parameter: "+Object(et.Y)(e)),r=Object(et.o)(oT(i,e,n),i.key),_M(n.add(wF(r)))}function cT(t){return"expr"===t}function lT(t){return"field"===t}function fT(t){return"compare"===t}function dT(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:_M(e.getData(t.data).output)}function hT(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}hT.fromEntries=function(t,e){var n=e.length,r=1,i=e[0],o=e[n-1],a=e[n-2],s=null;for(i&&"load"===i.type&&(i=e[1]),t.add(e[0]);r<n;++r)e[r].params.pulse=_M(e[r-1]),t.add(e[r]),"aggregate"===e[r].type&&(s=e[r]);return new hT(t,i,a,o,s)};var pT=hT.prototype;function gT(t){return Object(et.H)(t)?t:null}function mT(t,e,n){var r,i=kM(n.op,n.field);if(e.ops){for(var o=0,a=e.as.length;o<a;++o)if(e.as[o]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((r=n.op.signal)?t.signalRef(r):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(i))}function vT(t,e,n,r,i,o,a){var s,u,c=e[n]||(e[n]={}),l=function(t){return Object(et.F)(t)?(t.order===AM?"-":"+")+kM(t.op,t.field):""}(o),f=gT(i);if(null!=f&&(t=e.scope,s=c[f+=l?"|"+l:""]),!s){var d=o?{field:OM,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:_M(e.output)};l&&(d.sort=t.sortRef(o)),u=t.add(bM(r,void 0,d)),a&&(e.index[i]=u),s=_M(u),null!=f&&(c[f]=s)}return s}pT.countsRef=function(t,e,n){var r,i,o,a=this.counts||(this.counts={}),s=gT(e);return null!=s&&(t=this.scope,r=a[s]),r?n&&n.field&&mT(t,r.agg.params,n):(o={groupby:t.fieldRef(e,"key"),pulse:_M(this.output)},n&&n.field&&mT(t,o,n),i=t.add(oF(o)),r=t.add(uF({pulse:_M(i)})),r={agg:i,ref:_M(r)},null!=s&&(a[s]=r)),r.ref},pT.tuplesRef=function(){return _M(this.values)},pT.extentRef=function(t,e){return vT(t,this,"extent","extent",e,!1)},pT.domainRef=function(t,e){return vT(t,this,"domain","values",e,!1)},pT.valuesRef=function(t,e,n){return vT(t,this,"vals","values",e,n||!0)},pT.lookupRef=function(t,e){return vT(t,this,"lookup","tupleindex",e,!1)},pT.indataRef=function(t,e){return vT(t,this,"indata","tupleindex",e,!0,!0)};var yT=function(t,e,n){var r,i,o=t.remove,a=t.insert,s=t.toggle,u=t.modify,c=t.values,l=e.add(xM());r="if("+t.trigger+',modify("'+n+'",'+[a,o,s,u,c].map((function(t){return null==t?"null":t})).join(",")+"),0)",i=vM(r,e),l.update=i.$expr,l.params=i.$params},bT=function(t,e){var n,r,i,o,a,s,u,c,l,f,d,h,p,g,m=eT(t),v=t.type===$N,y=t.from&&t.from.facet,b=t.layout||"scope"===m||m===wN,x=m===_N||b||y,_=t.overlap;i=function(t,e,n){var r,i,o,a,s;return t?(r=t.facet)&&(e||Object(et.n)("Only group marks can be faceted."),null!=r.field?a=s=dT(r,n):(t.data?s=_M(n.getData(t.data).aggregate):((o=iT(Object(et.o)({type:"aggregate",groupby:Object(et.i)(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),o.params.pulse=dT(r,n),a=s=_M(n.add(o))),i=n.keyRef(r.groupby,!0))):a=_M(n.add(uF(null,[{}]))),a||(a=dT(t,n)),{key:i,pulse:a,parent:s}}(t.from,v,e),f=_M(r=e.add(lF({key:i.key||(t.key?wM(t.key):void 0),pulse:i.pulse,clean:!v}))),r=o=e.add(uF({pulse:f})),r=e.add(yF({markdef:nT(t),interactive:rT(t.interactive,e),clip:KN(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:_M(r)})),d=_M(r),(r=a=e.add(fF(DN(t.encode,t.type,m,t.style,e,{mod:!1,pulse:d})))).params.parent=e.encode(),t.transform&&t.transform.forEach((function(t){const n=iT(t,e),i=n.metadata;(i.generates||i.changes)&&Object(et.n)("Mark transforms should not generate new data."),i.nomod||(a.params.mod=!0),n.params.pulse=_M(r),e.add(r=n)})),t.sort&&(r=e.add(CF({sort:e.compareRef(t.sort),pulse:_M(r)}))),h=_M(r),(y||b)&&(p=_M(b=e.add(MF({layout:e.objectProperty(t.layout),legends:e.legends,mark:d,pulse:h})))),g=_M(s=e.add(sF({mark:d,pulse:p||h}))),v&&(x&&((n=e.operators).pop(),b&&n.pop()),e.pushState(h,p||g,f),y?function(t,e,n){var r,i,o,a,s=t.from.facet,u=s.name,c=dT(s,e);s.name||Object(et.n)("Facet must have a name: "+Object(et.Y)(s)),s.data||Object(et.n)("Facet must reference a data set: "+Object(et.Y)(s)),s.field?a=e.add(OF({field:e.fieldRef(s.field),pulse:c})):s.groupby?a=e.add(hF({key:e.keyRef(s.groupby),group:_M(e.proxy(n.parent)),pulse:c})):Object(et.n)("Facet must specify groupby or field: "+Object(et.Y)(s)),i=(r=e.fork()).add(uF()),o=r.add(DF({pulse:_M(i)})),r.addData(u,new hT(r,i,i,o)),r.addSignal("parent",null),a.params.subflow={$subflow:MT(t,r).toRuntime()}}(t,e,i):x?function(t,e,n){var r=e.add(OF({pulse:n.pulse})),i=e.fork();i.add(DF()),i.addSignal("parent",null),r.params.subflow={$subflow:MT(t,i).toRuntime()}}(t,e,i):MT(t,e),e.popState(),x&&(b&&n.push(b),n.push(s))),_&&(g=function(t,e,n){var r,i=t.method,o=t.bound,a=t.separation,s={separation:DM(a)?n.signalRef(a.signal):a,method:DM(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(s.sort=n.compareRef({field:t.order}));o&&(r=o.tolerance,s.boundTolerance=DM(r)?n.signalRef(r.signal):+r,s.boundScale=n.scaleRef(o.scale),s.boundOrient=o.orient);return _M(n.add(_F(s)))}(_,g,e)),u=e.add(SF({pulse:g})),c=e.add(DF({pulse:_M(u)},void 0,e.parent())),null!=t.name&&(l=t.name,e.addData(l,new hT(e,o,u,c)),t.on&&t.on.forEach((function(t){(t.insert||t.remove||t.toggle)&&Object(et.n)("Marks only support modify triggers."),yT(t,e,l)})))};var xT=function(t,e){var n,r,i,o,a,s,u,c,l,f=e.config.legend,d=t.encode||{},h=d.legend||{},p=h.name||void 0,g=h.interactive,m=h.style,v=NN(t,f),y=oN.reduce((function(e,n){return e||t[n]}),0);return y||Object(et.n)("Missing valid scale for legend."),a=function(t,e){var n=t.type||nN;t.type||1!==function(t){return oN.reduce((function(e,n){return e+(t[n]?1:0)}),0)}(t)||!t.fill&&!t.stroke||(n=jp(e)?rN:Cp(e)?iN:nN);return n!==rN?n:Cp(e)?iN:rN}(t,e.scaleType(y)),s={title:null!=t.title,type:a,vgrad:"symbol"!==a&&v.isVertical()},u=_M(e.add(uF(null,[s]))),h=jN(function(t,e){var n={enter:{},update:{}};return SN(n,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:e.strokeWidth,strokeDash:e.strokeDash,x:t("legendX"),y:t("legendY")}),n}(v,f),h,aN),n={enter:{x:{value:0},y:{value:0}}},c=_M(e.add(mF(i={type:a,scale:e.scaleRef(y),count:e.objectProperty(v("tickCount")),limit:e.property(v("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),a===rN?(o=[IN(t,y,f,d.gradient),PN(t,f,d.labels,c)],i.count=i.count||e.signalRef(`max(2,2*floor((${FM(v.gradientLength())})/100))`)):a===iN?o=[BN(t,y,f,d.gradient,c),PN(t,f,d.labels,c)]:(r=function(t,e){const n=NN(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,f),o=[qN(t,f,d,c,FM(r.columns))],i.size=function(t,e,n){var r=FM(_T("size",t,n)),i=FM(_T("strokeWidth",t,n)),o=FM(function(t,e,n){return TN("fontSize",t)||function(t,e,n){var r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,KF));return vM(`max(ceil(sqrt(${r})+${i}),${o})`,e)}(t,e,o[0].marks)),o=[UN("legend-entry",null,null,u,g,n,o,r)],s.title&&o.push(function(t,e,n,r){var i,o=NN(t,e);return SN(i={enter:{opacity:sN},update:{opacity:uN,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:sN}},{orient:o("titleOrient"),_anchor:o("titleAnchor"),anchor:{signal:JN},angle:{signal:ZN},align:{signal:XN},baseline:{signal:QN},text:t.title,fill:o("titleColor"),fillOpacity:o("titleOpacity"),font:o("titleFont"),fontSize:o("titleFontSize"),fontStyle:o("titleFontStyle"),fontWeight:o("titleFontWeight"),limit:o("titleLimit"),lineHeight:o("titleLineHeight")},{align:o("titleAlign"),baseline:o("titleBaseline")}),FN(LN,"legend-title","guide-title",null,r,i,n)}(t,f,d.title,u)),l=UN("legend",m,p,u,g,h,o),t.zindex&&(l.zindex=t.zindex),bT(l,e)};function _T(t,e,n){return e[t]?`scale("${e[t]}",datum)`:TN(t,n[0].encode)}const wT='item.orient==="left"?-90:item.orient==="right"?90:0';var OT=function(t,e){var n,r,i=NN(t=Object(et.H)(t)?{text:t}:t,e.config.title),o=t.encode||{},a=o.group||{},s=a.name||void 0,u=a.interactive,c=a.style,l=[];return n=_M(e.add(uF(null,[{}]))),l.push(function(t,e,n,r){var i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return SN(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),FN(LN,ON,tN,null,r,a,n)}(t,i,function(t){const e=t.encode;return e&&e.title||Object(et.o)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),n)),t.subtitle&&l.push(function(t,e,n,r){var i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return SN(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),FN(LN,EN,eN,null,r,a,n)}(t,i,o.subtitle,n)),r=UN("title",c,s,n,u,function(t,e){var n={enter:{},update:{}};return SN(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:zN},angle:{signal:wT},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),jN(n,e,aN)}(i,a),l),t.zindex&&(r.zindex=t.zindex),bT(r,e)};function ET(t,e){var n=[];t.transform&&t.transform.forEach((function(t){n.push(iT(t,e))})),t.on&&t.on.forEach((function(n){yT(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){var r,i,o,a,s,u=[],c=null,l=!1,f=!1;t.values?CM(t.values)||CM(t.format)?(u.push(kT(e,t)),u.push(c=AT())):u.push(c=AT({$ingest:t.values,$format:t.format})):t.url?CM(t.url)||CM(t.format)?(u.push(kT(e,t)),u.push(c=AT())):u.push(c=AT({$request:t.url,$format:t.format})):t.source&&(c=r=Object(et.i)(t.source).map((function(t){return _M(e.getData(t).output)})),u.push(null));for(i=0,o=n.length;i<o;++i)a=n[i],s=a.metadata,c||s.source||u.push(c=AT()),u.push(a),s.generates&&(f=!0),s.modifies&&!f&&(l=!0),s.source?c=a:s.changes&&(c=null);r&&(o=r.length-1,u[0]=kF({derive:l,pulse:o?r:r[0]}),(l||o)&&u.splice(1,0,AT()));c||u.push(AT());return u.push(DF({})),u}(t,e,n))}function AT(t){var e=uF({},t);return e.metadata={source:!0},e}function kT(t,e){return vF({url:e.url?t.property(e.url):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}function ST(t,e){return{scale:t.scale,range:e}}var jT=function(t,e,n,r,i){var o,a,s,u,c,l,f,d,h,p=NN(t,e),g=t.orient,m=t.gridScale,v="left"===g||"top"===g?1:-1,y=function(t,e){if(1===e);else if(Object(et.F)(t)){for(var n=t=Object(et.o)({},t);null!=n.mult;){if(!Object(et.F)(n.mult))return n.mult*=e,t;n=n.mult=Object(et.o)({},n.mult)}n.mult=e}else t=e*(t||0);return t}(t.offset,v);return SN(o={enter:a={opacity:sN},update:u={opacity:uN},exit:s={opacity:sN}},{stroke:p("gridColor"),strokeDash:p("gridDash"),strokeDashOffset:p("gridDashOffset"),strokeOpacity:p("gridOpacity"),strokeWidth:p("gridWidth")}),c={scale:t.scale,field:QF,band:i.band,extra:i.extra,offset:i.offset,round:p("tickRound")},"top"===g||"bottom"===g?(l="x",f="y",h="height"):(l="y",f="x",h="width"),d=f+"2",u[l]=a[l]=s[l]=c,m?(u[f]=a[f]={scale:m,range:0,mult:v,offset:y},u[d]=a[d]={scale:m,range:1,mult:v,offset:y}):(u[f]=a[f]={value:0,offset:y},u[d]=a[d]={signal:h,mult:v,offset:y}),FN("rule","axis-grid",null,QF,r,o,n)};function DT(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}var CT=function(t,e){var n,r,i,o,a,s,u=function(t,e){var n=e.config,r=t.orient,i="top"===r||"bottom"===r?n.axisX:n.axisY,o=n["axis"+r[0].toUpperCase()+r.slice(1)],a="band"===e.scaleType(t.scale)&&n.axisBand;return i||o||a?Object(et.o)({},n.axis,i,o,a):n.axis}(t,e),c=t.encode||{},l=c.axis||{},f=l.name||void 0,d=l.interactive,h=l.style,p=NN(t,u),g=function(t){let e,n,r=t("tickBand"),i=t("tickOffset");return r?r.signal?(e={signal:`(${r.signal})==='extent'?1:0.5`},n={signal:`(${r.signal})==='extent'?true:false`},Object(et.F)(i)||(i={signal:`(${r.signal})==='extent'?0:${i}`})):"extent"===r?(e=1,n=!0,i=0):(e=.5,n=!1):(e=t("bandPosition"),n=t("tickExtra")),{extra:n,band:e,offset:i}}(p);return n={orient:t.orient,ticks:!!p("ticks"),labels:!!p("labels"),grid:!!p("grid"),domain:!!p("domain"),title:null!=t.title,translate:p("translate")},r=_M(e.add(uF({},[n]))),l=jN({update:{offset:AN(p("offset")||0),position:AN(MM(t.position,0)),titlePadding:AN(p("titlePadding")),minExtent:AN(p("minExtent")),maxExtent:AN(p("maxExtent")),range:{signal:`abs(span(range("${t.scale}")))`}}},c.axis,aN),i=_M(e.add(aF({scale:e.scaleRef(t.scale),extra:e.property(g.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),s=[],n.grid&&s.push(jT(t,u,c.grid,i,g)),n.ticks&&(o=p("tickSize"),s.push(function(t,e,n,r,i,o){var a,s,u,c,l,f,d=NN(t,e),h=t.orient,p="left"===h||"top"===h?-1:1;return SN(a={enter:s={opacity:sN},update:c={opacity:uN},exit:u={opacity:sN}},{stroke:d("tickColor"),strokeDash:d("tickDash"),strokeDashOffset:d("tickDashOffset"),strokeOpacity:d("tickOpacity"),strokeWidth:d("tickWidth")}),(l=AN(i)).mult=p,f={scale:t.scale,field:QF,band:o.band,extra:o.extra,offset:o.offset,round:d("tickRound")},"top"===h||"bottom"===h?(c.y=s.y=sN,c.y2=s.y2=l,c.x=s.x=u.x=f):(c.x=s.x=sN,c.x2=s.x2=l,c.y=s.y=u.y=f),FN("rule","axis-tick",null,QF,r,a,n)}(t,u,c.ticks,i,o,g))),n.labels&&(o=n.ticks?o:0,s.push(function(t,e,n,r,i,o){var a,s,u,c,l,f,d,h,p,g,m=NN(t,e),v=t.orient,y="left"===v||"top"===v?-1:1,b="top"===v||"bottom"===v,x=t.scale,_=FM(m("labelFlush")),w=FM(m("labelFlushOffset")),O=0===_||!!_,E=m("labelAlign"),A=m("labelBaseline");return(u=AN(i)).mult=y,u.offset=AN(m("labelPadding")||0),u.offset.mult=y,c={scale:x,field:QF,band:.5,offset:o.offset},b?(l=E||(O?DT(x,_,'"left"','"right"','"center"'):"center"),f=A||("top"===v?"bottom":"top"),d=!E):(l=E||("right"===v?"left":"right"),f=A||(O?DT(x,_,'"top"','"bottom"','"middle"'):"middle"),d=!A),d=d&&O&&w?DT(x,_,"-("+w+")",w,0):null,SN(a={enter:s={opacity:sN,x:b?c:u,y:b?u:c},update:{opacity:uN,text:{field:"label"},x:s.x,y:s.y},exit:{opacity:sN,x:s.x,y:s.y}},{[b?"dx":"dy"]:d,align:l,baseline:f,angle:m("labelAngle"),fill:m("labelColor"),fillOpacity:m("labelOpacity"),font:m("labelFont"),fontSize:m("labelFontSize"),fontWeight:m("labelFontWeight"),fontStyle:m("labelFontStyle"),limit:m("labelLimit")}),h=m("labelBound"),p=m("labelOverlap"),g=m("labelSeparation"),t=FN(LN,"axis-label",KF,QF,r,a,n),(p||h)&&(t.overlap={separation:g,method:p,order:"datum.index",bound:h?{scale:x,orient:v,tolerance:h}:null}),t}(t,u,c.labels,i,o,g))),n.domain&&s.push(function(t,e,n,r){var i,o,a,s,u,c,l=NN(t,e),f=t.orient;return SN(i={enter:o={opacity:sN},update:a={opacity:uN},exit:{opacity:sN}},{stroke:l("domainColor"),strokeDash:l("domainDash"),strokeDashOffset:l("domainDashOffset"),strokeWidth:l("domainWidth"),strokeOpacity:l("domainOpacity")}),"top"===f||"bottom"===f?(s="x",c="y"):(s="y",c="x"),u=s+"2",o[c]=sN,a[s]=o[s]=ST(t,0),a[u]=o[u]=ST(t,1),FN("rule","axis-domain",null,null,r,i,n)}(t,u,c.domain,r)),n.title&&s.push(function(t,e,n,r){var i,o,a,s,u=NN(t,e),c=t.orient,l="left"===c||"top"===c?-1:1,f="top"===c||"bottom"===c;return i={enter:o={opacity:sN,anchor:AN(u("titleAnchor")),align:{signal:zN}},update:a=Object(et.o)({},o,{opacity:uN,text:AN(t.title)}),exit:{opacity:sN}},s={signal:`lerp(range("${t.scale}"), ${RN(0,1,.5)})`},f?(a.x=s,o.angle={value:0},o.baseline={value:"top"===c?"bottom":"top"}):(a.y=s,o.angle={value:90*l},o.baseline={value:"bottom"}),SN(i,{angle:u("titleAngle"),baseline:u("titleBaseline"),fill:u("titleColor"),fillOpacity:u("titleOpacity"),font:u("titleFont"),fontSize:u("titleFontSize"),fontStyle:u("titleFontStyle"),fontWeight:u("titleFontWeight"),limit:u("titleLimit"),lineHeight:u("titleLineHeight")},{align:u("titleAlign")}),!kN(i,"x",u("titleX"),"update")&&!f&&!MN("x",n)&&(i.enter.auto={value:!0}),!kN(i,"y",u("titleY"),"update")&&f&&!MN("y",n)&&(i.enter.auto={value:!0}),FN(LN,"axis-title","guide-title",null,r,i,n)}(t,u,c.title,r)),a=UN("axis",h,f,r,d,l,s),t.zindex&&(a.zindex=t.zindex),bT(a,e)},MT=function(t,e,n){var r=Object(et.i)(t.signals),i=Object(et.i)(t.scales);return n||r.forEach(t=>mM(t,e)),Object(et.i)(t.projections).forEach(t=>(function(t,e){var n=e.config.projection||{},r={};for(var i in t)"name"!==i&&(r[i]=VF(t[i],i,e));for(i in n)null==r[i]&&(r[i]=VF(n[i],i,e));e.addProjection(t.name,r)})(t,e)),i.forEach(t=>RF(t,e)),Object(et.i)(t.data).forEach(t=>ET(t,e)),i.forEach(t=>zF(t,e)),(n||r).forEach(t=>(function(t,e){var n=e.getSignal(t.name),r=t.update;t.init&&(r?Object(et.n)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=vM(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((function(t){nF(t,e,n.id)}))})(t,e)),Object(et.i)(t.axes).forEach(t=>CT(t,e)),Object(et.i)(t.marks).forEach(t=>bT(t,e)),Object(et.i)(t.legends).forEach(t=>xT(t,e)),t.title&&OT(t.title,e),e.parseLambdas(),e},FT=Object(et.cb)(["width","height","padding","autosize"]);function NT(t,e){var n,r,i,o,a,s,u=e.config;return e.background=t.background||u.background,e.eventConfig=u.events,a=_M(e.root=e.add(xM())),e.addSignal("width",t.width||0),e.addSignal("height",t.height||0),e.addSignal("padding",dM(t.padding,u)),e.addSignal("autosize",fM(t.autosize,u)),e.legends=e.objectProperty(u.legend&&u.legend.layout),s=function(t,e,n){if(Object(et.i)(e).forEach(e=>{FT[e.name]||mM(e,t)}),!n)return e;const r=Object(et.i)(e).slice();return Object(et.i)(n).forEach(e=>{t.hasOwnSignal(e.name)||(mM(e,t),r.push(e))}),r}(e,t.signals,u.signals),r=e.add(uF()),i=jN({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t.encode),i=e.add(fF(DN(i,$N,wN,t.style,e,{pulse:_M(r)}))),o=e.add(MF({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:a,pulse:_M(i)})),e.operators.pop(),e.pushState(_M(i),_M(o),null),MT(t,e,s),e.operators.push(o),n=e.add(sF({mark:a,pulse:_M(o)})),n=e.add(SF({pulse:_M(n)})),n=e.add(DF({pulse:_M(n)})),e.addData("root",new hT(e,r,r,n)),e}function TT(t){this.config=t,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function RT(t){this.config=t.config,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}var zT=TT.prototype=RT.prototype;function $T(t){return(Object(et.A)(t)?LT:IT)(t)}function LT(t){for(var e,n="[",r=0,i=t.length;r<i;++r)e=t[r],n+=(r>0?",":"")+(Object(et.F)(e)?e.signal||$T(e):Object(et.Y)(e));return n+"]"}function IT(t){var e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+Object(et.Y)(e)+":"+(Object(et.F)(n)?n.signal||$T(n):Object(et.Y)(n));return r+"}"}zT.fork=function(){return new RT(this)},zT.isSubscope=function(){return this._subid>0},zT.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},zT.id=function(){return(this._subid?this._subid+":":0)+this._id++},zT.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((function(e){e.$ref=t.id})),t.refs=null),t},zT.proxy=function(t){var e=t instanceof yM?_M(t):t;return this.add(AF({value:e}))},zT.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},zT.addUpdate=function(t){return this.updates.push(t),t},zT.finish=function(){var t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){var r;t&&((r=t.data||(t.data={}))[e]||(r[e]=[])).push(n)}for(t in this.data)for(var r in n((e=this.data[t]).input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values"),e.index)n(e.index[r],t,"index:"+r);return this},zT.pushState=function(t,e,n){this._encode.push(_M(this.add(DF({pulse:t})))),this._parent.push(e),this._lookup.push(n?_M(this.proxy(n)):null),this._markpath.push(-1)},zT.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},zT.parent=function(){return Object(et.T)(this._parent)},zT.encode=function(){return Object(et.T)(this._encode)},zT.lookup=function(){return Object(et.T)(this._lookup)},zT.markpath=function(){var t=this._markpath;return++t[t.length-1]},zT.fieldRef=function(t,e){if(Object(et.H)(t))return wM(t,e);t.signal||Object(et.n)("Unsupported field reference: "+Object(et.Y)(t));var n,r=t.signal,i=this.field[r];return i||(n={name:this.signalRef(r)},e&&(n.as=e),this.field[r]=i=_M(this.add(pF(n)))),i},zT.compareRef=function(t){function e(t){return DM(t)?(r=!0,n.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(r=!0,n.exprRef(t.expr)):t}var n=this,r=!1,i=Object(et.i)(t.field).map(e),o=Object(et.i)(t.order).map(e);return r?_M(this.add(cF({fields:i,orders:o}))):EM(i,o)},zT.keyRef=function(t,e){var n=this.signals,r=!1;return t=Object(et.i)(t).map((function(t){return DM(t)?(r=!0,_M(n[t.signal])):t})),r?_M(this.add(gF({fields:t,flat:e}))):function(t,e){var n={$key:t};return e&&(n.$flat=!0),n}(t,e)},zT.sortRef=function(t){if(!t)return t;var e=kM(t.op,t.field),n=t.order||"ascending";return n.signal?_M(this.add(cF({fields:e,orders:this.signalRef(n.signal)}))):EM(e,n)},zT.event=function(t,e){var n=t+":"+e;if(!this.events[n]){var r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},zT.hasOwnSignal=function(t){return Object(et.v)(this.signals,t)},zT.addSignal=function(t,e){this.hasOwnSignal(t)&&Object(et.n)("Duplicate signal name: "+Object(et.Y)(t));var n=e instanceof yM?e:this.add(xM(e));return this.signals[t]=n},zT.getSignal=function(t){return this.signals[t]||Object(et.n)("Unrecognized signal name: "+Object(et.Y)(t)),this.signals[t]},zT.signalRef=function(t){return this.signals[t]?_M(this.signals[t]):(Object(et.v)(this.lambdas,t)||(this.lambdas[t]=this.add(xM(null))),_M(this.lambdas[t]))},zT.parseLambdas=function(){for(var t=Object.keys(this.lambdas),e=0,n=t.length;e<n;++e){var r=t[e],i=vM(r,this),o=this.lambdas[r];o.params=i.$params,o.update=i.$expr}},zT.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},zT.objectProperty=function(t){return t&&Object(et.F)(t)?this.signalRef(t.signal||$T(t)):t},zT.exprRef=function(t,e){var n={expr:vM(t,this)};return e&&(n.expr.$name=e),_M(this.add(dF(n)))},zT.addBinding=function(t,e){this.bindings||Object(et.n)("Nested signals do not support binding: "+Object(et.Y)(t)),this.bindings.push(Object(et.o)({signal:t},e))},zT.addScaleProj=function(t,e){Object(et.v)(this.scales,t)&&Object(et.n)("Duplicate scale or projection name: "+Object(et.Y)(t)),this.scales[t]=this.add(e)},zT.addScale=function(t,e){this.addScaleProj(t,jF(e))},zT.addProjection=function(t,e){this.addScaleProj(t,EF(e))},zT.getScale=function(t){return this.scales[t]||Object(et.n)("Unrecognized scale name: "+Object(et.Y)(t)),this.scales[t]},zT.projectionRef=zT.scaleRef=function(t){return _M(this.getScale(t))},zT.projectionType=zT.scaleType=function(t){return this.getScale(t).params.type},zT.addData=function(t,e){return Object(et.v)(this.data,t)&&Object(et.n)("Duplicate data set name: "+Object(et.Y)(t)),this.data[t]=e},zT.getData=function(t){return this.data[t]||Object(et.n)("Undefined data set name: "+Object(et.Y)(t)),this.data[t]},zT.addDataPipeline=function(t,e){return Object(et.v)(this.data,t)&&Object(et.n)("Duplicate data set name: "+Object(et.Y)(t)),this.addData(t,hT.fromEntries(this,e))};var BT=function(t,e){return Object(et.F)(t)||Object(et.n)("Input Vega specification must be an object."),NT(t,new TT(e=Object(et.M)({padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}},e,t.config))).toRuntime()};Object(et.o)(zr,o,a,u,c,l,f,d,h,p,g);var PT=n(18),UT=function(t,e,n){return t.fields=e||[],t.fname=n,t};var qT=function(t){throw Error(t)},WT=function(t){var e,n,r,i=[],o=null,a=0,s=t.length,u="";function c(){i.push(u+t.substring(e,n)),u="",e=n+1}for(t+="",e=n=0;n<s;++n)if("\\"===(r=t[n]))u+=t.substring(e,n),e=++n;else if(r===o)c(),o=null,a=-1;else{if(o)continue;e===a&&'"'===r?(e=n+1,o=r):e===a&&"'"===r?(e=n+1,o=r):"."!==r||a?"["===r?(n>e&&c(),a=e=n+1):"]"===r&&(a||qT("Access path missing open bracket: "+t),a>0&&c(),a=0,e=n+1):n>e?c():e=n+1}return a&&qT("Access path missing closing bracket: "+t),o&&qT("Access path missing closing quote: "+t),n>e&&(n++,c()),i},HT=Array.isArray,YT=function(t){return t===Object(t)},GT=function(t){return"string"==typeof t};function VT(t){return HT(t)?"["+t.map(VT)+"]":YT(t)||GT(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}var XT,JT,ZT,QT,KT=[],tR=(ZT=WT(XT="id"),QT="return _["+ZT.map(VT).join("][")+"];",UT(Function("_",QT),[XT=1===ZT.length?ZT[0]:XT],JT||XT),UT((function(t){return t}),KT,"identity"));UT((function(){return 0}),KT,"zero"),UT((function(){return 1}),KT,"one"),UT((function(){return!0}),KT,"true"),UT((function(){return!1}),KT,"false");function eR(t,e,n){var r=[e].concat([].slice.call(n));console[t](...r)}var nR=function(t){return null!=t?HT(t)?t:[t]:[]},rR=function(t){return"function"==typeof t},iR=function(t){return"boolean"==typeof t},oR=function(t){return"number"==typeof t};var aR=function(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=!0;return e},sR=n(19),uR=n.n(sR),cR=n(20),lR=n.n(cR),fR=n(10),dR=n.n(fR);function hR(t){return!!t.or}function pR(t){return!!t.and}function gR(t){return!!t.not}function mR(t,e){return gR(t)?{not:mR(t.not,e)}:pR(t)?{and:t.and.map(t=>mR(t,e))}:hR(t)?{or:t.or.map(t=>mR(t,e))}:e(t)}const vR=lR.a,yR=uR.a;function bR(t,e){const n={};for(const r of e)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function xR(t,e){const n=Object.assign({},t);for(const t of e)delete n[t];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>dR()(t)).join(",")})`};const _R=dR.a;function wR(t){if(oR(t))return t;const e=GT(t)?t:dR()(t);if(e.length<250)return e;let n=0;for(let t=0;t<e.length;t++){n=(n<<5)-n+e.charCodeAt(t),n&=n}return n}function OR(t){return!1===t||null===t}function ER(t,e){return t.indexOf(e)>-1}function AR(t,e){let n=0;for(const[r,i]of t.entries())if(e(i,r,n++))return!0;return!1}function kR(t,e){let n=0;for(const[r,i]of t.entries())if(!e(i,r,n++))return!1;return!0}function SR(t){return[].concat(...t)}function jR(t,...e){for(const n of e)t=DR(t,n);return t}function DR(t,e){if("object"!=typeof e||null===e)return t;for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&("object"!=typeof e[n]||HT(e[n])||null===e[n]?t[n]=e[n]:"object"!=typeof t[n]||null===t[n]?t[n]=jR(HT(e[n].constructor)?[]:{},e[n]):jR(t[n],e[n]));return t}function CR(t,e){const n=[],r={};let i;for(const o of t)(i=e(o))in r||(r[i]=1,n.push(o));return n}function MR(t,e){for(const n of t)if(e.has(n))return!0;return!1}function FR(t){const e=new Set;for(const n of t){const t=WT(n).map((t,e)=>0===e?t:`[${t}]`);t.map((e,n)=>t.slice(0,n+1).join("")).forEach(t=>e.add(t))}return e}function NR(t,e){return MR(FR(t),FR(e))}const TR=Object.keys;function RR(t){const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}function zR(t){return!0===t||!1===t}function $R(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function LR(t,e){return gR(t)?"!("+LR(t.not,e)+")":pR(t)?"("+t.and.map(t=>LR(t,e)).join(") && (")+")":hR(t)?"("+t.or.map(t=>LR(t,e)).join(") || (")+")":e(t)}function IR(t,e){if(0===e.length)return!0;const n=e.shift();return IR(t[n],e)&&delete t[n],0===TR(t).length}function BR(t){return t.charAt(0).toUpperCase()+t.substr(1)}function PR(t,e="datum"){const n=WT(t),r=[];for(let t=1;t<=n.length;t++){const i=`[${n.slice(0,t).map(VT).join("][")}]`;r.push(`${e}${i}`)}return r.join(" && ")}function UR(t){return`${WT(t).map(t=>t.replace(".","\\.")).join("\\.")}`}function qR(t){return`${WT(t).join(".")}`}function WR(t){return t?WT(t).length:0}function HR(...t){for(const e of t)if(void 0!==e)return e}let YR=42;function GR(t){const e=++YR;return t?String(t)+e:e}function VR(t){return(t%360+360)%360}const XR="area",JR="bar",ZR="line",QR="point",KR="rect",tz="rule",ez="text",nz="tick",rz="trail",iz="circle",oz="square",az="geoshape",sz={area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1};function uz(t){return ER(["line","area","trail"],t)}const cz=TR(sz);function lz(t){return t.type}aR(cz);const fz=[].concat(["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],["fill","fillOpacity"]),dz=["filled","color","tooltip"],hz={binSpacing:1,continuousBandSize:5},pz={binSpacing:0,continuousBandSize:5};function gz(t){return!!t.mark}class mz{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!gz(t)&&(lz(e=t.mark)?e.type:e)===this.name;var e}}const vz={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1};function yz(t){return!!t&&!!t.argmin}function bz(t){return!!t&&!!t.argmax}TR(vz);function xz(t){return GT(t)&&!!vz[t]}const _z=["count","valid","missing","distinct"];function wz(t){return t&&GT(t)&&ER(_z,t)}const Oz=["count","sum","distinct","valid","missing"],Ez=aR(["mean","average","median","q1","q3","min","max"]),Az="row",kz="column",Sz="facet",jz="x",Dz="y",Cz="x2",Mz="y2",Fz="latitude",Nz="longitude",Tz="latitude2",Rz="longitude2",zz="color",$z="fill",Lz="stroke",Iz="shape",Bz="size",Pz="opacity",Uz="fillOpacity",qz="strokeOpacity",Wz="strokeWidth",Hz="text",Yz="order",Gz="detail",Vz="key",Xz="tooltip",Jz="href",Zz={x:1,y:1,x2:1,y2:1};const Qz={longitude:1,longitude2:1,latitude:1,latitude2:1};const Kz=TR(Qz),t$=Object.assign({},Zz,Qz,{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function e$(t){return"color"===t||"fill"===t||"stroke"===t}const n$={row:1,column:1,facet:1},r$=TR(n$),i$=Object.assign({},t$,n$),o$=TR(i$),{order:a$,detail:s$}=i$,u$=_(i$,["order","detail"]),{order:c$,detail:l$,row:f$,column:d$,facet:h$}=i$,p$=_(i$,["order","detail","row","column","facet"]);TR(u$),TR(p$);function g$(t){return!!p$[t]}function m$(t){return!!i$[t]}const v$=["x2","y2","latitude2","longitude2"];function y$(t){return b$(t)!==t}function b$(t){switch(t){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude"}return t}TR(t$);const{x:x$,y:_$,x2:w$,y2:O$,latitude:E$,longitude:A$,latitude2:k$,longitude2:S$}=t$,j$=_(t$,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),D$=TR(j$),C$={x:1,y:1},M$=TR(C$),{text:F$,tooltip:N$,href:T$,detail:R$,key:z$,order:$$}=j$,L$=_(j$,["text","tooltip","href","detail","key","order"]),I$=TR(L$);const B$=Object.assign({},C$,L$),P$=TR(B$);function U$(t){return!!B$[t]}function q$(t,e){return function(t){switch(t){case zz:case $z:case Lz:case Gz:case Vz:case Xz:case Jz:case Yz:case Pz:case Uz:case qz:case Wz:case Sz:case Az:case kz:return W$;case jz:case Dz:case Fz:case Nz:return Y$;case Cz:case Mz:case Tz:case Rz:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Bz:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Iz:return{point:"always",geoshape:"always"};case Hz:return{text:"always"}}}(t)[e]}const W$={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:H$}=W$,Y$=_(W$,["geoshape"]);function G$(t){switch(t){case jz:case Dz:case Bz:case Wz:case Pz:case Uz:case qz:case Cz:case Mz:return;case Sz:case Az:case kz:case Iz:case Hz:case Xz:case Jz:return"discrete";case zz:case $z:case Lz:return"flexible";case Fz:case Nz:case Tz:case Rz:case Gz:case Vz:case Yz:return}throw new Error("rangeType not implemented for "+t)}const V$="Invalid spec",X$='Autosize "fit" only works for single views and layered views.',J$='Cannot use a fixed value of "rangeStep" when "autosize" is "fit".';function Z$(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function Q$(t){return`The "nearest" transform is not supported for ${t} marks.`}function K$(t){return`Selection not supported for ${t} yet`}function tL(t){return`Cannot find a selection named "${t}"`}const eL="Scale bindings are currently only supported for scales with unbinned, continuous domains.",nL="Selections bound to scales cannot be separately initialized.";function rL(t){return`Unknown repeated value "${t}".`}function iL(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const oL="Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",aL="Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function sL(t){return`Unrecognized parse "${t}".`}function uL(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}function cL(t){return`Ignoring an invalid transform: ${_R(t)}.`}const lL='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fL(t){return`Layer's shared ${t.join(",")} channel ${1===t.length?"is":"are"} overriden`}function dL(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${_R(e)} is overridden by a child projection ${_R(n)}.`}function hL(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${_R(n)}}.`}function pL(t){return`Invalid field type "${t}"`}function gL(t,e,n){return`A ${n.scaleType?`${n.scaleType} scale`:n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${t}'s ${e}. This can be misleading as the ${"x"===e?"width":"height"} of the ${t} can be arbitrary based on the scale domain. You may want to use point mark instead.`}function mL(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}function vL(t){return`Invalid aggregation operator "${t}"`}function yL(t,e){return`Missing type for channel "${t}", using "${e}" instead.`}function bL(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has `+(n&&r?"fill and stroke":n?"fill":"stroke")}function xL(t,e){return`Dropping ${_R(t)} from channel "${e}" since it does not contain data field or value.`}function _L(t,e,n){return`${t}-encoding with type ${e} is deprecated. Replacing with ${n}-encoding.`}const wL="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function OL(t,e,n){return`${t} dropped as it is incompatible with "${e}"${n?` when ${n}`:""}.`}function EL(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function AL(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function kL(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function SL(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${"ordinal"===e?"order":"magnitude"}.`}const jL="Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.";function DL(t,e){return`Line mark is for continuous lines and thus cannot be used with ${t&&e?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function CL(t,e){return`Specified orient "${t}" overridden with "${e}"`}const ML="custom domain scale cannot be unioned with default field-based domain";function FL(t){return`Cannot use the scale property "${t}" with non-color channel.`}function NL(t){return`Using unaggregated domain with raw field has no effect (${_R(t)}).`}function TL(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function RL(t){return`Unaggregated domain is currently unsupported for log scale (${_R(t)}).`}function zL(t){return`Cannot apply size to non-oriented mark "${t}".`}function $L(t){return`rangeStep for "${t}" is dropped as top-level ${"x"===t?"width":"height"} is provided.`}function LL(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}function IL(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}function BL(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function PL(t,e){return`Scale type "${e}" does not work with mark "${t}".`}function UL(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${_R(n)} and ${_R(r)}).  Using ${_R(n)}.`}function qL(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${_R(n)} and ${_R(r)}).  Using the union of the two domains.`}function WL(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function HL(t){return`Dropping sort property ${_R(t)} as unioned domains only support boolean or op 'count'.`}const YL="Unable to merge domains",GL="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",VL="Invalid channel for axis.";function XL(t){return`Cannot stack "${t}" if there is already "${t}2"`}function JL(t){return`Cannot stack non-linear scale (${t})`}function ZL(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}")`}function QL(t,e){return`Invalid ${t}: ${_R(e)}`}function KL(t){return`Time unit "${t}" is not supported. We are replacing it with ${t.replace("day","date")}.`}function tI(t){return`Dropping day from datetime ${_R(t)} as day cannot be combined with other units.`}function eI(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}function nI(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}function rI(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}function iI(t,e){return`Center is not needed to be specified in ${e} when extent is ${t}.`}function oI(t){return`1D error band does not support ${t}`}function aI(t){return`Channel ${t} is required for "binned" bin`}function sI(t){return`Domain for ${t} is required for threshold scale`}const uI=v,cI=(fI=2||0,{level:function(t){return arguments.length?(fI=+t,this):fI},error:function(){return fI>=1&&eR(lI||"error","ERROR",arguments),this},warn:function(){return fI>=2&&eR(lI||"warn","WARN",arguments),this},info:function(){return fI>=3&&eR(lI||"log","INFO",arguments),this},debug:function(){return fI>=4&&eR(lI||"log","DEBUG",arguments),this}});var lI,fI;let dI=cI;function hI(){return dI=cI}function pI(...t){dI.warn.apply(dI,arguments)}const gI=2006;function mI(t){return!!(t&&(t.year||t.quarter||t.month||t.date||t.day||t.hours||t.minutes||t.seconds||t.milliseconds))}const vI=["january","february","march","april","may","june","july","august","september","october","november","december"],yI=vI.map(t=>t.substr(0,3)),bI=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],xI=bI.map(t=>t.substr(0,3));function _I(t,e=!1,n=!1){const r=[];if(e&&void 0!==t.day&&TR(t).length>1&&(pI(uI.droppedDay(t)),delete(t=yR(t)).day),void 0!==t.year?r.push(t.year):void 0!==t.day?r.push(gI):r.push(0),void 0!==t.month){const n=e?function(t){if(oR(t))return(t-1).toString();{const e=t.toLowerCase(),n=vI.indexOf(e);if(-1!==n)return n+"";const r=e.substr(0,3),i=yI.indexOf(r);if(-1!==i)return i+"";throw new Error(uI.invalidTimeUnit("month",t))}}(t.month):t.month;r.push(n)}else if(void 0!==t.quarter){const n=e?function(t){if(oR(t))return t>4&&pI(uI.invalidTimeUnit("quarter",t)),(t-1).toString();throw new Error(uI.invalidTimeUnit("quarter",t))}(t.quarter):t.quarter;r.push(n+"*3")}else r.push(0);if(void 0!==t.date)r.push(t.date);else if(void 0!==t.day){const n=e?function(t){if(oR(t))return t%7+"";{const e=t.toLowerCase(),n=bI.indexOf(e);if(-1!==n)return n+"";const r=e.substr(0,3),i=xI.indexOf(r);if(-1!==i)return i+"";throw new Error(uI.invalidTimeUnit("day",t))}}(t.day):t.day;r.push(n+"+1")}else r.push(1);for(const e of["hours","minutes","seconds","milliseconds"])void 0!==t[e]?r.push(t[e]):r.push(0);const i=r.join(", ");return n?t.utc?new Function(`return new Date(Date.UTC(${i}))`)().toJSON():new Function(`return new Date(${i})`)().toJSON():t.utc?`utc(${i})`:`datetime(${i})`}function wI(t){return!!t.row||!!t.column}function OI(t){return void 0!==t.facet}var EI;!function(t){t.YEAR="year",t.MONTH="month",t.DAY="day",t.DATE="date",t.HOURS="hours",t.MINUTES="minutes",t.SECONDS="seconds",t.MILLISECONDS="milliseconds",t.YEARMONTH="yearmonth",t.YEARMONTHDATE="yearmonthdate",t.YEARMONTHDATEHOURS="yearmonthdatehours",t.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",t.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",t.MONTHDATE="monthdate",t.MONTHDATEHOURS="monthdatehours",t.HOURSMINUTES="hoursminutes",t.HOURSMINUTESSECONDS="hoursminutesseconds",t.MINUTESSECONDS="minutesseconds",t.SECONDSMILLISECONDS="secondsmilliseconds",t.QUARTER="quarter",t.YEARQUARTER="yearquarter",t.QUARTERMONTH="quartermonth",t.YEARQUARTERMONTH="yearquartermonth",t.UTCYEAR="utcyear",t.UTCMONTH="utcmonth",t.UTCDAY="utcday",t.UTCDATE="utcdate",t.UTCHOURS="utchours",t.UTCMINUTES="utcminutes",t.UTCSECONDS="utcseconds",t.UTCMILLISECONDS="utcmilliseconds",t.UTCYEARMONTH="utcyearmonth",t.UTCYEARMONTHDATE="utcyearmonthdate",t.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",t.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",t.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",t.UTCMONTHDATE="utcmonthdate",t.UTCMONTHDATEHOURS="utcmonthdatehours",t.UTCHOURSMINUTES="utchoursminutes",t.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",t.UTCMINUTESSECONDS="utcminutesseconds",t.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",t.UTCQUARTER="utcquarter",t.UTCYEARQUARTER="utcyearquarter",t.UTCQUARTERMONTH="utcquartermonth",t.UTCYEARQUARTERMONTH="utcyearquartermonth"}(EI||(EI={}));const AI={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},kI=TR(AI);const SI={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};const jI={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},DI=Object.assign({},SI,jI);function CI(t){return!!DI[t]}const MI=Object.assign({},AI,SI,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},jI);TR(MI);function FI(t,e){const n=t.indexOf(e);return n>-1&&(e!==EI.SECONDS||0===n||"i"!==t.charAt(n-1))}function NI(t,e){const n=PR(e),r=CI(t)?"utc":"";return _I(kI.reduce((e,i)=>(FI(t,i)&&(e[i]=function(t){return t===EI.QUARTER?`(${r}quarter(${n})-1)`:`${r}${t}(${n})`}(i)),e),{}))}function TI(t,e){if(!t)return;const n=[],r=FI(t,EI.YEAR);FI(t,EI.MONTH)&&n.push(!1!==e?"%b":"%B"),FI(t,EI.DAY)?n.push(e?"%a":"%A"):FI(t,EI.DATE)&&n.push("%d"+(r?",":"")),r&&n.push(e?"%y":"%Y");const i=[];FI(t,EI.HOURS)&&i.push("%H"),FI(t,EI.MINUTES)&&i.push("%M"),FI(t,EI.SECONDS)&&i.push("%S"),FI(t,EI.MILLISECONDS)&&i.push("%L");const o=[];return n.length>0&&o.push(n.join(" ")),i.length>0&&o.push(i.join(":")),o}function RI(t){return"day"!==t&&t.indexOf("day")>=0?(pI(uI.dayReplacedWithDate(t)),t.replace("day","date")):t}const zI={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1};const $I="quantitative",LI="ordinal",II="temporal",BI="nominal",PI="geojson";function UI(t){const{field:e,timeUnit:n,bin:r,aggregate:i}=t;return Object.assign({},n?{timeUnit:n}:{},r?{bin:r}:{},i?{aggregate:i}:{},{field:e})}function qI(t){return!!t&&!!t.condition}function WI(t){return!!t&&!!t.condition&&!HT(t.condition)&&HI(t.condition)}function HI(t){return!(!t||!t.field&&"count"!==t.aggregate)}function YI(t){return!!t&&(!!t.field&&!!t.type||"count"===t.aggregate)}function GI(t){return HI(t)&&GT(t.field)}function VI(t){return t&&"value"in t&&void 0!==t.value}function XI(t){return!(!t||!t.scale&&!t.sort)}function JI(t){return!!t&&!!t.format}function ZI(t,e={}){let n=t.field;const r=e.prefix;let i=e.suffix,o="";if(function(t){return"count"===t.aggregate}(t))n=function(t){return function(t){return 0===t.indexOf("__")}(t)?t:`__${t}`}("count");else{let r;if(!e.nofn)if(function(t){return!!t.op}(t))r=t.op;else{const{bin:a,aggregate:s,timeUnit:u}=t;yB(a)?(r=vB(a),i=(e.binSuffix||"")+(e.suffix||"")):s?bz(s)?(o=`.${n}`,n=`argmax_${s.argmax}`):yz(s)?(o=`.${n}`,n=`argmin_${s.argmin}`):r=String(s):u&&(r=String(u))}r&&(n=n?`${r}_${n}`:r)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),e.forAs?n:e.expr?function(t,e="datum"){return`${e}[${VT(WT(t).join("."))}]`}(n,e.expr)+o:UR(n)+o}function QI(t){return!function(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!t.bin;case"temporal":return!1}throw new Error(uI.invalidFieldType(t.type))}(t)}function KI(t,e){const{field:n,bin:r,timeUnit:i,aggregate:o}=t;if("count"===o)return e.countTitle;if(yB(r))return`${n} (binned)`;if(i){return`${n} (${function(t){return kI.reduce((e,n)=>FI(t,n)?[...e,n]:e,[])}(i).join("-")})`}return o?bz(o)?`${n} for max ${o.argmax}`:yz(o)?`${n} for min ${o.argmin}`:`${BR(o)} of ${n}`:n}const tB=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:r,field:i}=t;if(bz(e))return`${i} for argmax(${e.argmax})`;if(yz(e))return`${i} for argmin(${e.argmin})`;const o=e||r||yB(n)&&"bin";return o?o.toUpperCase()+"("+i+")":i}(t);default:return KI(t,e)}};let eB=tB;function nB(t){eB=t}function rB(t,e,{allowDisabling:n,includeDefault:r=!0}){const i=(iB(t)||{}).title,o=r?oB(t,e):void 0;return n?HR(i,t.title,o):i||t.title||o}function iB(t){return(e=t)&&(e.axis||e.stack||e.impute)&&t.axis?t.axis:function(t){return!!t&&!!t.legend}(t)&&t.legend?t.legend:function(t){return!!t&&!!t.header}(t)&&t.header?t.header:void 0;var e}function oB(t,e){return eB(t,e)}function aB(t){if(JI(t)&&t.format)return t.format;return(iB(t)||{}).format}function sB(t){return HI(t)?t:WI(t)?t.condition:void 0}function uB(t){return HI(t)?t:WI(t)?t.condition:void 0}function cB(t,e){if(GT(t)||oR(t)||iR(t)){const n=GT(t)?"string":oR(t)?"number":"boolean";return pI(uI.primitiveChannelDef(e,n,t)),{value:t}}return HI(t)?lB(t,e):WI(t)?Object.assign({},t,{condition:lB(t.condition,e)}):t}function lB(t,e){const{aggregate:n,timeUnit:r,bin:i}=t;if(n&&!xz(n)&&!bz(n)&&!yz(n)){const{aggregate:e}=t,r=_(t,["aggregate"]);pI(uI.invalidAggregate(n)),t=r}if(r&&(t=Object.assign({},t,{timeUnit:RI(r)})),yB(i)&&(t=Object.assign({},t,{bin:fB(i,e)})),bB(i)&&!ER(M$,e)&&pI(`Channel ${e} should not be used with "binned" bin`),YI(t)){const{type:e}=t,r=function(t){if(t)switch(t=t.toLowerCase()){case"q":case $I:return"quantitative";case"t":case II:return"temporal";case"o":case LI:return"ordinal";case"n":case BI:return"nominal";case PI:return"geojson"}}(e);e!==r&&(t=Object.assign({},t,{type:r})),"quantitative"!==e&&wz(n)&&(pI(uI.invalidFieldTypeForCountAggregate(e,n)),t=Object.assign({},t,{type:"quantitative"}))}else if(!y$(e)){const n=function(t,e){if(t.timeUnit)return"temporal";if(yB(t.bin))return"quantitative";switch(G$(e)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}(t,e);pI(uI.missingFieldType(e,n)),t=Object.assign({},t,{type:n})}if(YI(t)){const{compatible:n,warning:r}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case"row":case"column":case"facet":return QI(t)?{compatible:!1,warning:uI.facetChannelShouldBeDiscrete(e)}:dB;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return dB;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==$I?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:dB;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return"nominal"!==n||t.sort?dB:{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`};case"shape":return ER(["ordinal","nominal","geojson"],t.type)?dB:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==t.type||"sort"in t?dB:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+e)}(t,e);n||pI(r)}return Object.assign({},t,void 0!==t.field?{field:`${t.field}`}:{})}function fB(t,e){return iR(t)?{maxbins:_B(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:Object.assign({},t,{maxbins:_B(e)})}const dB={compatible:!0};function hB(t){const e=iB(t),n=e&&e.formatType||JI(t)&&t.formatType;return"time"===n||!n&&function(t){return"temporal"===t.type||!!t.timeUnit}(t)}function pB(t,{timeUnit:e,type:n,time:r,undefinedIfExprNotRequired:i}){let o;var a;return mI(t)?o=_I(t,!0):(GT(t)||oR(t))&&(e||"temporal"===n)&&(o=function(t){return!!AI[t]}(e)?_I({[e]:t},!0):function(t){return!!SI[t]}(e)?pB(t,{timeUnit:(a=e,a.substr(3))}):`datetime(${JSON.stringify(t)})`),o?r?`time(${o})`:o:i?void 0:JSON.stringify(t)}function gB(t,e){const{timeUnit:n,type:r}=t;return e.map(t=>{const e=pB(t,{timeUnit:n,type:r,undefinedIfExprNotRequired:!0});return void 0!==e?{signal:e}:t})}function mB(t,e){return yB(t.bin)?U$(e)&&ER(["ordinal","nominal"],t.type):(console.warn("Only use this method with binned field defs"),!1)}function vB(t){return iR(t)&&(t=fB(t,void 0)),"bin"+TR(t).map(e=>$R(`_${e}_${t[e]}`)).join("")}function yB(t){return!0===t||xB(t)&&!t.binned}function bB(t){return"binned"===t||xB(t)&&t.binned}function xB(t){return YT(t)}function _B(t){switch(t){case Az:case kz:case Bz:case zz:case $z:case Lz:case Wz:case Pz:case Uz:case qz:case Iz:return 6;default:return 10}}function wB(t,e){const n=t&&t[e];return!!n&&(HT(n)?AR(n,t=>!!t.field):HI(n)||WI(n))}function OB(t){return AR(o$,e=>{if(wB(t,e)){const n=t[e];if(HT(n))return AR(n,t=>!!t.aggregate);{const t=sB(n);return t&&!!t.aggregate}}return!1})}function EB(t,e){const n=[],r=[],i=[],o=[],a={};return SB(t,(s,u)=>{if(HI(s)){const{field:c,aggregate:l,timeUnit:f,bin:d}=s,h=_(s,["field","aggregate","timeUnit","bin"]);if(l||f||d){const t=iB(s),p=t&&t.title;let g=ZI(s,{forAs:!0});const m=Object.assign({},p?[]:{title:rB(s,e,{allowDisabling:!0})},h,{field:g}),v="x"===u||"y"===u;if(l){let t;if(bz(l)?(t="argmax",g=ZI({aggregate:"argmax",field:l.argmax},{forAs:!0}),m.field=`${g}.${c}`):yz(l)?(t="argmin",g=ZI({aggregate:"argmin",field:l.argmin},{forAs:!0}),m.field=`${g}.${c}`):"boxplot"!==l&&"errorbar"!==l&&"errorband"!==l&&(t=l),t){const e={op:t,as:g};c&&(e.field=c),o.push(e)}}else if(n.push(g),YI(s)&&yB(d)){if(r.push({bin:d,field:c,as:g}),n.push(ZI(s,{binSuffix:"end"})),mB(s,u)&&n.push(ZI(s,{binSuffix:"range"})),v){const t={field:g+"_end"};a[u+"2"]=t}m.bin="binned",y$(u)||(m.type="quantitative")}else if(f){i.push({timeUnit:f,field:c,as:g});const t=TI(f,e.axis.shortTimeLabels).join(" "),n=YI(s)&&s.type!==II&&"time";"text"===u||"tooltip"===u?(m.format=m.format||t,n&&(m.formatType=n)):!function(t){return!!j$[t]}(u)?v&&(m.axis=Object.assign({format:t},n?{formatType:n}:{},m.axis)):m.legend=Object.assign({format:t},n?{formatType:n}:{},m.legend)}a[u]=m}else n.push(c),a[u]=t[u]}else a[u]=t[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function AB(t,e){return TR(t).reduce((n,r)=>{if(!m$(r))return pI(uI.invalidEncodingChannel(r)),n;if(!function(t,e,n){const r=q$(e,n);if(!r)return!1;if("binned"===r){const n=t["x2"===e?"x":"y"];return!!(HI(n)&&HI(t[e])&&bB(n.bin))}return!0}(t,r,e))return pI(uI.incompatibleChannel(r,e)),n;if("size"===r&&"line"===e){const e=uB(t[r]);if(e&&e.aggregate)return pI(uI.LINE_WITH_VARYING_SIZE),n}if("color"===r&&("fill"in t||"stroke"in t))return pI(uI.droppingColor("encoding",{fill:"fill"in t,stroke:"stroke"in t})),n;const i=t[r];if("detail"===r||"order"===r&&!HT(i)&&!VI(i)||"tooltip"===r&&HT(i))i&&(n[r]=(HT(i)?i:[i]).reduce((t,e)=>(HI(e)?t.push(lB(e,r)):pI(uI.emptyFieldDef(e,r)),t),[]));else{if("tooltip"===r&&null===i)n[r]=null;else if(!HI(i)&&!VI(i)&&!qI(i))return pI(uI.emptyFieldDef(i,r)),n;n[r]=cB(i,r)}return n},{})}function kB(t){const e=[];for(const n of TR(t))if(wB(t,n)){const r=t[n];(HT(r)?r:[r]).forEach(t=>{HI(t)?e.push(t):WI(t)&&e.push(t.condition)})}return e}function SB(t,e,n){if(t)for(const r of TR(t)){const i=t[r];HT(i)?i.forEach(t=>{e.call(n,t,r)}):e.call(n,i,r)}}function jB(t,e,n,r){return t?TR(t).reduce((n,i)=>{const o=t[i];return HT(o)?o.reduce((t,n)=>e.call(r,t,n,i),n):e.call(r,n,o,i)},n):n}function DB(t,e){return TR(e).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"x2":case"y2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case"shape":case"tooltip":return n;case"order":if("line"===t||"trail"===t)return n;case"detail":case"key":{const t=e[r];return(HT(t)||HI(t))&&(HT(t)?t:[t]).forEach(t=>{t.aggregate||n.push(ZI(t,{}))}),n}case"size":if("trail"===t)return n;case"color":case"fill":case"stroke":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":{const t=uB(e[r]);return t&&!t.aggregate&&n.push(ZI(t,{})),n}}},[])}function CB(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map(({fieldPrefix:t,titlePrefix:n})=>({field:t+e.field,type:e.type,title:n+(r?" of "+e.field:"")})),...kB(n)]}}function MB(t,e,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:c,endPositionPrefix:l,extraEncoding:f={}})=>{const d=a&&void 0!==a.title?void 0:void 0!==n.title?n.title:n.field;return FB(t,s,i,{mark:u,encoding:Object.assign({[e]:Object.assign({field:c+"_"+n.field,type:n.type},d?{title:d}:{},o?{scale:o}:{},a?{axis:a}:{})},GT(l)?{[e+"2"]:{field:l+"_"+n.field,type:n.type}}:{},r,f)})}}function FB(t,e,n,r){const{clip:i,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[Object.assign({},r,{mark:Object.assign({},n[e],i?{clip:i}:{},o?{color:o}:{},a?{opacity:a}:{},lz(r.mark)?r.mark:{type:r.mark},{style:`${s}-${e}`},iR(t[e])?{}:t[e])})]:[]}function NB(t,e,n){const{encoding:r}=t,i="vertical"===e?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:TB(o,n),continuousAxisChannelDef2:TB(a,n),continuousAxisChannelDefError:TB(s,n),continuousAxisChannelDefError2:TB(u,n),continuousAxis:i}}function TB(t,e){if(t&&t.aggregate){const{aggregate:n}=t,r=_(t,["aggregate"]);return n!==e&&pI(uI.errorBarContinuousAxisHasCustomizedAggregate(n,e)),r}return t}function RB(t,e){const{mark:n,encoding:r}=t;if(HI(r.x)&&QI(r.x)){if(HI(r.y)&&QI(r.y)){if(void 0===r.x.aggregate&&r.y.aggregate===e)return"vertical";if(void 0===r.y.aggregate&&r.x.aggregate===e)return"horizontal";if(r.x.aggregate===e&&r.y.aggregate===e)throw new Error("Both x and y cannot have aggregate");return lz(n)&&n.orient?n.orient:"vertical"}return"horizontal"}if(HI(r.y)&&QI(r.y))return"vertical";throw new Error("Need a valid continuous axis for "+e+"s")}const zB="boxplot",$B=TR({box:1,median:1,outliers:1,rule:1,ticks:1}),LB=new mz(zB,BB);function IB(t){return oR(t)?"tukey":t}function BB(t,{config:e}){const{mark:n,encoding:r,selection:i,projection:o}=t,a=_(t,["mark","encoding","selection","projection"]),s=lz(n)?n:{type:n};i&&pI(uI.selectionNotSupported("boxplot"));const u=s.extent||e.boxplot.extent,c=HR(s.size,e.boxplot.size),l=IB(u),{transform:f,continuousAxisChannelDef:d,continuousAxis:h,groupby:p,aggregate:g,encodingWithoutContinuousAxis:m,ticksOrient:v,customTooltipWithoutAggregatedField:y}=function(t,e,n){const r=RB(t,zB),{continuousAxisChannelDef:i,continuousAxis:o}=NB(t,r,zB),a=i.field,s=IB(e),u=[...PB(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],c="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:"iqr_"+a},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:"upper_whisker_"+a},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:"lower_whisker_"+a}],l=t.encoding,f=o,d=(l[f],_(l,["symbol"==typeof f?f:f+""])),{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(t){const{tooltip:e}=t,n=_(t,["tooltip"]);if(!e)return{filteredEncoding:t};let r,i;return HT(e)?(e.forEach(t=>{t.aggregate?(r||(r=[]),r.push(t)):(i||(i=[]),i.push(t))}),r&&(n.tooltip=r)):e.aggregate?n.tooltip=e:i=e,HT(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:b}=EB(p,n),x="vertical"===r?"horizontal":"vertical";return{transform:[...g,...m,{aggregate:[...v,...u],groupby:y},...c],groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:b,ticksOrient:x,customTooltipWithoutAggregatedField:h}}(t,u,e),{color:b,size:x}=m,w=_(m,["color","size"]),O=t=>MB(s,h,d,t,e.boxplot),E=O(w),A=O(m),k=O(Object.assign({},w,x?{size:x}:{})),S=CB([{fieldPrefix:"min-max"===l?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===l?"lower_whisker_":"min_",titlePrefix:"Min"}],d,m),j={type:"tick",color:"black",opacity:1,orient:v},D="min-max"===l?S:CB([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],d,m),C=[...E({partName:"rule",mark:"rule",positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:D}),...E({partName:"rule",mark:"rule",positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:D}),...E({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:D}),...E({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:D})],M=[..."tukey"!==l?C:[],...A({partName:"box",mark:Object.assign({type:"bar"},c?{size:c}:{}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:S}),...k({partName:"median",mark:Object.assign({type:"tick"},YT(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},c?{size:c}:{},{orient:v}),positionPrefix:"mid_box",extraEncoding:S})];let F;if("min-max"!==l){const t=`datum["lower_box_${d.field}"]`,n=`datum["upper_box_${d.field}"]`,r=`(${n} - ${t})`,i=`${t} - ${u} * ${r}`,o=`${n} + ${u} * ${r}`,a=`datum["${d.field}"]`,c={joinaggregate:PB(d.field),groupby:p};let f=void 0;"tukey"===l&&(f={transform:[{filter:`(${i} <= ${a}) && (${a} <= ${o})`},{aggregate:[{op:"min",field:d.field,as:"lower_whisker_"+d.field},{op:"max",field:d.field,as:"upper_whisker_"+d.field},{op:"min",field:"lower_box_"+d.field,as:"lower_box_"+d.field},{op:"max",field:"upper_box_"+d.field,as:"upper_box_"+d.field},...g],groupby:p}],layer:C});const{tooltip:m}=w,v=_(w,["tooltip"]),b=FB(s,"outliers",e.boxplot,{transform:[{filter:`(${a} < ${i}) || (${a} > ${o})`}],mark:"point",encoding:Object.assign({[h]:{field:d.field,type:d.type}},v,y?{tooltip:y}:{})})[0];b&&f?F={transform:[c],layer:[b,f]}:b?(F=b).transform.unshift(c):f&&(F=f).transform.unshift(c)}return F?Object.assign({},a,{layer:[...F?[F]:[],{transform:f,layer:M}]}):Object.assign({},a,{transform:(a.transform||[]).concat(f),layer:M})}function PB(t){return[{op:"q1",field:t,as:"lower_box_"+t},{op:"q3",field:t,as:"upper_box_"+t}]}const UB="errorbar",qB=TR({ticks:1,rule:1}),WB=new mz(UB,HB);function HB(t,{config:e}){const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:c}=GB(t,UB,e),l=MB(s,i,r,o,e.errorbar),f={type:"tick",orient:a};return Object.assign({},u,{transform:n,layer:[...l({partName:"ticks",mark:f,positionPrefix:"lower",extraEncoding:c}),...l({partName:"ticks",mark:f,positionPrefix:"upper",extraEncoding:c}),...l({partName:"rule",mark:"rule",positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})]})}function YB(t,e){const{encoding:n}=t;if(function(t){return(HI(t.x)||HI(t.y))&&!HI(t.x2)&&!HI(t.y2)&&!HI(t.xError)&&!HI(t.xError2)&&!HI(t.yError)&&!HI(t.yError2)}(n))return{orient:RB(t,e),inputType:"raw"};const r=function(t){return HI(t.x2)||HI(t.y2)}(n),i=function(t){return HI(t.xError)||HI(t.xError2)||HI(t.yError)||HI(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(e+" cannot be both type aggregated-upper-lower and aggregated-error");const t=n.x2,r=n.y2;if(HI(t)&&HI(r))throw new Error(e+" cannot have both x2 and y2");if(HI(t)){if(HI(o)&&QI(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+e)}if(HI(r)){if(HI(a)&&QI(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in "+e)}throw new Error("No ranged axis")}{const t=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(HI(r)&&!HI(t))throw new Error(e+" cannot have xError2 without xError");if(HI(s)&&!HI(i))throw new Error(e+" cannot have yError2 without yError");if(HI(t)&&HI(i))throw new Error(e+" cannot have both xError and yError with both are quantiative");if(HI(t)){if(HI(o)&&QI(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(HI(i)){if(HI(a)&&QI(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function GB(t,e,n){const{mark:r,encoding:i,selection:o,projection:a}=t,s=_(t,["mark","encoding","selection","projection"]),u=lz(r)?r:{type:r};o&&pI(uI.selectionNotSupported(e));const{orient:c,inputType:l}=YB(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=NB(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:b}=function(t,e,n,r,i,o,a,s){let u=[],c=[];const l=e.field;let f,d=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!=("iqr"===n)&&pI(uI.errorBarCenterIsUsedWithWrongExtent(e,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:l,as:"extent_"+l},{op:e,field:l,as:"center_"+l}],c=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:"upper_"+l},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:"lower_"+l}],f=[{fieldPrefix:"center_",titlePrefix:BR(e)},{fieldPrefix:"upper_",titlePrefix:VB(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:VB(e,n,"-")}],d=!0;else{let e,r,i;t.center&&t.extent&&pI(uI.errorBarCenterIsNotNeeded(t.extent,a)),"ci"===n?(e="mean",r="ci0",i="ci1"):(e="median",r="q1",i="q3"),u=[{op:r,field:l,as:"lower_"+l},{op:i,field:l,as:"upper_"+l},{op:e,field:l,as:"center_"+l}],f=[{fieldPrefix:"upper_",titlePrefix:rB({field:l,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:rB({field:l,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:rB({field:l,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&pI(uI.errorBarCenterAndExtentAreNotNeeded(t.center,t.extent)),"aggregated-upper-lower"===o?(f=[],c=[{calculate:`datum["${n.field}"]`,as:"upper_"+l},{calculate:`datum["${l}"]`,as:"lower_"+l}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:l}],c=[{calculate:`datum["${l}"] + datum["${r.field}"]`,as:"upper_"+l}],i?c.push({calculate:`datum["${l}"] + datum["${i.field}"]`,as:"lower_"+l}):c.push({calculate:`datum["${l}"] - datum["${r.field}"]`,as:"lower_"+l}));for(const t of c)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:t.calculate.replace(new RegExp('datum\\[\\"',"g"),"").replace(new RegExp('\\"\\]',"g"),"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(u,f,d,h,p,l,e,n),x=g,w=(i[x],"x"===g?"x2":"y2"),O=(i[w],"x"===g?"xError":"yError"),E=(i[O],"x"===g?"xError2":"yError2"),A=(i[E],_(i,["symbol"==typeof x?x:x+"","symbol"==typeof w?w:w+"","symbol"==typeof O?O:O+"","symbol"==typeof E?E:E+""])),{bins:k,timeUnits:S,aggregate:j,groupby:D,encoding:C}=EB(A,n),M=[...j,...m],F="raw"!==l?[]:D,N=CB(y,f,C,b);return{transform:[...s.transform||[],...k,...S,...M.length?[{aggregate:M,groupby:F}]:[],...v],groupby:F,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:u,outerSpec:s,tooltipEncoding:N}}function VB(t,e,n){return BR(t)+" "+n+" "+e}const XB="errorband",JB=TR({band:1,borders:1}),ZB=new mz(XB,QB);function QB(t,{config:e}){const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=GB(t,XB,e),c=a,l=MB(c,i,r,o,e.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign({},c.interpolate?{interpolate:c.interpolate}:{},c.tension&&c.interpolate?{interpolate:c.tension}:{});return f?(d=Object.assign({},d,p),h=Object.assign({},h,p)):c.interpolate?pI(uI.errorBand1DNotSupport("interpolate")):c.tension&&pI(uI.errorBand1DNotSupport("tension")),Object.assign({},s,{transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...l({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...l({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const KB={};function tP(t,e,n){const r=new mz(t,e);KB[t]={normalizer:r,parts:n}}tP(zB,BB,$B),tP(UB,HB,qB),tP(XB,QB,JB);const eP=["shortTimeLabels"],nP=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength"],rP={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},iP=Object.assign({},rP,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1}),oP=TR(rP),aP=TR(iP);var sP;!function(t){t.LINEAR="linear",t.LOG="log",t.POW="pow",t.SQRT="sqrt",t.SYMLOG="symlog",t.TIME="time",t.UTC="utc",t.QUANTILE="quantile",t.QUANTIZE="quantize",t.THRESHOLD="threshold",t.BIN_ORDINAL="bin-ordinal",t.ORDINAL="ordinal",t.POINT="point",t.BAND="band"}(sP||(sP={}));const uP={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},cP=TR(uP);function lP(t,e){const n=uP[t],r=uP[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const fP={linear:0,log:1,pow:1,sqrt:1,symlog:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function dP(t){return fP[t]}const hP=["linear","log","pow","sqrt","symlog","time","utc"],pP=aR(hP),gP=aR(["quantile","quantize","threshold"]),mP=aR(hP.concat(["quantile","quantize","threshold"])),vP=aR(["ordinal","bin-ordinal","point","band"]);function yP(t){return t in vP}function bP(t){return t in mP}function xP(t){return t in pP}function _P(t){return t in gP}const wP={textXRangeStep:90,rangeStep:20,pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4};function OP(t){return t&&t.selection}const EP={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:AP,domain:kP,range:SP,rangeStep:jP,scheme:DP}=(TR(EP),EP),CP=_(EP,["type","domain","range","rangeStep","scheme"]),MP=TR(CP);!function(){const t={};for(const e of o$)for(const n of TR(zI))for(const r of cP){const i=zP(e,n);RP(e,r)&&TP(r,n)&&(t[i]=t[i]||[],t[i].push(r))}}();function FP(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!ER(["point","band","identity"],t);case"bins":return!ER(["point","band","identity","ordinal"],t);case"round":return xP(t)||"band"===t||"point"===t;case"padding":return xP(t)||ER(["point","band"],t);case"paddingOuter":case"rangeStep":case"align":return ER(["point","band"],t);case"paddingInner":return"band"===t;case"clamp":return xP(t);case"nice":return xP(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return bP(t)&&!ER(["log","time","utc","threshold","quantile"],t)}}function NP(t,e){switch(e){case"interpolate":case"scheme":return e$(t)?void 0:uI.cannotUseScalePropertyWithNonColor(t);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function TP(t,e){return ER([LI,BI],e)?void 0===t||yP(t):e===II?ER([sP.TIME,sP.UTC,void 0],t):e!==$I||ER([sP.LOG,sP.POW,sP.SQRT,sP.SYMLOG,sP.QUANTILE,sP.QUANTIZE,sP.THRESHOLD,sP.LINEAR,void 0],t)}function RP(t,e){switch(t){case jz:case Dz:return xP(e)||ER(["band","point"],e);case Bz:case Wz:case Pz:case Uz:case qz:return xP(e)||_P(e)||ER(["band","point"],e);case zz:case $z:case Lz:return"band"!==e;case Iz:return"ordinal"===e}return!1}function zP(t,e){return t+"_"+e}const $P="_vgsid_";function LP(t){return"interval"===t.type}const IP={single:{on:"click",fields:[$P],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:[$P],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function BP(t){return void 0!==t.concat}function PP(t){return void 0!==t.vconcat}function UP(t){return void 0!==t.hconcat}function qP(t){return void 0!==t.repeat}const WP=TR({align:1,bounds:1,center:1,columns:1,spacing:1});function HP(t){const{anchor:e,frame:n,offset:r,orient:i,color:o}=t,a=_(t,["anchor","frame","offset","orient","color"]);return{mark:Object.assign({},a,o?{fill:o}:{}),nonMark:Object.assign({},e?{anchor:e}:{},n?{frame:n}:{},r?{offset:r}:{},i?{orient:i}:{})}}const YP={padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",invalidValues:"filter",view:{width:200,height:200},mark:{color:"#4c78a8",tooltip:{content:"encoding"}},area:{},bar:hz,circle:{},geoshape:{},line:{},point:{},rect:pz,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:wP,projection:{},axis:{},axisX:{},axisY:{},axisLeft:{},axisRight:{},axisTop:{},axisBottom:{},axisBand:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:IP,style:{},title:{},facet:{spacing:20},repeat:{spacing:20},concat:{spacing:20}};function GP(t){return jR(yR(YP),t)}const VP=["view",...cz],XP=["padding","facet","concat","repeat","numberFormat","timeFormat","countTitle","header","stack","scale","selection","invalidValues","overlay"],JP=Object.assign({view:["width","height"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],text:["shortTimeLabels"],tick:["bandSize","thickness"]});function ZP(t){t=yR(t);for(const e of XP)delete t[e];if(t.axis)for(const e of eP)delete t.axis[e];if(t.legend){for(const e of eP)delete t.legend[e];for(const e of nP)delete t.legend[e]}if(t.mark)for(const e of dz)delete t.mark[e];for(const e of VP){for(const n of dz)delete t[e][n];const n=JP[e];if(n)for(const r of n)delete t[e][r];QP(t,e)}for(const e of TR(KB))delete t[e];QP(t,"title","group-title");for(const e in t)YT(t[e])&&0===TR(t[e]).length&&delete t[e];return TR(t).length>0?t:void 0}function QP(t,e,n,r){const i="title"===e?HP(t.title).mark:r?t[e][r]:t[e];"view"===e&&(n="cell");const o=Object.assign({},i,t.style[e]);TR(o).length>0&&(t.style[n||e]=o),r||delete t[e]}function KP(t){return void 0!==t.layer}class tU{map(t,e){return OI(t)?this.mapFacet(t,e):qP(t)?this.mapRepeat(t,e):UP(t)?this.mapHConcat(t,e):PP(t)?this.mapVConcat(t,e):BP(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(KP(t))return this.mapLayer(t,e);if(gz(t))return this.mapUnit(t,e);throw new Error(uI.INVALID_SPEC)}mapLayer(t,e){return Object.assign({},t,{layer:t.layer.map(t=>this.mapLayerOrUnit(t,e))})}mapHConcat(t,e){return Object.assign({},t,{hconcat:t.hconcat.map(t=>this.map(t,e))})}mapVConcat(t,e){return Object.assign({},t,{vconcat:t.vconcat.map(t=>this.map(t,e))})}mapConcat(t,e){const{concat:n}=t,r=_(t,["concat"]);return Object.assign({},r,{concat:n.map(t=>this.map(t,e))})}mapFacet(t,e){return Object.assign({},t,{spec:this.map(t.spec,e)})}mapRepeat(t,e){return Object.assign({},t,{spec:this.map(t.spec,e)})}}const eU={zero:1,center:1,normalize:1};const nU=[JR,XR,tz,QR,iz,oz,ZR,ez,nz],rU=[JR,XR];function iU(t,e,n,r={}){const i=lz(t)?t.type:t;if(!ER(nU,i))return null;const o=function(t){const e=t.x,n=t.y;if(HI(e)&&HI(n))if("quantitative"===e.type&&"quantitative"===n.type){if(e.stack)return"x";if(n.stack)return"y";if(!!e.aggregate!=!!n.aggregate)return e.aggregate?"x":"y"}else{if("quantitative"===e.type)return"x";if("quantitative"===n.type)return"y"}else{if(HI(e)&&"quantitative"===e.type)return"x";if(HI(n)&&"quantitative"===n.type)return"y"}}(e);if(!o)return null;const a=e[o],s=GI(a)?ZI(a,{}):void 0,u="x"===o?"y":"x",c=e[u],l=GI(c)?ZI(c,{}):void 0,f=D$.reduce((t,n)=>{if("tooltip"!==n&&wB(e,n)){const r=e[n];(HT(r)?r:[r]).forEach(e=>{const r=uB(e);if(r.aggregate)return;const i=GI(r)?ZI(r,{}):void 0;(!i||i!==l&&i!==s)&&t.push({channel:n,fieldDef:r})})}return t},[]);let d;if(void 0!==a.stack?d=iR(a.stack)?a.stack?"zero":null:a.stack:f.length>0&&(d=ER(rU,i)?HR(n,"zero"):n),!d||!eU[d])return null;if(a.scale&&a.scale.type&&a.scale.type!==sP.LINEAR){if(r.disallowNonLinearStack)return null;pI(uI.cannotStackNonLinearScale(a.scale.type))}return wB(e,o===jz?Cz:Mz)?(void 0!==a.stack&&pI(uI.cannotStackRangedMark(o)),null):(a.aggregate&&!ER(Oz,a.aggregate)&&pI(uI.stackNonSummativeAggregate(a.aggregate)),{groupbyChannel:c?u:void 0,fieldChannel:o,impute:uz(i),stackBy:f,offset:d})}function oU(t){const{point:e,line:n}=t,r=_(t,["point","line"]);return TR(r).length>1?r:r.type}function aU(t){for(const e of["line","area","rule","trail"])t[e]&&(t=Object.assign({},t,{[e]:xR(t[e],["point","line"])}));return t}function sU(t,e={},n){return"transparent"===t.point?{opacity:0}:t.point?YT(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?YT(e.point)?e.point:{}:void 0}function uU(t,e={}){return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class cU{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(gz(t)){const{mark:n,encoding:r}=t,i=lz(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!sU(i,e[i.type],r);case"area":return!!sU(i,e[i.type],r)||!!uU(i,e[i.type])}}return!1}run(t,e,n){const{config:r}=e,{selection:i,projection:o,encoding:a,mark:s}=t,u=_(t,["selection","projection","encoding","mark"]),c=lz(s)?s:{type:s},l=sU(c,r[c.type],a),f="area"===c.type&&uU(c,r[c.type]),d=[Object.assign({},i?{selection:i}:{},{mark:oU(Object.assign({},c,"area"===c.type?{opacity:.7}:{})),encoding:xR(a,["shape"])})],h=iU(c,a,r?r.stack:void 0);let p=a;if(h){const{fieldChannel:t,offset:e}=h;p=Object.assign({},a,{[t]:Object.assign({},a[t],e?{stack:e}:{})})}return f&&d.push(Object.assign({},o?{projection:o}:{},{mark:Object.assign({type:"line"},bR(c,["clip","interpolate","tension","tooltip"]),f),encoding:p})),l&&d.push(Object.assign({},o?{projection:o}:{},{mark:Object.assign({type:"point",opacity:1,filled:!0},bR(c,["clip","tooltip"]),l),encoding:p})),n(Object.assign({},u,{layer:d}),Object.assign({},e,{config:aU(r)}))}}class lU{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(gz(t)){const{encoding:e,mark:n}=t;if("line"===n)for(const t of v$){const n=e[b$(t)];if(e[t]&&HI(n)&&!bB(n.bin))return!0}}return!1}run(t,e,n){const{encoding:r}=t;return pI(uI.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign({},t,{mark:"rule"}),e)}}function fU(t){const{parentEncoding:e,encoding:n}=t;if(e&&n){const t=TR(e).reduce((t,e)=>(n[e]&&t.push(e),t),[]);t.length>0&&pI(uI.encodingOverridden(t))}const r=Object.assign({},e||{},n||{});return TR(r).length>0?r:void 0}function dU(t){const{parentProjection:e,projection:n}=t;return e&&n&&pI(uI.projectionOverridden({parentProjection:e,projection:n})),n||e}function hU(t,e){return void 0===e&&(e=GP(t.config)),function(t,e={}){return pU.map(t,{config:e})}(t,e)}const pU=new class extends tU{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[LB,WB,ZB,new cU,new lU]}map(t,e){if(gz(t)){const n=wB(t.encoding,Az),r=wB(t.encoding,kz),i=wB(t.encoding,Sz);if(n||r||i)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:r}=e;if(n||r)return this.mapUnitWithParentEncodingOrProjection(t,e);const i=this.mapLayerOrUnit.bind(this);for(const n of this.nonFacetUnitNormalizers)if(n.hasMatchingType(t,e.config))return n.run(t,e,i);return t}mapRepeat(t,e){const{repeat:n}=t;return!HT(n)&&t.columns&&(t=xR(t,["columns"]),pI(uI.columnsNotSupportByRowCol("repeat"))),Object.assign({},t,{spec:this.map(t.spec,e)})}mapFacet(t,e){const{facet:n}=t;return wI(n)&&t.columns&&(t=xR(t,["columns"]),pI(uI.columnsNotSupportByRowCol("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:r}=t,{parentEncoding:i,parentProjection:o,config:a}=e,s=dU({parentProjection:o,projection:r}),u=fU({parentEncoding:i,encoding:n});return this.mapUnit(Object.assign({},t,s?{projection:s}:{},u?{encoding:u}:{}),{config:a})}mapFacetedUnit(t,e){const n=t.encoding,{row:r,column:i,facet:o}=n,a=_(n,["row","column","facet"]),{mark:s,width:u,projection:c,height:l,selection:f,encoding:d}=t,h=_(t,["mark","width","projection","height","selection","encoding"]);return o&&(r||i)&&pI(uI.facetChannelDropped([...r?[Az]:[],...i?[kz]:[]])),this.mapFacet(Object.assign({},h,{facet:r||i?Object.assign({},r?{row:r}:{},i?{column:i}:{}):o,spec:Object.assign({},c?{projection:c}:{},{mark:s},u?{width:u}:{},l?{height:l}:{},{encoding:a},f?{selection:f}:{})}),e)}mapLayer(t,e){var{parentEncoding:n,parentProjection:r}=e,i=_(e,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=t,s=_(t,["encoding","projection"]),u=Object.assign({},i,{parentEncoding:fU({parentEncoding:n,encoding:o}),parentProjection:dU({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function gU(t){return GT(t)?{type:t}:t||{}}const mU=["background","padding"];function vU(t){return mU.reduce((e,n)=>(t&&void 0!==t[n]&&(e[n]=t[n]),e),{})}function yU(t){return!!t.url}function bU(t){return!!t.values}function xU(t){return!(!t.name||yU(t)||bU(t)||_U(t))}function _U(t){return t&&(wU(t)||OU(t)||EU(t))}function wU(t){return!!t.sequence}function OU(t){return!!t.sphere}function EU(t){return!!t.graticule}const AU="main",kU="raw";function SU(t){return t&&!!t.field&&void 0!==t.equal}function jU(t){return t&&!!t.field&&void 0!==t.lt}function DU(t){return t&&!!t.field&&void 0!==t.lte}function CU(t){return t&&!!t.field&&void 0!==t.gt}function MU(t){return t&&!!t.field&&void 0!==t.gte}function FU(t){return!!(t&&t.field&&HT(t.range)&&2===t.range.length)}function NU(t){return t&&!!t.field&&(HT(t.oneOf)||HT(t.in))}function TU(t){return NU(t)||SU(t)||FU(t)||jU(t)||CU(t)||DU(t)||MU(t)}function RU(t,e){return pB(t,{timeUnit:e,time:!0})}function zU(t,e=!0){const{field:n,timeUnit:r}=t,i=r?"time("+NI(r,n)+")":ZI(t,{expr:"datum"});if(SU(t))return i+"==="+RU(t.equal,r);if(jU(t)){return`${i}<${RU(t.lt,r)}`}if(CU(t)){return`${i}>${RU(t.gt,r)}`}if(DU(t)){return`${i}<=${RU(t.lte,r)}`}if(MU(t)){return`${i}>=${RU(t.gte,r)}`}if(NU(t))return`indexof([${function(t,e){return t.map(t=>RU(t,e))}(t.oneOf,r).join(",")}], ${i}) !== -1`;if(function(t){return t&&!!t.field&&void 0!==t.valid}(t))return t.valid?`${i}!==null&&!isNaN(${i})`:`${i}===null||isNaN(${i})`;if(FU(t)){const n=t.range[0],o=t.range[1];if(null!==n&&null!==o&&e)return"inrange("+i+", ["+RU(n,r)+", "+RU(o,r)+"])";const a=[];return null!==n&&a.push(`${i} >= ${RU(n,r)}`),null!==o&&a.push(`${i} <= ${RU(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(t)}`)}function $U(t){return TU(t)&&t.timeUnit?Object.assign({},t,{timeUnit:RI(t.timeUnit)}):t}function LU(t){return void 0!==t.filter}function IU(t){return void 0!==t.lookup}function BU(t){return void 0!==t.sample}function PU(t){return void 0!==t.window}function UU(t){return void 0!==t.joinaggregate}function qU(t){return void 0!==t.flatten}function WU(t){return void 0!==t.calculate}function HU(t){return!!t.bin}function YU(t){return void 0!==t.impute}function GU(t){return void 0!==t.timeUnit}function VU(t){return void 0!==t.aggregate}function XU(t){return void 0!==t.stack}function JU(t){return void 0!==t.fold}function ZU(t){return!!t.signal}function QU(t){return!!t.step}function KU(t){return!HT(t)&&("field"in t&&"data"in t)}const tq=TR({opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeMiterLimit:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,cursor:1,href:1,tooltip:1,cornerRadius:1,x:1,y:1,x2:1,y2:1,width:1,height:1}),eq=["domain","grid","labels","ticks","title"],nq={grid:"grid",gridColor:"grid",gridDash:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",domain:"main",domainColor:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontWeight:"main",labelLimit:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",maxExtent:"main",minExtent:"main",offset:"main",position:"main",tickColor:"main",tickExtra:"main",tickOffset:"both",tickOpacity:"main",tickRound:"main",ticks:"main",tickSize:"main",title:"main",titleAlign:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontWeight:"main",titleLimit:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",tickWidth:"both",tickCount:"both",values:"both",scale:"both",zindex:"both"},rq={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},iq=Object.assign({},rq,{encoding:1}),oq=Object.assign({gridScale:1,scale:1},rq,{encode:1});const aq=TR(oq);TR(iq);function sq(t,e,n,r={header:!1}){const i=t.combine(),{orient:o,scale:a,title:s,zindex:u}=i,c=_(i,["orient","scale","title","zindex"]);if(TR(c).forEach(t=>{const n=nq[t];n&&n!==e&&"both"!==n&&delete c[t]}),"grid"===e){if(!c.grid)return;if(c.encode){const{grid:t}=c.encode;c.encode=Object.assign({},t?{grid:t}:{}),0===TR(c.encode).length&&delete c.encode}return Object.assign({scale:a,orient:o},c,{domain:!1,labels:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:HR(u,0)})}{if(!r.header&&t.mainExtracted)return;if(c.encode){for(const e of eq)t.hasAxisPart(e)||delete c.encode[e];0===TR(c.encode).length&&delete c.encode}const e=function(t,e){return HT(t)?t.map(t=>oB(t,e)).join(", "):t}(s,n);return Object.assign({scale:a,orient:o,grid:!1},e?{title:e}:{},c,{zindex:HR(u,1)})}}function uq(t){const{axes:e}=t.component;for(const n of M$)if(e[n])for(const r of e[n])if(!r.get("gridScale")){const e="x"===n?"height":"width";return[{name:e,update:t.getSizeSignalRef(e).signal}]}return[]}const cq={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleOrient:"orient",titlePadding:"offset"},lq={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelLimit:"limit",labelOrient:"orient",labelPadding:"offset"},fq=TR(cq),dq=TR(lq),hq="mean";function pq(t){return!(!t||"count"!==t.op&&!t.field)}function gq(t){return!!t&&HT(t)}function mq(t,e,n,r,i){const o=[..."band"===i?["axisBand"]:[],"x"===n?"axisX":"axisY",...r?["axis"+r.substr(0,1).toUpperCase()+r.substr(1)]:[],"axis"];for(const n of o)if(e[n]&&void 0!==e[n][t])return e[n][t]}function vq(t,e){if(void 0!==t)return t=VR(t),"top"===e||"bottom"===e?t<=45||315<=t?"top"===e?"bottom":"top":135<=t&&t<=225?"top"===e?"top":"bottom":"middle":t<=45||315<=t||135<=t&&t<=225?"middle":45<=t&&t<=135?"left"===e?"top":"bottom":"left"===e?"bottom":"top"}function yq(t,e){if(void 0!==t)return t=VR(t),"top"===e||"bottom"===e?t%180==0?"center":0<t&&t<180?"top"===e?"right":"left":"top"===e?"left":"right":(t+90)%180==0?"center":90<=t&&t<270?"left"===e?"left":"right":"left"===e?"right":"left"}function bq(t){switch(t){case jz:return"bottom";case Dz:return"left"}throw new Error(uI.INVALID_CHANNEL_FOR_AXIS)}function xq(t){return[].concat(t.type,t.style||[])}function _q(t,e,n,{vgChannel:r}={}){return HR(r?wq(t,e,n.style):void 0,wq(t,e,n.style),r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function wq(t,e,n){const r=xq(e);let i;for(const e of r){const r=n[e],o=t;r&&void 0!==r[o]&&(i=r[o])}return i}function Oq(t,e,n,r){if(hB(t)){const i=XI(t)&&t.scale&&t.scale.type===sP.UTC;return{signal:jq(ZI(t,{expr:n}),t.timeUnit,e,r.text.shortTimeLabels,r.timeFormat,i,!0)}}{const i=Eq(t,e,r);if(yB(t.bin)){return{signal:Sq(ZI(t,{expr:n}),ZI(t,{expr:n,binSuffix:"end"}),i,r)}}return"quantitative"===t.type||i?{signal:`${Aq(ZI(t,{expr:n,binSuffix:"range"}),i)}`}:{signal:`''+${ZI(t,{expr:n})}`}}}function Eq(t,e,n){return e||(t.type===$I?n.numberFormat:void 0)}function Aq(t,e){return`format(${t}, "${e||""}")`}function kq(t,e,n){return Aq(t,e||n.numberFormat)}function Sq(t,e,n,r){return`${t} === null || isNaN(${t}) ? "null" : ${kq(t,n,r)} + " - " + ${kq(e,n,r)}`}function jq(t,e,n,r,i,o,a=!1){return!e||n?(n=n||i)||a?`${o?"utc":"time"}Format(${t}, '${n}')`:void 0:function(t,e,n,r){if(!t)return;const i=TI(t,n);let o="";return FI(t,EI.QUARTER)&&(o=`'Q' + quarter(${e})`),i.length>0&&(o&&(o+=" + ' ' + "),o+=r?`utcFormat(${e}, '${i.join(" ")}')`:`timeFormat(${e}, '${i.join(" ")}')`),o||void 0}(e,t,r,o)}function Dq(t,e){return(HT(t)?t:[t]).reduce((t,n)=>(t.field.push(ZI(n,e)),t.order.push(n.sort||"ascending"),t),{field:[],order:[]})}function Cq(t,e){const n=[...t];return e.forEach(t=>{for(const e of n)if(_R(e)===_R(t))return;n.push(t)}),n}function Mq(t,e){return t!==e&&e?t?t+", "+e:e:t}function Fq(t,e){if(HT(t.value)&&HT(e.value))return{explicit:t.explicit,value:Cq(t.value,e.value)};if(!HT(t.value)&&!HT(e.value))return{explicit:t.explicit,value:Mq(t.value,e.value)};throw new Error("It should never reach here")}class Nq{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}hash(){return void 0===this._hash&&(this._hash=GR()),this._hash}producedFields(){return new Set}dependentFields(){return new Set}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.indexOf(t)>-1?console.warn("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const e of this._children)e.parent=t;this._children=[],t.removeChild(this),t.parent.removeChild(t),this.parent=e,t.parent=this}}class Tq extends Nq{constructor(t,e,n,r){super(t,e),this.type=n,this.refCounts=r,this._source=this._name=e,!this.refCounts||this._name in this.refCounts||(this.refCounts[this._name]=0)}clone(){const t=new this.constructor;return t.debugName="clone_"+this.debugName,t._source=this._source,t._name="clone_"+this._name,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function Rq(t){const e=kj(t),n=new Set;return e.visit(t=>{"MemberExpression"===t.type&&function t(e){return"MemberExpression"===e.object.type?t(e.object):"datum"===e.object.name}(t)&&n.add(function t(e){const n=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(n.push(...t(e.object)),n.push(...t(e.property))),n)}(t).slice(1).join("."))}),n}class zq extends Nq{constructor(t,e){super(t),this.transform=e,this._dependentFields=Rq(this.transform.calculate)}clone(){return new zq(null,yR(this.transform))}static parseAllForSortIndex(t,e){return e.forEachFieldDef((e,n)=>{if(XI(e)&&gq(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort,a=o.map((t,e)=>`${zU({field:r,timeUnit:i,equal:t})} ? ${e} : `).join("")+o.length;t=new zq(t,{calculate:a,as:$q(e,n,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${wR(this.transform)}`}}function $q(t,e,n){return ZI(t,Object.assign({prefix:e,suffix:"sort_index"},n||{}))}function Lq(t,e){return ER(["top","bottom"],e)?"column":ER(["left","right"],e)?"row":"row"===t?"row":"column"}function Iq(t,e,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return HR(e&&e.header?e.header[t]:void 0,i[t],n.header[t])}function Bq(t,e,n,r){const i={};for(const o of t){const t=Iq(o,e,n,r);void 0!==t&&(i[o]=t)}return i}const Pq=["row","column"],Uq=["header","footer"];function qq(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Bq(["titleAnchor","titleAngle","titleOrient"],i,r,e),u=Lq(e,s);return{name:`${e}-title`,type:"group",role:`${u}-title`,title:Object.assign({text:n},"row"===e?{orient:"left"}:{},{style:"guide-title"},Hq(a,u),Wq(u,a,o),Qq(r,i,e,fq,cq))}}function Wq(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=yq(e,"row"===t?"left":"top");return r?{align:r}:{}}function Hq(t,e){const n=vq(t,"row"===e?"left":"top");return n?{baseline:n}:{}}function Yq(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of Uq)if(n[i])for(const o of n[i])r.push(Xq(t,e,i,n,o));return r}function Gq(t,e){const{sort:n}=t;return pq(n)?{field:ZI(n,{expr:"datum"}),order:n.order||"ascending"}:HT(n)?{field:$q(t,e,{expr:"datum"}),order:"ascending"}:{field:ZI(t,{expr:"datum"}),order:n||"ascending"}}function Vq(t,e,n){const{format:r,labelAngle:i,labelAnchor:o,labelOrient:a}=Bq(["format","labelAngle","labelAnchor","labelOrient"],t,n,e),s=Lq(e,a);return Object.assign({text:Oq(t,r,"parent",n)},"row"===e?{orient:"left"}:{},{style:"guide-label",frame:"group"},Hq(i,s),Wq(s,i,o),Qq(n,t,e,dq,lq))}function Xq(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=t.config?t.config:void 0;if(a&&i.labels){const{labelOrient:t}=Bq(["labelOrient"],a,s,e);("row"===e&&!ER(["top","bottom"],t)||"column"===e&&!ER(["left","right"],t))&&(o=Vq(a,e,s))}const u=iG(t)&&!wI(t.facet),c=i.axes,l=c&&c.length>0;if(o||l){const s="row"===e?"height":"width";return Object.assign({name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`},r.facetFieldDef?{from:{data:t.getName(e+"_domain")},sort:Gq(a,e)}:{},l&&u?{from:{data:t.getName(`facet_domain_${e}`)}}:{},o?{title:o}:{},i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},l?{axes:c}:{})}}return null}const Jq={column:{start:0,end:1},row:{start:1,end:0}};function Zq(t,e){return Jq[e][t]}function Qq(t,e,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=Iq(a,e,t,n);void 0!==r&&(o[i[a]]=r)}return o}function Kq(t){return[...tW(t,"width"),...tW(t,"height")]}function tW(t,e){const n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];const i=t.getSizeSignalRef(e).signal;if("range-step"===r){const e=t.getScaleComponent(n);if(e){const r=e.get("type"),o=e.get("range");if(yP(r)&&QU(o)){const r=t.scaleName(n);if(iG(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[eW(r,o)]}return[eW(r,o),{name:i,update:nW(r,e,`domain('${r}').length`)}]}}throw new Error("layout size is range step although there is no rangeStep.")}return[{name:i,value:r}]}function eW(t,e){return{name:t+"_step",value:e.step}}function nW(t,e,n){const r=e.get("type"),i=e.get("padding"),o=HR(e.get("paddingOuter"),i);let a=e.get("paddingInner");return`bandspace(${n}, ${a="band"===r?void 0!==a?a:i:1}, ${o}) * ${t}_step`}class rW extends Nq{constructor(t,e){super(t),this.formula=e}clone(){return new rW(null,yR(this.formula))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,e)=>{const{timeUnit:n,field:r}=e;if(n){const i={as:ZI(e,{forAs:!0}),timeUnit:n,field:r};t[wR(i)]=i}return t},{});return 0===TR(n).length?null:new rW(t,n)}static makeFromTransform(t,e){const n=Object.assign({},e);return new rW(t,{[wR(n)]:n})}merge(t){this.formula=Object.assign({},this.formula,t.formula);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}producedFields(){return new Set(RR(this.formula).map(t=>t.as))}dependentFields(){return new Set(RR(this.formula).map(t=>t.field))}hash(){return`TimeUnit ${wR(this.formula)}`}assemble(){return RR(this.formula).map(t=>({type:"formula",as:t.as,expr:NI(t.timeUnit,t.field)}))}}var iW={has:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e,n)=>{const r=$R(n.name),i=n.scales=[];for(const e of n.project.items){const n=e.channel;if(!U$(n))continue;const o=t.getScaleComponent(n),a=o?o.get("type"):void 0;if(o&&bP(a)){if(o.set("domainRaw",{signal:PR(e.field,r)},!0),i.push(e),t.repeater&&t.repeater.row===t.repeater.column){t.getScaleComponent(n===jz?Dz:jz).set("domainRaw",{signal:PR(e.field,r)},!0)}}else pI(uI.SCALE_BINDINGS_CONTINUOUS)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(t=>!n.filter(e=>e.name===t.signals.data).length);if(!t.parent||!r.length)return n;const i=n.filter(t=>t.name===e.name)[0],o=i.update;if(o.indexOf(yW)>=0)i.update=`{${r.map(t=>`${VT(t.field)}: ${t.signals.data}`).join(", ")}}`;else for(const t of r){const e=`, ${VT(t.field)}: ${t.signals.data}`;o.indexOf(e)<0&&(i.update=o.substring(0,o.length-1)+e+"}")}return n.concat(r.map(t=>({name:t.signals.data})))},signals:(t,e,n)=>{if(t.parent)for(const t of e.scales){const e=n.filter(e=>e.name===t.signals.data)[0];e.push="outer",delete e.value,delete e.update}return n}};function oW(t,e){return`domain(${VT(t.scaleName(e))})`}const aW="_tuple_fields";class sW{constructor(...t){this.items=t,this.has={}}}const uW="_scale_trigger",cW={signals:(t,e)=>{const n=e.name,r=n+aW,i=iW.has(e),o=[],a=[],s=[];if(e.translate&&!i){const t=`!event.item || event.item.mark.name !== ${VT(n+"_brush")}`;lW(e,(e,n)=>{const r=n.between[0].filter||(n.between[0].filter=[]);r.indexOf(t)<0&&r.push(t)})}e.project.items.forEach((n,r)=>{const i=n.channel;if(i!==jz&&i!==Dz)return void pI("Interval selections only support x and y encoding channels.");const u=e.init?e.init[r]:null,c=function(t,e,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=iW.has(e),u=VT(t.scaleName(i)),c=t.getScaleComponent(i),l=c?c.get("type"):void 0,f=t=>`scale(${u}, ${t})`,d=t.getSizeSignalRef(i===jz?"width":"height").signal,h=`${i}(unit)`,p=lW(e,(t,e)=>[...t,{events:e.between[0],update:`[${h}, ${h}]`},{events:e,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]);return p.push({events:{signal:e.name+uW},update:bP(l)?`[${f(`${a}[0]`)}, ${f(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign({name:o},r?{init:$W(r,f)}:{value:[]},{on:p}),Object.assign({name:a},r?{init:$W(r)}:{},{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(t,e,n,u),l=n.signals.data,f=n.signals.visual,d=VT(t.scaleName(i)),h=bP(t.getScaleComponent(i).get("type"))?"+":"";o.push(...c),a.push(l),s.push({scaleName:t.scaleName(i),expr:`(!isArray(${l}) || `+`(${h}invert(${d}, ${f})[0] === ${h}${l}[0] && `+`${h}invert(${d}, ${f})[1] === ${h}${l}[1]))`})}),i||o.push({name:n+uW,value:{},on:[{events:s.map(t=>({scale:t.scaleName})),update:s.map(t=>t.expr).join(" && ")+` ? ${n+uW} : {}`}]});const u=e.init,c=`unit: ${_W(t)}, fields: ${r}, values`;return o.concat(Object.assign({name:n+gW},u?{init:`{${c}: ${$W(u)}}`}:{},{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${c}: [${a}]} : null`}]}))},modifyExpr:(t,e)=>{return e.name+gW+", "+("global"===e.resolve?"true":`{unit: ${_W(t)}}`)},marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.has,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${VT(e.name+pW)})`;if(iW.has(e))return n;const c={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===e.resolve)for(const e of TR(c))c[e]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${_W(t)}`},c[e]),{value:0}];const l=e.mark,{fill:f,fillOpacity:d}=l,h=_(l,["fill","fillOpacity"]),p=TR(h).reduce((t,e)=>(t[e]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(t=>t).join(" && "),value:h[e]},{value:null}],t),{});return[{name:r+"_brush_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:c}},...n,{name:r+"_brush",type:"rect",clip:!0,encode:{enter:{fill:{value:"transparent"}},update:Object.assign({},c,p)}}]}};function lW(t,e){return t.events.reduce((t,n)=>n.between?e(t,n):(pI(`${n} is not an ordered event stream for interval selections`),t),[])}function fW(t,e){const n=e.name,r=n+aW,i=e.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map(e=>{const n=t.fieldDef(e.channel);return n&&n.bin?`[${PR(t.vgField(e.channel,{}),o)}, `+`${PR(t.vgField(e.channel,{binSuffix:"end"}),o)}]`:`${PR(e.field,o)}`}).join(", "),s=`unit: ${_W(t)}, fields: ${r}, values`;return[{name:n+gW,on:[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]}]}const dW={signals:fW,modifyExpr:(t,e)=>{return e.name+gW+", "+("global"===e.resolve?"null":`{unit: ${_W(t)}}`)}};const hW={signals:fW,modifyExpr:(t,e)=>{return e.name+gW+", "+("global"===e.resolve?"true":`{unit: ${_W(t)}}`)}};const pW="_store",gW="_tuple",mW="_modify",vW="_selection_domain_",yW="vlSelectionResolve",bW={single:hW,multi:dW,interval:cW};function xW(t,e){const n=t.component.selection;for(const t in n)if(n.hasOwnProperty(t)){const r=n[t];e(r,bW[r.type])}}function _W(t){let e=VT(t.name);const n=function(t){let e=t.parent;for(;e&&!iG(e);)e=e.parent;return e}(t);if(n){const{facet:t}=n;for(const r of r$)t[r]&&(e+=` + '__facet_${r}_' + (${PR(n.vgField(r),"facet")})`)}return e}function wW(t){let e=!1;return xW(t,t=>{e=e||t.project.items.some(t=>t.field===$P)}),e}var OW={has:t=>"interval"!==t.type&&t.nearest,marks:(t,e,n)=>{const{x:r,y:i}=e.project.has,o=t.mark;if(uz(o))return pI(uI.nearestNotSupportForContinuous(o)),n;const a={name:t.getName("voronoi"),type:"path",from:{data:t.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},dH(t,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!r&&!i?"datum.datum.x || 0":"0"},y:{expr:i||!r&&!i?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach((e,n)=>{const r=e.name||"";r===t.component.mark[0].name?s=n:r.indexOf("voronoi")>=0&&(u=!0)}),u||n.splice(s+1,0,a),n}};var EW={has:t=>"single"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind,topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],s=OW.has(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((t,i)=>{const u=$R(`${r}_${t.field}`);n.filter(t=>t.name===u).length||n.unshift(Object.assign({name:u},a?{init:$W(a[i])}:{value:null},{on:[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${PR(t.field,s)} : null`}],bind:o[t.field]||o[t.channel]||o}))}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.filter(t=>t.name===r+gW)[0],a=r+aW,s=i.items.map(t=>$R(`${r}_${t.field}`)),u=s.map(t=>`${t} !== null`).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}};var AW={has:t=>"multi"===t.type&&t.toggle,signals:(t,e,n)=>n.concat({name:e.name+"_toggle",value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+gW,r=e.name+"_toggle";return`${r} ? null : ${n}, `+("global"===e.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${_W(t)}}, `)+`${r} ? ${n} : null`}};const kW={has:t=>!1!==t.clear,parse:(t,e,n)=>{e.clear&&(n.clear=PM(e.clear,"scope"))},topLevelSignals:(t,e,n)=>(EW.has(e)&&e.project.items.forEach(t=>{const r=n.findIndex(n=>n.name===$R(`${e.name}_${t.field}`));-1!==r&&n[r].on.push({events:e.clear,update:"null"})}),n),signals:(t,e,n)=>{function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type)e.project.items.forEach(t=>{const e=n.findIndex(e=>e.name===t.signals.visual);if(r(e,"[0, 0]"),-1===e){r(n.findIndex(e=>e.name===t.signals.data),"null")}});else{let t=n.findIndex(t=>t.name===e.name+gW);r(t,"null"),AW.has(e)&&r(t=n.findIndex(t=>t.name===e.name+"_toggle"),"false")}return n}};const SW="_translate_anchor",jW="_translate_delta",DW={has:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const r=e.name,i=iW.has(e),o=r+SW,{x:a,y:s}=e.project.has;let u=PM(e.translate,"scope");return i||(u=u.map(t=>(t.between[0].markname=r+"_brush",t))),n.push({name:o,value:{},on:[{events:u.map(t=>t.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?oW(t,jz):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?oW(t,Dz):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+jW,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&CW(t,e,a,"width",n),void 0!==s&&CW(t,e,s,"height",n),n}};function CW(t,e,n,r,i){const o=e.name,a=o+SW,s=o+jW,u=n.channel,c=iW.has(e),l=i.filter(t=>t.name===n.signals[c?"data":"visual"])[0],f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(u),h=d.get("type"),p=`${a}.extent_${u}`,g=`${c?"log"===h?"panLog":"pow"===h?"panPow":"panLinear":"panLinear"}(${p}, ${`${c&&u===jz?"-":""}${s}.${u} / `+(c?`${f}`:`span(${p})`)}`+(c&&"pow"===h?`, ${d.get("exponent")||1}`:"")+")";l.on.push({events:{signal:s},update:c?g:`clampRange(${g}, 0, ${f})`})}const MW="_zoom_anchor",FW="_zoom_delta",NW={has:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=iW.has(e),o=r+FW,{x:a,y:s}=e.project.has,u=VT(t.scaleName(jz)),c=VT(t.scaleName(Dz));let l=PM(e.zoom,"scope");return i||(l=l.map(t=>(t.markname=r+"_brush",t))),n.push({name:r+MW,on:[{events:l,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(t=>!!t).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&TW(t,e,a,"width",n),void 0!==s&&TW(t,e,s,"height",n),n}};function TW(t,e,n,r,i){const o=e.name,a=n.channel,s=iW.has(e),u=i.filter(t=>t.name===n.signals[s?"data":"visual"])[0],c=t.getSizeSignalRef(r).signal,l=t.getScaleComponent(a),f=l.get("type"),d=s?oW(t,a):u.name,h=o+FW,p=`${s?"log"===f?"zoomLog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${d}, ${`${o}${MW}.${a}`}, ${h}`+(s&&"pow"===f?`, ${l.get("exponent")||1}`:"")+")";u.on.push({events:{signal:h},update:s?p:`clampRange(${p}, 0, ${c})`})}const RW=[{has:()=>!0,parse:(t,e,n)=>{const r=n.name,i=n.project||(n.project=new sW),o={},a={},s=new Set,u=(t,e)=>{const n="visual"===e?t.channel:t.field;let i=$R(`${r}_${n}`);for(let t=1;s.has(i);t++)i=$R(`${r}_${n}_${t}`);return s.add(i),{[e]:i}};if(!e.fields&&!e.encodings){const n=t.config.selection[e.type];if(e.init)for(const t of nR(e.init))for(const r of TR(t))g$(r)?(e.encodings||(e.encodings=[])).push(r):LP(e)?(pI('Interval selections should be initialized using "x" and/or "y" keys.'),e.encodings=n.encodings):(e.fields||(e.fields=[])).push(r);else e.encodings=n.encodings,e.fields=n.fields}for(const t of e.fields||[]){const e={type:"E",field:t};e.signals=Object.assign({},u(e,"data")),i.items.push(e)}for(const r of e.encodings||[]){const e=t.fieldDef(r);if(e){let s=e.field;if(e.timeUnit){const n={as:s=t.vgField(r),field:e.field,timeUnit:e.timeUnit};a[wR(n)]=n}if(!o[s]){let a="E";if("interval"===n.type){bP(t.getScaleComponent(r).get("type"))&&(a="R")}else e.bin&&(a="R-RE");const c={field:s,channel:r,type:a};c.signals=Object.assign({},u(c,"data"),u(c,"visual")),i.items.push(o[s]=c),i.has[r]=o[s]}}else pI(uI.cannotProjectOnChannelWithoutField(r))}if(e.init)if(iW.has(n))pI(uI.NO_INIT_SCALE_BINDINGS);else{const t=t=>i.items.map(e=>void 0!==t[e.channel]?t[e.channel]:t[e.field]);if(LP(e))n.init=t(e.init);else{const r=HT(e.init)?e.init:[e.init];n.init=r.map(t)}}TR(a).length&&(i.timeUnit=new rW(null,a))},signals:(t,e,n)=>{const r=e.name+aW;return n.filter(t=>t.name===r).length?n:n.concat({name:r,value:e.project.items.map(t=>{const{signals:e}=t;return _(t,["signals"])})})}},AW,iW,DW,NW,EW,OW,kW];function zW(t,e){for(const n of RW)n.has(t)&&e(n)}function $W(t,e=tR){if(HT(t)){return`[${t.map(t=>$W(t,e)).join(", ")}]`}return mI(t)?e(_I(t)):e(JSON.stringify(t))}function LW(t,e){return xW(t,n=>{const r={name:n.name+pW};if(n.init){const e=n.project.items.map(t=>{const{signals:e}=t;return _(t,["signals"])}),i=n.init.map(t=>(function t(e){return HT(e)?e.map(e=>t(e)):mI(e)?_I(e,!1,!0):e})(t));r.values="interval"===n.type?[{unit:_W(t),fields:e,values:i}]:i.map(n=>({unit:_W(t),fields:e,values:n}))}e.filter(t=>t.name===n.name+pW).length||e.push(r)}),e}function IW(t,e){return xW(t,(n,r)=>{e=r.marks?r.marks(t,n,e):e,zW(n,r=>{r.marks&&(e=r.marks(t,n,e))})}),e}function BW(t,e,n){const r=[];const i=LR(e,(function(e){const i=$R(e),o=t.getSelectionComponent(i,e),a=VT(i+pW);if(o.project.timeUnit){const e=n||t.component.data.raw,r=o.project.timeUnit.clone();e.parent?r.insertAsParentOf(e):e.parent=r}return"none"!==o.empty&&r.push(a),`vlSelectionTest(${a}, datum`+("global"===o.resolve?")":`, ${VT(o.resolve)})`)}));return(r.length?"!("+r.map(t=>`length(data(${t}))`).join(" || ")+") || ":"")+`(${i})`}function PW(t,e,n){return LR(e,e=>GT(e)?e:function(t){return t&&t.selection}(e)?BW(t,e.selection,n):zU(e))}function UW(t){const{channel:e,channelDef:n,mark:r,scale:i}=t,o=ZW(t);return HI(n)&&!wz(n.aggregate)&&i&&xP(i.get("type"))&&!1===i.get("zero")?qW({fieldDef:n,channel:e,mark:r,ref:o}):o}function qW({fieldDef:t,channel:e,mark:n,ref:r}){return uz(n)?r:[WW(t,e),r]}function WW(t,e){const n=HW(t,!0),r="x"===b$(e)?{value:0}:{field:{group:"height"}};return Object.assign({test:n},r)}function HW(t,e=!0){return`${t=GT(t)?t:ZI(t,{expr:"datum"})} ${e?"===":"!=="} null ${e?"||":"&&"} ${e?"":"!"}isNaN(${t})`}function YW(t,e){const n=e[t+"Offset"];if(n)return n}function GW({channel:t,fieldDef:e,scaleName:n,mark:r,side:i,offset:o}){return qW({fieldDef:e,channel:t,mark:r,ref:VW(e,n,{binSuffix:"start"===i?void 0:"end"},o?{offset:o}:{})})}function VW(t,e,n,r){const i=Object.assign({},e?{scale:e}:{},{field:ZI(t,n)});if(r){const{offset:t,band:e}=r;return Object.assign({},i,t?{offset:t}:{},e?{band:e}:{})}return i}function XW(t,e=!0){return{scale:t,band:e}}function JW({scaleName:t,fieldDef:e,fieldDef2:n,offset:r,band:i}){i=HR(i,.5);const o=ZI(e,{expr:"datum"}),a=void 0!==n?ZI(n,{expr:"datum"}):ZI(e,{binSuffix:"end",expr:"datum"});return Object.assign({signal:`scale("${t}", ${i} * ${o} + ${1-i} * ${a})`},r?{offset:r}:{})}function ZW({channel:t,channelDef:e,channel2Def:n,scaleName:r,scale:i,stack:o,offset:a,defaultRef:s}){if(e){if(HI(e)){if(YI(e)){if(yB(e.bin))return ER([jz,Dz],t)&&e.type===$I?o&&o.impute?VW(e,r,{binSuffix:"mid"},{offset:a}):JW({scaleName:r,fieldDef:e,offset:a}):VW(e,r,mB(e,t)?{binSuffix:"range"}:{},{offset:a});if(bB(e.bin)){if(HI(n))return JW({scaleName:r,fieldDef:e,fieldDef2:n,offset:a});{const e=t===jz?Cz:Mz;pI(uI.channelRequiredForBinned(e))}}}if(i){const t=i.get("type");if(yP(t))return VW(e,r,{binSuffix:"range"},"band"===t?{band:.5,offset:a}:{offset:a})}return VW(e,r,{},{offset:a})}if(VI(e)){const n=e.value,r=a?{offset:a}:{};return Object.assign({},QW(t,n),r)}}return rR(s)?s():s}function QW(t,e){return ER(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:ER(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:{value:e}}function KW(t,e,{reactiveGeom:n}={}){const r=[],i={},o={},a=n?"datum.datum":"datum",s=[];function u(n,r){const i=b$(r),u=YI(n)?n:Object.assign({},n,{type:t[i].type}),c=rB(u,e,{allowDisabling:!1});let l=tH(u,e,a).signal;if("x"===r||"y"===r){const n="x"===r?"x2":"y2",i=sB(t[n]);if(bB(u.bin)&&i){l=Sq(ZI(u,{expr:a}),ZI(i,{expr:a}),aB(u),e),o[n]=!0}}s.push({channel:r,key:c,value:l})}SB(t,(t,e)=>{HI(t)?u(t,e):WI(t)&&u(t.condition,e)});for(const{channel:t,key:e,value:n}of s)o[t]||i[e]||(r.push(`${VT(e)}: ${n}`),i[e]=!0);return r.length?{signal:`{${r.join(", ")}}`}:void 0}function tH(t,e,n="datum"){if(t){if(VI(t))return{value:t.value};if(YI(t))return Oq(t,aB(t),n,e)}}function eH(t){return Object.assign({},t,{mult:.5})}function nH({markDef:t,config:e,defaultRef:n,channel:r,scaleName:i,scale:o,mark:a,checkBarAreaWithoutZero:s}){return()=>{const u=b$(r),c=HR(t[r],_q(r,t,e));if(void 0!==c)return QW(r,c);if(GT(n)){if(i){const t=o.get("type");if(ER([sP.LOG,sP.TIME,sP.UTC],t))!s||"bar"!==a&&"area"!==a||pI(uI.nonZeroScaleUsedWithLengthMark(a,u,{scaleType:t}));else{if(o.domainDefinitelyIncludesZero())return{scale:i,value:0};!s||"bar"!==a&&"area"!==a||pI(uI.nonZeroScaleUsedWithLengthMark(a,u,{zeroFalse:!1===o.explicit.zero}))}}return"zeroOrMin"===n?"x"===u?{value:0}:{field:{group:"height"}}:"x"===u?{field:{group:"width"}}:{value:0}}return n}}function rH(t){return"transparent"!==t&&null!=t}function iH(t){const{markDef:e,encoding:n,config:r}=t,{filled:i,type:o}=e,a={fill:_q("fill",e,r),stroke:_q("stroke",e,r),color:_q("color",e,r)},s=ER(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=HR(e.fill,a.fill,s),c=HR(e.stroke,a.stroke),l=i?"fill":"stroke",f=Object.assign({},u?{fill:{value:u}}:{},c?{stroke:{value:c}}:{});return n.fill||n.stroke?(e.color&&pI(uI.droppingColor("property",{fill:"fill"in n,stroke:"stroke"in n})),Object.assign({},lH("fill",t,{defaultValue:HR(u,s)}),lH("stroke",t,{defaultValue:c}))):n.color?Object.assign({},f,lH("color",t,{vgChannel:l,defaultValue:HR(e[l],e.color,a[l],a.color,i?s:void 0)})):rH(e.fill)||rH(e.stroke)?(e.color&&pI(uI.droppingColor("property",{fill:"fill"in e,stroke:"stroke"in e})),f):e.color?Object.assign({},f,{[l]:{value:e.color}}):rH(a.fill)||rH(a.stroke)?f:a.color?Object.assign({},s?{fill:{value:"transparent"}}:{},{[l]:{value:a.color}}):{}}function oH(t,e){const{fill:n,stroke:r}=iH(t);return Object.assign({},function(t,e){return tq.reduce((n,r)=>(void 0!==t[r]&&"ignore"!==e[r]&&(n[r]={value:t[r]}),n),{})}(t.markDef,e),aH(t,"fill",n),aH(t,"stroke",r),lH("opacity",t),lH("fillOpacity",t),lH("strokeOpacity",t),lH("strokeWidth",t),dH(t),hH(t,"href"))}function aH(t,e,n){const{config:r,mark:i}=t;if("hide"===r.invalidValues&&n&&!uz(i)){const r=uH(t,{invalid:!0,channels:P$});if(r)return{[e]:[{test:r,value:null},...nR(n)]}}return n?{[e]:n}:{}}function sH(t,e){if(void 0!==e)return{[t]:{value:e}}}function uH(t,{invalid:e=!1,channels:n}){const r=n.reduce((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&bP(i)&&(e[o]=!0)}return e},{}),i=TR(r);if(i.length>0){const t=e?"||":"&&";return i.map(t=>HW(t,e)).join(` ${t} `)}}function cH(t){if(t.config.invalidValues){const e=uH(t,{channels:["x","y"]});if(e)return{defined:{signal:e}}}return{}}function lH(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:a=t}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=u||(a===t?r[t]:HR(r[t],r[a],_q(t,r,o,{vgChannel:a}))),s=u?{value:u}:void 0);const c=i[t];return fH(e,c,a,n=>ZW({channel:t,channelDef:n,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s}))}function fH(t,e,n,r){const i=e&&e.condition,o=r(e);if(i){return{[n]:[...(HT(i)?i:[i]).map(e=>{const n=r(e),i=function(t){return t.selection}(e)?BW(t,e.selection):PW(t,e.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function dH(t,e={}){const{encoding:n,markDef:r,config:i}=t,o=n.tooltip;return HT(o)?{tooltip:KW({tooltip:o},i,e)}:fH(t,o,"tooltip",o=>{const a=tH(o,t.config,e.reactiveGeom?"datum.datum":"datum");if(a)return a;if(null===o)return;const s=HR(r.tooltip,_q("tooltip",r,i));return GT(s)?{value:s}:YT(s)?"encoding"===s.content?KW(n,i,e):{signal:"datum"}:void 0})}function hH(t,e="text"){const n=t.encoding[e];return fH(t,n,e,e=>tH(e,t.config))}function pH(t,e,n,r){const{encoding:i,mark:o,markDef:a,config:s,stack:u}=e,c=i[t],l=i[t===jz?Cz:Mz],f=e.scaleName(t),d=e.getScaleComponent(t),h=YW(t,e.markDef);return{[r||t]:c||!i.latitude&&!i.longitude?function(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o}=t;return HI(n)&&i&&e===i.fieldChannel?VW(n,r,{suffix:"end"},{offset:o}):UW(t)}({channel:t,channelDef:c,channel2Def:l,scaleName:f,scale:d,stack:u,mark:o,offset:h,defaultRef:nH({markDef:a,config:s,defaultRef:n,channel:t,scaleName:f,scale:d,mark:o,checkBarAreaWithoutZero:!l})}):{field:e.getName(t)}}}function gH(t,e,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=t,u="x2"===n?"x":"y",c="x2"===n?"width":"height",l=r[u],f=t.scaleName(u),d=t.getScaleComponent(u),h=YW(n,t.markDef);if(!l&&(r.latitude||r.longitude))return{[n]:{field:t.getName(n)}};const p=function({channel:t,channelDef:e,channel2Def:n,scaleName:r,scale:i,stack:o,mark:a,offset:s,defaultRef:u}){return HI(e)&&o&&t.charAt(0)===o.fieldChannel.charAt(0)?VW(e,r,{suffix:"start"},{offset:s}):UW({channel:t,channelDef:n,scaleName:r,scale:i,stack:o,mark:a,offset:s,defaultRef:u})}({channel:n,channelDef:l,channel2Def:r[n],scaleName:f,scale:d,stack:a,mark:i,offset:h,defaultRef:void 0});return void 0!==p?{[n]:p}:HR(mH(n,o),mH(n,{[n]:wq(n,o,s.style),[c]:wq(c,o,s.style)}),mH(n,s[i]),mH(n,s.mark),{[n]:nH({markDef:o,config:s,defaultRef:e,channel:n,scaleName:f,scale:d,mark:i,checkBarAreaWithoutZero:!r[n]})()})}function mH(t,e){const n="x2"===t?"width":"height";return e[t]?{[t]:QW(t,e[t])}:e[n]?{[n]:{value:e[n]}}:void 0}function vH(t,e){return TR(t).reduce((n,r)=>{const i=t[r];return Object.assign({},n,fH(e,i,r,t=>({value:t.value})))},{})}function yH(t,e){if(sG(e)||iG(e))return"shared";if(aG(e)||oG(e))return ER(M$,t)?"independent":"shared";throw new Error("invalid model type for resolve")}function bH(t,e){const n=t.scale[e],r=ER(M$,e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&pI(uI.independentScaleMeansIndependentGuide(e)),"independent"):t[r][e]||"shared"}class xH{constructor(t={},e={}){this.explicit=t,this.implicit=e}clone(){return new xH(yR(this.explicit),yR(this.implicit))}combine(){return Object.assign({},this.explicit,this.implicit)}get(t){return HR(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,e){void 0!==e.value&&this.set(t,e.value,e.explicit)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,e){void 0!==e.explicit[t]?this.set(t,e.explicit[t],!0):void 0!==e.implicit[t]&&this.set(t,e.implicit[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of TR(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function _H(t){return{explicit:!0,value:t}}function wH(t){return{explicit:!1,value:t}}function OH(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:EH(e,n,r,i)}}function EH(t,e,n,r){return t.explicit&&e.explicit&&pI(uI.mergeConflictingProperty(n,r,t.value,e.value)),t}function AH(t,e,n,r,i=EH){return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:_R(t.value)===_R(e.value)?t:i(t,e,n,r)}class kH extends xH{}function SH(t){const{legend:e}=t;return HR(e.type,jH(t))}function jH({channel:t,timeUnit:e,scaleType:n,alwaysReturn:r}){if(e$(t)){if(ER(["quarter","month","day"],e))return"symbol";if(xP(n))return r?"gradient":void 0}return r?"symbol":void 0}function DH({legend:t,legendConfig:e,timeUnit:n,channel:r,scaleType:i}){const o=HR(t.orient,e.orient,"right"),a=SH({legend:t,channel:r,timeUnit:n,scaleType:i,alwaysReturn:!0});return HR(t.direction,e[a?"gradientDirection":"symbolDirection"],function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(o,a))}function CH(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function MH(t,e,n){const r=e.getScaleComponent(n).get("type");return HR(t.get("type"),jH({channel:n,scaleType:r,alwaysReturn:!0}))}function FH(t,e,n,r,i){if("symbol"!==MH(i,n,r))return;let o=Object.assign({},function(t,e,n){for(const r of n){const n=_q(r,e.markDef,e.config);void 0!==n&&(t[r]={value:n})}return t}({},n,fz),iH(n));const{markDef:a,encoding:s,config:u}=n,c=a.filled,l=RH(s.opacity)||a.opacity;if(o.fill)if("fill"===r||c&&r===zz)delete o.fill;else if(o.fill.field)i.get("symbolFillColor")?delete o.fill:(o.fill={value:u.legend.symbolBaseFillColor||"black"},o.fillOpacity={value:l||1});else if(HT(o.fill)){const t=zH(s.fill||s.color)||a.fill||c&&a.color;t&&(o.fill={value:t})}if(o.stroke)if("stroke"===r||!c&&r===zz)delete o.stroke;else if(o.stroke.field)delete o.stroke;else if(HT(o.stroke)){const t=HR(zH(s.stroke||s.color),a.stroke,c?a.color:void 0);t&&(o.stroke={value:t})}return r!==Pz&&l&&(o.opacity={value:l}),o=Object.assign({},o,e),TR(o).length>0?o:void 0}function NH(t,e,n,r,i){if("gradient"!==MH(i,n,r))return;let o={};const a=RH(n.encoding.opacity)||n.markDef.opacity;return a&&(o.opacity={value:a}),o=Object.assign({},o,e),TR(o).length>0?o:void 0}function TH(t,e,n,r){const i=n.legend(r),o=n.config;let a={};if(hB(t)){const a=n.getScaleComponent(r).get("type")===sP.UTC,s=jq("datum.value",t.timeUnit,i.format,o.legend.shortTimeLabels,o.timeFormat,a);e=Object.assign({},s?{text:{signal:s}}:{},e)}return a=Object.assign({},a,e),TR(a).length>0?a:void 0}function RH(t){return $H(t,(t,e)=>Math.max(t,e.value))}function zH(t){return $H(t,(t,e)=>HR(t,e.value))}function $H(t,e){return function(t){return!!t&&!!t.condition&&(HT(t.condition)||VI(t.condition))}(t)?(HT(t.condition)?t.condition:[t.condition]).reduce(e,t.value):VI(t)?t.value:void 0}function LH(t){rG(t)?t.component.legends=function(t){const{encoding:e}=t;return[zz,$z,Lz,Wz,Bz,Iz,Pz,Uz,qz].reduce((n,r)=>{const i=e[r];return!t.legend(r)||!t.getScaleComponent(r)||HI(i)&&r===Iz&&i.type===PI||(n[r]=function(t,e){const n=t.fieldDef(e),r=t.legend(e),i=new kH({},function(t,e){const n=t.scaleName(zz);if("color"===e)return t.markDef.filled?{fill:n}:{stroke:n};return{[e]:t.scaleName(e)}}(t,e));for(const o of oP){const a=BH(o,r,e,t);if(void 0!==a){const e=IH(a,o,r,n);(e||void 0===t.config.legend[o])&&i.set(o,a,e)}}const o=r.encoding||{},a=["labels","legend","title","symbols","gradient"].reduce((r,a)=>{const s=vH(o[a]||{},t),u=y[a]?y[a](n,s,t,e,i):s;return void 0!==u&&TR(u).length>0&&(r[a]={update:u}),r},{});TR(a).length>0&&i.set("encode",a,!!r.encoding);return i}(t,r)),n},{})}(t):t.component.legends=function(t){const{legends:e,resolve:n}=t.component;for(const r of t.children)LH(r),TR(r.component.legends).forEach(i=>{n.legend[i]=bH(t.component.resolve,i),"shared"===n.legend[i]&&(e[i]=PH(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))});return TR(e).forEach(e=>{for(const r of t.children)r.component.legends[e]&&"shared"===n.legend[e]&&delete r.component.legends[e]}),e}(t)}function IH(t,e,n,r){switch(e){case"values":return!!n.values;case"title":if("title"===e&&t===r.title)return!0}return t===n[e]}function BH(t,e,n,r){const{encoding:i,mark:o}=r,a=uB(i[n]),s=r.config.legend,{timeUnit:u}=a,c=r.getScaleComponent(n).get("type");switch(t){case"direction":return DH({legend:e,legendConfig:s,timeUnit:u,channel:n,scaleType:c});case"format":if(hB(a))return;return Eq(a,e.format,r.config);case"formatType":if(hB(a))return;return e.formatType;case"gradientLength":return HR(e.gradientLength,s.gradientLength,function({legend:t,legendConfig:e,model:n,channel:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if("horizontal"===DH({legend:t,legendConfig:e,channel:r,scaleType:i})){const r=HR(t.orient,e.orient);return"top"===r||"bottom"===r?CH(n,"width",a,o):a}return CH(n,"height",u,s)}({model:r,legend:e,legendConfig:s,channel:n,scaleType:c}));case"labelOverlap":return HR(e.labelOverlap,function(t){if(ER(["quantile","threshold","log"],t))return"greedy"}(c));case"symbolType":return HR(e.symbolType,function(t,e,n,r){if("shape"!==e){const t=zH(n)||r;if(t)return t}switch(t){case"bar":case"rect":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(o,n,i.shape,r.markDef.shape));case"title":return rB(a,r.config,{allowDisabling:!0})||void 0;case"type":return SH({legend:e,channel:n,timeUnit:u,scaleType:c,alwaysReturn:!1});case"values":return function(t,e){const n=t.values;if(n)return gB(e,n)}(e,a)}return e[t]}function PH(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const n of aP){const r=AH(t.getWithExplicit(n),e.getWithExplicit(n),n,"legend",(t,e)=>{switch(n){case"symbolType":return UH(t,e);case"title":return Fq(t,e);case"type":return i=!0,wH("symbol")}return EH(t,e,n,"legend")});t.setWithExplicit(n,r)}return i&&(((t.implicit||{}).encode||{}).gradient&&IR(t.implicit,["encode","gradient"]),((t.explicit||{}).encode||{}).gradient&&IR(t.explicit,["encode","gradient"])),t}function UH(t,e){return"circle"===e.value?e:t}function qH(t){const e=t.component.legends,n={};for(const r of TR(e)){const i=t.getScaleComponent(r),o=_R(i.get("domains"));if(n[o])for(const t of n[o]){PH(t,e[r])||n[o].push(e[r])}else n[o]=[e[r].clone()]}return SR(RR(n)).map(t=>{const e=t.combine();if(e.encode&&e.encode.symbols){const t=e.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||e.stroke||(t.stroke={value:"transparent"}),e.fill&&delete t.fill}return e})}function WH(t){return sG(t)||aG(t)||oG(t)?function(t){return t.children.reduce((t,e)=>t.concat(e.assembleProjections()),HH(t))}(t):HH(t)}function HH(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n,i=_(n,["name"]);if(e.data){const n={signal:`[${e.size.map(t=>t.signal).join(", ")}]`},o=e.data.reduce((e,n)=>{const r=ZU(n)?n.signal:`data('${t.lookupDataSource(n)}')`;return ER(e,r)||e.push(r),e},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:n,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},i)]}return[Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}},i)]}const YH=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class GH extends xH{constructor(t,e,n,r){super(Object.assign({},e),{name:t}),this.specifiedProjection=e,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function VH(t){t.component.projection=rG(t)?function(t){if(t.hasProjection){const e=t.specifiedProjection,n=!(e&&(null!=e.scale||null!=e.translate)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?function(t){const e=[];[[Nz,Fz],[Rz,Tz]].forEach(n=>{(t.channelHasField(n[0])||t.channelHasField(n[1]))&&e.push({signal:t.getName(`geojson_${e.length}`)})}),t.channelHasField(Iz)&&t.fieldDef(Iz).type===PI&&e.push({signal:t.getName(`geojson_${e.length}`)});0===e.length&&e.push(t.requestDataName(AU));return e}(t):void 0;return new GH(t.projectionName(!0),Object.assign({},t.config.projection||{},e||{}),r,i)}return}(t):function(t){if(0===t.children.length)return;let e;t.children.forEach(t=>VH(t));const n=kR(t.children,t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=kR(YH,n=>!t.explicit.hasOwnProperty(n)&&!e.explicit.hasOwnProperty(n)||!(!t.explicit.hasOwnProperty(n)||!e.explicit.hasOwnProperty(n)||_R(t.get(n))!==_R(e.get(n))));if(_R(t.size)===_R(e.size)){if(n)return t;if(_R(t.explicit)===_R({}))return e;if(_R(e.explicit)===_R({}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0});if(e&&n){const n=t.projectionName(!0),r=new GH(n,e.specifiedProjection,e.size,yR(e.data));return t.children.forEach(t=>{const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}),r}return}(t)}function XH(t,e){return`${vB(t)}_${e}`}function JH(t,e,n){const r=XH(fB(n,void 0)||{},e);return t.getName(`${r}_bins`)}function ZH(t,e,n){let r;r=function(t){return"as"in t}(t)?GT(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:[ZI(t,{forAs:!0}),ZI(t,{binSuffix:"end",forAs:!0})];const i=fB(e,void 0)||{},o=XH(i,t.field),{signal:a,extentSignal:s}=function(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}(n,o);return{key:o,binComponent:Object.assign({bin:i,field:t.field,as:[r]},a?{signal:a}:{},s?{extentSignal:s}:{})}}class QH extends Nq{constructor(t,e){super(t),this.bins=e}clone(){return new QH(null,yR(this.bins))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,n,r)=>{if(YI(n)&&yB(n.bin)){const{key:i,binComponent:o}=ZH(n,n.bin,e);t[i]=Object.assign({},o,t[i],function(t,e,n,r){if(mB(e,n)){const i=rG(t)&&(t.axis(n)||t.legend(n))||{},o=ZI(e,{expr:"datum"}),a=ZI(e,{expr:"datum",binSuffix:"end"});return{formulaAs:ZI(e,{binSuffix:"range",forAs:!0}),formula:Sq(o,a,i.format,r)}}return{}}(e,n,r,e.config))}return t},{});return 0===TR(n).length?null:new QH(t,n)}static makeFromTransform(t,e,n){const{key:r,binComponent:i}=ZH(e,e.bin,n);return new QH(t,{[r]:i})}merge(t,e){for(const n of TR(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=CR([...this.bins[n].as,...t.bins[n].as],wR)):this.bins[n]=t.bins[n];for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}producedFields(){return new Set(SR(SR(RR(this.bins).map(t=>t.as))))}dependentFields(){return new Set(RR(this.bins).map(t=>t.field))}hash(){return`Bin ${wR(this.bins)}`}assemble(){return SR(RR(this.bins).map(t=>{const e=[],[n,...r]=t.as,i=Object.assign({type:"bin",field:UR(t.field),as:n,signal:t.signal},t.bin);!t.bin.extent&&t.extentSignal&&(e.push({type:"extent",field:UR(t.field),signal:t.extentSignal}),i.extent={signal:t.extentSignal}),e.push(i);for(const t of r)for(let r=0;r<2;r++)e.push({type:"formula",expr:ZI({field:n[r]},{expr:"datum"}),as:t[r]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}class KH extends Nq{constructor(t){let e;if(super(null),_U(t=t||{name:"source"})||(e=t.format?Object.assign({},xR(t.format,["parse"])):{}),bU(t))this._data={values:t.values};else if(yU(t)){if(this._data={url:t.url},!e.type){let n=/(?:\.([^.]+))?$/.exec(t.url)[1];ER(["json","csv","tsv","dsv","topojson"],n)||(n="json"),e.type=n}}else OU(t)?this._data={values:[{type:"Sphere"}]}:(xU(t)||_U(t))&&(this._data={});this._generator=_U(t),t.name&&(this._name=t.name),e&&TR(e).length>0&&(this._data.format=e)}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign({name:this._name},this._data,{transform:[]})}}function tY(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return console.error("Dataflow graph is inconsistent.",e,t),!1;if(!tY(e.children))return!1}return!0}class eY extends Nq{constructor(t,e){super(t),this.params=e}clone(){return new eY(null,this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class nY extends Nq{constructor(t,e){super(t),this.params=e}clone(){return new nY(null,this.params)}producedFields(){return new Set([this.params.as||"data"])}assemble(){return Object.assign({type:"sequence"},this.params)}}function rY(t){return t instanceof KH||t instanceof eY||t instanceof nY}class iY{constructor(){this._mutated=!1}setMutated(){this._mutated=!0}get mutatedFlag(){return this._mutated}}class oY extends iY{constructor(){super(),this._continue=!1}setContinue(){this._continue=!0}get continueFlag(){return this._continue}get flags(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}}set flags({continueFlag:t,mutatedFlag:e}){t&&this.setContinue(),e&&this.setMutated()}reset(){}optimizeNextFromLeaves(t){if(rY(t))return!1;const e=t.parent,{continueFlag:n}=this.run(t);return n&&this.optimizeNextFromLeaves(e),this.mutatedFlag}}class aY extends iY{}function sY(t,e,n,r){if(YI(n)&&yB(n.bin))t.add(ZI(n,{})),t.add(ZI(n,{binSuffix:"end"})),mB(n,e)&&t.add(ZI(n,{binSuffix:"range"}));else if(e in Qz){const n=function(t){switch(t){case Fz:return"y";case Tz:return"y2";case Nz:return"x";case Rz:return"x2"}}(e);t.add(r.getName(n))}else t.add(ZI(n));return t}class uY extends Nq{constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}clone(){return new uY(null,new Set(this.dimensions),yR(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef(t=>{t.aggregate&&(n=!0)});const r={},i=new Set;return n?(e.forEachFieldDef((t,n)=>{const{aggregate:o,field:a}=t;if(o)if("count"===o)r["*"]=r["*"]||{},r["*"].count=new Set([ZI(t,{forAs:!0})]);else{if(yz(o)||bz(o)){const t=yz(o)?"argmin":"argmax",e=o[t];r[e]=r[e]||{},r[e][t]=new Set([ZI({op:t,field:e},{forAs:!0})])}else r[a]=r[a]||{},r[a][o]=new Set([ZI(t,{forAs:!0})]);U$(n)&&"unaggregated"===e.scaleDomain(n)&&(r[a]=r[a]||{},r[a].min=new Set([ZI({field:a,aggregate:"min"},{forAs:!0})]),r[a].max=new Set([ZI({field:a,aggregate:"max"},{forAs:!0})]))}else sY(i,n,t,e)}),i.size+TR(r).length===0?null:new uY(t,i,r)):null}static makeFromTransform(t,e){const n=new Set,r={};for(const t of e.aggregate){const{op:e,field:n,as:i}=t;e&&("count"===e?(r["*"]=r["*"]||{},r["*"].count=new Set([i||ZI(t,{forAs:!0})])):(r[n]=r[n]||{},r[n][e]=new Set([i||ZI(t,{forAs:!0})])))}for(const t of e.groupby||[])n.add(t);return n.size+TR(r).length===0?null:new uY(t,n,r)}merge(t){return function(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}(this.dimensions,t.dimensions)?(function(t,e){for(const n of TR(e)){const r=e[n];for(const e of TR(r))n in t?t[n][e]=new Set([...t[n][e]||[],...r[e]]):t[n]={[e]:r[e]}}}(this.measures,t.measures),!0):(function(...t){dI.debug.apply(dI,arguments)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...TR(this.measures)])}producedFields(){const t=new Set;for(const e of TR(this.measures))for(const n of TR(this.measures[e])){const r=this.measures[e][n];0===r.size?t.add(`${n}_${e}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${wR({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],e=[],n=[];for(const r of TR(this.measures))for(const i of TR(this.measures[r]))for(const o of this.measures[r][i])n.push(o),t.push(i),e.push("*"===r?null:UR(r));return{type:"aggregate",groupby:[...this.dimensions],ops:t,fields:e,as:n}}}class cY extends Nq{constructor(t,e,n,r){super(t),this.model=e,this.name=n,this.data=r;for(const t of r$){const n=e.facet[t];if(n){const{bin:r,sort:i}=n;this[t]=Object.assign({name:e.getName(`${t}_domain`),fields:[ZI(n),...yB(r)?[ZI(n,{binSuffix:"end"})]:[]]},pq(i)?{sortField:i}:HT(i)?{sortIndexField:$q(n,t)}:{})}}this.childModel=e.child}hash(){let t="Facet";for(const e of r$)this[e]&&(t+=` ${e.charAt(0)}:${wR(this[e])}`);return t}get fields(){const t=[];for(const e of r$)this[e]&&this[e].fields&&t.push(...this[e].fields);return t}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of["x","y"]){const n=this.childModel.component.scales[e];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(yP(r)&&QU(i)){const n=IY(BY(this.childModel,e));n?t[e]=n:pI("Unknown field for ${channel}.  Cannot calculate view size.")}}}return t}assembleRowColumnHeaderData(t,e,n){const r={row:"y",column:"x"}[t],i=[],o=[],a=[];n&&n[r]&&(e?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[t];if(s){const{op:t=hq,field:e}=s;i.push(e),o.push(t),a.push(ZI(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:e||this.data,transform:[Object.assign({type:"aggregate",groupby:this[t].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(const t of Pq){for(const e of Uq){const r=n[t]&&n[t][e]||[];for(const e of r)if(e.axes&&e.axes.length>0){i[t]=!0;break}}if(i[t]){const n=`length(data("${this.facet.name}"))`,i="row"===t?e?{signal:`ceil(${n} / ${e})`}:1:e?{signal:`min(${n}, ${e})`}:{signal:n};r.push({name:`${this.facet.name}_${t}`,transform:[{type:"sequence",start:0,stop:i}]})}}const{row:o,column:a}=i;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){e=`cross_${this.column.name}_${this.row.name}`;const r=[].concat(n.x||[],n.y||[]),i=r.map(()=>"distinct");t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:r,ops:i}]})}for(const r of[kz,Az])this[r]&&t.push(this.assembleRowColumnHeaderData(r,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}class lY extends Nq{constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=PW(this.model,this.filter,this),this._dependentFields=Rq(this.expr)}clone(){return new lY(null,this.model,yR(this.filter))}dependentFields(){return this._dependentFields}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function fY(t){return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):t}class dY extends Nq{clone(){return new dY(null,yR(this._parse))}constructor(t,e){super(t),this._parse=e}hash(){return`Parse ${wR(this._parse)}`}static makeExplicit(t,e,n){let r={};const i=e.data;return!_U(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(t,r,{},n)}static makeImplicitFromFilterTransform(t,e,n){const r={};return function t(e,n){if(gR(e))t(e.not,n);else if(pR(e))for(const r of e.and)t(r,n);else if(hR(e))for(const r of e.or)t(r,n);else n(e)}(e.filter,t=>{if(TU(t)){let e=null;SU(t)?e=t.equal:FU(t)?e=t.range[0]:NU(t)&&(e=(t.oneOf||t.in)[0]),e&&(mI(e)?r[t.field]="date":oR(e)?r[t.field]="number":GT(e)&&(r[t.field]="string")),t.timeUnit&&(r[t.field]="date")}}),0===TR(r).length?null:this.makeWithAncestors(t,{},r,n)}static makeImplicitFromEncoding(t,e,n){const r={};function i(t){var e;hB(t)?r[t.field]="date":"quantitative"===t.type&&((e=t.aggregate)&&GT(e)&&ER(["min","max"],e))?r[t.field]="number":WR(t.field)>1?t.field in r||(r[t.field]="flatten"):XI(t)&&pq(t.sort)&&WR(t.sort.field)>1&&(t.sort.field in r||(r[t.sort.field]="flatten"))}if((rG(e)||iG(e))&&e.forEachFieldDef((t,n)=>{if(YI(t))i(t);else{const r=b$(n),o=e.fieldDef(r);i(Object.assign({},t,{type:o.type}))}}),rG(e)){const{mark:t,markDef:n,encoding:i}=e;if(uz(t)&&!e.encoding.order){const t=i["horizontal"===n.orient?"y":"x"];!HI(t)||"quantitative"!==t.type||t.field in r||(r[t.field]="number")}}return this.makeWithAncestors(t,{},r,n)}static makeWithAncestors(t,e,n,r){for(const t of TR(n)){const e=r.getWithExplicit(t);void 0!==e.value&&(e.explicit||e.value===n[t]||"derived"===e.value||"flatten"===n[t]?delete n[t]:pI(uI.differentParse(t,n[t],e.value)))}for(const t of TR(e)){const n=r.get(t);void 0!==n&&(n===e[t]?delete e[t]:pI(uI.differentParse(t,e[t],n)))}const i=new xH(e,n);r.copyAll(i);const o={};for(const t of TR(i.combine())){const e=i.get(t);null!==e&&(o[t]=e)}return 0===TR(o).length||r.parseNothing?null:new dY(t,o)}get parse(){return this._parse}merge(t){this._parse=Object.assign({},this._parse,t.parse),t.remove()}assembleFormatParse(){const t={};for(const e of TR(this._parse)){const n=this._parse[e];1===WR(e)&&(t[e]=n)}return t}producedFields(){return new Set(TR(this._parse))}dependentFields(){return new Set(TR(this._parse))}assembleTransforms(t=!1){return TR(this._parse).filter(e=>!t||WR(e)>1).map(t=>{const e=function(t,e){const n=PR(t);if("number"===e)return`toNumber(${n})`;if("boolean"===e)return`toBoolean(${n})`;if("string"===e)return`toString(${n})`;if("date"===e)return`toDate(${n})`;if("flatten"===e)return n;if(0===e.indexOf("date:")){return`timeParse(${n},'${fY(e.slice(5,e.length))}')`}if(0===e.indexOf("utc:")){return`utcParse(${n},'${fY(e.slice(4,e.length))}')`}return pI(uI.unrecognizedParse(e)),null}(t,this._parse[t]);return e?{type:"formula",expr:e,as:qR(t)}:null}).filter(t=>null!==t)}}class hY extends Nq{constructor(t,e){super(t),this.transform=e}clone(){return new hY(null,yR(this.transform))}addDimensions(t){this.transform.groupby=CR(this.transform.groupby.concat(t),t=>t)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e=>t.add(e)),this.transform.joinaggregate.map(t=>t.field).filter(t=>void 0!==t).forEach(e=>t.add(e)),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as||ZI(t)}hash(){return`JoinAggregateTransform ${wR(this.transform)}`}assemble(){const t=[],e=[],n=[];for(const r of this.transform.joinaggregate)e.push(r.op),n.push(this.getDefaultName(r)),t.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:e,fields:t},void 0!==r?{groupby:r}:{})}}class pY extends Nq{clone(){return new pY(null,yR(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:r,as:i,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const t of e.sort)a.push(t.field),s.push(HR(t.order,"ascending"));const u={field:a,order:s};let c;return c=function(t){return HT(t)&&t.every(t=>GT(t))&&t.length>1}(i)?i:GT(i)?[i,i+"_end"]:[e.stack+"_start",e.stack+"_end"],new pY(t,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:c})}static makeFromEncoding(t,e){const n=e.stack,{encoding:r}=e;if(!n)return null;let i;if(n.groupbyChannel){i=uB(r[n.groupbyChannel])}const o=function(t){return t.stack.stackBy.reduce((t,e)=>{const n=ZI(e.fieldDef);return n&&t.push(n),t},[])}(e),a=e.encoding.order;let s;return s=HT(a)||HI(a)?Dq(a):o.reduce((t,e)=>(t.field.push(e),t.order.push("descending"),t),{field:[],order:[]}),new pY(t,{dimensionFieldDef:i,stackField:e.vgField(n.fieldChannel),facetby:[],stackby:o,sort:s,offset:n.offset,impute:n.impute,as:[e.vgField(n.fieldChannel,{suffix:"start",forAs:!0}),e.vgField(n.fieldChannel,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(e=>t.add(e)),this._stack.facetby.forEach(e=>t.add(e)),this._stack.sort.field.forEach(e=>t.add(e)),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${wR(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:t,impute:e,groupby:n}=this._stack;return t?t.bin?e?[ZI(t,{binSuffix:"mid"})]:[ZI(t,{}),ZI(t,{binSuffix:"end"})]:[ZI(t)]:n||[]}assemble(){const t=[],{facetby:e,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;return s&&n&&(n.bin&&t.push({type:"formula",expr:"0.5*"+ZI(n,{expr:"datum"})+"+0.5*"+ZI(n,{expr:"datum",binSuffix:"end"}),as:ZI(n,{binSuffix:"mid",forAs:!0})}),t.push({type:"impute",field:r,groupby:[...i,...e],key:ZI(n,{binSuffix:"mid"}),method:"value",value:0})),t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:r,sort:o,as:u,offset:a}),t}}class gY extends Nq{constructor(t,e){super(t),this.transform=e}clone(){return new gY(null,yR(this.transform))}addDimensions(t){this.transform.groupby=CR(this.transform.groupby.concat(t),t=>t)}dependentFields(){const t=new Set;return(this.transform.groupby||[]).forEach(e=>t.add(e)),(this.transform.sort||[]).forEach(e=>t.add(e.field)),this.transform.window.map(t=>t.field).filter(t=>void 0!==t).forEach(e=>t.add(e)),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as||ZI(t)}hash(){return`WindowTransform ${wR(this.transform)}`}assemble(){const t=[],e=[],n=[],r=[];for(const i of this.transform.window)e.push(i.op),n.push(this.getDefaultName(i)),r.push(void 0===i.param?null:i.param),t.push(void 0===i.field?null:i.field);const i=this.transform.frame,o=this.transform.groupby;if(i&&null===i[0]&&null===i[1]&&e.every(t=>xz(t)))return Object.assign({type:"joinaggregate",as:n,ops:e,fields:t},void 0!==o?{groupby:o}:{});const a=[],s=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)a.push(t.field),s.push(t.order||"ascending");const u={field:a,order:s},c=this.transform.ignorePeers;return Object.assign({type:"window",params:r,as:n,ops:e,fields:t,sort:u},void 0!==c?{ignorePeers:c}:{},void 0!==o?{groupby:o}:{},void 0!==i?{frame:i}:{})}}class mY extends oY{run(t){const e=t.parent;if(t instanceof dY){if(rY(e))return this.flags;if(e.numChildren()>1)return this.setContinue(),this.flags;if(e instanceof dY)this.setMutated(),e.merge(t);else{if(NR(e.producedFields(),t.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),t.swapWithParent()}}return this.setContinue(),this.flags}}class vY extends aY{mergeNodes(t,e){const n=e.shift();for(const r of e)t.removeChild(r),r.parent=n,r.remove()}run(t){const e=t.children.map(t=>t.hash()),n={};for(let r=0;r<e.length;r++)void 0===n[e[r]]?n[e[r]]=[t.children[r]]:n[e[r]].push(t.children[r]);for(const e of TR(n))n[e].length>1&&(this.setMutated(),this.mergeNodes(t,n[e]));for(const e of t.children)this.run(e);return this.mutatedFlag}}class yY extends oY{run(t){return t instanceof Tq||t.numChildren()>0||t instanceof cY?this.flags:(this.setMutated(),t.remove(),this.flags)}}class bY extends oY{constructor(){super(...arguments),this.fields=new Set}run(t){if(this.setContinue(),t instanceof rW){const e=t.producedFields();MR(e,this.fields)?(this.setMutated(),t.remove()):this.fields=new Set([...this.fields,...e])}return this.flags}reset(){this.fields.clear()}}class xY extends oY{run(t){this.setContinue();const e=t.parent.children.filter(t=>t instanceof rW),n=e.pop();for(const t of e)this.setMutated(),n.merge(t);return this.flags}}function _Y(t){if(t instanceof cY)if(1!==t.numChildren()||t.children[0]instanceof Tq){const n=t.model.component.data.main;!function t(e){if(e instanceof Tq&&e.type===AU&&1===e.numChildren()){const n=e.children[0];n instanceof cY||(n.swapWithParent(),t(e))}}(n);const r=(e=t,function t(n){if(!(n instanceof cY)){const r=n.clone();if(r instanceof Tq){const t=SY+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof uY||r instanceof pY||r instanceof gY||r instanceof hY)&&r.addDimensions(e.fields);return SR(n.children.map(t)).forEach(t=>t.parent=r),[r]}return SR(n.children.map(t))}),i=SR(t.children.map(r));for(const t of i)t.parent=n}else{const e=t.children[0];(e instanceof uY||e instanceof pY||e instanceof gY||e instanceof hY)&&e.addDimensions(t.fields),e.swapWithParent(),_Y(t)}else t.children.map(_Y);var e}class wY extends aY{run(t){t instanceof Tq&&!t.isRequired()&&(this.setMutated(),t.remove());for(const e of t.children)this.run(e);return this.mutatedFlag}}class OY extends oY{run(t){const e=t.parent,n=[...e.children],r=e.children.filter(t=>t instanceof dY);if(e.numChildren()>1&&r.length>=1){const t={},i=new Set;for(const e of r){const n=e.parse;for(const e of TR(n))e in t?t[e]!==n[e]&&i.add(e):t[e]=n[e]}for(const e of i)delete t[e];if(0!==TR(t).length){this.setMutated();const r=new dY(e,t);for(const i of n){if(i instanceof dY)for(const e of TR(t))delete i.parse[e];e.removeChild(i),i.parent=r,i instanceof dY&&0===TR(i.parse).length&&i.remove()}}}return this.setContinue(),this.flags}}class EY extends oY{run(t){const e=t.parent,n=e.children.filter(t=>t instanceof uY),r={};for(const t of n){const e=wR(t.groupBy);e in r||(r[e]=[]),r[e].push(t)}for(const t of TR(r)){const n=r[t];if(n.length>1){const t=n.pop();for(const r of n)t.merge(r)&&(e.removeChild(r),r.parent=t,r.remove(),this.setMutated())}}return this.setContinue(),this.flags}}class AY extends oY{constructor(t){super(),this.model=t}run(t){const e=t.parent,n=!(rY(e)||e instanceof lY||e instanceof dY),r=[],i=[];for(const t of e.children)t instanceof QH&&(n&&!NR(e.producedFields(),t.dependentFields())?r.push(t):i.push(t));if(r.length>0){const t=r.pop();for(const e of r)t.merge(e,this.model.renameSignal.bind(this.model));this.setMutated(),e instanceof QH?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const t=i.pop();for(const e of i)t.merge(e,this.model.renameSignal.bind(this.model));this.setMutated()}return this.setContinue(),this.flags}}class kY extends oY{run(t){const e=t.parent,n=[...e.children];if(!AR(n,t=>t instanceof Tq)||e.numChildren()<=1)return this.setContinue(),this.flags;const r=[];let i;for(const t of n)if(t instanceof Tq){let n=t;for(;1===n.numChildren();){const t=n.children[0];if(!(t instanceof Tq))break;n=t}r.push(...n.children),i?(e.removeChild(t),t.parent=i.parent,i.parent.removeChild(i),i.parent=n,this.setMutated()):i=n}else r.push(t);if(r.length){this.setMutated();for(const t of r)t.parent.removeChild(t),t.parent=i}return this.setContinue(),this.flags}}const SY="scale_",jY=5;function DY(t){const e=[];return t.forEach((function t(n){0===n.numChildren()?e.push(n):n.children.forEach(t)})),e}function CY(t){return t}function MY(t,e){return e.map(e=>{if(t instanceof oY){const n=t.optimizeNextFromLeaves(e);return t.reset(),n}return t.run(e)}).some(CY)}function FY(t,e){let n=t.sources;const r=new Set;return r.add(MY(new wY,n)),n=n.filter(t=>t.numChildren()>0),r.add(MY(new yY,DY(n))),n=n.filter(t=>t.numChildren()>0),r.add(MY(new mY,DY(n))),r.add(MY(new AY(e),DY(n))),r.add(MY(new bY,DY(n))),r.add(MY(new OY,DY(n))),r.add(MY(new EY,DY(n))),r.add(MY(new xY,DY(n))),r.add(MY(new vY,n)),r.add(MY(new kY,DY(n))),t.sources=n,r.has(!0)}class NY{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new NY(()=>t(e))}}function TY(t){rG(t)?function(t){const e=t.specifiedScales,n=t.component.scales;TR(n).forEach(r=>{const i=e[r],o=i?i.domain:void 0,a=function(t,e){const n=t.getScaleComponent(e).get("type"),r=function(t,e,n,r){if("unaggregated"===t){const{valid:t,reason:r}=$Y(e,n);if(!t)return void pI(r)}else if(void 0===t&&r.useUnaggregatedDomain){const{valid:t}=$Y(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.fieldDef(e),n,t.config.scale);r!==t.scaleDomain(e)&&(t.specifiedScales[e]=Object.assign({},t.specifiedScales[e],{domain:r}));if("x"===e&&t.channelHasField("x2"))return t.channelHasField("x")?AH(RY(n,r,t,"x"),RY(n,r,t,"x2"),"domain","scale",LY):RY(n,r,t,"x2");if("y"===e&&t.channelHasField("y2"))return t.channelHasField("y")?AH(RY(n,r,t,"y"),RY(n,r,t,"y2"),"domain","scale",LY):RY(n,r,t,"y2");return RY(n,r,t,e)}(t,r),s=n[r];if(s.setWithExplicit("domains",a),OP(o)&&s.set("domainRaw",{signal:vW+wR(o)},!0),t.component.data.isFaceted){let e=t;for(;!iG(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[r])for(const t of a.value)KU(t)&&(t.data=SY+t.data.replace(SY,""))}})}(t):function(t){for(const e of t.children)TY(e);const e=t.component.scales;TR(e).forEach(n=>{let r,i=null;for(const e of t.children){const t=e.component.scales[n];if(t){r=void 0===r?t.getWithExplicit("domains"):AH(r,t.getWithExplicit("domains"),"domains","scale",LY);const e=t.get("domainRaw");i&&e&&i.signal!==e.signal&&pI("The same selection must be used to override scale domains in a layered view."),i=e}}e[n].setWithExplicit("domains",r),i&&e[n].set("domainRaw",i,!0)})}(t)}function RY(t,e,n,r){const i=n.fieldDef(r);if(e&&"unaggregated"!==e&&!OP(e)){const{type:t,timeUnit:n}=i;return _H("temporal"===t||n?function(t,e,n){return t.map(t=>{return{signal:`{data: ${pB(t,{timeUnit:n,type:e})}}`}})}(e,t,n):[e])}const o=n.stack;if(o&&r===o.fieldChannel){if("normalize"===o.offset)return wH([[0,1]]);const t=n.requestDataName(AU);return wH([{data:t,field:n.vgField(r,{suffix:"start"})},{data:t,field:n.vgField(r,{suffix:"end"})}])}const a=U$(r)?function(t,e,n){if(!yP(n))return;const r=t.fieldDef(e),i=r.sort;if(gq(i))return{op:"min",field:$q(r,e),order:"ascending"};const o=null!==t.stack;if(pq(i))return zY(i,o);if(function(t){return!!t&&!!t.encoding}(i)){const{encoding:e,order:n}=i,{aggregate:r,field:a}=t.fieldDef(e);return zY({op:r,field:a,order:n},o)}if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(ER(["ascending",void 0],i))return!0;return}(n,r,t):void 0;if("unaggregated"===e){const t=n.requestDataName(AU),{field:e}=i;return wH([{data:t,field:ZI({field:e,aggregate:"min"})},{data:t,field:ZI({field:e,aggregate:"max"})}])}if(yB(i.bin)){if(yP(t))return wH("bin-ordinal"===t?[]:[{data:zR(a)?n.requestDataName(AU):n.requestDataName(kU),field:n.vgField(r,mB(i,r)?{binSuffix:"range"}:{}),sort:!0!==a&&YT(a)?a:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:t}=i;if(yB(t)){const e=JH(n,i.field,t);return wH([new NY(()=>{const t=n.getSignalName(e);return`[${t}.start, ${t}.stop]`})])}return wH([{data:n.requestDataName(AU),field:n.vgField(r,{})}])}}return wH(a?[{data:zR(a)?n.requestDataName(AU):n.requestDataName(kU),field:n.vgField(r),sort:a}]:[{data:n.requestDataName(AU),field:n.vgField(r)}])}function zY(t,e){const{op:n,field:r,order:i}=t;return Object.assign({op:n||(e?"sum":hq)},r?{field:UR(r)}:{},i?{order:i}:{})}function $Y(t,e){const{aggregate:n,type:r}=t;return n?GT(n)&&!Ez[n]?{valid:!1,reason:uI.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:uI.unaggregatedDomainWithLogScale(t)}:{valid:!0}:{valid:!1,reason:uI.unaggregateDomainHasNoEffectForRawField(t)}}function LY(t,e,n,r){return t.explicit&&e.explicit&&pI(uI.mergeConflictingDomainProperty(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function IY(t){if(KU(t)&&GT(t.field))return t.field;if(function(t){return!HT(t)&&("fields"in t&&!("data"in t))}(t)){let e;for(const n of t.fields)if(KU(n)&&GT(n.field))if(e){if(e!==n.field)return pI("Detected faceted independent scales that union domain of multiple fields from different data sources.  We will use the first field.  The result view size may be incorrect."),e}else e=n.field;return pI("Detected faceted independent scales that union domain of identical fields from different source detected.  We will assume that this is the same field from a different fork of the same data source.  However, if this is not case, the result view size maybe incorrect."),e}if(function(t){return!HT(t)&&("fields"in t&&"data"in t)}(t)){pI("Detected faceted independent scales that union domain of multiple fields from the same data source.  We will use the first field.  The result view size may be incorrect.");const e=t.fields[0];return GT(e)?e:void 0}}function BY(t,e){return function(t){const e=CR(t.map(t=>{if(KU(t)){const{sort:e}=t;return _(t,["sort"])}return t}),wR),n=CR(t.map(t=>{if(KU(t)){const e=t.sort;return void 0===e||zR(e)||("count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}}).filter(t=>void 0!==t),wR);if(0===e.length)return;if(1===e.length){const e=t[0];if(KU(e)&&n.length>0){let t=n[0];return n.length>1&&(pI(uI.MORE_THAN_ONE_SORT),t=!0),Object.assign({},e,{sort:t})}return e}const r=CR(n.map(t=>zR(t)||"count"===t.op?t:(pI(uI.domainSortDropped(t)),!0)),wR);let i;1===r.length?i=r[0]:r.length>1&&(pI(uI.MORE_THAN_ONE_SORT),i=!0);const o=CR(t.map(t=>KU(t)?t.data:null),t=>t);if(1===o.length&&null!==o[0]){return Object.assign({data:o[0],fields:e.map(t=>t.field)},i?{sort:i}:{})}return Object.assign({fields:e},i?{sort:i}:{})}(t.component.scales[e].get("domains").map(e=>(KU(e)&&(e.data=t.lookupDataSource(e.data)),e)))}function PY(t){return TR(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine();let{domainRaw:o}=i;const{name:a,type:s,domains:u,domainRaw:c,range:l}=i,f=_(i,["name","type","domains","domainRaw","range"]),d=function(t,e,n){if(("x"===n||"y"===n)&&QU(t))return{step:{signal:e+"_step"}};return t}(i.range,a,n);o&&function(t){return t.signal.indexOf(vW)>=0}(o)&&(o=function(t,e){const n=JSON.parse(e.signal.replace(vW,"")),r=$R(n.selection),i=n.encoding;let o=n.field,a=t.component.selection&&t.component.selection[r];if(!a){if(a=t.getSelectionComponent(r,n.selection),i||o){if(i&&!o){const t=a.project.items.filter(t=>t.channel===i);!t.length||t.length>1?(o=a.project.items[0].field,pI((t.length?"Multiple ":"No ")+`matching ${VT(i)} encoding found for selection ${VT(n.selection)}. `+`Using "field": ${VT(o)}.`)):o=t[0].field}}else o=a.project.items[0].field,a.project.items.length>1&&pI('A "field" or "encoding" must be specified when using a selection as a scale domain. '+`Using "field": ${VT(o)}.`);return{signal:PR(o,r)}}return pI('Use "bind": "scales" to setup a binding for scales and selections within the same view.'),{signal:"null"}}(t,o));const h=BY(t,n);return e.push(Object.assign({name:a,type:s},h?{domain:h}:{},o?{domainRaw:o}:{},{range:d},f)),e},[])}class UY extends xH{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||AR(this.get("domains"),t=>HT(t)&&2===t.length&&t[0]<=0&&t[1]>=0)}}const qY=["range","rangeStep","scheme"];function WY(t){return"x"===t?"width":"y"===t?"height":void 0}function HY(t){const e=t.component.scales;P$.forEach(n=>{const r=e[n];if(!r)return;const i=t.getScaleComponent(n),o=t.specifiedScales[n],a=t.fieldDef(n),s=WY(n);let u=s?!!t.component.layoutSize.get(s):void 0;const c=i.get("type"),l=ER(["point","band"],c)||!!o.rangeStep;s&&t.fit&&!u&&l&&(pI(uI.CANNOT_FIX_RANGE_STEP_WITH_FIT),u=!0);const f=function(t){const e=[];for(const n of M$){const r=YY(t,n);void 0!==r&&e.push(r)}return e}(t),d=function(t,e,n,r,i,o,a,s,u,c,l){const f=u||null===i.rangeStep;for(const e of qY)if(void 0!==i[e]){const r=FP(n,e),o=NP(t,e);if(r)if(o)pI(o);else switch(e){case"range":return _H(i[e]);case"scheme":return _H(GY(i[e]));case"rangeStep":{const n=i[e];if(null!==n){if(!u)return _H({step:n});pI(uI.rangeStepDropped(t))}}}else pI(uI.scalePropertyNotWorkWithScaleType(n,e,t))}return wH(function(t,e,n,r,i,o,a,s,u,c,l){switch(t){case jz:case Dz:if(ER(["point","band"],n)&&!c)if(t===jz&&"text"===a){if(i.scale.textXRangeStep)return{step:i.scale.textXRangeStep}}else if(i.scale.rangeStep)return{step:i.scale.rangeStep};return t===Dz&&bP(n)?[NY.fromName(e,s),0]:[0,NY.fromName(e,s)];case Bz:{const e=function(t,e,n){if(e)return 0;switch(t){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(uI.incompatibleChannel("size",t))}(a,o,i),r=function(t,e,n){const r=n.scale;switch(t){case"bar":case"tick":{if(void 0!==n.scale.maxBandSize)return n.scale.maxBandSize;const t=XY(e,n.scale);return oR(t)?t-1:new NY(()=>`${t.signal} - 1`)}case"line":case"trail":case"rule":return n.scale.maxStrokeWidth;case"text":return n.scale.maxFontSize;case"point":case"square":case"circle":{if(n.scale.maxSize)return n.scale.maxSize;const t=XY(e,r);return oR(t)?Math.pow(VY*t,2):new NY(()=>`pow(${VY} * ${t.signal}, 2)`)}}throw new Error(uI.incompatibleChannel("size",t))}(a,u,i);return _P(n)?function(t,e,n){const r=()=>{const r=`(${ZU(e)?e.signal:e} - ${t}) / (${n} - 1)`;return`sequence(${t}, ${e} + ${r}, ${r})`};return ZU(e)?new NY(r):{signal:r()}}(e,r,function(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&HT(n)?n.length+1:(pI(uI.domainRequiredForThresholdScale(r)),3)}}(n,i,l,t)):[e,r]}case Wz:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Iz:return"symbol";case zz:case $z:case Lz:return"ordinal"===n?"nominal"===r?"category":"ordinal":"rect"===a||"geoshape"===a?"heatmap":"ramp";case Pz:case Uz:case qz:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${t}`)}(t,e,n,r,o,a,s,c,l,f,i.domain))}(n,t.getSignalName.bind(t),c,a.type,o,t.config,r.get("zero"),t.mark,u,t.getName(s),f);r.setWithExplicit("range",d)})}function YY(t,e){const n=t.getScaleComponent(e);if(!n)return;const r=n.get("type"),i=t.fieldDef(e);if(yP(r)){const t=n&&n.get("range");if(t&&QU(t)&&oR(t.step))return t.step}else if(i&&i.bin&&yB(i.bin)){const n=JH(t,i.field,i.bin),r=WY(e),o=t.getName(r);return new NY(()=>{const e=t.getSignalName(n),r=`(${e}.stop - ${e}.start) / ${e}.step`;return`${t.getSignalName(o)} / (${r})`})}}function GY(t){return function(t){return t&&!!t.name}(t)?Object.assign({scheme:t.name},xR(t,["name"])):{scheme:t}}const VY=.95;function XY(t,e){if(t.length>0){let e=1/0;for(const n of t)ZU(n)?e=void 0:void 0!==e&&n<e&&(e=n);return void 0!==e?e:new NY(()=>{return`min(${t.map(t=>ZU(t)?t.signal:t).join(", ")})`})}return e.rangeStep?e.rangeStep:21}function JY(t,e){rG(t)?function(t,e){const n=t.component.scales;TR(n).forEach(r=>{const i=t.specifiedScales[r],o=n[r],a=t.getScaleComponent(r),s=t.fieldDef(r),u=t.config,c=i[e],l=a.get("type"),f=FP(l,e),d=NP(r,e);if(void 0!==c&&(f?d&&pI(d):pI(uI.scalePropertyNotWorkWithScaleType(l,e,r))),f&&void 0===d)if(void 0!==c)o.copyKeyFromObject(e,i);else{const n=function(t,e,n,r,i,o,a,s,u,c){const l=c.scale,{type:f,sort:d}=r;switch(t){case"bins":return function(t,e){const n=e.bin;if(yB(n)){const r=JH(t,e.field,n);return new NY(()=>t.getSignalName(r))}if(bB(n)&&xB(n)&&void 0!==n.step)return{step:n.step};return}(e,r);case"interpolate":return function(t,e){if(ER([zz,$z,Lz],t)&&"nominal"!==e)return"hcl";return}(n,f);case"nice":return function(t,e,n){if(n.bin||ER([sP.TIME,sP.UTC],t))return;return!!ER([jz,Dz],e)||void 0}(i,n,r);case"padding":return function(t,e,n,r,i,o){if(ER([jz,Dz],t)){if(xP(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=i;if("bar"===e&&!r.bin&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===sP.POINT)return n.pointPadding}return}(n,i,l,r,u,c.bar);case"paddingInner":return function(t,e,n,r){if(void 0!==t)return;if(ER([jz,Dz],e)){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i}=r;return HR(t,"bar"===n?e:i)}return}(o,n,u.type,l);case"paddingOuter":return function(t,e,n,r,i,o){if(void 0!==t)return;if(ER([jz,Dz],e)&&n===sP.BAND){const{bandPaddingOuter:t,barBandPaddingOuter:e,rectBandPaddingOuter:n}=o;return HR(t,"bar"===r?e:n,i/2)}return}(o,n,i,u.type,a,l);case"reverse":return function(t,e){if(bP(t)&&"descending"===e)return!0;return}(i,d);case"zero":return function(t,e,n,r,i){if(n&&"unaggregated"!==n&&bP(i)){if(HT(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!_P(i))return!0;if(!e.bin&&ER([jz,Dz],t)){const{orient:e,type:n}=r;return!ER(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t)}return!1}(n,r,s,u,i)}return l[t]}(e,t,r,s,a.get("type"),a.get("padding"),a.get("paddingInner"),i.domain,t.markDef,u);void 0!==n&&o.set(e,n,!1)}})}(t,e):QY(t,e)}function ZY(t){rG(t)?HY(t):QY(t,"range")}function QY(t,e){const n=t.component.scales;for(const n of t.children)"range"===e?ZY(n):JY(n,e);TR(n).forEach(r=>{let i;for(const n of t.children){const t=n.component.scales[r];if(t){i=AH(i,t.getWithExplicit(e),e,"scale",OH((t,n)=>{switch(e){case"range":return t.step&&n.step?t.step-n.step:0}return 0}))}}n[r].setWithExplicit(e,i)})}function KY(t,e,n,r){const i=function(t,e,n){switch(e.type){case"nominal":case"ordinal":if(e$(t)||"discrete"===G$(t))return"shape"===t&&"ordinal"===e.type&&pI(uI.discreteChannelCannotEncode(t,"ordinal")),"ordinal";if(ER(["x","y"],t)){if(ER(["rect","bar","rule"],n))return"band";if("bar"===n)return"band"}return"point";case"temporal":return e$(t)?"time":"discrete"===G$(t)?(pI(uI.discreteChannelCannotEncode(t,"temporal")),"ordinal"):"time";case"quantitative":return e$(t)?yB(e.bin)?"bin-ordinal":"linear":"discrete"===G$(t)?(pI(uI.discreteChannelCannotEncode(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(uI.invalidFieldType(e.type))}(e,n,r),{type:o}=t;return U$(e)?void 0!==o?RP(e,o)?TP(o,n.type)?o:(pI(uI.scaleTypeNotWorkWithFieldDef(o,i)),i):(pI(uI.scaleTypeNotWorkWithChannel(e,o,i)),i):i:null}function tG(t){rG(t)?t.component.scales=function(t){const{encoding:e,mark:n}=t;return P$.reduce((r,i)=>{let o,a;const s=e[i];if(HI(s)&&n===az&&i===Iz&&s.type===PI)return r;if(HI(s)?(o=s,a=s.scale):WI(s)&&(o=s.condition,a=s.condition.scale),o&&null!==a&&!1!==a){const e=KY(a=a||{},i,o,n);r[i]=new UY(t.scaleName(i+"",!0),{value:e,explicit:a.type===e})}return r},{})}(t):t.component.scales=function(t){const e=t.component.scales={},n={},r=t.component.resolve;for(const e of t.children)tG(e),TR(e.component.scales).forEach(i=>{if(r.scale[i]=r.scale[i]||yH(i,t),"shared"===r.scale[i]){const t=n[i],o=e.component.scales[i].getWithExplicit("type");t?lP(t.value,o.value)?n[i]=AH(t,o,"type","scale",eG):(r.scale[i]="independent",delete n[i]):n[i]=o}});return TR(n).forEach(r=>{const i=t.scaleName(r,!0),o=n[r];e[r]=new UY(i,o);for(const e of t.children){const t=e.component.scales[r];t&&(e.renameScale(t.get("name"),i),t.merged=!0)}}),e}(t)}const eG=OH((t,e)=>dP(t)-dP(e));class nG{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function rG(t){return t&&"unit"===t.type}function iG(t){return t&&"facet"===t.type}function oG(t){return t&&"repeat"===t.type}function aG(t){return t&&"concat"===t.type}function sG(t){return t&&"layer"===t.type}class uG{constructor(t,e,n,r,i,o,a,s){this.type=e,this.parent=n,this.config=i,this.repeater=o,this.view=s,this.children=[],this.correctDataNames=t=>(t.from&&t.from.data&&(t.from.data=this.lookupDataSource(t.from.data)),t.from&&t.from.facet&&t.from.facet.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t),this.parent=n,this.config=i,this.repeater=o,this.name=t.name||r,this.title=GT(t.title)?{text:t.title}:t.title,this.scaleNameMap=n?n.scaleNameMap:new nG,this.projectionNameMap=n?n.projectionNameMap:new nG,this.signalNameMap=n?n.signalNameMap:new nG,this.data=t.data,this.description=t.description,this.transforms=(t.transform||[]).map(t=>LU(t)?{filter:mR(t.filter,$U)}:t),this.layout=gz(t)||KP(t)?{}:function(t,e,n){const r=n[e],i={},{spacing:o,columns:a}=r;void 0!==o&&(i.spacing=o),void 0!==a&&(OI(t)&&!wI(t.facet)||qP(t)&&HT(t.repeat)||BP(t))&&(i.columns=a);for(const e of WP)if(void 0!==t[e])if("spacing"===e){const n=t[e];i[e]=oR(n)?n:{row:n.row||o,column:n.column||o}}else i[e]=t[e];return i}(t,e,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:OI(t)||n&&n.component.data.isFaceted&&void 0===t.data},layoutSize:new xH,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},a?yR(a):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}initSize(t){const{width:e,height:n}=t;e&&this.component.layoutSize.set("width",e,!0),n&&this.component.layoutSize.set("height",n,!0)}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(t){tG(t),TY(t);for(const e of MP)JY(t,e);ZY(t)}(this)}parseProjection(){VH(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){LH(this)}assembleGroupStyle(){if("unit"===this.type||"layer"===this.type)return this.view&&this.view.style||"cell"}assembleEncodeFromView(t){const{style:e}=t,n=_(t,["style"]),r={};for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];void 0!==e&&(r[t]={value:e})}return r}assembleGroupEncodeEntry(t){let e=void 0;return this.view&&(e=this.assembleEncodeFromView(this.view)),t||"unit"!==this.type&&"layer"!==this.type?e:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},e||{})}assembleLayout(){if(!this.layout)return;const t=this.layout,{spacing:e}=t,n=_(t,["spacing"]),{component:r,config:i}=this,o=function(t,e){const n={};for(const r of r$){const i=t[r];if(i&&i.facetFieldDef){const{titleAnchor:t,titleOrient:o}=Bq(["titleAnchor","titleOrient"],i.facetFieldDef,e,r),a=Lq(r,o),s=Zq(t,a);void 0!==s&&(n[a]=s)}}return TR(n).length>0?n:void 0}(r.layoutHeaders,i);return Object.assign({padding:e},this.assembleDefaultLayout(),n,o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of r$)t[n].title&&e.push(qq(this,n));for(const t of Pq)e=e.concat(Yq(this,t));return e}assembleAxes(){return function(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(t=>sq(t,"main",e)),...n.map(t=>sq(t,"grid",e)),...r.map(t=>sq(t,"main",e)),...r.map(t=>sq(t,"grid",e))].filter(t=>t)}(this.component.axes,this.config)}assembleLegends(){return qH(this)}assembleProjections(){return WH(this)}assembleTitle(){const t=this.title||{},{encoding:e}=t,n=_(t,["encoding"]),r=Object.assign({},HP(this.config.title).nonMark,n,e?{encode:{update:e}}:{});if(r.text)return ER(["unit","layer"],this.type)?ER(["middle",void 0],r.anchor)&&(r.frame=r.frame||"group"):r.anchor=r.anchor||"start",TR(r).length>0?r:void 0}assembleGroup(t=[]){const e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||iG(this.parent)?function t(e){return sG(e)||aG(e)||oG(e)?e.children.reduce((e,n)=>e.concat(t(n)),PY(e)):PY(e)}(this):[];r.length>0&&(e.scales=r);const i=this.assembleAxes();i.length>0&&(e.axes=i);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}hasDescendantWithFieldOnChannel(t){for(const e of this.children)if(rG(e)){if(e.channelHasField(t))return!0}else if(e.hasDescendantWithFieldOnChannel(t))return!0;return!1}getName(t){return $R((this.name?this.name+"_":"")+t)}requestDataName(t){const e=this.getName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(iG(this.parent)){const e="width"===t?"x":"y",n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),r=n.get("range");if(yP(t)&&QU(r)){const t=n.get("name"),r=IY(BY(this,e));if(r){return{signal:nW(t,n,ZI({aggregate:"distinct",field:r},{expr:"datum"}))}}return pI("Unknown field for ${channel}.  Cannot calculate view size."),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):m$(t)&&U$(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale().  Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(uI.selectionNotFound(e));return n}}class cG extends uG{vgField(t,e={}){const n=this.fieldDef(t);if(n)return ZI(n,e)}reduceFieldDef(t,e,n){return jB(this.getMapping(),(e,n,r)=>{const i=sB(n);return i?t(e,i,r):e},e,n)}forEachFieldDef(t,e){SB(this.getMapping(),(e,n)=>{const r=sB(e);r&&t(r,n)},e)}}class lG extends Nq{constructor(t,e){super(t),this.filter=e}clone(){return new lG(null,Object.assign({},this.filter))}static make(t,e){const{config:n,mark:r}=e;if("filter"!==n.invalidValues)return null;const i=e.reduceFieldDef((t,n,i)=>{const o=U$(i)&&e.getScaleComponent(i);if(o){!bP(o.get("type"))||n.aggregate||uz(r)||(t[n.field]=n)}return t},{});return TR(i).length?new lG(t,i):null}dependentFields(){return new Set(TR(this.filter))}assemble(){const t=TR(this.filter).reduce((t,e)=>{const n=this.filter[e],r=ZI(n,{expr:"datum"});return null!==n&&(t.push(`${r} !== null`),t.push(`!isNaN(${r})`)),t},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class fG extends Nq{constructor(t,e){super(t),this.transform=e,this.transform=yR(e);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((t,e)=>r[e]||t)}clone(){return new fG(this.parent,yR(this.transform))}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${wR(this.transform)}`}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class dG extends Nq{constructor(t,e){super(t),this.transform=e,this.transform=yR(e);const n=this.transform.as||[void 0,void 0];this.transform.as=[n[0]||"key",n[1]||"value"]}clone(){return new dG(null,yR(this.transform))}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${wR(this.transform)}`}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class hG extends Nq{constructor(t,e,n,r){super(t),this.fields=e,this.geojson=n,this.signal=r}clone(){return new hG(null,yR(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;if([[Nz,Fz],[Rz,Tz]].forEach(r=>{const i=r.map(t=>e.channelHasField(t)?e.fieldDef(t).field:VI(e.encoding[t])?{expr:e.encoding[t].value+""}:void 0);(i[0]||i[1])&&(t=new hG(t,i,null,e.getName(`geojson_${n++}`)))}),e.channelHasField(Iz)){const r=e.fieldDef(Iz);r.type===PI&&(t=new hG(t,null,r.field,e.getName(`geojson_${n++}`)))}return t}assemble(){return Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{},this.geojson?{geojson:this.geojson}:{},{signal:this.signal})}}class pG extends Nq{constructor(t,e,n,r){super(t),this.projection=e,this.fields=n,this.as=r}clone(){return new pG(null,this.projection,yR(this.fields),yR(this.as))}static parseAll(t,e){return e.projectionName()?([[Nz,Fz],[Rz,Tz]].forEach(n=>{const r=n.map(t=>e.channelHasField(t)?e.fieldDef(t).field:VI(e.encoding[t])?{expr:e.encoding[t].value+""}:void 0),i=n[0]===Rz?"2":"";(r[0]||r[1])&&(t=new pG(t,e.projectionName(),r,[e.getName("x"+i),e.getName("y"+i)]))}),t):t}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class gG extends Nq{clone(){return new gG(null)}constructor(t){super(t)}producedFields(){return new Set([$P])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:$P}}}class mG extends Nq{constructor(t,e){super(t),this.transform=e}clone(){return new mG(null,yR(this.transform))}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:r}=t;return{signal:`sequence(${[e,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,e){return new mG(t,e)}static makeFromEncoding(t,e){const n=e.encoding,r=n.x,i=n.y;if(HI(r)&&HI(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:c,keyvals:l}=o.impute,f=DB(e.mark,n);return new mG(t,Object.assign({impute:o.field,key:a.field},s?{method:s}:{},void 0!==u?{value:u}:{},c?{frame:c}:{},void 0!==l?{keyvals:l}:{},f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${wR(this.transform)}`}assemble(){const{impute:t,key:e,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign({type:"impute",field:t,key:e},n?{keyvals:(u=n,u&&void 0!==u.stop?this.processSequence(n):n)}:{},{method:"value"},i?{groupby:i}:{},{value:null});var u;let c;if(r&&"value"!==r){c=[Object.assign({type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t}]}else{c=[{type:"formula",expr:`datum.${t} === null ? ${o} : datum.${t}`,as:t}]}return[s,...c]}}class vG extends xH{constructor(t={},e={},n=!1){super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}class yG extends Nq{constructor(t,e,n){super(t),this.transform=e,this.secondary=n}clone(){return new yG(null,yR(this.transform),this.secondary)}static make(t,e,n,r){const i=e.component.data.sources;let o=zG(n.from.data,i);o||(o=new KH(n.from.data),i.push(o));const a=e.getName(`lookup_${r}`),s=new Tq(o,a,"lookup",e.component.data.outputNodeRefCounts);return e.component.data.outputNodes[a]=s,new yG(t,n,s.getSource())}producedFields(){return new Set(this.transform.from.fields||(this.transform.as instanceof Array?this.transform.as:[this.transform.as]))}hash(){return`Lookup ${wR({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t=Object.assign({values:this.transform.from.fields},this.transform.as?{as:this.transform.as instanceof Array?this.transform.as:[this.transform.as]}:{});else{let e=this.transform.as;GT(e)||(pI(uI.NO_FIELDS_NEEDS_AS),e="_lookup"),t={as:[e]}}return Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},t,this.transform.default?{default:this.transform.default}:{})}}class bG extends Nq{constructor(t,e){super(t),this.transform=e}clone(){return new bG(null,yR(this.transform))}hash(){return`SampleTransform ${wR(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function xG(t){let e=0;return function n(r,i){if(r instanceof KH&&!r.isGenerator&&!yU(r.data)){t.push(i),i={name:null,source:i.name,transform:[]}}if(r instanceof dY&&(r.parent instanceof KH&&!i.source?(i.format=Object.assign({},i.format||{},{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof cY)return i.name||(i.name=`data_${e++}`),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,void r.assemble().forEach(e=>t.push(e));if((r instanceof eY||r instanceof nY||r instanceof lG||r instanceof lY||r instanceof zq||r instanceof pG||r instanceof hG||r instanceof uY||r instanceof yG||r instanceof gY||r instanceof hY||r instanceof dG||r instanceof fG||r instanceof gG||r instanceof bG)&&i.transform.push(r.assemble()),(r instanceof QH||r instanceof rW||r instanceof mG||r instanceof pY)&&i.transform.push(...r.assemble()),r instanceof Tq)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof Tq)r.setSource(i.name);else if(i.name||(i.name=`data_${e++}`),r.setSource(i.name),1===r.numChildren()){t.push(i),i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof Tq&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${e++}`);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source,r.children.forEach(t=>{n(t,{name:null,source:o,transform:[]})});break}}}}function _G(t,e){if(t.channelHasField(e)){const n=t.facet[e],r=Iq("title",null,t.config,e);let i=rB(n,t.config,{allowDisabling:!0,includeDefault:void 0===r||!!r});t.child.component.layoutHeaders[e].title&&(i+=" / "+t.child.component.layoutHeaders[e].title,t.child.component.layoutHeaders[e].title=null);const o=Iq("labelOrient",n,t.config,e),a=HR((n.header||{}).labels,!0),s=ER(["bottom","right"],o)?"footer":"header";t.component.layoutHeaders[e]={title:i,facetFieldDef:n,[s]:"facet"===e?[]:[wG(t,e,a)]}}}function wG(t,e,n){const r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function OG(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:i,resolve:o}=t.component;if(o.axis[e]=bH(o,e),"shared"===o.axis[e]){const o="x"===e?"column":"row",a=i[o];for(const i of n.component.axes[e]){const e="top"===(r=i.get("orient"))||"left"===r?"header":"footer";a[e]=a[e]||[wG(t,o,!1)];const n=sq(i,"main",t.config,{header:!0});a[e][0].axes.push(n),i.mainExtracted=!0}}}var r}function EG(t){SG(t);const e=t.component.layoutSize;e.setWithExplicit("width",jG(t,"width")),e.setWithExplicit("height",jG(t,"height"))}const AG=EG,kG={vconcat:"width",hconcat:"height"};function SG(t){for(const e of t.children)e.parseLayoutSize()}function jG(t,e){const n="width"===e?"x":"y",r=t.component.resolve;let i;for(const o of t.children){const t=o.component.layoutSize.getWithExplicit(e),a=r.scale[n];if("independent"===a&&"range-step"===t.value){i=void 0;break}if(i){if("independent"===a&&i.value!==t.value){i=void 0;break}i=AH(i,t,e,"")}else i=t}if(i){for(const n of t.children)t.renameSignal(n.getName(e),t.getName(e)),n.component.layoutSize.set(e,"merged",!1);return i}return{explicit:!1,value:void 0}}function DG(t,e){const n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const t=i.get("type"),n=i.get("range");return yP(t)&&QU(n)?"range-step":r.view[e]}return t.hasProjection?r.view[e]:"width"===e&&"text"===t.mark?r.scale.textXRangeStep:r.scale.rangeStep||wP.rangeStep}function CG(t,e){return function(t){return t&&!GT(t)&&"repeat"in t}(t.field)?t.field.repeat in e?Object.assign({},t,{field:e[t.field.repeat]}):void pI(uI.noSuchRepeatedValue(t.field.repeat)):t}function MG(t,e){if(void 0!==(t=CG(t,e))){if(null===t)return null;if(function(t){return YI(t)&&!!t.sort}(t)&&pq(t.sort)){const n=CG(t.sort,e);t=Object.assign({},t,n?{sort:n}:{})}return t}}function FG(t,e){if(!HI(t)){if(WI(t)){const n=MG(t.condition,e);if(n)return Object.assign({},t,{condition:n});{const{condition:e}=t;return _(t,["condition"])}}return t}{const n=MG(t,e);if(n)return n;if(qI(t))return{condition:t.condition}}}function NG(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];if(HT(i))n[r]=i.map(t=>FG(t,e)).filter(t=>t);else{const t=FG(i,e);void 0!==t&&(n[r]=t)}}return n}function TG(t,e,n){return ZI(e,Object.assign({suffix:`by_${ZI(t)}`},n||{}))}class RG extends cG{constructor(t,e,n,r,i){super(t,"facet",e,n,i,r,t.resolve),this.child=iV(t.spec,this,this.getName("child"),void 0,r,i,!1),this.children=[this.child];const o=function(t,e){return wI(t)?NG(t,e):MG(t,e)}(t.facet,r);this.facet=this.initFacet(o)}initFacet(t){return wI(t)?jB(t,(t,e,n)=>ER([Az,kz],n)?void 0===e.field?(pI(uI.emptyFieldDef(e,n)),t):(t[n]=cB(e,n),t):(pI(uI.incompatibleChannel(n,"facet")),t),{}):{facet:cB(t,"facet")}}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=$G(this),this.child.parseData()}parseLayoutSize(){SG(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of r$)_G(t,e);OG(t,"x"),OG(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const e of r$)for(const n of Uq){const r=this.component.layoutHeaders[e],i=r[n],{facetFieldDef:o}=r;if(o){const n=Iq("titleOrient",o,this.config,e);if(ER(["right","bottom"],n)){const r=Lq(e,n);t.titleAnchor=t.titleAnchor||{},t.titleAnchor[r]="end"}}if(i&&i[0]){const i="row"===e?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===e||this.child.component.layoutSize.get(i)||(t[o]=t[o]||{},t[o][e]=.5),r.title&&(t.offset=t.offset||{},t.offset["row"===e?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let r="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(r="none"),Object.assign({},this.getHeaderLayoutMixins(),n?{columns:n}:{},{bounds:"full",align:r})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof RG)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(t){return this.parent&&this.parent instanceof RG?Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:ZI(this.facet.column,{prefix:"distinct"})}}}}:{},super.assembleGroup(t)):super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof RG){if(this.child.channelHasField("column")){const r=ZI(this.child.facet.column);t.push(r),e.push("distinct"),n.push(`distinct_${r}`)}}else for(const r of["x","y"]){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(yP(o)&&QU(a)){const i=IY(BY(this.child,r));i?(t.push(i),e.push("distinct"),n.push(`distinct_${i}`)):pI("Unknown field for ${channel}.  Cannot calculate view size.")}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const t of r$){const e=this.facet[t];if(e){s.push(ZI(e));const{bin:u,sort:c}=e;if(yB(u)&&s.push(ZI(e,{binSuffix:"end"})),pq(c)){const{field:t,op:s=hq}=c,u=TG(e,c);n&&r?(i.push(u),o.push("max"),a.push(u)):(i.push(t),o.push(s),a.push(u))}else if(HT(c)){const n=$q(e,t);i.push(n),o.push("max"),a.push(n)}}}const u=!!n&&!!r;return Object.assign({name:t,data:e,groupby:s},u||i.length?{aggregate:Object.assign({},u?{cross:u}:{},i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(t){const{facet:e}=this,n=e[t];return n?pq(n.sort)?[TG(n,n.sort,{expr:"datum"})]:HT(n.sort)?[$q(n,t,{expr:"datum"})]:[ZI(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(pq(t)?t.order:!HT(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:e}=this;if(t.facet)return Vq(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const r of Pq)if(t[r]){const i=Iq("labelOrient",t[r],e,r);if(ER(n[r],i))return Vq(t[r],r,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=xG(e);return t.children.forEach(e=>n(e,{source:t.name,name:null,transform:[]})),e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||t.assembleTitle(),i=t.assembleGroupStyle();return[Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{},i?{style:i}:{},{from:{facet:this.assembleFacet()},sort:{field:SR(r$.map(t=>this.facetSortFields(t))),order:SR(r$.map(t=>this.facetSortOrder(t)))}},e.length>0?{data:e}:{},n?{encode:{update:n}}:{},t.assembleGroup(function(t,e){if(t.component.selection&&TR(t.component.selection).length){const n=VT(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:PM("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return e}(this,[])))]}getMapping(){return this.facet}}function zG(t,e){for(const n of e){const e=n.data;if((!t.name||!n.hasName()||t.name===n.dataName)&&!(t.format&&t.format.mesh&&e.format&&e.format.feature))if(bU(t)&&bU(e)){if(vR(t.values,e.values))return n}else if(yU(t)&&yU(e)){if(t.url===e.url)return n}else if(xU(t)&&t.name===n.dataName)return n}return null}function $G(t){let e=function(t,e){if(void 0===t.data&&t.parent)return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main;{if(null===t.data){const t=new KH([]);return e.push(t),t}const n=zG(t.data,e);if(n)return _U(t.data)||(n.data.format=jR({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new KH(t.data);return e.push(n),n}}}(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.parent?t.parent.component.data.ancestorParse.clone():new vG,o=t.data;_U(o)?(wU(o)?e=new nY(e,o.sequence):EU(o)&&(e=new eY(e,o.graticule)),i.parseNothing=!0):o&&o.format&&null===o.format.parse&&(i.parseNothing=!0),e=dY.makeExplicit(e,t,i)||e,!wW(t)||!rG(t)&&!sG(t)||t.parent&&sG(t.parent)||(e=new gG(e));const a=t.parent&&sG(t.parent);(rG(t)||iG(t))&&a&&(e=QH.makeFromEncoding(e,t)||e),t.transforms.length>0&&(e=function(t,e,n){let r=0;for(const i of e.transforms){let o,a=void 0;if(WU(i))o=t=new zq(t,i),a="derived";else if(LU(i))o=t=dY.makeImplicitFromFilterTransform(t,i,n)||t,t=new lY(t,e,i.filter);else if(HU(i))o=t=QH.makeFromTransform(t,i,e),a="number";else if(GU(i)){a="date",void 0===n.getWithExplicit(i.field).value&&(t=new dY(t,{[i.field]:a}),n.set(i.field,a,!1)),o=t=rW.makeFromTransform(t,i)}else if(VU(i))o=t=uY.makeFromTransform(t,i),a="number",wW(e)&&(t=new gG(t));else if(IU(i))o=t=yG.make(t,e,i,r++),a="derived";else if(PU(i))o=t=new gY(t,i),a="number";else if(UU(i))o=t=new hY(t,i),a="number";else if(XU(i))o=t=pY.makeFromTransform(t,i),a="derived";else if(JU(i))o=t=new dG(t,i),a="derived";else if(qU(i))o=t=new fG(t,i),a="derived";else if(BU(i))t=new bG(t,i);else{if(!YU(i)){pI(uI.invalidTransformIgnored(i));continue}o=t=mG.makeFromTransform(t,i),a="derived"}if(o&&void 0!==a)for(const t of o.producedFields())n.set(t,a,!1)}return t}(e,t,i)),e=dY.makeImplicitFromEncoding(e,t,i)||e,rG(t)&&(e=hG.parseAll(e,t),e=pG.parseAll(e,t)),(rG(t)||iG(t))&&(a||(e=QH.makeFromEncoding(e,t)||e),e=rW.makeFromEncoding(e,t)||e,e=zq.parseAllForSortIndex(e,t));const s=t.getName(kU),u=new Tq(e,s,kU,r);if(n[s]=u,e=u,rG(t)){const n=uY.makeFromEncoding(e,t);n&&(e=n,wW(t)&&(e=new gG(e))),e=mG.makeFromEncoding(e,t)||e,e=pY.makeFromEncoding(e,t)||e}rG(t)&&(e=lG.make(e,t)||e);const c=t.getName(AU),l=new Tq(e,c,AU,r);n[c]=l,e=l;let f=null;if(iG(t)){const r=t.getName("facet");e=function(t,e){const{row:n,column:r}=e;if(n&&r){let e=null;for(const i of[n,r])if(pq(i.sort)){const{field:n,op:r=hq}=i.sort;t=e=new hY(t,{joinaggregate:[{op:r,field:n,as:TG(i,i.sort,{forAs:!0})}],groupby:[ZI(i)]})}return e}return null}(e=zq.parseAllForSortIndex(e,t),t.facet)||e,f=new cY(e,t,r,l.getSource()),n[r]=f,e=f}return Object.assign({},t.component.data,{outputNodes:n,outputNodeRefCounts:r,raw:u,main:l,facetRoot:f,ancestorParse:i})}class LG extends uG{constructor(t,e,n,r,i,o,a){super(t,e,n,r,i,o,a)}parseData(){this.component.data=$G(this),this.children.forEach(t=>{t.parseData()})}parseSelections(){this.component.selection={};for(const t of this.children)t.parseSelections(),TR(t.component.selection).forEach(e=>{this.component.selection[e]=t.component.selection[e]})}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){return this.children.reduce((t,e)=>[...t,...e.assembleLayoutSignals()],Kq(this))}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleMarks(){return this.children.map(t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return Object.assign({type:"group",name:t.getName("group")},e?{title:e}:{},n?{style:n}:{},r?{encode:{update:r}}:{},t.assembleGroup())})}}class IG extends LG{constructor(t,e,n,r,i){super(t,"concat",e,n,i,r,t.resolve),t.resolve&&t.resolve.axis&&("shared"===t.resolve.axis.x||"shared"===t.resolve.axis.y)&&pI(uI.CONCAT_CANNOT_SHARE_AXIS),this.concatType=PP(t)?"vconcat":UP(t)?"hconcat":"concat",this.children=this.getChildren(t).map((t,e)=>iV(t,this,this.getName("concat_"+e),void 0,r,i,!1))}getChildren(t){return PP(t)?t.vconcat:UP(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){SG(t);const e=t.component.layoutSize,n=kG[t.concatType];n&&e.setWithExplicit(n,jG(t,n))}(this)}parseAxisGroup(){return null}assembleDefaultLayout(){return Object.assign({},"vconcat"===this.concatType?{columns:1}:{},{bounds:"full",align:"each"})}}class BG extends xH{constructor(t={},e={},n=!1){super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new BG(yR(this.explicit),yR(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}}const PG={bottom:"top",top:"bottom",left:"right",right:"left"};function UG(t,e){if(!t)return e.map(t=>t.clone());{if(t.length!==e.length)return;const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e[r];if(!!n!=!!i)return;if(n&&i){const e=n.getWithExplicit("orient"),o=i.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[r]=qG(n,i)}}}return t}function qG(t,e){for(const n of aq){const r=AH(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(t,e)=>{switch(n){case"title":return Fq(t,e);case"gridScale":return{explicit:t.explicit,value:HR(t.value,e.value)}}return EH(t,e,n,"axis")});t.setWithExplicit(n,r)}return t}function WG(t,e){const n="x"===e?"x2":"y2",r=t.fieldDef(e),i=t.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?Mq(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}function HG(t,e){const n=e.axis(t),r=new BG;aq.forEach(i=>{const o=function(t,e,n,r){const i=r.fieldDef(n),o=function(t,e,n,r){if(void 0!==e.labelAngle)return VR(e.labelAngle);{const e=mq("labelAngle",t.config,n,bq(n),t.getScaleComponent(n).get("type"));return void 0!==e?VR(e):n===jz&&ER([BI,LI],r.type)?270:void 0}}(r,e,n,i),a=HR(e.orient,bq(n));switch(t){case"scale":return r.scaleName(n);case"gridScale":return function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n)}(r,n);case"format":if(hB(i))return;return Eq(i,e.format,r.config);case"formatType":if(hB(i))return;return e.formatType;case"grid":if(bB(r.fieldDef(n).bin))return!1;{const t=r.getScaleComponent(n).get("type");return HR(e.grid,function(t,e){return!yP(t)&&!yB(e.bin)}(t,i))}case"labelAlign":return HR(e.labelAlign,yq(o,a));case"labelAngle":return o;case"labelBaseline":return HR(e.labelBaseline,vq(o,a));case"labelFlush":return HR(e.labelFlush,function(t,e){if("x"===e&&ER(["quantitative","temporal"],t.type))return!0}(i,n));case"labelOverlap":{const t=r.getScaleComponent(n).get("type");return HR(e.labelOverlap,function(t,e){if("nominal"!==t.type)return"log"!==e||"greedy"}(i,t))}case"orient":return a;case"tickCount":{const t=r.getScaleComponent(n).get("type"),o="x"===n?"width":"y"===n?"height":void 0,a=o?r.getSizeSignalRef(o):void 0;return HR(e.tickCount,function({fieldDef:t,scaleType:e,size:n}){if(!yP(e)&&"log"!==e&&!ER(["month","hours","day","quarter"],t.timeUnit))return yB(t.bin)?{signal:`ceil(${n.signal}/10)`}:{signal:`ceil(${n.signal}/40)`}}({fieldDef:i,scaleType:t,size:a}))}case"title":{const t="x"===n?"x2":"y2",o=r.fieldDef(t);return HR(e.title,WG(r,n),Cq([UI(i)],o?[UI(o)]:[]))}case"values":return function(t,e,n){const r=t.values;if(r)return gB(n,r)}(e,0,i)}return s=t,iq[s]?e[t]:void 0;var s}(i,n,t,e);if(void 0!==o){const a=function(t,e,n,r,i){switch(e){case"titleAngle":case"labelAngle":return t===VR(n[e]);case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===WG(r,i))return!0}return t===n[e]}(o,i,n,e,t),s=mq(i,e.config,t,r.get("orient"),e.getScaleComponent(t).get("type"));a||void 0===s?r.set(i,o,a):ER(["grid","orient"],i)&&s&&r.set(i,s,!1)}});const i=n.encoding||{},o=eq.reduce((n,o)=>{if(!r.hasAxisPart(o))return n;const a=vH(i[o]||{},e),s="labels"===o?function(t,e,n){const r=t.fieldDef(e)||("x"===e?t.fieldDef("x2"):"y"===e?t.fieldDef("y2"):void 0),i=t.axis(e),o=t.config;let a={};if(hB(r)){const n=t.getScaleComponent(e).get("type")===sP.UTC,s=jq("datum.value",r.timeUnit,i.format,o.axis.shortTimeLabels,null,n);s&&(a.text={signal:s})}return a=Object.assign({},a,n),0===TR(a).length?void 0:a}(e,t,a):a;return void 0!==s&&TR(s).length>0&&(n[o]={update:s}),n},{});return TR(o).length>0&&r.set("encode",o,!!n.encoding||void 0!==n.labelAngle),r}function YG(t,e,n){const r=lz(t)?Object.assign({},t):{type:t},i=r.orient||_q("orient",r,n);return r.orient=function(t,e,n){switch(t){case QR:case iz:case oz:case ez:case KR:return}const{x:r,y:i,x2:o,y2:a}=e;switch(t){case JR:if(HI(r)&&bB(r.bin))return"vertical";if(HI(i)&&bB(i.bin))return"horizontal";if(a||o){if(n)return n;if(!o&&HI(r)&&r.type===$I&&!yB(r.bin))return"horizontal";if(!a&&HI(i)&&i.type===$I&&!yB(i.bin))return"vertical"}case tz:if(o&&a)return;case XR:if(a)return HI(i)&&bB(i.bin)?"horizontal":"vertical";if(o)return HI(r)&&bB(r.bin)?"vertical":"horizontal";if(t===tz){if(e.x&&!e.y)return"vertical";if(e.y&&!e.x)return"horizontal"}case ZR:case nz:{const r=HI(e.x)&&QI(e.x),i=HI(e.y)&&QI(e.y);if(r&&!i)return"tick"!==t?"horizontal":"vertical";if(!r&&i)return"tick"!==t?"vertical":"horizontal";if(r&&i){const r=e.x,i=e.y,o=r.type===II,a=i.type===II;return o&&!a?"tick"!==t?"vertical":"horizontal":!o&&a?"tick"!==t?"horizontal":"vertical":!r.aggregate&&i.aggregate?"tick"!==t?"vertical":"horizontal":r.aggregate&&!i.aggregate?"tick"!==t?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,e,i),void 0!==i&&i!==r.orient&&pI(uI.orientOverridden(r.orient,i)),void 0===HR(r.opacity,_q("opacity",r,n))&&(r.opacity=function(t,e){if(ER([QR,nz,iz,oz],t)&&!OB(e))return.7;return}(r.type,e)),void 0===r.filled&&(r.filled=function(t,e){const n=_q("filled",t,e),r=t.type;return HR(n,r!==QR&&r!==ZR&&r!==tz)}(r,n)),void 0===(r.cursor||_q("cursor",r,n))&&(r.cursor=function(t,e,n){if(e.href||t.href||_q("href",t,n))return"pointer";return t.cursor}(r,e,n)),r}function GG(t,e,n){const{config:r,encoding:i,markDef:o}=t,a="x"===e?"x2":"y2",s="x"===e?"width":"height",u=i[e],c=i[a],l=t.getScaleComponent(e),f=l?l.get("type"):void 0,d=t.scaleName(e),h=o.orient,p=i[s]||i.size||o[s]||o.size||_q("size",o,r,{vgChannel:s}),g="x"===e?"vertical"===h:"horizontal"===h;return!HI(u)||!yB(u.bin)&&!bB(u.bin)||p||yP(f)?(HI(u)&&yP(f)||g)&&!c?HI(u)&&f===sP.BAND?function(t,e,n,r){const i=n.scaleName(e),o="x"===e?"width":"height";if(n.encoding.size||void 0!==n.markDef.size||r&&void 0!==r.value){if(n.markDef.orient){const a={[e+"c"]:VW(t,i,{},{band:.5})};if(uB(n.encoding.size))return Object.assign({},a,lH("size",n,{vgChannel:o}));if(VI(n.encoding.size))return Object.assign({},a,lH("size",n,{vgChannel:o}));if(void 0!==n.markDef.size)return Object.assign({},a,{[o]:{value:n.markDef.size}});if(r&&void 0!==r.value)return Object.assign({},a,{[o]:r})}else pI(uI.cannotApplySizeToNonOrientedMark(n.markDef.type))}return{[e]:VW(t,i,{binSuffix:"range"},{}),[o]:r||XW(i)}}(u,e,t,VG(n,o,s,d,l,r)):function(t,e,n,r){const i="x"===t?"xc":"yc",o="x"===t?"width":"height";return Object.assign({},pH(t,e,n,i),lH("size",e,{defaultRef:r,vgChannel:o}))}(e,t,eH(t[s]),VG(n,o,s,d,l,r)):Object.assign({},pH(e,t,"zeroOrMax"),gH(t,"zeroOrMin",a)):function({fieldDef:t,fieldDef2:e,channel:n,scaleName:r,mark:i,spacing:o=0,reverse:a}){const s={x:a?o:0,x2:a?0:o,y:a?0:o,y2:a?o:0},u=n===jz?Cz:Mz;return yB(t.bin)?{[u]:GW({channel:n,fieldDef:t,scaleName:r,mark:i,side:"start",offset:s[`${n}2`]}),[n]:GW({channel:n,fieldDef:t,scaleName:r,mark:i,side:"end",offset:s[n]})}:bB(t.bin)&&HI(e)?{[u]:VW(t,r,{},{offset:s[`${n}2`]}),[n]:VW(e,r,{},{offset:s[n]})}:void pI(uI.channelRequiredForBinned(u))}({fieldDef:u,fieldDef2:c,channel:e,mark:n,scaleName:d,spacing:HR(o.binSpacing,r[n].binSpacing),reverse:l.get("reverse")})}function VG(t,e,n,r,i,o){const a=HR(e[n],e.size,_q("size",e,o,{vgChannel:n}));if(void 0!==a)return{value:a};if(i){const e=i.get("type");if("point"!==e&&"band"!==e)return{value:o[t].continuousBandSize};if(void 0!==o[t].discreteBandSize)return{value:o[t].discreteBandSize};if(e!==sP.POINT)return XW(r);{const t=i.get("range");if(QU(t)&&oR(t.step))return{value:t.step-1};pI(uI.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL)}}return{value:HR(o[t].discreteBandSize,o.scale.rangeStep?o.scale.rangeStep-1:void 0,20)}}function XG(t,e){const{config:n,width:r,height:i}=t;return Object.assign({},oH(t,{size:"include",orient:"ignore"}),pH("x",t,eH(r)),pH("y",t,eH(i)),lH("size",t),function(t,e,n){if(n)return{shape:{value:n}};return lH("shape",t)}(t,0,e))}function JG(t){const{config:e,markDef:n}=t,{orient:r}=n,i="horizontal"===r?"width":"height",o=t.getScaleComponent("horizontal"===r?"x":"y"),a=HR(n[i],n.size,_q("size",n,e,{vgChannel:i}),e.tick.bandSize);if(void 0!==a)return a;{const t=o?o.get("range"):void 0,n=t&&QU(t)?t.step:e.scale.rangeStep;if("number"!=typeof n)throw new Error("Function does not handle non-numeric rangeStep");return 3*n/4}}const ZG={area:{vgMark:"area",encodeEntry:t=>Object.assign({},oH(t,{size:"ignore",orient:"include"}),pH("x",t,"zeroOrMin"),pH("y",t,"zeroOrMin"),gH(t,"zeroOrMin","horizontal"===t.markDef.orient?"x2":"y2"),cH(t))},bar:{vgMark:"rect",encodeEntry:t=>Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),GG(t,"x","bar"),GG(t,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:t=>XG(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>Object.assign({},oH(t,{size:"ignore",orient:"ignore"})),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[Object.assign({type:"geoshape",projection:t.projectionName()},n&&HI(n)&&n.type===PI?{field:ZI(n,{expr:"datum"})}:{})]}},line:{vgMark:"line",encodeEntry:t=>{const{width:e,height:n}=t;return Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),pH("x",t,eH(e)),pH("y",t,eH(n)),lH("size",t,{vgChannel:"strokeWidth"}),cH(t))}},point:{vgMark:"symbol",encodeEntry:t=>XG(t)},rect:{vgMark:"rect",encodeEntry:t=>Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),GG(t,"x","rect"),GG(t,"y","rect"))},rule:{vgMark:"rule",encodeEntry:t=>{const{markDef:e,width:n,height:r}=t,i=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),pH("x",t,"horizontal"===i?"zeroOrMin":eH(n)),pH("y",t,"vertical"===i?"zeroOrMin":eH(r)),"vertical"!==i?gH(t,"zeroOrMax","x2"):{},"horizontal"!==i?gH(t,"zeroOrMax","y2"):{},lH("size",t,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:t=>XG(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n,width:r,height:i}=t;return Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),pH("x",t,eH(r)),pH("y",t,eH(i)),hH(t),lH("size",t,{vgChannel:"fontSize"}),sH("align",function(t,e,n){if(void 0===(t.align||_q("align",t,n)))return"center";return}(t.markDef,0,e)),sH("baseline",function(t,e,n){if(void 0===(t.baseline||_q("baseline",t,n)))return"middle";return}(t.markDef,0,e)))}},tick:{vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n,width:r,height:i}=t,o=n.orient,a="horizontal"===o?"width":"height",s="horizontal"===o?"height":"width";return Object.assign({},oH(t,{size:"ignore",orient:"ignore"}),pH("x",t,eH(r),"xc"),pH("y",t,eH(i),"yc"),lH("size",t,{defaultValue:JG(t),vgChannel:a}),{[s]:{value:HR(n.thickness,e.tick.thickness)}})}},trail:{vgMark:"trail",encodeEntry:t=>{const{width:e,height:n}=t;return Object.assign({},oH(t,{size:"include",orient:"ignore"}),pH("x",t,eH(e)),pH("y",t,eH(n)),lH("size",t),cH(t))}}};function QG(t){return ER([ZR,XR,rz],t.mark)?function(t){const e=DB(t.mark,t.encoding),n=tV(t,{fromPrefix:e.length>0?KG:""});return e.length>0?[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:KG+t.requestDataName(AU),data:t.requestDataName(AU),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:n}]:n}(t):tV(t)}const KG="faceted_path_";function tV(t,e={fromPrefix:""}){const n=t.mark,r=HR(t.markDef.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(e&&e.get("domainRaw")||n&&n.get("domainRaw"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),i=xq(t.markDef),o=t.encoding.key,a=function(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,a=e.order;if(!(!HT(a)&&VI(a)&&OR(a.value)||!a&&OR(i.order)||OR(_q("order",i,o)))){if((HT(a)||HI(a))&&!n)return Dq(a,{expr:"datum"});if(uz(r)){const n="horizontal"===i.orient?"y":"x",r=e[n];if(HI(r)){const e=r.sort;return HT(e)?{field:ZI(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:pq(e)?{field:ZI({aggregate:OB(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})}:{field:ZI(r,{binSuffix:t.stack&&t.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(t),s=ZG[n].postEncodingTransform?ZG[n].postEncodingTransform(t):null;return[Object.assign({name:t.getName("marks"),type:ZG[n].vgMark},r?{clip:!0}:{},i?{style:i}:{},o?{key:{field:o.field}}:{},a?{sort:a}:{},{from:{data:e.fromPrefix+t.requestDataName(AU)},encode:{update:ZG[n].encodeEntry(t)}},s?{transform:s}:{})]}class eV extends cG{constructor(t,e,n,r={},i,o,a){super(t,"unit",e,n,o,i,void 0,t.view),this.fit=a,this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[],this.initSize(Object.assign({},r,t.width?{width:t.width}:{},t.height?{height:t.height}:{}));const s=lz(t.mark)?t.mark.type:t.mark,u=this.encoding=AB(function(t,e){return NG(t,e)}(t.encoding||{},i),s);this.markDef=YG(t.mark,u,o),this.stack=iU(s,u,this.config.stack),this.specifiedScales=this.initScales(s,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegend(u),this.specifiedProjection=t.projection,this.selection=t.selection}get hasProjection(){const{encoding:t}=this,e=this.mark===az,n=t&&Kz.some(e=>HI(t[e]));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return P$.reduce((t,n)=>{let r,i;const o=e[n];return HI(o)?(r=o,i=o.scale):WI(o)&&(r=o.condition,i=o.condition.scale),r&&(t[n]=i||{}),t},{})}initAxes(t){return[jz,Dz].reduce((e,n)=>{const r=t[n];if(HI(r)||n===jz&&HI(t.x2)||n===Dz&&HI(t.y2)){const t=HI(r)?r.axis:null;null!==t&&(e[n]=Object.assign({},t))}return e},{})}initLegend(t){return I$.reduce((e,n)=>{const r=t[n];if(r){const t=HI(r)?r.legend:WI(r)?r.condition.legend:null;null!==t&&!1!==t&&function(t){switch(t){case zz:case $z:case Lz:case Bz:case Iz:case Pz:case Wz:return!0;case Uz:case qz:return!1}}(n)&&(e[n]=Object.assign({},t))}return e},{})}parseData(){this.component.data=$G(this)}parseLayoutSize(){!function(t){const e=t.component.layoutSize;if(!e.explicit.width){const n=DG(t,"width");e.set("width",n,!1)}if(!e.explicit.height){const n=DG(t,"height");e.set("height",n,!1)}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},r=t.config.selection;e&&(e=yR(e));for(let i in e){if(!e.hasOwnProperty(i))continue;const o=e[i],a=r[o.type],{fields:s,encodings:u}=a,c=_(a,["fields","encodings"]);for(const t in c)"encodings"===t&&o.fields||"fields"===t&&o.encodings||("mark"===t&&(o[t]=Object.assign({},c[t],o[t])),void 0!==o[t]&&!0!==o[t]||(o[t]=c[t]||o[t]));const l=n[i=$R(i)]=Object.assign({},o,{name:i,events:GT(o.on)?PM(o.on,"scope"):o.on});zW(l,e=>{e.parse&&e.parse(t,o,l)})}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=QG(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,M$.reduce((e,n)=>(t.component.scales[n]&&t.axis(n)&&(e[n]=[HG(n,t)]),e),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;if(xW(t,(r,i)=>{const o=r.name,a=VT(o+pW);e.filter(t=>t.name===o).length||e.push({name:r.name,update:`${yW}(${a}`+("global"===r.resolve?")":`, ${VT(r.resolve)})`)}),n=!0,i.topLevelSignals&&(e=i.topLevelSignals(t,r,e)),zW(r,n=>{n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))})}),n){e.filter(t=>"unit"===t.name).length||e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return e}(this,t)}assembleSignals(){return[...uq(this),...(t=this,e=[],xW(t,(n,r)=>{const i=n.name;let o=r.modifyExpr(t,n);e.push(...r.signals(t,n)),zW(n,r=>{r.signals&&(e=r.signals(t,n,e)),r.modifyExpr&&(o=r.modifyExpr(t,n,o))}),e.push({name:i+mW,update:`modify(${VT(n.name+pW)}, ${o})`})}),e)];var t,e}assembleSelectionData(t){return LW(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Kq(this)}assembleMarks(){let t=this.component.mark||[];return this.parent&&sG(this.parent)||(t=IW(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return wB(this.encoding,t)}fieldDef(t){return uB(this.encoding[t])}}class nV extends uG{constructor(t,e,n,r,i,o,a){super(t,"layer",e,n,o,i,t.resolve,t.view);const s=Object.assign({},r,t.width?{width:t.width}:{},t.height?{height:t.height}:{});this.initSize(s),this.children=t.layer.map((t,e)=>{if(KP(t))return new nV(t,this,this.getName("layer_"+e),s,i,o,a);if(gz(t))return new eV(t,this,this.getName("layer_"+e),s,i,o,a);throw new Error(uI.INVALID_SPEC)})}parseData(){this.component.data=$G(this);for(const t of this.children)t.parseData()}parseLayoutSize(){EG(this)}parseSelections(){this.component.selection={};for(const t of this.children)t.parseSelections(),TR(t.component.selection).forEach(e=>{this.component.selection[e]=t.component.selection[e]})}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const r of t.children){r.parseAxesAndHeaders();for(const i of TR(r.component.axes))n.axis[i]=bH(t.component.resolve,i),"shared"===n.axis[i]&&(e[i]=UG(e[i],r.component.axes[i]),e[i]||(n.axis[i]="independent",delete e[i]))}for(const i of[jz,Dz]){for(const o of t.children)if(o.component.axes[i]){if("independent"===n.axis[i]){e[i]=(e[i]||[]).concat(o.component.axes[i]);for(const t of o.component.axes[i]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(r[e]>0&&!n){const n=PG[e];r[e]>r[n]&&t.set("orient",n,!1)}r[e]++}}delete o.component.axes[i]}if("independent"===n.axis[i]&&e[i]&&e[i].length>1)for(const t of e[i])t.get("grid")&&!t.explicit.grid&&(t.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleSignals()),uq(this))}assembleLayoutSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleLayoutSignals()),Kq(this))}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle())return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)rG(n)&&(e=IW(n,e));return e}(this,SR(this.children.map(t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce((t,e)=>t.concat(e.assembleLegends()),qH(this))}}class rV extends LG{constructor(t,e,n,r,i){super(t,"repeat",e,n,i,r,t.resolve),t.resolve&&t.resolve.axis&&("shared"===t.resolve.axis.x||"shared"===t.resolve.axis.y)&&pI(uI.REPEAT_CANNOT_SHARE_AXIS),this.repeat=t.repeat,this.children=this._initChildren(t,this.repeat,r,i)}_initChildren(t,e,n,r){const i=[],o=!HT(e)&&e.row||[n?n.row:null],a=!HT(e)&&e.column||[n?n.column:null],s=HT(e)&&e||[n?n.repeat:null];for(const e of s)for(const n of o)for(const o of a){const a=(e?`__repeat_repeat_${e}`:"")+(n?`__repeat_row_${n}`:"")+(o?`__repeat_column_${o}`:""),s={repeat:e,row:n,column:o};i.push(iV(t.spec,this,this.getName("child"+a),void 0,s,r,!1))}return i}parseLayoutSize(){AG(this)}assembleDefaultLayout(){const{repeat:t}=this,e=HT(t)?void 0:t.column?t.column.length:1;return Object.assign({},e?{columns:e}:{},{bounds:"full",align:"all"})}}function iV(t,e,n,r,i,o,a){if(OI(t))return new RG(t,e,n,i,o);if(KP(t))return new nV(t,e,n,r,i,o,a);if(gz(t))return new eV(t,e,n,r,i,o,a);if(qP(t))return new rV(t,e,n,i,o);if(function(t){return PP(t)||UP(t)||BP(t)}(t))return new IG(t,e,n,i,o);throw new Error(uI.INVALID_SPEC)}function oV(t,e={}){var n;e.logger&&(n=e.logger,dI=n),e.fieldTitle&&nB(e.fieldTitle);try{const n=GP(jR({},e.config,t.config)),r=hU(t,n),i=function(t,e,n=!0){const r=Object.assign({type:"pad"},gU(e),gU(t));return"fit"===r.type&&(n||(pI(uI.FIT_NON_SINGLE),r.type="pad")),r}(t.autosize,n.autosize,KP(r)||gz(r)),o=iV(r,null,"",void 0,void 0,n,"fit"===i.type);return o.parse(),function(t,e){tY(t.sources);let n=0,r=0;for(let r=0;r<jY&&FY(t,e);r++)n++;t.sources.map(_Y);for(let n=0;n<jY&&FY(t,e);n++)r++;tY(t.sources),Math.max(n,r)===jY&&pI(`Maximum optimization runs(${jY}) reached.`)}(o.component.data,o),function(t,e,n={},r){const i=t.config?ZP(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){const n=[],r=xG(n);let i=0;t.sources.forEach(t=>{t.hasName()||(t.dataName=`source_${i++}`);const e=t.assemble();r(t,e)}),n.forEach(t=>{0===t.transform.length&&delete t.transform});let o=0;for(const[t,e]of n.entries())0!==(e.transform||[]).length||e.source||n.splice(o++,0,n.splice(t,1)[0]);for(const e of n)for(const n of e.transform||[])"lookup"===n.type&&(n.from=t.outputNodes[n.from].getSource());for(const t of n)t.name in e&&(t.values=e[t.name]);return n}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),u=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let l=t.assembleLayoutSignals();return l=l.filter(t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)),{spec:Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},t.description?{description:t.description}:{},e,s?{title:s}:{},u?{style:u}:{},c?{encode:{update:c}}:{},{data:o},a.length>0?{projections:a}:{},t.assembleGroup([...l,...t.assembleSelectionTopLevelSignals([])]),i?{config:i}:{},r?{usermeta:r}:{})}}(o,function(t,e,n){return Object.assign({autosize:1===TR(n).length&&n.type?n.type:n},vU(e),vU(t))}(t,n,i),t.datasets,t.usermeta)}finally{e.logger&&hI(),e.fieldTitle&&nB(tB)}}const aV=new class extends tU{mapUnit(t,{config:e}){if(t.encoding){const{encoding:n,transform:r}=t,{bins:i,timeUnits:o,aggregate:a,groupby:s,encoding:u}=EB(n,e),c=[...r||[],...i,...o,...a.length?[{aggregate:a,groupby:s}]:[]];return Object.assign({},t,c.length>0?{transform:c}:{},{encoding:u})}return t}};function sV(t,e){return aV.map(t,{config:e})}const uV=PT.version;var cV=n(13),lV=n.n(cV),fV=n(21);var dV={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}};var hV={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}};var pV={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},style:{bar:{binSpacing:2,fill:"#30a2da",stroke:null}},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}};var gV={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}};const mV="Benton Gothic Bold, sans-serif",vV={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]};var yV={background:"#ffffff",title:{anchor:"start",color:"#000000",font:mV,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:mV,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:mV,titleFontSize:13,titleFontWeight:"normal"},range:{category:vV["category-6"],diverging:vV["fireandice-6"],heatmap:vV["fire-7"],ordinal:vV["fire-7"],ramp:vV["fire-7"]}};var bV={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}};var xV={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}};const _V={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]};var wV={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:_V["six-groups-cat-1"],diverging:_V["diverging-colors"],heatmap:_V["diverging-colors"],ordinal:_V["six-groups-seq"],ramp:_V["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:!1}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}};const OV=fV.version;var EV=n(22),AV="#vg-tooltip-element {\n  visibility: hidden;\n  padding: 8px;\n  position: fixed;\n  z-index: 1000;\n  font-family: sans-serif;\n  font-size: 11px;\n  border-radius: 3px;\n  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n  /* The default theme is the light theme. */\n  background-color: rgba(255, 255, 255, 0.95);\n  border: 1px solid #d9d9d9;\n  color: black; }\n  #vg-tooltip-element.visible {\n    visibility: visible; }\n  #vg-tooltip-element h2 {\n    margin-top: 0;\n    margin-bottom: 10px;\n    font-size: 13px; }\n  #vg-tooltip-element table {\n    border-spacing: 0; }\n    #vg-tooltip-element table tr {\n      border: none; }\n      #vg-tooltip-element table tr td {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        padding-top: 2px;\n        padding-bottom: 2px; }\n        #vg-tooltip-element table tr td.key {\n          color: #808080;\n          max-width: 150px;\n          text-align: right;\n          padding-right: 4px; }\n        #vg-tooltip-element table tr td.value {\n          display: block;\n          max-width: 300px;\n          max-height: 7em;\n          text-align: left; }\n  #vg-tooltip-element.dark-theme {\n    background-color: rgba(32, 32, 32, 0.9);\n    border: 1px solid #f5f5f5;\n    color: white; }\n    #vg-tooltip-element.dark-theme td.key {\n      color: #bfbfbf; }\n";const kV="vg-tooltip-element",SV={offsetX:10,offsetY:10,id:kV,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};var jV=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function DV(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}class CV{constructor(t){this.options=Object.assign(Object.assign({},SV),t);const e=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return AV.toString().replace(kV,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}this.el=document.getElementById(e),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",e),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(t,e,n,r){if(null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=function(t,e,n){if(Object(et.A)(t))return`[${t.map(t=>e(Object(et.H)(t)?t:DV(t,n))).join(", ")}]`;if(Object(et.F)(t)){let r="";const i=t,{title:o}=i,a=jV(i,["title"]);o&&(r+=`<h2>${e(o)}</h2>`);const s=Object.keys(a);if(s.length>0){r+="<table>";for(const t of s){let i=a[t];void 0!==i&&(Object(et.F)(i)&&(i=DV(i,n)),r+=`<tr><td class="key">${e(t)}:</td><td class="value">${e(i)}</td></tr>`)}r+="</table>"}return r||"{}"}return e(t)}(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(t,e,n,r){let i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${i}px`)}}EV.version;var MV=function(t,e,n){const r=t.open(e),i=250;let o=~~(1e4/i);t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,"*"),setTimeout(t,i),o-=1)}),i)},FV='.vega-embed {\n  position: relative;\n  display: inline-block; }\n  .vega-embed.has-actions {\n    padding-right: 38px; }\n  .vega-embed details:not([open]) > :not(summary) {\n    display: none !important; }\n  .vega-embed summary {\n    list-style: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    padding: 6px;\n    z-index: 1000;\n    background: white;\n    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n    color: #1b1e23;\n    border: 1px solid #aaa;\n    border-radius: 999px;\n    opacity: 0.2;\n    transition: opacity 0.4s ease-in;\n    outline: none;\n    cursor: pointer;\n    line-height: 0px; }\n    .vega-embed summary::-webkit-details-marker {\n      display: none; }\n    .vega-embed summary:active {\n      box-shadow: #aaa 0px 0px 0px 1px inset; }\n    .vega-embed summary svg {\n      width: 14px;\n      height: 14px; }\n  .vega-embed details[open] summary {\n    opacity: 0.7; }\n  .vega-embed:hover summary,\n  .vega-embed:focus summary {\n    opacity: 1 !important;\n    transition: opacity 0.2s ease; }\n  .vega-embed .vega-actions {\n    position: absolute;\n    top: 35px;\n    right: -9px;\n    display: flex;\n    flex-direction: column;\n    padding-bottom: 8px;\n    padding-top: 8px;\n    border-radius: 4px;\n    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n    border: 1px solid #d9d9d9;\n    background: white;\n    animation-duration: 0.15s;\n    animation-name: scale-in;\n    animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); }\n    .vega-embed .vega-actions a {\n      padding: 8px 16px;\n      font-family: sans-serif;\n      font-size: 14px;\n      font-weight: 600;\n      white-space: nowrap;\n      color: #434a56;\n      text-decoration: none; }\n      .vega-embed .vega-actions a:hover {\n        background-color: #f7f7f9;\n        color: black; }\n    .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n      content: "";\n      display: inline-block;\n      position: absolute; }\n    .vega-embed .vega-actions::before {\n      left: auto;\n      right: 14px;\n      top: -16px;\n      border: 8px solid #0000;\n      border-bottom-color: #d9d9d9; }\n    .vega-embed .vega-actions::after {\n      left: auto;\n      right: 15px;\n      top: -14px;\n      border: 7px solid #0000;\n      border-bottom-color: #fff; }\n\n.vega-embed-wrapper {\n  max-width: 100%;\n  overflow: scroll;\n  padding-right: 14px; }\n\n@keyframes scale-in {\n  from {\n    opacity: 0;\n    transform: scale(0.6); }\n  to {\n    opacity: 1;\n    transform: scale(1); } }\n';function NV(t,...e){for(const n of e)TV(t,n);return t}function TV(t,e){for(const n of Object.keys(e))Object(et.ib)(t,n,e[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t}),n.d(e,"vega",(function(){return RV})),n.d(e,"vegaLite",(function(){return zV})),n.d(e,"DEFAULT_ACTIONS",(function(){return LV})),n.d(e,"guessMode",(function(){return HV})),n.d(e,"default",(function(){return YV}));const RV=m;let zV=b;const $V=window;void 0===zV&&$V.vl&&$V.vl.compile&&(zV=$V.vl);const LV={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},IV={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},BV={vega:"Vega","vega-lite":"Vega-Lite"},PV={vega:RV.version,"vega-lite":zV?zV.version:"not available"},UV={vega:t=>t,"vega-lite":(t,e)=>zV.compile(t,{config:e}).spec},qV='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n  <circle r="2" cy="8" cx="2"></circle>\n  <circle r="2" cy="8" cx="8"></circle>\n  <circle r="2" cy="8" cx="14"></circle>\n</svg>';function WV(t,e,n,r){const i=`<html><head>${e}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(i+t+o),a.document.title=`${BV[r]} JSON Source`}function HV(t,e){var n;if(t.$schema){const r=lV()(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${BV[r.library]}, but mode argument sets ${n=BV[e],null!=n?n:e}.`);const i=r.library;return Object(tt.satisfies)(PV[i],`^${r.version.slice(1)}`)||console.warn(`The input spec uses ${BV[i]} ${r.version}, but the current version of ${BV[i]} is v${PV[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!=e?e:"vega"}function YV(t,e,n={}){var r,i,o;return w(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:RV.loader(n.loader);var s;const u=Object(et.H)(e)?JSON.parse(yield a.load(e)):e,c=yield GV((r=u.usermeta&&u.usermeta.embedOptions,null!=r?r:{}),a),l=yield GV(n,a),f=Object.assign(Object.assign({},NV(l,c)),{config:Object(et.M)((i=l.config,null!=i?i:{}),(o=c.config,null!=o?o:{}))});return yield function(t,e,n={},r){var i,o,a,s,u,c;return w(this,void 0,void 0,(function*(){const l=n.theme?Object(et.M)(x[n.theme],null!=(i=n.config)?i:{}):n.config,f=Object(et.B)(n.actions)?n.actions:NV({},LV,null!=(o=n.actions)?o:{}),d=Object.assign(Object.assign({},IV),n.i18n),h=null!=(a=n.renderer)?a:"canvas",p=null!=(s=n.logLevel)?s:RV.Warn,g=null!=(u=n.downloadFileName)?u:"visualization";if(!1!==n.defaultStyle){const t="vega-embed-style";if(!document.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?(null!=FV?FV:"").toString():n.defaultStyle,document.head.appendChild(e)}}const m=HV(e,n.mode);let v=UV[m](e,l);if("vega-lite"===m&&v.$schema){const t=lV()(v.$schema);Object(tt.satisfies)(PV.vega,`^${t.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${PV.vega}.`)}const y="string"==typeof t?document.querySelector(t):t;if(!y)throw Error("${el} does not exist");y.classList.add("vega-embed"),f&&y.classList.add("has-actions"),y.innerHTML="";const b=n.patch;b&&(v=b instanceof Function?b(v):I(v,b,!0,!1).newDocument),n.formatLocale&&RV.formatLocale(n.formatLocale),n.timeFormatLocale&&RV.timeFormatLocale(n.timeFormatLocale);const _=RV.parse(v,"vega-lite"===m?{}:l),w=new RV.View(_,{loader:r,logLevel:p,renderer:h});if(!1!==n.tooltip){let t;t="function"==typeof n.tooltip?n.tooltip:new CV(!0===n.tooltip?{}:n.tooltip).call,w.tooltip(t)}let O,{hover:E}=n;if(void 0===E&&(E="vega"===m),E){const{hoverSet:t,updateSet:e}="boolean"==typeof E?{}:E;w.hover(t,e)}if(n&&(n.width&&w.width(n.width),n.height&&w.height(n.height),n.padding&&w.padding(n.padding)),yield w.initialize(t).runAsync(),!1!==f){let t=y;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=d.CLICK_TO_VIEW_ACTIONS,y.append(e),t=e;const n=document.createElement("summary");n.innerHTML=qV,e.append(n),O=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",O)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const t of["svg","png"])if(!0===f||!0===f.export||f.export[t]){const e=d[`${t.toUpperCase()}_ACTION`],i=document.createElement("a");i.text=e,i.href="#",i.target="_blank",i.download=`${g}.${t}`,i.addEventListener("mousedown",(function(e){w.toImageURL(t,n.scaleFactor).then(t=>{this.href=t}).catch(t=>{throw t}),e.preventDefault()})),r.append(i)}if(!0===f||!1!==f.source){const t=document.createElement("a");t.text=d.SOURCE_ACTION,t.href="#",t.addEventListener("mousedown",(function(t){var r,i;WV(K()(e),null!=(r=n.sourceHeader)?r:"",null!=(i=n.sourceFooter)?i:"",m),t.preventDefault()})),r.append(t)}if("vega-lite"===m&&(!0===f||!1!==f.compiled)){const t=document.createElement("a");t.text=d.COMPILED_ACTION,t.href="#",t.addEventListener("mousedown",(function(t){var e,r;WV(K()(v),null!=(e=n.sourceHeader)?e:"",null!=(r=n.sourceFooter)?r:"","vega"),t.preventDefault()})),r.append(t)}if(!0===f||!1!==f.editor){const t=null!=(c=n.editorUrl)?c:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("mousedown",(function(n){MV(window,t,{config:l,mode:m,renderer:h,spec:K()(e)}),n.preventDefault()})),r.append(i)}}return{view:w,spec:e,vgSpec:v,finalize:function(){O&&document.removeEventListener("click",O),w.finalize()}}}))}(t,u,f,a)}))}function GV(t,e){var n;return w(this,void 0,void 0,(function*(){const r=Object(et.H)(t.config)?JSON.parse(yield e.load(t.config)):null!=(n=t.config)?n:{},i=Object(et.H)(t.patch)?JSON.parse(yield e.load(t.patch)):t.patch;return Object.assign(Object.assign(Object.assign({},t),i?{patch:i}:{}),r?{config:r}:{})}))}},function(t){t.exports=JSON.parse('{"name":"vega-lite","author":"Dominik Moritz, Kanit \\"Ham\\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer","version":"3.4.0","collaborators":["Kanit Wongsuphasawat <kanitw@gmail.com> (http://kanitw.yellowpigz.com)","Dominik Moritz <domoritz@cs.washington.edu> (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com/)","Jeffrey Heer (https://jheer.org)"],"homepage":"https://vega.github.io/vega-lite/","description":"Vega-Lite is a concise high-level language for interactive visualization.","main":"build/vega-lite.js","unpkg":"build/vega-lite.min.js","jsdelivr":"build/vega-lite.min.js","module":"build/src/index","types":"build/src/index.d.ts","bin":{"vl2png":"./bin/vl2png","vl2svg":"./bin/vl2svg","vl2vg":"./bin/vl2vg"},"directories":{"test":"test"},"scripts":{"build":"npm run build:only","build:only":"npm run tsc:src && rollup -c","postbuild":"terser build/vega-lite.js -cm --source-map content=build/vega-lite.js.map,filename=build/vega-lite.min.js.map -o build/vega-lite.min.js && npm run schema","build:examples":"npm run build:only","postbuild:examples":"npm run data && TZ=America/Los_Angeles scripts/build-examples.sh","build:examples-full":"npm run build:only","postbuild:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"npm run data && bundle exec jekyll build -q && scripts/generate-toc","build:site":"npm run tsc:site && rollup -c site/rollup.config.js","build:versions":"scripts/update-version.sh","clean":"rm -rf build && rm -f examples/compiled/*.png && find site/examples ! -name \'index.md\' -type f -delete","data":"rsync -r node_modules/vega-datasets/data/* data","deploy":"scripts/deploy.sh","deploy:gh":"scripts/deploy-gh.sh","deploy:schema":"scripts/deploy-schema.sh","schema":"mkdir -p build && ts-json-schema-generator -c -f tsconfig.json -t TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/","renameschema":"scripts/rename-schema.sh","presite":"npm run data && npm run build:site && npm run build:toc && npm run build:versions && scripts/create-example-pages","site":"bundle exec jekyll serve --incremental","tsc:src":"tsc -b src/tsconfig.src.json","tsc:site":"tsc -b site/tsconfig.site.json","prettierbase":"prettier \'{src,test,test-runtime,site,typings}/**/*.{md,css}\'","eslintbase":"eslint \'{src,test,test-runtime,site,typings}/**/*.{ts,js}\'","format":"npm run eslintbase -- --fix && npm run prettierbase -- --write","lint":"npm run eslintbase && npm run prettierbase -- --check","test":"jest test/ && npm run lint && npm run schema && jest examples/ && npm run test:runtime","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles jest test-runtime/","test:runtime:generate":"rm -Rf test-runtime/resources && VL_GENERATE_TESTS=true npm run test:runtime","watch:build":"npm run build:only && concurrently --kill-others -n Typescript,Rollup \'npm run tsc:src -- -w\' \'rollup -c -w\'","watch:site":"concurrently --kill-others -n Typescript,Rollup \'npm run tsc:site -- -w\' \'rollup -c site/rollup.config.js -w\'","watch:test":"jest --watch"},"repository":{"type":"git","url":"https://github.com/vega/vega-lite.git"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-lite/issues"},"devDependencies":{"@types/chai":"^4.1.7","@types/d3":"^5.7.2","@types/highlight.js":"^9.12.3","@types/jest":"^24.0.15","@types/jest-environment-puppeteer":"^4.0.0","@types/mkdirp":"^0.5.2","@types/node":"^12.6.8","@types/puppeteer":"^1.12.4","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.13.0","ajv":"^6.10.2","chai":"^4.2.0","cheerio":"^1.0.0-rc.2","codecov":"^3.5.0","concurrently":"^4.1.1","d3":"^5.9.7","eslint":"^5.16.0","eslint-config-prettier":"^6.0.0","eslint-plugin-prettier":"^3.1.0","highlight.js":"^9.15.8","http-server":"^0.11.1","jest":"^24.8.0","jest-puppeteer":"^4.3.0","mkdirp":"^0.5.1","prettier":"^1.18.2","puppeteer":"^1.19.0","rollup":"^1.17.0","rollup-plugin-commonjs":"^10.0.1","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-terser":"^5.1.1","svg2png-many":"^0.0.7","terser":"^4.1.2","ts-jest":"^24.0.2","ts-json-schema-generator":"^0.52.14","typescript":"~3.4.5","vega-cli":"^5.4.0","vega-datasets":"^1.25.0","vega-embed":"^4.2.1","vega-tooltip":"^0.18.1","yaml-front-matter":"^4.0.0"},"dependencies":{"@types/clone":"~0.1.30","@types/fast-json-stable-stringify":"^2.0.0","clone":"~2.1.2","fast-deep-equal":"~2.0.1","fast-json-stable-stringify":"~2.0.0","json-stringify-pretty-compact":"~2.0.0","tslib":"~1.10.0","vega-event-selector":"~2.0.0","vega-expression":"~2.6.0","vega-typings":"0.7.2","vega-util":"~1.10.0","yargs":"~13.3.0"},"peerDependencies":{"vega":"^5.4.0"},"jest":{"preset":"jest-puppeteer","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["<rootDir>/node_modules","<rootDir>/build","<rootDir>/_site","<rootDir>/src"],"coverageDirectory":"./coverage/","collectCoverage":false}}')},function(t,e,n){(function(e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{i=Promise}catch(t){i=function(){}}function o(a,u,c,l,f){"object"==typeof u&&(c=u.depth,l=u.prototype,f=u.includeNonEnumerable,u=u.circular);var d=[],h=[],p=void 0!==e;return void 0===u&&(u=!0),void 0===c&&(c=1/0),function a(c,g){if(null===c)return null;if(0===g)return c;var m,v;if("object"!=typeof c)return c;if(t(c,n))m=new n;else if(t(c,r))m=new r;else if(t(c,i))m=new i((function(t,e){c.then((function(e){t(a(e,g-1))}),(function(t){e(a(t,g-1))}))}));else if(o.__isArray(c))m=[];else if(o.__isRegExp(c))m=new RegExp(c.source,s(c)),c.lastIndex&&(m.lastIndex=c.lastIndex);else if(o.__isDate(c))m=new Date(c.getTime());else{if(p&&e.isBuffer(c))return m=e.allocUnsafe?e.allocUnsafe(c.length):new e(c.length),c.copy(m),m;t(c,Error)?m=Object.create(c):void 0===l?(v=Object.getPrototypeOf(c),m=Object.create(v)):(m=Object.create(l),v=l)}if(u){var y=d.indexOf(c);if(-1!=y)return h[y];d.push(c),h.push(m)}for(var b in t(c,n)&&c.forEach((function(t,e){var n=a(e,g-1),r=a(t,g-1);m.set(n,r)})),t(c,r)&&c.forEach((function(t){var e=a(t,g-1);m.add(e)})),c){var x;v&&(x=Object.getOwnPropertyDescriptor(v,b)),x&&null==x.set||(m[b]=a(c[b],g-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(c);for(b=0;b<_.length;b++){var w=_[b];(!(E=Object.getOwnPropertyDescriptor(c,w))||E.enumerable||f)&&(m[w]=a(c[w],g-1),E.enumerable||Object.defineProperty(m,w,{enumerable:!1}))}}if(f){var O=Object.getOwnPropertyNames(c);for(b=0;b<O.length;b++){var E,A=O[b];(E=Object.getOwnPropertyDescriptor(c,A))&&E.enumerable||(m[A]=a(c[A],g-1),Object.defineProperty(m,A,{enumerable:!1}))}}return m}(a,c)}function a(t){return Object.prototype.toString.call(t)}function s(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return o.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},o.__objToStr=a,o.__isDate=function(t){return"object"==typeof t&&"[object Date]"===a(t)},o.__isArray=function(t){return"object"==typeof t&&"[object Array]"===a(t)},o.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===a(t)},o.__getRegExpFlags=s,o}();t.exports&&(t.exports=n)}).call(this,n(15).Buffer)},function(t,e,n){"use strict";var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty;t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){var a,s,u,c=r(e),l=r(n);if(c&&l){if((s=e.length)!=n.length)return!1;for(a=s;0!=a--;)if(!t(e[a],n[a]))return!1;return!0}if(c!=l)return!1;var f=e instanceof Date,d=n instanceof Date;if(f!=d)return!1;if(f&&d)return e.getTime()==n.getTime();var h=e instanceof RegExp,p=n instanceof RegExp;if(h!=p)return!1;if(h&&p)return e.toString()==n.toString();var g=i(e);if((s=g.length)!==i(n).length)return!1;for(a=s;0!=a--;)if(!o.call(n,g[a]))return!1;for(a=s;0!=a--;)if(!t(e[u=g[a]],n[u]))return!1;return!0}return e!=e&&n!=n}},function(t){t.exports=JSON.parse('{"name":"vega-themes","version":"2.5.0","description":"Themes for stylized Vega and Vega-Lite visualizations.","keywords":["vega","vega-lite","themes","style"],"license":"BSD-3-Clause","author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"contributors":[{"name":"Emily Gu","url":"https://github.com/emilygu"},{"name":"Arvind Satyanarayan","url":"http://arvindsatya.com"},{"name":"Jeffrey Heer","url":"http://idl.cs.washington.edu"},{"name":"Dominik Moritz","url":"https://www.domoritz.de"}],"main":"build/vega-themes.js","module":"build/src/index.js","unpkg":"build/vega-themes.min.js","jsdelivr":"build/vega-themes.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-themes.git"},"scripts":{"prepare":"beemo create-config --silent","clean":"rm -rf build examples/build","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'src/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","prebuild":"mkdir -p build","build":"tsc && rollup -c","postbuild":"terser build/vega-themes.js -cm > build/vega-themes.min.js","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","serve":"browser-sync start -s -f build examples --serveStatic examples","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'yarn serve\' \'tsc -w\' \'rollup -c -w\'"},"devDependencies":{"browser-sync":"^2.26.7","concurrently":"^4.1.2","gh-pages":"^2.1.1","rollup":"^1.22.0","rollup-plugin-json":"^4.0.0","terser":"^4.3.4","typescript":"~3.6.3","vega":"^5.5.2","vega-lite":"^4.0.0-beta.1","vega-lite-dev-config":"^0.3.0"},"peerDependencies":{"vega":"*","vega-lite":"*"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]}}')},function(t){t.exports=JSON.parse('{"name":"vega-tooltip","version":"0.19.1","description":"A tooltip plugin for Vega-Lite and Vega visualizations.","main":"build/vega-tooltip.js","module":"build/src/index.js","unpkg":"build/vega-tooltip.min.js","jsdelivr":"build/vega-tooltip.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-tooltip.git"},"keywords":["vega-lite","vega","tooltip"],"author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"collaborators":["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-tooltip/issues"},"homepage":"https://github.com/vega/vega-tooltip#readme","scripts":{"prepare":"beemo create-config --silent","tsc:src":"tsc -b tsconfig.src.json","build":"yarn tsc:src && rollup -c","clean":"rm -rf build examples/data && rm -f src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'{src,test,types}/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","postbuild":"terser build/vega-tooltip.js -c -m -o build/vega-tooltip.min.js","prebuild":"mkdir -p build && yarn copy:data && ./build-style.sh","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'browser-sync start -s -f build examples --serveStatic examples\' \'yarn tsc:src -w\' \'rollup -c -w\'","pretest":"./build-style.sh","test":"jest"},"devDependencies":{"@types/jest":"^24.0.18","browser-sync":"^2.26.7","concurrently":"^4.1.2","gh-pages":"^2.1.1","jest":"^24.9.0","node-sass":"^4.12.0","path":"^0.12.7","rollup":"^1.20.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","terser":"^4.2.1","ts-jest":"^24.0.2","typescript":"^3.6.2","vega-datasets":"^1.25.0","vega-lite-dev-config":"^0.2.5","vega-typings":"^0.8.1"},"dependencies":{"vega-util":"^1.11.1"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]},"jest":{"testURL":"http://localhost/","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","<rootDir>/build","src"]}}')},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(17);var i=n(17);function o(t,e){throw t.innerHTML=`<div class="error">\n    <p>Javascript Error: ${e.message}</p>\n    <p>This usually means there's a typo in your chart specification.\n    See the JavaScript console for the full traceback.</p>\n  </div>`,e}e.vegaEmbed=i.default,e.render=function(t,e,n,i,a){const s=function(t,e){for(let n=0;n<e.length;n++){const r=e[n];if(r.metadata&&r.metadata["jupyter-vega"]===t&&void 0!==r.data["image/png"])return n}return-1}(t,a.outputs),u=function(t,e){for(let n=0;n<e.length;n++){const r=e[n];if(r.metadata&&r.metadata["jupyter-vega"]===t&&void 0!==r.data["application/javascript"])return n}return-1}(t,a.outputs);if(s>-1&&u>-1)return;const c=document.getElementById(t.substring(1));r.default(c,e,Object.assign(Object.assign({loader:{http:{credentials:"same-origin"}}},i),{mode:n})).then(e=>{e.view.toImageURL("png").then(e=>{if(void 0!==a){const n={data:{"image/png":e.split(",")[1]},metadata:{"jupyter-vega":t},output_type:"display_data"};a.outputs.push(n)}}).catch(t=>o(c,t))}).catch(t=>o(c,t))}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var t=s(d);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n<f;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(l(t,a,a+16383>s?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,d=n?-1:1,h=t[e+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+h]=255&a,h+=p,a/=256,c-=8);t[n+h-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}}])}));
  //# sourceMappingURL=index.js.map