// https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.4/vega-lite.min.js

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).vl=e()}}(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r="undefined"!=typeof JSON?JSON:e("jsonify");t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var o="boolean"==typeof t.cycles&&t.cycles,s=t.replacer||function(e,t){return t},l=t.cmp&&function(e){return function(t){return function(n,r){var i={key:n,value:t[n]},a={key:r,value:t[r]};return e(i,a)}}}(t.cmp),c=[];return function e(t,u,f,d){var p=n?"\n"+new Array(d+1).join(n):"",m=n?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=s.call(t,u,f))){if("object"!=typeof f||null===f)return r.stringify(f);if(i(f)){for(var g=[],h=0;h<f.length;h++){var v=e(f,h,f[h],d+1)||r.stringify(null);g.push(p+n+v)}return"["+g.join(",")+p+"]"}if(-1!==c.indexOf(f)){if(o)return r.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}c.push(f);for(var y=a(f).sort(l&&l(f)),g=[],h=0;h<y.length;h++){var b=e(f,u=y[h],f[u],d+1);if(b){var _=r.stringify(u)+m+b;g.push(p+n+_)}}return c.splice(c.indexOf(f),1),"{"+g.join(",")+p+"}"}}({"":e},"",e,0)};var i=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},a=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var r in e)t.call(e,r)&&n.push(r);return n}},{jsonify:2}],2:[function(e,t,n){n.parse=e("./lib/parse"),n.stringify=e("./lib/stringify")},{"./lib/parse":3,"./lib/stringify":4}],3:[function(e,t,n){var r,i,a,o,s={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},l=function(e){throw{name:"SyntaxError",message:e,at:r,text:a}},c=function(e){return e&&e!==i&&l("Expected '"+e+"' instead of '"+i+"'"),i=a.charAt(r),r+=1,i},u=function(){var e,t="";for("-"===i&&(t="-",c("-"));i>="0"&&i<="9";)t+=i,c();if("."===i)for(t+=".";c()&&i>="0"&&i<="9";)t+=i;if("e"===i||"E"===i)for(t+=i,c(),"-"!==i&&"+"!==i||(t+=i,c());i>="0"&&i<="9";)t+=i,c();if(e=+t,isFinite(e))return e;l("Bad number")},f=function(){var e,t,n,r="";if('"'===i)for(;c();){if('"'===i)return c(),r;if("\\"===i)if(c(),"u"===i){for(n=0,t=0;t<4&&(e=parseInt(c(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof s[i])break;r+=s[i]}else r+=i}l("Bad string")},d=function(){for(;i&&i<=" ";)c()};o=function(){switch(d(),i){case"{":return function(){var e,t={};if("{"===i){if(c("{"),d(),"}"===i)return c("}"),t;for(;i;){if(e=f(),d(),c(":"),Object.hasOwnProperty.call(t,e)&&l('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===i)return c("}"),t;c(","),d()}}l("Bad object")}();case"[":return function(){var e=[];if("["===i){if(c("["),d(),"]"===i)return c("]"),e;for(;i;){if(e.push(o()),d(),"]"===i)return c("]"),e;c(","),d()}}l("Bad array")}();case'"':return f();case"-":return u();default:return i>="0"&&i<="9"?u():function(){switch(i){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}l("Unexpected '"+i+"'")}()}},t.exports=function(e,t){var n;return a=e,r=0,i=" ",n=o(),d(),i&&l("Syntax error"),"function"==typeof t?function e(n,r){var i,a,o=n[r];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(void 0!==(a=e(o,i))?o[i]=a:delete o[i]);return t.call(n,r,o)}({"":n},""):n}},{}],4:[function(e,t,n){function r(e){return l.lastIndex=0,l.test(e)?'"'+e.replace(l,function(e){var t=c[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function i(e,t){var n,l,c,u,f,d=a,p=t[e];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(e)),"function"==typeof s&&(p=s.call(t,e,p)),typeof p){case"string":return r(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(a+=o,f=[],"[object Array]"===Object.prototype.toString.apply(p)){for(u=p.length,n=0;n<u;n+=1)f[n]=i(n,p)||"null";return c=0===f.length?"[]":a?"[\n"+a+f.join(",\n"+a)+"\n"+d+"]":"["+f.join(",")+"]",a=d,c}if(s&&"object"==typeof s)for(u=s.length,n=0;n<u;n+=1)"string"==typeof(l=s[n])&&(c=i(l,p))&&f.push(r(l)+(a?": ":":")+c);else for(l in p)Object.prototype.hasOwnProperty.call(p,l)&&(c=i(l,p))&&f.push(r(l)+(a?": ":":")+c);return c=0===f.length?"{}":a?"{\n"+a+f.join(",\n"+a)+"\n"+d+"}":"{"+f.join(",")+"}",a=d,c}}var a,o,s,l=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};t.exports=function(e,t,n){var r;if(a="",o="","number"==typeof n)for(r=0;r<n;r+=1)o+=" ";else"string"==typeof n&&(o=n);if(s=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return i("",{"":e})}},{}],5:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(u===setTimeout)return setTimeout(e,0);if((u===r||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function o(){g&&p&&(g=!1,p.length?m=p.concat(m):h=-1,m.length&&s())}function s(){if(!g){var e=a(o);g=!0;for(var t=m.length;t;){for(p=m,m=[];++h<t;)p&&p[h].run();h=-1,t=m.length}p=null,g=!1,function(e){if(f===clearTimeout)return clearTimeout(e);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var u,f,d=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:r}catch(e){u=r}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(e){f=i}}();var p,m=[],g=!1,h=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];m.push(new l(e,t)),1!==m.length||g||a(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.prependListener=c,d.prependOnceListener=c,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],6:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],7:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],8:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(t)?r.showHidden=t:t&&n._extend(r,t),g(r.showHidden)&&(r.showHidden=!1),g(r.depth)&&(r.depth=2),g(r.colors)&&(r.colors=!1),g(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),s(r,e,r.depth)}function a(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function o(e,t){return e}function s(e,t,r){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return m(i)||(i=s(e,i,r)),i}var a=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(p(t))return e.stylize(""+t,"number");if(f(t))return e.stylize(""+t,"boolean");if(d(t))return e.stylize("null","null")}(e,t);if(a)return a;var o=Object.keys(t),v=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),b(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(t);if(0===o.length){if(_(t)){var O=t.name?": "+t.name:"";return e.stylize("[Function"+O+"]","special")}if(h(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(y(t))return e.stylize(Date.prototype.toString.call(t),"date");if(b(t))return l(t)}var S="",w=!1,E=["{","}"];if(u(t)&&(w=!0,E=["[","]"]),_(t)){S=" [Function"+(t.name?": "+t.name:"")+"]"}if(h(t)&&(S=" "+RegExp.prototype.toString.call(t)),y(t)&&(S=" "+Date.prototype.toUTCString.call(t)),b(t)&&(S=" "+l(t)),0===o.length&&(!w||0==t.length))return E[0]+S+E[1];if(r<0)return h(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var N;return N=w?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)x(t,String(o))?a.push(c(e,t,n,r,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(c(e,t,n,r,i,!0))}),a}(e,t,r,v,o):o.map(function(n){return c(e,t,r,v,n,w)}),e.seen.pop(),function(e,t,n){var r=0;if(e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(N,S,E)}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?l=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(l=e.stylize("[Setter]","special")),x(r,i)||(o="["+i+"]"),l||(e.seen.indexOf(c.value)<0?(l=d(n)?s(e,c.value,null):s(e,c.value,n-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+l.split("\n").map(function(e){return"   "+e}).join("\n")):l=e.stylize("[Circular]","special")),g(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+l}function u(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function d(e){return null===e}function p(e){return"number"==typeof e}function m(e){return"string"==typeof e}function g(e){return void 0===e}function h(e){return v(e)&&"[object RegExp]"===O(e)}function v(e){return"object"==typeof e&&null!==e}function y(e){return v(e)&&"[object Date]"===O(e)}function b(e){return v(e)&&("[object Error]"===O(e)||e instanceof Error)}function _(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var w=/%[sdj%]/g;n.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,a=r.length,o=String(e).replace(w,function(e){if("%%"===e)return"%";if(n>=a)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n<a;s=r[++n])d(s)||!v(s)?o+=" "+s:o+=" "+i(s);return o},n.deprecate=function(e,i){if(g(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var a=!1;return function(){if(!a){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),a=!0}return e.apply(this,arguments)}};var E,N={};n.debuglog=function(e){if(g(E)&&(E=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!N[e])if(new RegExp("\\b"+e+"\\b","i").test(E)){var r=t.pid;N[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else N[e]=function(){};return N[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=u,n.isBoolean=f,n.isNull=d,n.isNullOrUndefined=function(e){return null==e},n.isNumber=p,n.isString=m,n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=g,n.isRegExp=h,n.isObject=v,n.isDate=y,n.isError=b,n.isFunction=_,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e("./support/isBuffer");var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",function(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":7,_process:5,inherits:6}],9:[function(e,t,n){!function(e,r){r("object"==typeof n&&void 0!==t?n:e.vega=e.vega||{})}(this,function(e){"use strict";function t(e,t,n,r,i){for(var a,o=0,s=e.length;t<s;++t){if(a=e[t],!o&&a===n)return t;i&&i.indexOf(a)>=0?--o:r&&r.indexOf(a)>=0&&++o}return t}function n(e){for(var n=[],r=0,i=e.length,a=0;a<i;)a=t(e,a,d,s+c,l+u),n.push(e.substring(r,a).trim()),r=++a;if(0===n.length)throw"Empty event selector: "+e;return n}function r(e){return"["===e[0]?function(e){var i,a,o=e.length,c=1;if((c=t(e,c,l,s,l))===o)throw"Empty between selector: "+e;if(2!==(i=n(e.substring(1,c))).length)throw"Between selector must have two elements: "+e;if((e=e.slice(c+1).trim())[0]!==m)throw"Expected '>' after between selector: "+e;{if(i=i.map(r),(a=r(e.slice(1).trim())).between)return{between:i,stream:a};a.between=i}return a}(e):function(e){var n,r,o={source:i},m=[],h=[0,0],v=0,y=0,b=e.length,_=0;if(e[b-1]===u){if(!((_=e.lastIndexOf(c))>=0))throw"Unmatched right brace: "+e;try{h=function(e){var t=e.split(d);if(!e.length||t.length>2)throw e;return t.map(function(t){var n=+t;if(n!=n)throw e;return n})}(e.substring(_+1,b-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,_).trim(),b=e.length,_=0}if(!b)throw e;e[0]===p&&(v=++_);(n=t(e,_,f))<b&&(m.push(e.substring(y,n).trim()),y=_=++n);if((_=t(e,_,s))===b)m.push(e.substring(y,b).trim());else if(m.push(e.substring(y,_).trim()),r=[],(y=++_)===b)throw"Unmatched left bracket: "+e;for(;_<b;){if((_=t(e,_,l))===b)throw"Unmatched left bracket: "+e;if(r.push(e.substring(y,_).trim()),_<b-1&&e[++_]!==s)throw"Expected left bracket: "+e;y=++_}if(!(b=m.length)||g.test(m[b-1]))throw"Invalid event selector: "+e;b>1?(o.type=m[1],v?o.markname=m[0].slice(1):!function(e){return a.hasOwnProperty(e)}(m[0])?o.source=m[0]:o.marktype=m[0]):o.type=m[0];"!"===o.type.slice(-1)&&(o.consume=!0,o.type=o.type.slice(0,-1));null!=r&&(o.filter=r);h[0]&&(o.throttle=h[0]);h[1]&&(o.debounce=h[1]);return o}(e)}var i,a,o="view",s="[",l="]",c="{",u="}",f=":",d=",",p="@",m=">",g=/[[\]{}]/,h={"*":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};e.selector=function(e,t,s){return i=t||o,a=s||h,n(e.trim()).map(r)},Object.defineProperty(e,"__esModule",{value:!0})})},{}],10:[function(e,t,n){!function(e,r){r("object"==typeof n&&void 0!==t?n:e.vega=e.vega||{})}(this,function(e){"use strict";function t(e){return null==e?null:e.fields}function n(e){return d(e)?"["+e.map(n)+"]":p(e)||m(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function r(e,t,n){var r=[t].concat([].slice.call(n));console[e].apply(console,r)}function i(e){return function(t){return e*Math.exp(t)}}function a(e){return function(t){return Math.log(e*t)}}function o(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function s(e,t,n,r){var i=n(e[0]),a=n(x(e)),o=(a-i)*t;return[r(i-o),r(a-o)]}function l(e,t,n,r,i){var a=r(e[0]),o=r(x(e)),s=null!=t?r(t):(a+o)/2;return[i(s+(a-s)*n),i(s+(o-s)*n)]}var c=function(e,t,n){return e.fields=t||[],e.fname=n,e},u=function(e){throw Error(e)},f=function(e){function t(){a.push(c+e.substring(n,r)),c="",n=r+1}var n,r,i,a=[],o=null,s=0,l=e.length,c="";for(e+="",n=r=0;r<l;++r)if("\\"===(i=e[r]))c+=e.substring(n,r),n=++r;else if(i===o)t(),o=null,s=-1;else{if(o)continue;n===s&&'"'===i?(n=r+1,o=i):n===s&&"'"===i?(n=r+1,o=i):"."!==i||s?"["===i?(r>n&&t(),s=n=r+1):"]"===i&&(s||u("Access path missing open bracket: "+e),s>0&&t(),s=0,n=r+1):r>n?t():n=r+1}return s&&u("Access path missing closing bracket: "+e),o&&u("Access path missing closing quote: "+e),r>n&&(r++,t()),a},d=Array.isArray,p=function(e){return e===Object(e)},m=function(e){return"string"==typeof e},g=function(e,t){var r=f(e),i="return _["+r.map(n).join("][")+"];";return c(Function("_",i),[e=1===r.length?r[0]:e],t||e)},h=[],v=g("id"),y=c(function(e){return e},h,"identity"),b=c(function(){return 0},h,"zero"),_=c(function(){return 1},h,"one"),O=c(function(){return!0},h,"true"),S=c(function(){return!1},h,"false"),x=function(e){return e[e.length-1]},w=function(e){return null==e||""===e?null:+e},E=function(e){return null!=e?d(e)?e:[e]:[]},N=function(e){return"function"==typeof e},T={},P=function(e){return"[object Date]"===Object.prototype.toString.call(e)},k=function(e){return"number"==typeof e},D=function(e,t){for(var n="";--t>=0;)n+=e;return n};e.accessor=c,e.accessorName=function(e){return null==e?null:e.fname},e.accessorFields=t,e.id=v,e.identity=y,e.zero=b,e.one=_,e.truthy=O,e.falsy=S,e.logger=function(e){var t=e||0;return{level:function(e){return arguments.length?(t=+e,this):t},error:function(){return t>=1&&r("error","ERROR",arguments),this},warn:function(){return t>=2&&r("warn","WARN",arguments),this},info:function(){return t>=3&&r("log","INFO",arguments),this},debug:function(){return t>=4&&r("log","DEBUG",arguments),this}}},e.None=0,e.Error=1,e.Warn=2,e.Info=3,e.Debug=4,e.panLinear=function(e,t){return s(e,t,w,y)},e.panLog=function(e,t){var n=Math.sign(e[0]);return s(e,t,a(n),i(n))},e.panPow=function(e,t,n){return s(e,t,o(n),o(1/n))},e.zoomLinear=function(e,t,n){return l(e,t,n,w,y)},e.zoomLog=function(e,t,n){var r=Math.sign(e[0]);return l(e,t,n,a(r),i(r))},e.zoomPow=function(e,t,n,r){return l(e,t,n,o(r),o(1/r))},e.array=E,e.compare=function(e,r){var i,a,o,s,l,u,d,p,m,g=[],h=(e=E(e)).map(function(e,t){return null==e?null:(g.push(t),N(e)?e:f(e).map(n).join("]["))}),v=g.length-1,y=E(r),b="var u,v;return ";if(v<0)return null;for(a=0;a<=v;++a)o=h[i=g[a]],N(o)?(s="(u=this."+(u="f"+i)+"(a))",l="(v=this."+u+"(b))",(d=d||{})[u]=o):(s="(u=a["+o+"])",l="(v=b["+o+"])"),u="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[i]?(m=1,p=-1):(m=-1,p=1),b+="("+s+"<"+l+"||u==null)&&v!=null?"+p+":(u>v||v==null)&&u!=null?"+m+":"+u+"!==u&&v===v?"+p+":v!==v&&u===u?"+m+(i<v?":":":0");return o=Function("a","b",b+";"),d&&(o=o.bind(d)),e=e.reduce(function(e,n){return N(n)?(t(n)||[]).forEach(function(t){e[t]=1}):null!=n&&(e[n+""]=1),e},{}),c(o,Object.keys(e))},e.constant=function(e){return N(e)?e:function(){return e}},e.debounce=function(e,t){function n(){t(i),r=i=null}var r,i;return function(t){i=t,r&&clearTimeout(r),r=setTimeout(n,e)}},e.error=u,e.extend=function(e){for(var t,n,r=1,i=arguments.length;r<i;++r){t=arguments[r];for(n in t)e[n]=t[n]}return e},e.extentIndex=function(e,t){var n,r,i,a,o,s=-1,l=e.length;if(null==t){for(;++s<l;)if(null!=(r=e[s])&&r>=r){n=i=r;break}for(a=o=s;++s<l;)null!=(r=e[s])&&(n>r&&(n=r,a=s),i<r&&(i=r,o=s))}else{for(;++s<l;)if(null!=(r=t(e[s],s,e))&&r>=r){n=i=r;break}for(a=o=s;++s<l;)null!=(r=t(e[s],s,e))&&(n>r&&(n=r,a=s),i<r&&(i=r,o=s))}return[a,o]},e.fastmap=function(e){function t(e){return i.hasOwnProperty(e)&&i[e]!==T}var n,r,i={};return n={size:0,empty:0,object:i,has:t,get:function(e){return t(e)?i[e]:void 0},set:function(e,r){return t(e)||(++n.size,i[e]===T&&--n.empty),i[e]=r,this},delete:function(e){return t(e)&&(--n.size,++n.empty,i[e]=T),this},clear:function(){n.size=n.empty=0,n.object=i={}},test:function(e){return arguments.length?(r=e,n):r},clean:function(){var e,t,a={},o=0;for(e in i)(t=i[e])===T||r&&r(t)||(a[e]=t,++o);n.size=o,n.empty=0,n.object=i=a}},e&&Object.keys(e).forEach(function(t){n.set(t,e[t])}),n},e.field=g,e.inherits=function(e,t){var n=e.prototype=Object.create(t.prototype);return n.constructor=e,n},e.isArray=d,e.isBoolean=function(e){return"boolean"==typeof e},e.isDate=P,e.isFunction=N,e.isNumber=k,e.isObject=p,e.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},e.isString=m,e.key=function(e,t){e&&(e=t?E(e).map(function(e){return e.replace(/\\(.)/g,"$1")}):E(e));var r=e&&e.length?Function("_","return ''+"+e.map(function(e){return"_["+(t?n(e):f(e).map(n).join("]["))+"]"}).join("+'|'+")+";"):function(){return""};return c(r,e,"key")},e.merge=function(e,t,n,r){var i=t.length,a=n.length;if(!a)return t;if(!i)return n;for(var o=r||new t.constructor(i+a),s=0,l=0,c=0;s<i&&l<a;++c)o[c]=e(t[s],n[l])>0?n[l++]:t[s++];for(;s<i;++s,++c)o[c]=t[s];for(;l<a;++l,++c)o[c]=n[l];return o},e.pad=function(e,t,n,r){var i=n||" ",a=e+"",o=t-a.length;return o<=0?a:"left"===r?D(i,o)+a:"center"===r?D(i,~~(o/2))+a+D(i,Math.ceil(o/2)):a+D(i,o)},e.peek=x,e.repeat=D,e.splitAccessPath=f,e.stringValue=n,e.toBoolean=function(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e||!e)},e.toDate=function(e,t){return t=t||function(e){return k(e)?e:P(e)?e:Date.parse(e)},null==e||""===e?null:t(e)},e.toNumber=w,e.toString=function(e){return null==e||""===e?null:e+""},e.toSet=function(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=1;return t},e.truncate=function(e,t,n,r){var i=null!=r?r:"…",a=e+"",o=a.length,s=Math.max(0,t-i.length);return o<=t?a:"left"===n?i+a.slice(o-s):"center"===n?a.slice(0,Math.ceil(s/2))+i+a.slice(o-~~(s/2)):a.slice(0,s)+i},e.visitArray=function(e,t,n){if(e){var r,i=0,a=e.length;if(t)for(;i<a;++i)(r=t(e[i]))&&n(r,i,e);else e.forEach(n)}},Object.defineProperty(e,"__esModule",{value:!0})})},{}],11:[function(e,t,n){t.exports={name:"vega-lite",author:'Jeffrey Heer, Dominik Moritz, Kanit "Ham" Wongsuphasawat',version:"2.0.4",collaborators:["Kanit Wongsuphasawat <kanitw@gmail.com> (http://kanitw.yellowpigz.com)","Dominik Moritz <domoritz@cs.washington.edu> (https://www.domoritz.de)","Jeffrey Heer <jheer@uw.edu> (http://jheer.org)"],homepage:"https://vega.github.io/vega-lite/",description:"Vega-lite provides a higher-level grammar for visual analysis, comparable to ggplot or Tableau, that generates complete Vega specifications.",main:"build/src/index.js",types:"typings/vega-lite.d.ts",bin:{vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},directories:{test:"test"},scripts:{pretsc:"mkdir -p build && rm -rf build/*/** && cp package.json build/",tsc:"tsc",prebuild:"mkdir -p build/site build/test-gallery",build:"npm run build:only","build:only":"npm run tsc && cp package.json build && browserify src/index.ts -p tsify -d -s vl | exorcist build/vega-lite.js.map > build/vega-lite.js",postbuild:"node node_modules/uglify-js/bin/uglifyjs 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 data && npm run build:only && npm run build:examples-only","build:examples-only":"npm run build:example && npm run build:examples-normalized","build:examples-normalized":"rm -f examples/specs/normalized/*.vl.json && scripts/build-normalized-examples","build:example":"TZ=America/Los_Angeles scripts/build-examples.sh","build:toc":"bundle exec jekyll build -q && scripts/generate-toc","build:site":"browserify site/static/main.ts -p [tsify -p site] -d | exorcist build/site/main.js.map > build/site/main.js","build:versions":"scripts/update-version.sh","build:test-gallery":"browserify test-gallery/main.ts -p [tsify -p test-gallery] -d > build/test-gallery/main.js","check:examples":"scripts/check-examples.sh","check:schema":"scripts/check-schema.sh",clean:"rm -rf build && rm -f vega-lite.* & find -E src test site examples -regex '.*\\.(js|js.map|d.ts)' -delete && rm -f examples/compiled/*.png && find site/examples ! -name 'index.md' -type f -exec rm -f {} +",data:"rsync -r node_modules/vega-datasets/data/* data",link:"npm link && npm link vega-lite",deploy:"scripts/deploy.sh","deploy:gh":"scripts/deploy-gh.sh","deploy:schema":"scripts/deploy-schema.sh",prestart:"npm run data && npm run build && scripts/index-examples",start:"nodemon -x 'npm run build:test-gallery' & browser-sync start --server --files 'build/test-gallery/main.js' --index 'test-gallery/index.html'",poststart:"rm examples/all-examples.json",preschema:"npm run prebuild",schema:"ts-json-schema-generator --path tsconfig.json --type TopLevelExtendedSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/",renameschema:"scripts/rename-schema.sh",presite:"npm run prebuild && 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",lint:"tslint -p .",test:"npm run build:only && npm run test:only && npm run test:runtime && npm run lint",posttest:"npm run schema && npm run data && npm run mocha:examples","test:nocompile":"npm run test:only && npm run test:runtime && npm run lint && npm run mocha:examples","test:only":"nyc --reporter=html --reporter=text-summary npm run mocha:test","test:runtime":"TZ=America/Los_Angeles wdio wdio.conf.js","test:runtime:generate":"rm -Rf test-runtime/resources && VL_GENERATE_TESTS=true npm run test:runtime","test:debug":"npm run tsc && mocha --recursive --debug-brk --inspect build/test","test:debug-examples":"npm run tsc && npm run schema && mocha --recursive --debug-brk --inspect build/examples","mocha:test":"mocha --require source-map-support/register --reporter dot --recursive build/test","mocha:examples":"mocha --require source-map-support/register --reporter dot --recursive build/examples",codecov:"nyc report --reporter=json && codecov -f coverage/*.json","watch:build":"watchify src/index.ts -p tsify -v -d -s vl -o 'exorcist build/vega-lite.js.map > build/vega-lite.js'","watch:tsc":"npm run tsc -- -w","watch:test":"nodemon -x 'npm test'",watch:"nodemon -x 'npm run build && npm run test:nocompile' # already ran schema in build"},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.0.6","@types/d3":"^4.12.0","@types/highlight.js":"^9.12.2","@types/json-stable-stringify":"^1.0.32","@types/mkdirp":"^0.5.1","@types/mocha":"^2.2.44","@types/node":"^8.0.53","@types/webdriverio":"^4.8.6",ajv:"^5.5.0","browser-sync":"^2.18.13",browserify:"^14.5.0","browserify-shim":"^3.8.14",chai:"^4.1.2",cheerio:"^1.0.0-rc.2",chromedriver:"^2.33.2",codecov:"^3.0.0",d3:"^4.12.0",exorcist:"^1.0.0","highlight.js":"^9.12.0",mkdirp:"^0.5.1",mocha:"^4.0.1",nodemon:"^1.12.1",nyc:"^11.3.0","source-map-support":"^0.5.0","svg2png-many":"^0.0.7","ts-json-schema-generator":"^0.18.0","ts-node":"^3.3.0",tsify:"^3.0.3",tslint:"5.4.3","tslint-eslint-rules":"^4.1.1",typescript:"^2.6.2","uglify-js":"^3.2.0",vega:"^3.0.8","vega-datasets":"^1.11.0","vega-embed":"^3.0.0-rc7","vega-tooltip":"^0.4.4",watchify:"^3.9.0","wdio-chromedriver-service":"^0.1.1","wdio-dot-reporter":"0.0.9","wdio-mocha-framework":"^0.5.11","wdio-static-server-service":"^1.0.1",webdriverio:"^4.9.11","yaml-front-matter":"^3.4.0"},dependencies:{"json-stable-stringify":"^1.0.1",tslib:"^1.8.0","vega-event-selector":"^2.0.0","vega-util":"^1.6.2",yargs:"^10.0.3"}}},{}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./util"),i={values:1,count:1,valid:1,missing:1,distinct:1,sum:1,mean:1,average:1,variance:1,variancep:1,stdev:1,stdevp:1,median:1,q1:1,q3:1,ci0:1,ci1:1,min:1,max:1,argmin:1,argmax:1};n.AGGREGATE_OPS=r.flagKeys(i),n.isAggregateOp=function(e){return!!i[e]},n.COUNTING_OPS=["count","valid","missing","distinct"],n.isCountingAggregateOp=function(e){return e&&r.contains(n.COUNTING_OPS,e)},n.SUM_OPS=["count","sum","distinct","valid","missing"],n.SHARED_DOMAIN_OPS=["mean","average","median","q1","q3","min","max"],n.SHARED_DOMAIN_OP_INDEX=r.toSet(n.SHARED_DOMAIN_OPS)},{"./util":118}],13:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./util");n.AXIS_PROPERTY_TYPE={grid:"grid",labelOverlap:"main",offset:"main",title:"main"};var a={orient:1,domain:1,format:1,grid:1,labelBound:1,labelFlush:1,labelPadding:1,labels:1,labelOverlap:1,maxExtent:1,minExtent:1,offset:1,position:1,tickCount:1,ticks:1,tickSize:1,title:1,titlePadding:1,values:1,zindex:1},o=r({},a,{encoding:1,labelAngle:1,titleMaxLength:1}),s=r({scale:1},a,{gridScale:1,encode:1});n.isAxisProperty=function(e){return!!o[e]},n.VG_AXIS_PROPERTIES=i.flagKeys(s),n.AXIS_PROPERTIES=i.flagKeys(o)},{"./util":118}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./channel"),i=e("./util");n.binToString=function(e){return i.isBoolean(e)?"bin":"bin"+i.keys(e).map(function(t){return("_"+t+"_"+e[t]).replace(",","_")}).join("")},n.autoMaxBins=function(e){switch(e){case r.ROW:case r.COLUMN:case r.SIZE:case r.COLOR:case r.OPACITY:case r.SHAPE:return 6;default:return 10}}},{"./channel":15,"./util":118}],15:[function(e,t,n){"use strict";function r(e){switch(e){case n.X:case n.Y:case n.COLOR:case n.DETAIL:case n.TOOLTIP:case n.ORDER:case n.OPACITY:case n.ROW:case n.COLUMN:return{point:!0,tick:!0,rule:!0,circle:!0,square:!0,bar:!0,rect:!0,line:!0,area:!0,text:!0};case n.X2:case n.Y2:return{rule:!0,bar:!0,rect:!0,area:!0};case n.SIZE:return{point:!0,tick:!0,rule:!0,circle:!0,square:!0,bar:!0,text:!0,line:!0};case n.SHAPE:return{point:!0};case n.TEXT:return{text:!0}}}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var o,s=e("./util");!function(e){e.ROW="row",e.COLUMN="column",e.X="x",e.Y="y",e.X2="x2",e.Y2="y2",e.COLOR="color",e.SHAPE="shape",e.SIZE="size",e.OPACITY="opacity",e.TEXT="text",e.ORDER="order",e.DETAIL="detail",e.TOOLTIP="tooltip"}(o=n.Channel||(n.Channel={})),n.X=o.X,n.Y=o.Y,n.X2=o.X2,n.Y2=o.Y2,n.ROW=o.ROW,n.COLUMN=o.COLUMN,n.SHAPE=o.SHAPE,n.SIZE=o.SIZE,n.COLOR=o.COLOR,n.TEXT=o.TEXT,n.DETAIL=o.DETAIL,n.ORDER=o.ORDER,n.OPACITY=o.OPACITY,n.TOOLTIP=o.TOOLTIP;var l={x:1,y:1,x2:1,y2:1,size:1,shape:1,color:1,order:1,opacity:1,text:1,detail:1,tooltip:1},c=i({},l,{row:1,column:1});n.CHANNELS=s.flagKeys(c);c.order,c.detail;var u=a(c,["order","detail"]);n.SINGLE_DEF_CHANNELS=s.flagKeys(u),n.isChannel=function(e){return!!c[e]},n.UNIT_CHANNELS=s.flagKeys(l);var f=a(l,["x","y","x2","y2"]);n.NONPOSITION_CHANNELS=s.flagKeys(f);var d={x:1,y:1};n.POSITION_SCALE_CHANNELS=s.flagKeys(d);f.text,f.tooltip,f.detail,f.order;var p=a(f,["text","tooltip","detail","order"]);n.NONPOSITION_SCALE_CHANNELS=s.flagKeys(p);var m=i({},d,p);n.SCALE_CHANNELS=s.flagKeys(m),n.isScaleChannel=function(e){return!!m[e]},n.supportMark=function(e,t){return t in r(e)},n.getSupportedMark=r,n.rangeType=function(e){switch(e){case n.X:case n.Y:case n.SIZE:case n.OPACITY:case n.X2:case n.Y2:return"continuous";case n.ROW:case n.COLUMN:case n.SHAPE:case n.TEXT:case n.TOOLTIP:return"discrete";case n.COLOR:return"flexible";case n.DETAIL:case n.ORDER:return}throw new Error("getSupportedRole not implemented for "+e)}},{"./util":118}],16:[function(e,t,n){"use strict";function r(e){return function(t,n){return n[e]&&t.push(n[e].combine()),t}}Object.defineProperty(n,"__esModule",{value:!0});var i=r("main"),a=r("grid");n.assembleAxes=function(e){return[].concat(e.x?[].concat(e.x.reduce(i,[]),e.x.reduce(a,[])):[],e.y?[].concat(e.y.reduce(i,[]),e.y.reduce(a,[])):[])}},{}],17:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(e("../split").Split);n.AxisComponentPart=i},{"../split":89}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getAxisConfig=function(e,t,n,r,i){void 0===r&&(r="");for(var a=0,o=("band"===i?["axisBand"]:[]).concat(["x"===n?"axisX":"axisY","axis"+r.substr(0,1).toUpperCase()+r.substr(1),"axis"]);a<o.length;a++){var s=o[a];if(t[s]&&void 0!==t[s][e])return t[s][e]}}},{}],19:[function(e,t,n){"use strict";function r(e,t,n){return void 0!==e.labelAngle?(e.labelAngle%360+360)%360:t===o.X&&u.contains([c.NOMINAL,c.ORDINAL],n.type)?270:void 0}function i(e,t){if(e>0){if(e%360>180)return"top"===t?"left":"right";if(e%360<180)return"top"===t?"right":"left"}else if(e<0)return i(e%360+360,t)}var a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../channel"),s=e("../../fielddef"),l=e("../../scale"),c=e("../../type"),u=e("../../util"),f=e("../common"),d=e("./config");n.labels=function(e,t,n,o){var c=e.fieldDef(t)||("x"===t?e.fieldDef("x2"):"y"===t?e.fieldDef("y2"):void 0),p=e.axis(t),m=e.config,g={};if(s.isTimeFieldDef(c)){var h=e.getScaleComponent(t).get("type")===l.ScaleType.UTC;g.text={signal:f.timeFormatExpression("datum.value",c.timeUnit,p.format,m.axis.shortTimeLabels,m.timeFormat,h)}}var v=d.getAxisConfig("labelAngle",e.config,t,o,e.getScaleComponent(t).get("type"));if(void 0===v&&(v=r(p,t,c))&&(g.angle={value:v}),void 0!==v&&"x"===t){var y=i(v,o);y&&(g.align={value:y}),u.contains([90,270],v)&&(g.baseline={value:"middle"})}return g=a({},g,n),0===u.keys(g).length?void 0:g},n.labelAngle=r,n.labelAlign=i},{"../../channel":15,"../../fielddef":100,"../../scale":108,"../../type":117,"../../util":118,"../common":24,"./config":18}],20:[function(e,t,n){"use strict";function r(e,t){for(var n=function(n){var r=g.mergeValuesWithExplicit(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",function(e,t){switch(n){case"title":return p.titleMerger(e,t);case"gridScale":return{explicit:e.explicit,value:e.value||t.value}}return g.defaultTieBreaker(e,t,n,"axis")});e.setWithExplicit(n,r)},r=0,i=u.VG_AXIS_PROPERTIES;r<i.length;r++){n(i[r])}return e}function i(e){return d.some(_,function(t){return a(e,t)})}function a(e,t){return"axis"===t||("grid"===t||"title"===t?!!e.get(t):!function(e){return!1===e||null===e}(e.get(t)))}function o(e,t){return l(e,t,!0)}function s(e,t){return l(e,t,!1)}function l(e,t,n){var r=t.axis(e),i=new h.AxisComponentPart;u.VG_AXIS_PROPERTIES.forEach(function(a){var o=function(e,t,n,r,i){var a=r.fieldDef(n);if(i&&"main"===u.AXIS_PROPERTY_TYPE[e]||!i&&"grid"===u.AXIS_PROPERTY_TYPE[e])return;switch(e){case"scale":return r.scaleName(n);case"gridScale":return b.gridScale(r,n,i);case"domain":return b.domain(e,t,i,n);case"format":return p.numberFormat(a,t.format,r.config);case"grid":o=r.getScaleComponent(n).get("type");return p.getSpecifiedOrDefaultValue(t.grid,b.grid(o,a));case"labels":return!i&&t.labels;case"labelFlush":return b.labelFlush(a,n,t,i);case"labelOverlap":o=r.getScaleComponent(n).get("type");return b.labelOverlap(a,t,n,o);case"minExtent":return b.minMaxExtent(t.minExtent,i);case"maxExtent":return b.minMaxExtent(t.maxExtent,i);case"orient":return p.getSpecifiedOrDefaultValue(t.orient,b.orient(n));case"tickCount":var o=r.getScaleComponent(n).get("type"),s="x"===n?"width":"y"===n?"height":void 0,l=s?r.getSizeSignalRef(s):void 0;return p.getSpecifiedOrDefaultValue(t.tickCount,b.tickCount(n,a,o,l));case"ticks":return b.ticks(e,t,i,n);case"title":return p.getSpecifiedOrDefaultValue(t.title,b.title(t.titleMaxLength,a,r.config));case"values":return b.values(t,r,a);case"zindex":return p.getSpecifiedOrDefaultValue(t.zindex,b.zindex(i))}return u.isAxisProperty(e)?t[e]:void 0}(a,r,e,t,n);if(void 0!==o){var s="values"===a?!!r.values:"encode"===a?!!r.encoding||!!r.labelAngle:o===r[a],l=v.getAxisConfig(a,t.config,e,i.get("orient"),t.getScaleComponent(e).get("type"));(s||void 0===l||n)&&i.set(a,o,s)}});var o=r.encoding||{},s=_.reduce(function(n,r){if(!a(i,r))return n;var s="labels"===r?y.labels(t,e,o.labels||{},i.get("orient")):o[r]||{};return void 0!==s&&d.keys(s).length>0&&(n[r]={update:s}),n},{});return d.keys(s).length>0&&i.set("encode",s,!!r.encoding||!!r.labelAngle),i}var c=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var u=e("../../axis"),f=e("../../channel"),d=e("../../util"),p=e("../common"),m=e("../resolve"),g=e("../split"),h=e("./component"),v=e("./config"),y=e("./encode"),b=e("./properties"),_=["domain","grid","labels","ticks","title"];n.parseUnitAxis=function(e){return f.POSITION_SCALE_CHANNELS.reduce(function(t,n){if(e.axis(n)){var r={},a=s(n,e);a&&i(a)&&(r.main=a);var l=o(n,e);l&&i(l)&&(r.grid=l),t[n]=[r]}return t},{})};var O={bottom:"top",top:"bottom",left:"right",right:"left"};n.parseLayerAxis=function(e){for(var t=e.component,n=t.axes,i=t.resolve,a={top:0,bottom:0,right:0,left:0},o=0,s=e.children;o<s.length;o++){(y=s[o]).parseAxisAndHeader();for(var l=0,u=d.keys(y.component.axes);l<u.length;l++)g=u[l],i.axis[g]=m.parseGuideResolve(e.component.resolve,g),"shared"===i.axis[g]&&(n[g]=function(e,t){if(!e)return t.map(function(e){return c({},e.main?{main:e.main.clone()}:{},e.grid?{grid:e.grid.clone()}:{})});if(e.length===t.length){for(var n=e.length,i=0;i<n;i++){var a=e[i].main,o=t[i].main;if(!!a!=!!o)return;if(a&&o){var s=a.getWithExplicit("orient"),l=o.getWithExplicit("orient");if(s.explicit&&l.explicit&&s.value!==l.value)return;e[i].main=r(a,o)}var u=e[i].grid,f=t[i].grid;if(!!u!=!!f)return;u&&f&&(e[i].grid=r(u,f))}return e}}(n[g],y.component.axes[g]),n[g]||(i.axis[g]="independent",delete n[g]))}for(var f=0,p=["x","y"];f<p.length;f++)for(var g=p[f],h=0,v=e.children;h<v.length;h++){var y=v[h];if(y.component.axes[g]){if("independent"===i.axis[g]){n[g]=(n[g]||[]).concat(y.component.axes[g]);for(var b=0,_=y.component.axes[g];b<_.length;b++){var S=_[b],x=S.main.getWithExplicit("orient"),w=x.value,E=x.explicit;if(a[w]>0&&!E){var N=O[w];a[w]>a[N]&&S.main.set("orient",N,!1)}a[w]++}}delete y.component.axes[g]}}},n.parseGridAxis=o,n.parseMainAxis=s},{"../../axis":13,"../../channel":15,"../../util":118,"../common":24,"../resolve":69,"../split":89,"./component":17,"./config":18,"./encode":19,"./properties":21}],21:[function(e,t,n){"use strict";function r(e,t,n,r){return!n&&t[e]}Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../bin"),a=e("../../channel"),o=e("../../datetime"),s=e("../../fielddef"),l=e("../../log"),c=e("../../scale"),u=e("../../type"),f=e("../../util");n.domainAndTicks=r,n.domain=r,n.ticks=r,n.grid=function(e,t){return!c.hasDiscreteDomain(e)&&!t.bin},n.gridScale=function(e,t,n){if(n){var r="x"===t?"y":"x";if(e.getScaleComponent(r))return e.scaleName(r)}},n.labelFlush=function(e,t,n,r){if(!r)return void 0!==n.labelFlush?n.labelFlush:!("x"!==t||!f.contains(["quantitative","temporal"],e.type))||void 0},n.labelOverlap=function(e,t,n,r){return void 0!==t.labelOverlap?t.labelOverlap:"nominal"!==e.type?"log"!==r||"greedy":void 0},n.minMaxExtent=function(e,t){return t?0:e},n.orient=function(e){switch(e){case a.X:return"bottom";case a.Y:return"left"}throw new Error(l.message.INVALID_CHANNEL_FOR_AXIS)},n.tickCount=function(e,t,n,r){if(!c.hasDiscreteDomain(n)&&"log"!==n&&!f.contains(["month","hours","day","quarter"],t.timeUnit))return t.bin?{signal:"ceil("+r.signal+"/20)"}:{signal:"ceil("+r.signal+"/40)"}},n.title=function(e,t,n){var r=s.title(t,n);return e?f.truncate(r,e):r},n.values=function(e,t,n){var r=e.values;if(e.values&&o.isDateTime(r[0]))return r.map(function(e){return{signal:o.dateTimeExpr(e,!0)}});if(!r&&n.bin&&n.type===u.QUANTITATIVE){var a=t.getName(i.binToString(n.bin)+"_"+n.field+"_bins");return{signal:"sequence("+a+".start, "+a+".stop + "+a+".step, "+a+".step)"}}return r},n.zindex=function(e){return e?0:1}},{"../../bin":14,"../../channel":15,"../../datetime":97,"../../fielddef":100,"../../log":105,"../../scale":108,"../../type":117,"../../util":118}],22:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../util"),o=e("./data/parse"),s=e("./layoutsize/assemble"),l=function(e){function t(t,n,r,i,a){return e.call(this,t,n,r,i,a)||this}return r(t,e),t.prototype.parseData=function(){this.component.data=o.parseData(this),this.children.forEach(function(e){e.parseData()})},t.prototype.parseSelection=function(){var e=this;this.component.selection={};for(var t=function(t){t.parseSelection(),a.keys(t.component.selection).forEach(function(n){e.component.selection[n]=t.component.selection[n]})},n=0,r=this.children;n<r.length;n++){t(r[n])}},t.prototype.parseMarkGroup=function(){for(var e=0,t=this.children;e<t.length;e++){t[e].parseMarkGroup()}},t.prototype.parseAxisAndHeader=function(){for(var e=0,t=this.children;e<t.length;e++){t[e].parseAxisAndHeader()}},t.prototype.assembleSelectionTopLevelSignals=function(e){return this.children.reduce(function(e,t){return t.assembleSelectionTopLevelSignals(e)},e)},t.prototype.assembleSelectionSignals=function(){return this.children.forEach(function(e){return e.assembleSelectionSignals()}),[]},t.prototype.assembleLayoutSignals=function(){return this.children.reduce(function(e,t){return e.concat(t.assembleLayoutSignals())},s.assembleLayoutSignals(this))},t.prototype.assembleSelectionData=function(e){return this.children.reduce(function(e,t){return t.assembleSelectionData(e)},[])},t.prototype.assembleMarks=function(){return this.children.map(function(e){var t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleLayoutSize();return i({type:"group",name:e.getName("group")},t?{title:t}:{},n?{style:n}:{},r?{encode:{update:r}}:{},e.assembleGroup())})},t}(e("./model").Model);n.BaseConcatModel=l},{"../util":118,"./data/parse":40,"./layoutsize/assemble":47,"./model":66}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../log"),i=e("../spec"),a=e("./concat"),o=e("./facet"),s=e("./layer"),l=e("./repeat"),c=e("./unit");n.buildModel=function(e,t,n,u,f,d,p){if(i.isFacetSpec(e))return new o.FacetModel(e,t,n,f,d);if(i.isLayerSpec(e))return new s.LayerModel(e,t,n,u,f,d,p);if(i.isUnitSpec(e))return new c.UnitModel(e,t,n,u,f,d,p);if(i.isRepeatSpec(e))return new l.RepeatModel(e,t,n,f,d);if(i.isConcatSpec(e))return new a.ConcatModel(e,t,n,f,d);throw new Error(r.message.INVALID_SPEC)}},{"../log":105,"../spec":111,"./concat":26,"./facet":44,"./layer":45,"./repeat":67,"./unit":90}],24:[function(e,t,n){"use strict";function r(e){return[].concat(e.type,e.style||[])}function i(e,t,n){var i=n.mark[e],a=n[t.type];void 0!==a[e]&&(i=a[e]);for(var o=0,s=r(t);o<s.length;o++){var l=s[o],c=n.style[l],u=e;c&&void 0!==c[u]&&(i=c[u])}return i}function a(e,t,n){if(e.type===m.QUANTITATIVE)return t||n.numberFormat}function o(e,t){return"format("+e+', "'+(t||"")+'")'}function s(e,t,n){return o(e,t||n.numberFormat)}function l(e,t,n,r){return e+" === null || isNaN("+e+') ? "null" : '+s(e,n,r)+' + " - " + '+s(t,n,r)}function c(e,t,n,r,i,a){if(!t||n){var o=n||i;return a?"utcFormat("+e+", '"+o+"')":"timeFormat("+e+", '"+o+"')"}return p.formatExpression(t,e,r,a)}Object.defineProperty(n,"__esModule",{value:!0});var u=e("../channel"),f=e("../fielddef"),d=e("../scale"),p=e("../timeunit"),m=e("../type"),g=e("../util");n.applyConfig=function(e,t,n){for(var r=0,i=n;r<i.length;r++){var a=i[r],o=t[a];void 0!==o&&(e[a]={value:o})}return e},n.applyMarkConfig=function(e,t,n){for(var r=0,a=n;r<a.length;r++){var o=a[r],s=i(o,t.markDef,t.config);void 0!==s&&(e[o]={value:s})}return e},n.getStyles=r,n.getMarkConfig=i,n.formatSignalRef=function(e,t,n,r){var i=a(e,t,r);if(e.bin)return{signal:l(f.field(e,{expr:n}),f.field(e,{expr:n,binSuffix:"end"}),i,r)};if("quantitative"===e.type)return{signal:""+o(f.field(e,{expr:n}),i)};if(f.isTimeFieldDef(e)){var s=f.isScaleFieldDef(e)&&e.scale&&e.scale.type===d.ScaleType.UTC;return{signal:c(f.field(e,{expr:n}),e.timeUnit,t,r.text.shortTimeLabels,r.timeFormat,s)}}return{signal:"''+"+f.field(e,{expr:n})}},n.getSpecifiedOrDefaultValue=function(e,t){return void 0!==e?e:t},n.numberFormat=a,n.numberFormatExpr=s,n.binFormatExpression=l,n.timeFormatExpression=c,n.sortParams=function(e,t){return(g.isArray(e)?e:[e]).reduce(function(e,n){return e.field.push(f.field(n,t)),e.order.push(n.sort||"ascending"),e},{field:[],order:[]})},n.titleMerger=function(e,t){return{explicit:e.explicit,value:e.value===t.value?e.value:e.value+", "+t.value}},n.binRequiresRange=function(e,t){return e.bin?u.isScaleChannel(t)&&g.contains(["ordinal","nominal"],e.type):(console.warn("Only use this method with binned field defs"),!1)}},{"../channel":15,"../fielddef":100,"../scale":108,"../timeunit":113,"../type":117,"../util":118}],25:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../config"),a=e("../fielddef"),o=e("../log"),s=e("../spec"),l=e("../toplevelprops"),c=e("../util"),u=e("./buildmodel"),f=e("./data/assemble"),d=e("./data/optimize");n.compile=function(e,t){void 0===t&&(t={}),t.logger&&o.set(t.logger),t.fieldTitle&&a.setTitleFormatter(t.fieldTitle);try{var n=i.initConfig(c.mergeDeep({},t.config,e.config)),p=s.normalize(e,n),m=l.normalizeAutoSize(e.autosize,n.autosize,s.isLayerSpec(p)||s.isUnitSpec(p)),g=u.buildModel(p,null,"",void 0,void 0,n,"fit"===m.type);return g.parse(),d.optimizeDataflow(g.component.data),function(e,t){var n=e.config?i.stripAndRedirectConfig(e.config):void 0,a=e.assembleTitle(),o=e.assembleGroupStyle(),s=e.assembleLayoutSignals();return s=s.filter(function(e){return"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)}),{spec:r({$schema:"https://vega.github.io/schema/vega/v3.0.json"},e.description?{description:e.description}:{},t,a?{title:a}:{},o?{style:o}:{},{data:[].concat(e.assembleSelectionData([]),f.assembleRootData(e.component.data))},e.assembleGroup(s.concat(e.assembleSelectionTopLevelSignals([]))),n?{config:n}:{})}}(g,function(e,t,n){return r({autosize:1===c.keys(n).length&&n.type?n.type:n},l.extractTopLevelProperties(t),l.extractTopLevelProperties(e))}(e,n,m))}finally{t.logger&&o.reset(),t.fieldTitle&&a.resetTitleFormatter()}}},{"../config":95,"../fielddef":100,"../log":105,"../spec":111,"../toplevelprops":115,"../util":118,"./buildmodel":23,"./data/assemble":28,"./data/optimize":38}],26:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../log"),o=e("../spec"),s=e("./baseconcat"),l=e("./buildmodel"),c=e("./layoutsize/parse"),u=function(e){function t(t,n,r,i,s){var c=e.call(this,t,n,r,s,t.resolve)||this;return c.type="concat",t.resolve&&t.resolve.axis&&("shared"===t.resolve.axis.x||"shared"===t.resolve.axis.y)&&a.warn(a.message.CONCAT_CANNOT_SHARE_AXIS),c.isVConcat=o.isVConcatSpec(t),c.children=(o.isVConcatSpec(t)?t.vconcat:t.hconcat).map(function(e,t){return l.buildModel(e,c,c.getName("concat_"+t),void 0,i,s,!1)}),c}return r(t,e),t.prototype.parseLayoutSize=function(){c.parseConcatLayoutSize(this)},t.prototype.parseAxisGroup=function(){return null},t.prototype.assembleLayout=function(){return i({padding:{row:10,column:10},offset:10},this.isVConcat?{columns:1}:{},{bounds:"full",align:"each"})},t}(s.BaseConcatModel);n.ConcatModel=u},{"../log":105,"../spec":111,"./baseconcat":22,"./buildmodel":23,"./layoutsize/parse":48}],27:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../channel"),o=e("../../fielddef"),s=e("../../log"),l=e("../../util"),c=e("../common"),u=function(e){function t(t,n){var r=e.call(this)||this;return r.dimensions=t,r.measures=n,r}return r(t,e),t.prototype.clone=function(){return new t(i({},this.dimensions),l.duplicate(this.measures))},t.makeFromEncoding=function(e){var n=!1;e.forEachFieldDef(function(e){e.aggregate&&(n=!0)});var r={},i={};return n?(e.forEachFieldDef(function(t,n){t.aggregate?"count"===t.aggregate?(r["*"]=r["*"]||{},r["*"].count=o.field(t,{aggregate:"count"})):(r[t.field]=r[t.field]||{},r[t.field][t.aggregate]=o.field(t),a.isScaleChannel(n)&&"unaggregated"===e.scaleDomain(n)&&(r[t.field].min=o.field(t,{aggregate:"min"}),r[t.field].max=o.field(t,{aggregate:"max"}))):function(e,t,n){n.bin?(e[o.field(n,{})]=!0,e[o.field(n,{binSuffix:"end"})]=!0,c.binRequiresRange(n,t)&&(e[o.field(n,{binSuffix:"range"})]=!0)):e[o.field(n)]=!0}(i,n,t)}),l.keys(i).length+l.keys(r).length===0?null:new t(i,r)):null},t.makeFromTransform=function(e){for(var n={},r={},i=0,a=e.aggregate;i<a.length;i++){(u=a[i]).op&&("count"===u.op?(r["*"]=r["*"]||{},r["*"].count=u.as||o.field(u)):(r[u.field]=r[u.field]||{},r[u.field][u.op]=u.as||o.field(u)))}for(var s=0,c=e.groupby;s<c.length;s++){var u=c[s];n[u]=!0}return l.keys(n).length+l.keys(r).length===0?null:new t(n,r)},t.prototype.merge=function(e){l.differ(this.dimensions,e.dimensions)?s.debug("different dimensions, cannot merge"):(!function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];for(var i in r)r.hasOwnProperty(i)&&(n in e?e[n][i]=r[i]:e[n]={op:r[i]})}}(this.measures,e.measures),e.remove())},t.prototype.addDimensions=function(e){var t=this;e.forEach(function(e){return t.dimensions[e]=!0})},t.prototype.dependentFields=function(){var e={};return l.keys(this.dimensions).forEach(function(t){return e[t]=!0}),l.keys(this.measures).forEach(function(t){return e[t]=!0}),e},t.prototype.producedFields=function(){var e=this,t={};return l.keys(this.measures).forEach(function(n){l.keys(e.measures[n]).forEach(function(e){t[e+"_"+n]=!0})}),t},t.prototype.assemble=function(){for(var e=[],t=[],n=[],r=0,i=l.keys(this.measures);r<i.length;r++)for(var a=i[r],o=0,s=l.keys(this.measures[a]);o<s.length;o++){var c=s[o];n.push(this.measures[a][c]),e.push(c),t.push(a)}return{type:"aggregate",groupby:l.keys(this.dimensions),ops:e,fields:t,as:n}},t}(e("./dataflow").DataFlowNode);n.AggregateNode=u},{"../../channel":15,"../../fielddef":100,"../../log":105,"../../util":118,"../common":24,"./dataflow":31}],28:[function(e,t,n){"use strict";function r(e){function t(r,o){if(r instanceof v.SourceNode&&!a.isUrlData(r.data)){e.push(o);o=_={name:null,source:o.name,transform:[]}}if(r instanceof m.ParseNode&&(r.parent instanceof v.SourceNode&&!o.source?o.format=i({},o.format||{},{parse:r.assembleFormatParse()}):o.transform=o.transform.concat(r.assembleTransforms())),r instanceof f.FacetNode)return o.name||(o.name="data_"+n++),!o.source||o.transform.length>0?(e.push(o),r.data=o.name):r.data=o.source,void r.assemble().forEach(function(t){return e.push(t)});if((r instanceof d.FilterNode||r instanceof c.CalculateNode||r instanceof s.AggregateNode||r instanceof h.LookupNode||r instanceof g.IdentifierNode)&&o.transform.push(r.assemble()),(r instanceof p.FilterInvalidNode||r instanceof l.BinNode||r instanceof b.TimeUnitNode||r instanceof y.StackNode)&&(o.transform=o.transform.concat(r.assemble())),r instanceof s.AggregateNode&&(o.name||(o.name="data_"+n++)),r instanceof u.OutputNode)if(o.source&&0===o.transform.length)r.setSource(o.source);else if(r.parent instanceof u.OutputNode)r.setSource(o.name);else if(o.name||(o.name="data_"+n++),r.setSource(o.name),1===r.numChildren()){e.push(o);var _={name:null,source:o.name,transform:[]};o=_}switch(r.numChildren()){case 0:r instanceof u.OutputNode&&(!o.source||o.transform.length>0)&&e.push(o);break;case 1:t(r.children[0],o);break;default:o.name||(o.name="data_"+n++);var O=o.name;!o.source||o.transform.length>0?e.push(o):O=o.source,r.children.forEach(function(e){t(e,{name:null,source:O,transform:[]})})}}var n=0;return t}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../data"),o=e("../../util"),s=e("./aggregate"),l=e("./bin"),c=e("./calculate"),u=e("./dataflow"),f=e("./facet"),d=e("./filter"),p=e("./filterinvalid"),m=e("./formatparse"),g=e("./indentifier"),h=e("./lookup"),v=e("./source"),y=e("./stack"),b=e("./timeunit");n.assembleFacetData=function(e){var t=[],n=r(t);return e.children.forEach(function(t){return n(t,{source:e.name,name:null,transform:[]})}),t},n.assembleRootData=function(e){var t=o.vals(e.sources),n=[],i=r(n),a=0;t.forEach(function(e){e.hasName()||(e.dataName="source_"+a++);var t=e.assemble();i(e,t)}),n.forEach(function(e){0===e.transform.length&&delete e.transform}),n.sort(function(e,t){return 0===(e.transform||[]).length?-1:0===(t.transform||[]).length?1:0});for(var s=0,l=n;s<l.length;s++)for(var c=0,u=l[s].transform||[];c<u.length;c++){var f=u[c];"lookup"===f.type&&(f.from=e.outputNodes[f.from].getSource())}return n}},{"../../data":96,"../../util":118,"./aggregate":27,"./bin":29,"./calculate":30,"./dataflow":31,"./facet":32,"./filter":33,"./filterinvalid":34,"./formatparse":35,"./indentifier":36,"./lookup":37,"./source":41,"./stack":42,"./timeunit":43}],29:[function(e,t,n){"use strict";function r(e,t){var n;n=function(e){return"as"in e}(e)?[e.as,e.as+"_end"]:[s.field(e,{}),s.field(e,{binSuffix:"end"})];var r=s.normalizeBin(e.bin,void 0)||{},i=function(e,t){return o.binToString(e)+"_"+t}(r,e.field),l=function(e,t){if(!!e.model){var n=e.model;return{signal:n.getName(t+"_bins"),extentSignal:n.getName(t+"_extent")}}return e}(t,i),c=l.signal,u=l.extentSignal;return{key:i,binComponent:a({bin:r,field:e.field,as:n},c?{signal:c}:{},u?{extentSignal:u}:{})}}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../bin"),s=e("../../fielddef"),l=e("../../util"),c=e("../common"),u=e("../model"),f=function(e){function t(t){var n=e.call(this)||this;return n.bins=t,n}return i(t,e),t.prototype.clone=function(){return new t(l.duplicate(this.bins))},t.makeBinFromEncoding=function(e){var n=e.reduceFieldDef(function(t,n,i){if(n.bin){var o=r(n,{model:e}),l=o.key,f=o.binComponent;t[l]=a({},f,t[l],function(e,t,n,r){if(c.binRequiresRange(t,n)){var i=u.isUnitModel(e)?e.axis(n)||e.legend(n)||{}:{},a=s.field(t,{expr:"datum"}),o=s.field(t,{expr:"datum",binSuffix:"end"});return{formulaAs:s.field(t,{binSuffix:"range"}),formula:c.binFormatExpression(a,o,i.format,r)}}return{}}(e,n,i,e.config))}return t},{});return 0===l.keys(n).length?null:new t(n)},t.makeFromTransform=function(e,n){var i=r(e,n),a=i.key,o=i.binComponent;return new t((s={},s[a]=o,s));var s},t.prototype.merge=function(e){this.bins=a({},this.bins,e.bins),e.remove()},t.prototype.producedFields=function(){var e={};return l.vals(this.bins).forEach(function(t){t.as.forEach(function(t){return e[t]=!0})}),e},t.prototype.dependentFields=function(){var e={};return l.vals(this.bins).forEach(function(t){e[t.field]=!0}),e},t.prototype.assemble=function(){return l.flatten(l.vals(this.bins).map(function(e){var t=[],n=a({type:"bin",field:e.field,as:e.as,signal:e.signal},e.bin);return!e.bin.extent&&e.extentSignal&&(t.push({type:"extent",field:e.field,signal:e.extentSignal}),n.extent={signal:e.extentSignal}),t.push(n),e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))},t}(e("./dataflow").DataFlowNode);n.BinNode=f},{"../../bin":14,"../../fielddef":100,"../../util":118,"../common":24,"../model":66,"./dataflow":31}],30:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../util"),a=function(e){function t(t){var n=e.call(this)||this;return n.transform=t,n}return r(t,e),t.prototype.clone=function(){return new t(i.duplicate(this.transform))},t.prototype.producedFields=function(){var e={};return e[this.transform.as]=!0,e},t.prototype.assemble=function(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}},t}(e("./dataflow").DataFlowNode);n.CalculateNode=a},{"../../util":118,"./dataflow":31}],31:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e){this.debugName=e,this._children=[],this._parent=null}return e.prototype.clone=function(){throw new Error("Cannot clone node")},e.prototype.producedFields=function(){return{}},e.prototype.dependentFields=function(){return{}},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(e){this._parent=e,e.addChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),e.prototype.numChildren=function(){return this._children.length},e.prototype.addChild=function(e){this._children.push(e)},e.prototype.removeChild=function(e){this._children.splice(this._children.indexOf(e),1)},e.prototype.remove=function(){for(var e=0,t=this._children;e<t.length;e++){t[e].parent=this._parent}this._parent.removeChild(this)},e.prototype.insertAsParentOf=function(e){var t=e.parent;t.removeChild(this),this.parent=t,e.parent=this},e.prototype.swapWithParent=function(){for(var e=this._parent,t=e.parent,n=0,r=this._children;n<r.length;n++){r[n].parent=e}this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this},e}();n.DataFlowNode=i;var a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type=n,i.refCounts=r,i._source=i._name=t,!i.refCounts||i._name in i.refCounts||(i.refCounts[i._name]=0),i}return r(t,e),t.prototype.clone=function(){var e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e},t.prototype.getSource=function(){return this.refCounts[this._name]++,this._source},t.prototype.isRequired=function(){return!!this.refCounts[this._name]},t.prototype.setSource=function(e){this._source=e},t}(i);n.OutputNode=a},{}],32:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../channel"),o=e("../../log"),s=e("../../scale"),l=e("../../vega.schema"),c=e("../scale/domain"),u=function(e){function t(t,n,r){var i=e.call(this)||this;return i.model=t,i.name=n,i.data=r,t.facet.column&&(i.columnFields=[t.field(a.COLUMN)],i.columnName=t.getName("column_domain"),t.fieldDef(a.COLUMN).bin&&i.columnFields.push(t.field(a.COLUMN,{binSuffix:"end"}))),t.facet.row&&(i.rowFields=[t.field(a.ROW)],i.rowName=t.getName("row_domain"),t.fieldDef(a.ROW).bin&&i.rowFields.push(t.field(a.ROW,{binSuffix:"end"}))),i.childModel=t.child,i}return r(t,e),Object.defineProperty(t.prototype,"fields",{get:function(){var e=[];return this.columnFields&&(e=e.concat(this.columnFields)),this.rowFields&&(e=e.concat(this.rowFields)),e},enumerable:!0,configurable:!0}),t.prototype.getSource=function(){return this.name},t.prototype.getChildIndependentFieldsWithStep=function(){for(var e={},t=0,n=["x","y"];t<n.length;t++){var r=n[t],i=this.childModel.component.scales[r];if(i&&!i.merged){var a=i.get("type"),u=i.get("range");if(s.hasDiscreteDomain(a)&&l.isVgRangeStep(u)){var f=c.assembleDomain(this.childModel,r),d=c.getFieldFromDomain(f);d?e[r]=d:o.warn("Unknown field for ${channel}.  Cannot calculate view size.")}}}return e},t.prototype.assembleRowColumnData=function(e,t,n){var r={},a="row"===e?"y":"x";return n[a]&&(r=t?{fields:["distinct_"+n[a]],ops:["max"],as:["distinct_"+n[a]]}:{fields:[n[a]],ops:["distinct"]}),{name:"row"===e?this.rowName:this.columnName,source:t||this.data,transform:[i({type:"aggregate",groupby:"row"===e?this.rowFields:this.columnFields},r)]}},t.prototype.assemble=function(){var e=[],t=null,n=this.getChildIndependentFieldsWithStep();if(this.columnName&&this.rowName&&(n.x||n.y)){t="cross_"+this.columnName+"_"+this.rowName;var r=[].concat(n.x?[n.x]:[],n.y?[n.y]:[]),i=r.map(function(){return"distinct"});e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.columnFields.concat(this.rowFields),fields:r,ops:i}]})}return this.columnName&&e.push(this.assembleRowColumnData("column",t,n)),this.rowName&&e.push(this.assembleRowColumnData("row",t,n)),e},t}(e("./dataflow").DataFlowNode);n.FacetNode=u},{"../../channel":15,"../../log":105,"../../scale":108,"../../vega.schema":120,"../scale/domain":72,"./dataflow":31}],33:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../filter"),a=e("../../util"),o=function(e){function t(t,n){var r=e.call(this)||this;return r.model=t,r.filter=n,r.expr=i.expression(r.model,r.filter,r),r}return r(t,e),t.prototype.clone=function(){return new t(this.model,a.duplicate(this.filter))},t.prototype.assemble=function(){return{type:"filter",expr:this.expr}},t}(e("./dataflow").DataFlowNode);n.FilterNode=o},{"../../filter":101,"../../util":118,"./dataflow":31}],34:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../channel"),o=e("../../fielddef"),s=e("../../scale"),l=e("../../util"),c=function(e){function t(t){var n=e.call(this)||this;return n.fieldDefs=t,n}return r(t,e),t.prototype.clone=function(){return new t(i({},this.fieldDefs))},t.make=function(e){if("filter"!==e.config.invalidValues)return null;var n=e.reduceFieldDef(function(t,n,r){var i=a.isScaleChannel(r)&&e.getScaleComponent(r);if(i){var o=i.get("type");s.hasContinuousDomain(o)&&!n.aggregate&&(t[n.field]=n)}return t},{});return l.keys(n).length?new t(n):null},Object.defineProperty(t.prototype,"filter",{get:function(){return this.fieldDefs},enumerable:!0,configurable:!0}),t.prototype.assemble=function(){var e=this,t=l.keys(this.filter).reduce(function(t,n){var r=e.fieldDefs[n],i=o.field(r,{expr:"datum"});return null!==r&&(t.push(i+" !== null"),t.push("!isNaN("+i+")")),t},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null},t}(e("./dataflow").DataFlowNode);n.FilterInvalidNode=c},{"../../channel":15,"../../fielddef":100,"../../scale":108,"../../util":118,"./dataflow":31}],35:[function(e,t,n){"use strict";function r(e,t){var n="datum"+d.accessPath(e);if("number"===t)return"toNumber("+n+")";if("boolean"===t)return"toBoolean("+n+")";if("string"===t)return"toString("+n+")";if("date"===t)return"toDate("+n+")";if(0===t.indexOf("date:")){return"timeParse("+n+","+(r=t.slice(5,t.length))+")"}if(0===t.indexOf("utc:")){var r=t.slice(4,t.length);return"utcParse("+n+","+r+")"}return c.warn(c.message.unrecognizedParse(t)),null}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../aggregate"),s=e("../../fielddef"),l=e("../../filter"),c=e("../../log"),u=e("../../logical"),f=e("../../transform"),d=e("../../util"),p=e("../model"),m=function(e){function t(t){var n=e.call(this)||this;return n._parse={},n._parse=t,n}return i(t,e),t.prototype.clone=function(){return new t(d.duplicate(this.parse))},t.make=function(e){var n={},r={};(e.transforms||[]).forEach(function(e){f.isCalculate(e)?r[e.as]=!0:f.isFilter(e)&&u.forEachLeave(e.filter,function(e){(l.isEqualFilter(e)||l.isRangeFilter(e)||l.isOneOfFilter(e))&&e.timeUnit&&(n[e.field]="date")})},{}),(p.isUnitModel(e)||p.isFacetModel(e))&&e.forEachFieldDef(function(e){if(s.isTimeFieldDef(e))n[e.field]="date";else if(s.isNumberFieldDef(e)){if(r[e.field]||o.isCountingAggregateOp(e.aggregate))return;n[e.field]="number"}});var i=e.data;if(i&&i.format&&i.format.parse){var a=i.format.parse;d.keys(a).forEach(function(e){n[e]=a[e]})}var m=e.component.data.ancestorParse;return d.keys(m).forEach(function(e){n[e]!==m[e]?c.warn(c.message.differentParse(e,n[e],m[e])):delete n[e]}),0===d.keys(n).length?null:new t(n)},Object.defineProperty(t.prototype,"parse",{get:function(){return this._parse},enumerable:!0,configurable:!0}),t.prototype.merge=function(e){this._parse=a({},this._parse,e.parse),e.remove()},t.prototype.assembleFormatParse=function(){return this._parse},t.prototype.producedFields=function(){return d.toSet(d.keys(this.parse))},t.prototype.dependentFields=function(){return d.toSet(d.keys(this.parse))},t.prototype.assembleTransforms=function(){var e=this;return d.keys(this._parse).map(function(t){var n=r(t,e._parse[t]);if(!n)return null;return{type:"formula",expr:n,as:t}}).filter(function(e){return null!==e})},t}(e("./dataflow").DataFlowNode);n.ParseNode=m},{"../../aggregate":12,"../../fielddef":100,"../../filter":101,"../../log":105,"../../logical":106,"../../transform":116,"../../util":118,"../model":66,"./dataflow":31}],36:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../selection"),a=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.clone=function(){return new t},t.prototype.producedFields=function(){return e={},e[i.SELECTION_ID]=!0,e;var e},t.prototype.assemble=function(){return{type:"identifier",as:i.SELECTION_ID}},t}(e("./dataflow").DataFlowNode);n.IdentifierNode=a},{"../../selection":109,"./dataflow":31}],37:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("vega-util"),o=e("../../log"),s=e("./dataflow"),l=e("./source"),c=function(e){function t(t,n){var r=e.call(this)||this;return r.transform=t,r.secondary=n,r}return r(t,e),t.make=function(e,n,r){var i=e.component.data.sources,a=new l.SourceNode(n.from.data),o=i[a.hash()];o||(i[a.hash()]=a,o=a);var c=e.getName("lookup_"+r),u=new s.OutputNode(c,"lookup",e.component.data.outputNodeRefCounts);return u.parent=o,e.component.data.outputNodes[c]=u,new t(n,u.getSource())},t.prototype.producedFields=function(){return a.toSet(this.transform.from.fields||(this.transform.as instanceof Array?this.transform.as:[this.transform.as]))},t.prototype.assemble=function(){var e;if(this.transform.from.fields)e=i({values:this.transform.from.fields},this.transform.as?{as:this.transform.as instanceof Array?this.transform.as:[this.transform.as]}:{});else{var t=this.transform.as;a.isString(t)||(o.warn(o.message.NO_FIELDS_NEEDS_AS),t="_lookup"),e={as:[t]}}return i({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e,this.transform.default?{default:this.transform.default}:{})},t}(s.DataFlowNode);n.LookupNode=c},{"../../log":105,"./dataflow":31,"./source":41,"vega-util":10}],38:[function(e,t,n){"use strict";function r(e){if(e instanceof f.FacetNode)if(1!==e.numChildren()||e.children[0]instanceof u.OutputNode){i(e.model.component.data.main);l.flatten(e.children.map(function(e){function t(r){if(!(r instanceof f.FacetNode)){var i=r.clone();if(i instanceof u.OutputNode){var a=n.FACET_SCALE_PREFIX+i.getSource();i.setSource(a),e.model.component.data.outputNodes[a]=i}else(i instanceof c.AggregateNode||i instanceof m.StackNode)&&i.addDimensions(e.fields);return l.flatten(r.children.map(t)).forEach(function(e){return e.parent=i}),[i]}return l.flatten(r.children.map(t))}return t}(e))).forEach(function(t){return t.parent=e.model.component.data.main})}else{var t=e.children[0];(t instanceof c.AggregateNode||t instanceof m.StackNode)&&t.addDimensions(e.fields),t.swapWithParent(),r(e)}else e.children.forEach(r)}function i(e){if(e instanceof u.OutputNode&&e.type===s.MAIN&&1===e.numChildren()){var t=e.children[0];t instanceof f.FacetNode||(t.swapWithParent(),i(e))}}function a(e){e instanceof d.FilterInvalidNode&&l.every(l.vals(e.filter),function(e){return null===e})&&e.remove(),e instanceof u.OutputNode&&!e.isRequired()&&e.remove(),e.children.forEach(a)}function o(e){function t(e){0===e.numChildren()?n.push(e):e.children.forEach(t)}var n=[];return e.forEach(t),n}Object.defineProperty(n,"__esModule",{value:!0});var s=e("../../data"),l=e("../../util"),c=e("./aggregate"),u=e("./dataflow"),f=e("./facet"),d=e("./filterinvalid"),p=e("./optimizers"),m=e("./stack");n.FACET_SCALE_PREFIX="scale_",n.optimizeDataflow=function(e){var t=l.vals(e.sources);t.forEach(a),o(t=t.filter(function(e){return e.numChildren()>0})).forEach(p.iterateFromLeaves(p.removeUnusedSubtrees)),o(t=t.filter(function(e){return e.numChildren()>0})).forEach(p.iterateFromLeaves(p.moveParseUp)),o(t).forEach(p.removeDuplicateTimeUnits),t.forEach(r),l.keys(e.sources).forEach(function(t){0===e.sources[t].numChildren()&&delete e.sources[t]})}},{"../../data":96,"../../util":118,"./aggregate":27,"./dataflow":31,"./facet":32,"./filterinvalid":34,"./optimizers":39,"./stack":42}],39:[function(e,t,n){"use strict";function r(e){function t(n){if(!(n instanceof l.SourceNode)){var r=n.parent;e(n)&&t(r)}}return t}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../util"),o=e("./dataflow"),s=e("./formatparse"),l=e("./source"),c=e("./timeunit");n.iterateFromLeaves=r,n.moveParseUp=function(e){var t=e.parent;if(e instanceof s.ParseNode){if(t instanceof l.SourceNode)return!1;if(t.numChildren()>1)return!0;if(t instanceof s.ParseNode)t.merge(e);else{if(a.hasIntersection(t.producedFields(),e.dependentFields()))return!0;e.swapWithParent()}}return!0},n.removeUnusedSubtrees=function(e){return!(e instanceof o.OutputNode||e.numChildren()>0||(e.remove(),0))},n.removeDuplicateTimeUnits=function(e){var t={};return r(function(e){if(e instanceof c.TimeUnitNode){var n=e.producedFields();a.keys(n).every(function(e){return!!t[e]})?e.remove():t=i({},t,n)}return!0})(e)}},{"../../util":118,"./dataflow":31,"./formatparse":35,"./source":41,"./timeunit":43}],40:[function(e,t,n){"use strict";function r(e){function t(e){i?e.parent?r.insertAsParentOf(e):e.parent=r:i=e.parent||e,r=e}var n,r,i=null,o=0;e.transforms.forEach(function(r){if(u.isCalculate(r))n=new h.CalculateNode(r);else if(u.isFilter(r)){var i={},d=r.filter,v=null;if(l.isEqualFilter(d)?v=d.equal:l.isRangeFilter(d)?v=d.range[0]:l.isOneOfFilter(d)&&(v=(d.oneOf||d.in)[0]),v&&(s.isDateTime(v)?i[d.field]="date":a.isNumber(v)?i[d.field]="number":a.isString(v)&&(i[d.field]="string")),f.keys(i).length>0){t(new O.ParseNode(i))}n=new b.FilterNode(e,r.filter)}else if(u.isBin(r))n=g.BinNode.makeFromTransform(r,{model:e});else if(u.isTimeUnit(r))n=N.TimeUnitNode.makeFromTransform(r);else if(u.isAggregate(r))n=m.AggregateNode.makeFromTransform(r),p.requiresSelectionId(e)&&(t(n),n=new S.IdentifierNode);else{if(!u.isLookup(r))return void c.warn(c.message.invalidTransformIgnored(r));n=x.LookupNode.make(e,r,o++)}t(n)});return{first:i,last:n}}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("vega-util"),o=e("../../data"),s=e("../../datetime"),l=e("../../filter"),c=e("../../log"),u=e("../../transform"),f=e("../../util"),d=e("../model"),p=e("../selection/selection"),m=e("./aggregate"),g=e("./bin"),h=e("./calculate"),v=e("./dataflow"),y=e("./facet"),b=e("./filter"),_=e("./filterinvalid"),O=e("./formatparse"),S=e("./indentifier"),x=e("./lookup"),w=e("./source"),E=e("./stack"),N=e("./timeunit");n.parseTransformArray=r,n.parseData=function(e){var t=function(e,t){if(e.data||!e.parent){var n=new w.SourceNode(e.data),r=n.hash();return r in t?t[r]:(t[r]=n,n)}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources),n=e.component.data.outputNodes,a=e.component.data.outputNodeRefCounts,s=t;p.requiresSelectionId(e)&&!e.parent&&((D=new S.IdentifierNode).parent=s,s=D);var l=e.parent&&d.isLayerModel(e.parent);(d.isUnitModel(e)||d.isFacetModel(e))&&l&&(b=g.BinNode.makeBinFromEncoding(e))&&(b.parent=s,s=b);if(e.transforms.length>0){var c=r(e),u=c.first,f=c.last;u.parent=s,s=f}var h=O.ParseNode.make(e);if(h&&(h.parent=s,s=h),d.isUnitModel(e)||d.isFacetModel(e)){if(!l){var b=g.BinNode.makeBinFromEncoding(e);b&&(b.parent=s,s=b)}var x=N.TimeUnitNode.makeFromEncoding(e);x&&(x.parent=s,s=x)}var T=e.getName(o.RAW),P=new v.OutputNode(T,o.RAW,a);if(n[T]=P,P.parent=s,s=P,d.isUnitModel(e)){var k=m.AggregateNode.makeFromEncoding(e);if(k&&(k.parent=s,s=k,p.requiresSelectionId(e))){var D=new S.IdentifierNode;D.parent=s,s=D}var C=E.StackNode.make(e);C&&(C.parent=s,s=C)}if(d.isUnitModel(e)){var A=_.FilterInvalidNode.make(e);A&&(A.parent=s,s=A)}var M=e.getName(o.MAIN),j=new v.OutputNode(M,o.MAIN,a);n[M]=j,j.parent=s,s=j;var R=null;if(d.isFacetModel(e)){var I=e.getName("facet");R=new y.FacetNode(e,I,j.getSource()),n[I]=R,R.parent=s,s=R}var L=i({},e.component.data.ancestorParse,h?h.parse:{});return i({},e.component.data,{outputNodes:n,outputNodeRefCounts:a,raw:P,main:j,facetRoot:R,ancestorParse:L})}},{"../../data":96,"../../datetime":97,"../../filter":101,"../../log":105,"../../transform":116,"../../util":118,"../model":66,"../selection/selection":79,"./aggregate":27,"./bin":29,"./calculate":30,"./dataflow":31,"./facet":32,"./filter":33,"./filterinvalid":34,"./formatparse":35,"./indentifier":36,"./lookup":37,"./source":41,"./stack":42,"./timeunit":43,"vega-util":10}],41:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../data"),s=e("../../util"),l=function(e){function t(t){var n=e.call(this)||this;if(t=t||{name:"source"},o.isInlineData(t))n._data={values:t.values};else if(o.isUrlData(t)){if(n._data={url:t.url},t.format||(t.format={}),!t.format||!t.format.type){var r=/(?:\.([^.]+))?$/.exec(t.url)[1];s.contains(["json","csv","tsv","topojson"],r)||(r="json"),t.format.type=r}}else o.isNamedData(t)&&(n._name=t.name,n._data={});if(!o.isNamedData(t)&&t.format){var i=t.format,l=(i.parse,a(i,["parse"]));n._data.format=l}return n}return r(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),t.prototype.hasName=function(){return!!this._name},Object.defineProperty(t.prototype,"dataName",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{set:function(e){throw new Error("Source nodes have to be roots.")},enumerable:!0,configurable:!0}),t.prototype.remove=function(){throw new Error("Source nodes are roots and cannot be removed.")},t.prototype.hash=function(){return o.isInlineData(this._data)?(this._hash||(this._hash=s.hash(this._data)),this._hash):o.isUrlData(this._data)?s.hash([this._data.url,this._data.format]):this._name},t.prototype.assemble=function(){return i({name:this._name},this._data,{transform:[]})},t}(e("./dataflow").DataFlowNode);n.SourceNode=l},{"../../data":96,"../../util":118,"./dataflow":31}],42:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=e("vega-util"),a=e("../../fielddef"),o=e("../../util"),s=e("../common"),l=function(e){function t(t){var n=e.call(this)||this;return n._stack=t,n}return r(t,e),t.prototype.clone=function(){return new t(o.duplicate(this._stack))},t.make=function(e){var n=e.stack;if(!n)return null;var r;n.groupbyChannel&&(r=e.fieldDef(n.groupbyChannel));var i,o=function(e){return e.stack.stackBy.reduce(function(e,t){var n=t.fieldDef,r=a.field(n);return r&&e.push(r),e},[])}(e),l=e.encoding.order;return i=l?s.sortParams(l):o.reduce(function(e,t){return e.field.push(t),e.order.push("descending"),e},{field:[],order:[]}),new t({dimensionFieldDef:r,field:e.field(n.fieldChannel),facetby:[],stackby:o,sort:i,offset:n.offset,impute:n.impute})},Object.defineProperty(t.prototype,"stack",{get:function(){return this._stack},enumerable:!0,configurable:!0}),t.prototype.addDimensions=function(e){this._stack.facetby=this._stack.facetby.concat(e)},t.prototype.dependentFields=function(){var e={};e[this._stack.field]=!0,this.getGroupbyFields().forEach(function(t){return e[t]=!0}),this._stack.facetby.forEach(function(t){return e[t]=!0});var t=this._stack.sort.field;return i.isArray(t)?t.forEach(function(t){return e[t]=!0}):e[t]=!0,e},t.prototype.producedFields=function(){var e={};return e[this._stack.field+"_start"]=!0,e[this._stack.field+"_end"]=!0,e},t.prototype.getGroupbyFields=function(){var e=this._stack,t=e.dimensionFieldDef,n=e.impute;return t?t.bin?n?[a.field(t,{binSuffix:"mid"})]:[a.field(t,{}),a.field(t,{binSuffix:"end"})]:[a.field(t)]:[]},t.prototype.assemble=function(){var e=[],t=this._stack,n=t.facetby,r=t.field,i=t.dimensionFieldDef,o=t.impute,s=t.offset,l=t.sort,c=t.stackby;if(o&&i){var u=i?a.field(i,{binSuffix:"mid"}):void 0;i.bin&&e.push({type:"formula",expr:"("+a.field(i,{expr:"datum"})+"+"+a.field(i,{expr:"datum",binSuffix:"end"})+")/2",as:u}),e.push({type:"impute",field:r,groupby:c,key:u,method:"value",value:0})}return e.push({type:"stack",groupby:this.getGroupbyFields().concat(n),field:r,sort:l,as:[r+"_start",r+"_end"],offset:s}),e},t}(e("./dataflow").DataFlowNode);n.StackNode=l},{"../../fielddef":100,"../../util":118,"../common":24,"./dataflow":31,"vega-util":10}],43:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../../fielddef"),o=e("../../timeunit"),s=e("../../util"),l=function(e){function t(t){var n=e.call(this)||this;return n.formula=t,n}return r(t,e),t.prototype.clone=function(){return new t(s.duplicate(this.formula))},t.makeFromEncoding=function(e){var n=e.reduceFieldDef(function(e,t){if(t.timeUnit){var n=a.field(t);e[n]={as:n,timeUnit:t.timeUnit,field:t.field}}return e},{});return 0===s.keys(n).length?null:new t(n)},t.makeFromTransform=function(e){return new t((n={},n[e.field]={as:e.as,timeUnit:e.timeUnit,field:e.field},n));var n},t.prototype.merge=function(e){this.formula=i({},this.formula,e.formula),e.remove()},t.prototype.producedFields=function(){var e={};return s.vals(this.formula).forEach(function(t){e[t.as]=!0}),e},t.prototype.dependentFields=function(){var e={};return s.vals(this.formula).forEach(function(t){e[t.field]=!0}),e},t.prototype.assemble=function(){return s.vals(this.formula).map(function(e){return{type:"formula",as:e.as,expr:o.fieldExpr(e.timeUnit,e.field)}})},t}(e("./dataflow").DataFlowNode);n.TimeUnitNode=l},{"../../fielddef":100,"../../timeunit":113,"../../util":118,"./dataflow":31}],44:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../channel"),o=e("../encoding"),s=e("../fielddef"),l=e("../log"),c=e("../scale"),u=e("../util"),f=e("../vega.schema"),d=e("./buildmodel"),p=e("./data/assemble"),m=e("./data/parse"),g=e("./layout/header"),h=e("./layoutsize/parse"),v=e("./model"),y=e("./repeater"),b=e("./resolve"),_=e("./scale/domain"),O=function(e){function t(t,n,r,i,a){var o=e.call(this,t,n,r,a,t.resolve)||this;o.type="facet",o.child=d.buildModel(t.spec,o,o.getName("child"),void 0,i,a,!1),o.children=[o.child];var s=y.replaceRepeaterInFacet(t.facet,i);return o.facet=o.initFacet(s),o}return r(t,e),t.prototype.initFacet=function(e){return o.reduce(e,function(e,t,n){return u.contains([a.ROW,a.COLUMN],n)?void 0===t.field?(l.warn(l.message.emptyFieldDef(t,n)),e):(e[n]=s.normalize(t,n),e):(l.warn(l.message.incompatibleChannel(n,"facet")),e)},{})},t.prototype.channelHasField=function(e){return!!this.facet[e]},t.prototype.fieldDef=function(e){return this.facet[e]},t.prototype.parseData=function(){this.component.data=m.parseData(this),this.child.parseData()},t.prototype.parseLayoutSize=function(){h.parseChildrenLayoutSize(this)},t.prototype.parseSelection=function(){this.child.parseSelection(),this.component.selection=this.child.component.selection},t.prototype.parseMarkGroup=function(){this.child.parseMarkGroup()},t.prototype.parseAxisAndHeader=function(){this.child.parseAxisAndHeader(),this.parseHeader("column"),this.parseHeader("row"),this.mergeChildAxis("x"),this.mergeChildAxis("y")},t.prototype.parseHeader=function(e){if(this.channelHasField(e)){var t=this.facet[e],n=t.header||{},r=void 0!==n.title?n.title:s.title(t,this.config);this.child.component.layoutHeaders[e].title&&(r+=" / "+this.child.component.layoutHeaders[e].title,this.child.component.layoutHeaders[e].title=null),this.component.layoutHeaders[e]={title:r,facetFieldDef:t,header:[this.makeHeaderComponent(e,!0)]}}},t.prototype.makeHeaderComponent=function(e,t){var n="row"===e?"height":"width";return{labels:t,sizeSignal:this.child.component.layoutSize.get(n)?this.child.getSizeSignalRef(n):void 0,axes:[]}},t.prototype.mergeChildAxis=function(e){var t=this.child;if(t.component.axes[e]){var n=this.component,r=n.layoutHeaders,i=n.resolve;if(i.axis[e]=b.parseGuideResolve(i,e),"shared"===i.axis[e])for(var a="x"===e?"column":"row",o=r[a],s=0,l=t.component.axes[e];s<l.length;s++){var c=l[s],u=c.main,f=g.getHeaderType(u.get("orient"));o[f]=o[f]||[this.makeHeaderComponent(a,!1)],o[f][0].axes.push(u.combine()),delete c.main}}},t.prototype.assembleSelectionTopLevelSignals=function(e){return this.child.assembleSelectionTopLevelSignals(e)},t.prototype.assembleSelectionSignals=function(){return this.child.assembleSelectionSignals(),[]},t.prototype.assembleSelectionData=function(e){return this.child.assembleSelectionData(e)},t.prototype.getLayoutBandMixins=function(e){for(var t={},n="header"===e?"headerBand":"footerBand",r=0,i=["row","column"];r<i.length;r++){var a=i[r],o=this.component.layoutHeaders[a][e];if(o&&o[0]){var s="row"===a?"height":"width";this.child.component.layoutSize.get(s)||(t[n]=t[n]||{},t[n][a]=.5)}}return t},t.prototype.assembleLayout=function(){var e=this.channelHasField("column")?this.columnDistinctSignal():1;return i({padding:{row:10,column:10}},this.getLayoutBandMixins("header"),this.getLayoutBandMixins("footer"),{offset:10,columns:e,bounds:"full",align:"all"})},t.prototype.assembleLayoutSignals=function(){return this.child.assembleLayoutSignals()},t.prototype.columnDistinctSignal=function(){if(!(this.parent&&this.parent instanceof t)){return{signal:"length(data('"+this.getName("column_domain")+"'))"}}},t.prototype.assembleGroup=function(n){return this.parent&&this.parent instanceof t?i({},this.channelHasField("column")?{encode:{update:{columns:{field:s.field(this.facet.column,{prefix:"distinct"})}}}}:{},e.prototype.assembleGroup.call(this,n)):e.prototype.assembleGroup.call(this,n)},t.prototype.getCardinalityAggregateForChild=function(){var e=[],n=[];if(this.child instanceof t)this.child.channelHasField("column")&&(e.push(s.field(this.child.facet.column)),n.push("distinct"));else for(var r=0,i=["x","y"];r<i.length;r++){var a=i[r],o=this.child.component.scales[a];if(o&&!o.merged){var u=o.get("type"),d=o.get("range");if(c.hasDiscreteDomain(u)&&f.isVgRangeStep(d)){var p=_.assembleDomain(this.child,a),m=_.getFieldFromDomain(p);m?(e.push(m),n.push("distinct")):l.warn("Unknown field for ${channel}.  Cannot calculate view size.")}}}return e.length?{fields:e,ops:n}:void 0},t.prototype.assembleMarks=function(){var e=this.child,t=this.facet,n=this.component.data.facetRoot,r=p.assembleFacetData(n),o=this.channelHasField(a.ROW),s=this.channelHasField(a.COLUMN),l=e.assembleLayoutSize(),c={};o&&s&&(c.aggregate={cross:!0});var u=this.getCardinalityAggregateForChild();u&&(c.aggregate=i({},c.aggregate,u));var f=e.assembleTitle(),d=e.assembleGroupStyle();return[i({name:this.getName("cell"),type:"group"},f?{title:f}:{},d?{style:d}:{},{from:{facet:i({name:n.name,data:n.data,groupby:[].concat(o?[this.field(a.ROW)]:[],s?[this.field(a.COLUMN)]:[])},c)},sort:{field:[].concat(o?[this.field(a.ROW,{expr:"datum"})]:[],s?[this.field(a.COLUMN,{expr:"datum"})]:[]),order:[].concat(o?[t.row.sort||"ascending"]:[],s?[t.column.sort||"ascending"]:[])}},r.length>0?{data:r}:{},l?{encode:{update:l}}:{},e.assembleGroup())]},t.prototype.getMapping=function(){return this.facet},t}(v.ModelWithField);n.FacetModel=O},{"../channel":15,"../encoding":98,"../fielddef":100,"../log":105,"../scale":108,"../util":118,"../vega.schema":120,"./buildmodel":23,"./data/assemble":28,"./data/parse":40,"./layout/header":46,"./layoutsize/parse":48,"./model":66,"./repeater":68,"./resolve":69,"./scale/domain":72}],45:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../log"),o=e("../spec"),s=e("../util"),l=e("./axis/parse"),c=e("./data/parse"),u=e("./layoutsize/assemble"),f=e("./layoutsize/parse"),d=e("./legend/assemble"),p=e("./model"),m=e("./selection/selection"),g=e("./unit"),h=function(e){function t(n,r,s,l,c,u,f){var d=e.call(this,n,r,s,u,n.resolve)||this;d.type="layer";var p=i({},l,n.width?{width:n.width}:{},n.height?{height:n.height}:{});return d.initSize(p),d.children=n.layer.map(function(e,n){if(o.isLayerSpec(e))return new t(e,d,d.getName("layer_"+n),p,c,u,f);if(o.isUnitSpec(e))return new g.UnitModel(e,d,d.getName("layer_"+n),p,c,u,f);throw new Error(a.message.INVALID_SPEC)}),d}return r(t,e),t.prototype.parseData=function(){this.component.data=c.parseData(this);for(var e=0,t=this.children;e<t.length;e++){t[e].parseData()}},t.prototype.parseLayoutSize=function(){f.parseLayerLayoutSize(this)},t.prototype.parseSelection=function(){var e=this;this.component.selection={};for(var t=function(t){t.parseSelection(),s.keys(t.component.selection).forEach(function(n){e.component.selection[n]=t.component.selection[n]})},n=0,r=this.children;n<r.length;n++){t(r[n])}},t.prototype.parseMarkGroup=function(){for(var e=0,t=this.children;e<t.length;e++){t[e].parseMarkGroup()}},t.prototype.parseAxisAndHeader=function(){l.parseLayerAxis(this)},t.prototype.assembleSelectionTopLevelSignals=function(e){return this.children.reduce(function(e,t){return t.assembleSelectionTopLevelSignals(e)},e)},t.prototype.assembleSelectionSignals=function(){return this.children.reduce(function(e,t){return e.concat(t.assembleSelectionSignals())},[])},t.prototype.assembleLayoutSignals=function(){return this.children.reduce(function(e,t){return e.concat(t.assembleLayoutSignals())},u.assembleLayoutSignals(this))},t.prototype.assembleSelectionData=function(e){return this.children.reduce(function(e,t){return t.assembleSelectionData(e)},[])},t.prototype.assembleTitle=function(){var t=e.prototype.assembleTitle.call(this);if(t)return t;for(var n=0,r=this.children;n<r.length;n++){if(t=r[n].assembleTitle())return t}},t.prototype.assembleLayout=function(){return null},t.prototype.assembleMarks=function(){return m.assembleLayerSelectionMarks(this,s.flatten(this.children.map(function(e){return e.assembleMarks()})))},t.prototype.assembleLegends=function(){return this.children.reduce(function(e,t){return e.concat(t.assembleLegends())},d.assembleLegends(this))},t}(p.Model);n.LayerModel=h},{"../log":105,"../spec":111,"../util":118,"./axis/parse":20,"./data/parse":40,"./layoutsize/assemble":47,"./layoutsize/parse":48,"./legend/assemble":49,"./model":66,"./selection/selection":79,"./unit":90}],46:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../fielddef"),a=e("../../util"),o=e("../common");n.HEADER_CHANNELS=["row","column"],n.HEADER_TYPES=["header","footer"],n.getHeaderType=function(e){return"top"===e||"left"===e?"header":"footer"},n.getTitleGroup=function(e,t){var n=e.component.layoutHeaders[t].title,i=r({align:{value:"center"},text:{value:n}},"vertical"===("row"===t?"vertical":void 0)?{angle:{value:270}}:{});return{name:e.getName(t+"_title"),role:t+"-title",type:"group",marks:[r({type:"text",role:t+"-title-text",style:"guide-title"},a.keys(i).length>0?{encode:{update:i}}:{})]}},n.getHeaderGroup=function(e,t,n,s,l){if(l){var c=null;if(s.facetFieldDef&&l.labels){var u=s.facetFieldDef,f=u.header,d=void 0===f?{}:f,p=d.format,m=d.labelAngle,g=r({},m?{angle:{value:m}}:{});c=r({text:o.formatSignalRef(u,p,"parent",e.config),offset:10,orient:"row"===t?"left":"top",style:"guide-label"},a.keys(g).length>0?{encode:{update:g}}:{})}var h=l.axes,v=h&&h.length>0;if(c||v){var y="row"===t?"height":"width";return r({name:e.getName(t+"_"+n),type:"group",role:t+"-"+n},s.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:{field:i.field(s.facetFieldDef,{expr:"datum"}),order:s.facetFieldDef.header&&s.facetFieldDef.sort||"ascending"}}:{},c?{title:c}:{},l.sizeSignal?{encode:{update:(b={},b[y]=l.sizeSignal,b)}}:{},v?{axes:h}:{})}}return null;var b}},{"../../fielddef":100,"../../util":118,"../common":24}],47:[function(e,t,n){"use strict";function r(e,t){var n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];var c=e.getSizeSignalRef(t).signal;if("range-step"===r){var u=e.getScaleComponent(n);if(u){var f=u.get("type"),d=u.get("range");if(o.hasDiscreteDomain(f)&&s.isVgRangeStep(d)){var p=e.scaleName(n);if(l.isFacetModel(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[i(p,d)]}return[i(p,d),{name:c,update:a(p,u,"domain('"+p+"').length")}]}}throw new Error("layout size is range step although there is no rangeStep.")}return[{name:c,value:r}]}function i(e,t){return{name:e+"_step",value:t.step}}function a(e,t,n){var r=t.get("type"),i=t.get("padding"),a=t.get("paddingOuter");a=void 0!==a?a:i;var o=t.get("paddingInner");return o="band"===r?void 0!==o?o:i:1,"bandspace("+n+", "+o+", "+a+") * "+e+"_step"}Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../scale"),s=e("../../vega.schema"),l=e("../model");n.assembleLayoutSignals=function(e){return[].concat(r(e,"width"),r(e,"height"))},n.sizeSignals=r,n.sizeExpr=a},{"../../scale":108,"../../vega.schema":120,"../model":66}],48:[function(e,t,n){"use strict";function r(e){i(e);var t=e.component.layoutSize;t.setWithExplicit("width",a(e,"width")),t.setWithExplicit("height",a(e,"height"))}function i(e){for(var t=0,n=e.children;t<n.length;t++){n[t].parseLayoutSize()}}function a(e,t){for(var n,r="width"===t?"x":"y",i=e.component.resolve,a=0,o=e.children;a<o.length;a++){var s=(d=o[a]).component.layoutSize.getWithExplicit(t),l=i.scale[r];if("independent"===l&&"range-step"===s.value){n=void 0;break}if(n){if("independent"===l&&n.value!==s.value){n=void 0;break}n=c.mergeValuesWithExplicit(n,s,t,"")}else n=s}if(n){for(var u=0,f=e.children;u<f.length;u++){var d=f[u];e.renameLayoutSize(d.getName(t),e.getName(t)),d.component.layoutSize.set(t,"merged",!1)}return n}return{explicit:!1,value:void 0}}function o(e,t){var n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){var a=i.get("type"),o=i.get("range");return s.hasDiscreteDomain(a)&&l.isVgRangeStep(o)?"range-step":r.view[t]}return"width"===t&&"text"===e.mark()?r.scale.textXRangeStep:r.scale.rangeStep||s.defaultScaleConfig.rangeStep}Object.defineProperty(n,"__esModule",{value:!0});var s=e("../../scale"),l=e("../../vega.schema"),c=e("../split");n.parseLayerLayoutSize=r,n.parseRepeatLayoutSize=r,n.parseConcatLayoutSize=function(e){i(e);var t=e.component.layoutSize,n=e.isVConcat?"width":"height";t.setWithExplicit(n,a(e,n))},n.parseChildrenLayoutSize=i,n.parseUnitLayoutSize=function(e){var t=e.component.layoutSize;if(!t.explicit.width){var n=o(e,"width");t.set("width",n,!1)}if(!t.explicit.height){var r=o(e,"height");t.set("height",r,!1)}}},{"../../scale":108,"../../vega.schema":120,"../split":89}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("json-stable-stringify"),i=e("../../util"),a=e("./parse");n.assembleLegends=function(e){for(var t=e.component.legends,n={},o=0,s=i.keys(t);o<s.length;o++){var l=s[o],c=e.getScaleComponent(l),u=r(c.domains);if(n[u])for(var f=0,d=n[u];f<d.length;f++){var p=d[f];a.mergeLegendComponent(p,t[l])||n[u].push(t[l])}else n[u]=[t[l].clone()]}return i.flatten(i.vals(n)).map(function(e){return e.combine()})}},{"../../util":118,"./parse":52,"json-stable-stringify":1}],50:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(e("../split").Split);n.LegendComponent=i},{"../split":89}],51:[function(e,t,n){"use strict";function r(e){if(s.isValueDef(e)){if(s.hasConditionalValueDef(e)){var t=a.isArray(e.condition)?e.condition.map(function(e){return e.value}):[e.condition.value];return Math.max.apply(null,[e.value].concat(t))}return e.value}}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("vega-util"),o=e("../../channel"),s=e("../../fielddef"),l=e("../../mark"),c=e("../../scale"),u=e("../../util"),f=e("../common"),d=e("../mark/mixins");n.symbols=function(e,t,n,a,c){if("gradient"!==c){var p={},m=n.mark();switch(m){case l.BAR:case l.TICK:case l.TEXT:p.shape={value:"square"};break;case l.CIRCLE:case l.SQUARE:p.shape={value:m};break;case l.POINT:case l.LINE:case l.AREA:}var g=n.markDef.filled,h=a===o.COLOR?u.without(l.FILL_STROKE_CONFIG,[g?"fill":"stroke","strokeDash","strokeDashOffset"]):l.FILL_STROKE_CONFIG;if(h=u.without(h,["strokeDash","strokeDashOffset"]),f.applyMarkConfig(p,n,h),a!==o.COLOR){var v=d.color(n);v.fill&&(v.fill.field||"transparent"===v.fill.value)&&delete v.fill,v.stroke&&(v.stroke.field||"transparent"===v.stroke.value)&&delete v.stroke,p=i({},p,v)}if(a!==o.SHAPE){var y=n.encoding.shape;s.isValueDef(y)&&(p.shape={value:y.value})}if(a!==o.OPACITY){var b=r(n.encoding.opacity)||n.markDef.opacity;b&&(p.opacity={value:b})}return p=i({},p,t),u.keys(p).length>0?p:void 0}},n.gradient=function(e,t,n,a,o){var s={};if("gradient"===o){var l=r(n.encoding.opacity)||n.markDef.opacity;l&&(s.opacity={value:l})}return s=i({},s,t),u.keys(s).length>0?s:void 0},n.labels=function(e,t,n,r,a){var o=n.legend(r),l=n.config,d={};if(s.isTimeFieldDef(e)){var p=n.getScaleComponent(r).get("type")===c.ScaleType.UTC;t=i({text:{signal:f.timeFormatExpression("datum.value",e.timeUnit,o.format,l.legend.shortTimeLabels,l.timeFormat,p)}},t)}return d=i({},d,t),u.keys(d).length>0?d:void 0}},{"../../channel":15,"../../fielddef":100,"../../mark":107,"../../scale":108,"../../util":118,"../common":24,"../mark/mixins":59,"vega-util":10}],52:[function(e,t,n){"use strict";function r(e){f.isUnitModel(e)?e.component.legends=function(e){return[o.COLOR,o.SIZE,o.SHAPE,o.OPACITY].reduce(function(t,n){return e.legend(n)&&(t[n]=i(e,n)),t},{})}(e):e.component.legends=function(e){for(var t=e.component,n=t.legends,i=t.resolve,o=function(t){r(t),c.keys(t.component.legends).forEach(function(r){i.legend[r]=d.parseGuideResolve(e.component.resolve,r),"shared"===i.legend[r]&&(n[r]=a(n[r],t.component.legends[r]),n[r]||(i.legend[r]="independent",delete n[r]))})},s=0,l=e.children;s<l.length;s++){var u=l[s];o(u)}return c.keys(n).forEach(function(t){for(var n=0,r=e.children;n<r.length;n++){var a=r[n];a.component.legends[t]&&"shared"===i.legend[t]&&delete a.component.legends[t]}}),n}(e)}function i(e,t){var n=e.fieldDef(t),r=e.legend(t),i=new g.LegendComponent({},function(e,t){switch(t){case o.COLOR:var n=e.scaleName(o.COLOR);return e.markDef.filled?{fill:n}:{stroke:n};case o.SIZE:return{size:e.scaleName(o.SIZE)};case o.SHAPE:return{shape:e.scaleName(o.SHAPE)};case o.OPACITY:return{opacity:e.scaleName(o.OPACITY)}}return null}(e,t));l.LEGEND_PROPERTIES.forEach(function(n){var a=function(e,t,n,r){var i=r.fieldDef(n);switch(e){case"format":return u.numberFormat(i,t.format,r.config);case"title":return u.getSpecifiedOrDefaultValue(t.title,s.title(i,r.config));case"values":return v.values(t);case"type":return u.getSpecifiedOrDefaultValue(t.type,v.type(i.type,n,r.getScaleComponent(n).get("type")))}return t[e]}(n,r,t,e);if(void 0!==a){var o="values"===n?!!r.values:a===r[n];(o||void 0===e.config.legend[n])&&i.set(n,a,o)}});var a=r.encoding||{},f=["labels","legend","title","symbols","gradient"].reduce(function(r,o){var s=h[o]?h[o](n,a[o],e,t,i.get("type")):a[o];return void 0!==s&&c.keys(s).length>0&&(r[o]={update:s}),r},{});return c.keys(f).length>0&&i.set("encode",f,!!r.encoding),i}function a(e,t){if(!e)return t.clone();var n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(!n.explicit||!r.explicit||n.value===r.value){for(var i=!1,a=function(n){var r=m.mergeValuesWithExplicit(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",function(e,t){switch(n){case"title":return u.titleMerger(e,t);case"type":return i=!0,p.makeImplicit("symbol")}return m.defaultTieBreaker(e,t,n,"legend")});e.setWithExplicit(n,r)},o=0,s=l.VG_LEGEND_PROPERTIES;o<s.length;o++){a(s[o])}return i&&(((e.implicit||{}).encode||{}).gradient&&c.deleteNestedProperty(e.implicit,["encode","gradient"]),((e.explicit||{}).encode||{}).gradient&&c.deleteNestedProperty(e.explicit,["encode","gradient"])),e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../channel"),s=e("../../fielddef"),l=e("../../legend"),c=e("../../util"),u=e("../common"),f=e("../model"),d=e("../resolve"),p=e("../split"),m=e("../split"),g=e("./component"),h=e("./encode"),v=e("./properties");n.parseLegend=r,n.parseLegendForChannel=i,n.mergeLegendComponent=a},{"../../channel":15,"../../fielddef":100,"../../legend":104,"../../util":118,"../common":24,"../model":66,"../resolve":69,"../split":89,"./component":50,"./encode":51,"./properties":53}],53:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../channel"),i=e("../../datetime"),a=e("../../scale"),o=e("../../util");n.values=function(e){var t=e.values;return t&&i.isDateTime(t[0])?t.map(function(e){return{signal:i.dateTimeExpr(e,!0)}}):t},n.type=function(e,t,n){if(t===r.COLOR&&("quantitative"===e&&!a.isBinScale(n)||"temporal"===e&&o.contains(["time","utc"],n)))return"gradient"}},{"../../channel":15,"../../datetime":97,"../../scale":108,"../../util":118}],54:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./mixins");n.area={vgMark:"area",encodeEntry:function(e){return r({},i.markDefProperties(e.markDef),i.pointPosition("x",e,"zeroOrMin"),i.pointPosition("y",e,"zeroOrMin"),i.pointPosition2(e,"zeroOrMin"),i.color(e),i.text(e,"tooltip"),i.nonPosition("opacity",e))}}},{"./mixins":59}],55:[function(e,t,n){"use strict";function r(e,t,n){if(n.bar.discreteBandSize)return{value:n.bar.discreteBandSize};if(t){var r=t.get("type");if(r!==c.ScaleType.POINT)return r===c.ScaleType.BAND?d.band(e):{value:n.bar.continuousBandSize};var i=t.get("range");if(u.isVgRangeStep(i)&&a.isNumber(i.step))return{value:i.step-1};l.warn(l.message.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL)}return n.scale.rangeStep&&null!==n.scale.rangeStep?{value:n.scale.rangeStep-1}:{value:20}}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("vega-util"),o=e("../../channel"),s=e("../../fielddef"),l=e("../../log"),c=e("../../scale"),u=e("../../vega.schema"),f=e("./mixins"),d=e("./valueref");n.bar={vgMark:"rect",encodeEntry:function(e){e.stack;return i({},f.markDefProperties(e.markDef,!0),function(e,t){var n=e.config,a=e.width,l=e.markDef.orient,u=e.encoding.size,p=e.encoding.x,m=e.scaleName(o.X),g=e.getScaleComponent(o.X);if("horizontal"===l)return i({},f.pointPosition("x",e,"zeroOrMin"),f.pointPosition2(e,"zeroOrMin"));if(s.isFieldDef(p)){var h=g.get("type");if(p.bin&&!u&&!c.hasDiscreteDomain(h))return f.binnedPosition(p,"x",e.scaleName("x"),n.bar.binSpacing,g.get("reverse"));if(h===c.ScaleType.BAND)return f.bandPosition(p,"x",e)}return f.centeredBandPosition("x",e,i({},d.mid(a)),r(m,g,n))}(e),function(e,t){var n=e.config,a=e.encoding,l=e.height,u=e.markDef.orient,p=a.size,m=a.y,g=e.scaleName(o.Y),h=e.getScaleComponent(o.Y);if("vertical"===u)return i({},f.pointPosition("y",e,"zeroOrMin"),f.pointPosition2(e,"zeroOrMin"));if(s.isFieldDef(m)){var v=h.get("type");if(m.bin&&!p&&!c.hasDiscreteDomain(v))return f.binnedPosition(m,"y",e.scaleName("y"),n.bar.binSpacing,h.get("reverse"));if(v===c.ScaleType.BAND)return f.bandPosition(m,"y",e)}return f.centeredBandPosition("y",e,d.mid(l),r(g,h,n))}(e),f.color(e),f.text(e,"tooltip"),f.nonPosition("opacity",e))}}},{"../../channel":15,"../../fielddef":100,"../../log":105,"../../scale":108,"../../vega.schema":120,"./mixins":59,"./valueref":65,"vega-util":10}],56:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../encoding"),a=e("../../fielddef"),o=e("../../log"),s=e("../../mark"),l=e("../../type"),c=e("../../util"),u=e("../common");n.normalizeMarkDef=function(e,t,n){var f=s.isMarkDef(e)?r({},e):{type:e},d=f.orient||u.getMarkConfig("orient",f,n);return f.orient=function(e,t,n){switch(e){case s.POINT:case s.CIRCLE:case s.SQUARE:case s.TEXT:case s.RECT:return}var r=t.y2,i=t.x2;switch(e){case s.RULE:case s.BAR:case s.AREA:if(r)return"vertical";if(i)return"horizontal";if(e===s.RULE){if(t.x&&!t.y)return"vertical";if(t.y&&!t.x)return"horizontal"}case s.LINE:case s.TICK:var c=a.isFieldDef(t.x)&&a.isContinuous(t.x),u=a.isFieldDef(t.y)&&a.isContinuous(t.y);if(c&&!u)return"tick"!==e?"horizontal":"vertical";if(!c&&u)return"tick"!==e?"vertical":"horizontal";if(c&&u){var f=t.x,d=t.y,p=f.type===l.TEMPORAL,m=d.type===l.TEMPORAL;return p&&!m?"tick"!==e?"vertical":"horizontal":!p&&m?"tick"!==e?"horizontal":"vertical":!f.aggregate&&d.aggregate?"tick"!==e?"vertical":"horizontal":f.aggregate&&!d.aggregate?"tick"!==e?"horizontal":"vertical":n||(e===s.LINE&&t.order||o.warn(o.message.unclearOrientContinuous(e)),"vertical")}return void o.warn(o.message.unclearOrientDiscreteOrEmpty(e))}return"vertical"}(f.type,t,d),void 0!==d&&d!==f.orient&&o.warn(o.message.orientOverridden(f.orient,d)),void 0===(f.opacity||u.getMarkConfig("opacity",f,n))&&(f.opacity=function(e,t){if(c.contains([s.POINT,s.TICK,s.CIRCLE,s.SQUARE],e)&&!i.isAggregate(t))return.7}(f.type,t)),void 0===f.filled&&(f.filled=function(e,t){var n=u.getMarkConfig("filled",e,t),r=e.type;return void 0!==n?n:r!==s.POINT&&r!==s.LINE&&r!==s.RULE}(f,n)),f}},{"../../encoding":98,"../../fielddef":100,"../../log":105,"../../mark":107,"../../type":117,"../../util":118,"../common":24}],57:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./mixins"),a=e("./valueref");n.line={vgMark:"line",encodeEntry:function(e){var t=e.width,n=e.height;return r({},i.markDefProperties(e.markDef,!0),i.pointPosition("x",e,a.mid(t)),i.pointPosition("y",e,a.mid(n)),i.color(e),i.text(e,"tooltip"),i.nonPosition("opacity",e),i.nonPosition("size",e,{vgChannel:"strokeWidth"}))}}},{"./mixins":59,"./valueref":65}],58:[function(e,t,n){"use strict";function r(e){if("line"===e.mark()&&e.channelHasField("order"))return m.sortParams(e.encoding.order,{expr:"datum"});var t="horizontal"===e.markDef.orient?"y":"x",n=e.sort(t),r=d.isSortField(n)?u.field({aggregate:c.isAggregate(e.encoding)?n.op:void 0,field:n.field},{expr:"datum"}):e.field(t,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"});return r?{field:r,order:"descending"}:void 0}function i(e){return p.keys(e).reduce(function(t,n){switch(n){case"x":case"y":case"order":case"tooltip":case"x2":case"y2":case"text":case"shape":return t;case"detail":var r=e[n];return r&&(s.isArray(r)?r:[r]).forEach(function(e){e.aggregate||t.push(u.field(e,{}))}),t;case"color":case"size":case"opacity":var i=u.getFieldDef(e[n]);return i&&!i.aggregate&&t.push(u.field(i,{})),t;default:throw new Error("Bug: Channel "+n+" unimplemented for line mark")}},[])}function a(e){var t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("domainRaw")||n&&n.get("domainRaw"))}var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var s=e("vega-util"),l=e("../../data"),c=e("../../encoding"),u=e("../../fielddef"),f=e("../../mark"),d=e("../../sort"),p=e("../../util"),m=e("../common"),g=e("./area"),h=e("./bar"),v=e("./line"),y=e("./point"),b=e("./rect"),_=e("./rule"),O=e("./text"),S=e("./tick"),x={area:g.area,bar:h.bar,line:v.line,point:y.point,text:O.text,tick:S.tick,rect:b.rect,rule:_.rule,circle:y.circle,square:y.square};n.parseMarkGroup=function(e){return p.contains([f.LINE,f.AREA],e.mark())?function(e){var t=e.mark(),n=i(e.encoding),s=void 0!==e.markDef.clip?!!e.markDef.clip:a(e),c=m.getStyles(e.markDef),u=r(e),f=[o({name:e.getName("marks"),type:x[t].vgMark},s?{clip:!0}:{},c?{style:c}:{},u?{sort:u}:{},{from:{data:(n.length>0?w:"")+e.requestDataName(l.MAIN)},encode:{update:x[t].encodeEntry(e)}})];return n.length>0?[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:w+e.requestDataName(l.MAIN),data:e.requestDataName(l.MAIN),groupby:n}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:f}]:f}(e):function(e){var t=e.mark(),n=m.getStyles(e.markDef),r=void 0!==e.markDef.clip?!!e.markDef.clip:a(e),i=[];return i.push(o({name:e.getName("marks"),type:x[t].vgMark},r?{clip:!0}:{},n?{style:n}:{},{from:{data:e.requestDataName(l.MAIN)},encode:{update:x[t].encodeEntry(e)}})),i}(e)};var w="faceted_path_";n.getPathSort=r,n.pathGroupingFields=i},{"../../data":96,"../../encoding":98,"../../fielddef":100,"../../mark":107,"../../sort":110,"../../util":118,"../common":24,"./area":54,"./bar":55,"./line":57,"./point":60,"./rect":61,"./rule":62,"./text":63,"./tick":64,"vega-util":10}],59:[function(e,t,n){"use strict";function r(e,t,n){void 0===n&&(n={});var r=n.defaultValue,a=n.vgChannel,o=n.defaultRef||(void 0!==r?{value:r}:void 0),s=t.encoding[e];return i(t,s,a||e,function(n){return m.midPoint(e,n,t.scaleName(e),t.getScaleComponent(e),null,o)})}function i(e,t,n,r){var i=t&&t.condition,a=r(t);if(i){var l=(s.isArray(i)?i:[i]).map(function(t){var n=r(t);return o({test:p.predicate(e,t.selection)},n)});return c={},c[n]=l.concat(void 0!==a?[a]:[]),c}return void 0!==a?(u={},u[n]=a,u):{};var c,u}function a(e,t,n,r){var i=t.encoding,a=t.stack,o=m.stackable(e,i[e],t.scaleName(e),t.getScaleComponent(e),a,n);return s={},s[r||e]=o,s;var s}var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var s=e("vega-util"),l=e("../../fielddef"),c=e("../../log"),u=e("../../util"),f=e("../../vega.schema"),d=e("../common"),p=e("../selection/selection"),m=e("./valueref");n.color=function(e){var t=e.config,n=e.markDef.filled?"fill":"stroke",i=r("color",e,{vgChannel:n,defaultValue:e.markDef[n]||e.markDef.color||d.getMarkConfig(n,e.markDef,t)||d.getMarkConfig("color",e.markDef,t)});return!i.fill&&u.contains(["bar","point","circle","square"],e.mark())&&(i.fill={value:"transparent"}),i},n.markDefProperties=function(e,t){return f.VG_MARK_CONFIGS.reduce(function(n,r){return!e[r]||t&&"orient"===r||(n[r]={value:e[r]}),n},{})},n.valueIfDefined=function(e,t){if(void 0!==t)return n={},n[e]={value:t},n;return;var n},n.nonPosition=r,n.text=function(e,t){void 0===t&&(t="text");var n=e.encoding[t];return i(e,n,t,function(t){return m.text(t,e.config)})},n.bandPosition=function(e,t,n){var i=n.scaleName(t),a="x"===t?"width":"height";if(n.encoding.size)if(n.markDef.orient){var s=(u={},u[t+"c"]=m.fieldRef(e,i,{},{band:.5}),u);if(l.getFieldDef(n.encoding.size))c.warn(c.message.cannotUseSizeFieldWithBandSize(t));else if(l.isValueDef(n.encoding.size))return o({},s,r("size",n,{vgChannel:a}))}else c.warn(c.message.cannotApplySizeToNonOrientedMark(n.markDef.type));return f={},f[t]=m.fieldRef(e,i,{binSuffix:"range"}),f[a]=m.band(i),f;var u,f},n.centeredBandPosition=function(e,t,n,i){var s="x"===e?"width":"height";return o({},a(e,t,n,"x"===e?"xc":"yc"),r("size",t,{defaultRef:i,vgChannel:s}))},n.binnedPosition=function(e,t,n,r,i){return"x"===t?{x2:m.bin(e,n,"start",i?0:r),x:m.bin(e,n,"end",i?r:0)}:{y2:m.bin(e,n,"start",i?r:0),y:m.bin(e,n,"end",i?0:r)}},n.pointPosition=a,n.pointPosition2=function(e,t,n){var r=e.encoding,i=e.markDef,a=e.stack,o="x2"===(n=n||("horizontal"===i.orient?"x2":"y2"))?"x":"y",s=m.stackable2(n,r[o],r[n],e.scaleName(o),e.getScaleComponent(o),a,t);return l={},l[n]=s,l;var l}},{"../../fielddef":100,"../../log":105,"../../util":118,"../../vega.schema":120,"../common":24,"../selection/selection":79,"./valueref":65,"vega-util":10}],60:[function(e,t,n){"use strict";function r(e,t){var n=e.config,r=e.width,o=e.height;return a({},s.markDefProperties(e.markDef,!0),s.pointPosition("x",e,l.mid(r)),s.pointPosition("y",e,l.mid(o)),s.color(e),s.text(e,"tooltip"),s.nonPosition("size",e),i(e,n,t),s.nonPosition("opacity",e))}function i(e,t,n){return n?{shape:{value:n}}:s.nonPosition("shape",e,{defaultValue:o.getMarkConfig("shape",e.markDef,t)})}var a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../common"),s=e("./mixins"),l=e("./valueref");n.shapeMixins=i,n.point={vgMark:"symbol",encodeEntry:function(e){return r(e)}},n.circle={vgMark:"symbol",encodeEntry:function(e){return r(e,"circle")}},n.square={vgMark:"symbol",encodeEntry:function(e){return r(e,"square")}}},{"../common":24,"./mixins":59,"./valueref":65}],61:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../channel"),a=e("../../fielddef"),o=e("../../log"),s=e("../../mark"),l=e("../../scale"),c=e("./mixins");n.rect={vgMark:"rect",encodeEntry:function(e){return r({},c.markDefProperties(e.markDef,!0),function(e){var t=e.encoding.x,n=e.encoding.x2,u=e.getScaleComponent(i.X),f=u?u.get("type"):void 0;if(a.isFieldDef(t)&&t.bin&&!n)return c.binnedPosition(t,"x",e.scaleName("x"),0,u.get("reverse"));if(a.isFieldDef(t)&&u&&l.hasDiscreteDomain(f)){if(f===l.ScaleType.BAND)return c.bandPosition(t,"x",e);throw new Error(o.message.scaleTypeNotWorkWithMark(s.RECT,f))}return r({},c.pointPosition("x",e,"zeroOrMax"),c.pointPosition2(e,"zeroOrMin","x2"))}(e),function(e){var t=e.encoding.y,n=e.encoding.y2,u=e.getScaleComponent(i.Y),f=u?u.get("type"):void 0;if(a.isFieldDef(t)&&t.bin&&!n)return c.binnedPosition(t,"y",e.scaleName("y"),0,u.get("reverse"));if(a.isFieldDef(t)&&u&&l.hasDiscreteDomain(f)){if(f===l.ScaleType.BAND)return c.bandPosition(t,"y",e);throw new Error(o.message.scaleTypeNotWorkWithMark(s.RECT,f))}return r({},c.pointPosition("y",e,"zeroOrMax"),c.pointPosition2(e,"zeroOrMin","y2"))}(e),c.color(e),c.text(e,"tooltip"),c.nonPosition("opacity",e))}}},{"../../channel":15,"../../fielddef":100,"../../log":105,"../../mark":107,"../../scale":108,"./mixins":59}],62:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./mixins"),a=e("./valueref");n.rule={vgMark:"rule",encodeEntry:function(e){e.config;var t=e.markDef,n=e.width,o=e.height,s=t.orient;return e.encoding.x||e.encoding.y?r({},i.markDefProperties(e.markDef,!0),i.pointPosition("x",e,"horizontal"===s?"zeroOrMin":a.mid(n)),i.pointPosition("y",e,"vertical"===s?"zeroOrMin":a.mid(o)),i.pointPosition2(e,"zeroOrMax"),i.color(e),i.text(e,"tooltip"),i.nonPosition("opacity",e),i.nonPosition("size",e,{vgChannel:"strokeWidth"})):{}}}},{"./mixins":59,"./valueref":65}],63:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../channel"),a=e("../../encoding"),o=e("../../fielddef"),s=e("../../type"),l=e("../common"),c=e("./mixins"),u=e("./valueref");n.text={vgMark:"text",encodeEntry:function(e){var t=e.config,n=e.encoding,f=e.height,d=n.text;return r({},c.markDefProperties(e.markDef,!0),c.pointPosition("x",e,function(e,t){return o.isFieldDef(t)&&t.type===s.QUANTITATIVE?{field:{group:"width"},offset:-5}:{value:e.scale.textXRangeStep/2}}(t,d)),c.pointPosition("y",e,u.mid(f)),c.text(e),c.color(e),c.text(e,"tooltip"),c.nonPosition("opacity",e),c.nonPosition("size",e,{vgChannel:"fontSize"}),c.valueIfDefined("align",function(e,t,n){if(void 0===(e.align||l.getMarkConfig("align",e,n)))return a.channelHasField(t,i.X)?"center":"right"}(e.markDef,n,t)))}}},{"../../channel":15,"../../encoding":98,"../../fielddef":100,"../../type":117,"../common":24,"./mixins":59,"./valueref":65}],64:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../vega.schema"),a=e("./mixins"),o=e("./valueref");n.tick={vgMark:"rect",encodeEntry:function(e){var t=e.config,n=e.markDef,s=e.width,l=e.height,c=n.orient,u="horizontal"===c?"width":"height",f="horizontal"===c?"height":"width";return r({},a.markDefProperties(e.markDef,!0),a.pointPosition("x",e,o.mid(s),"xc"),a.pointPosition("y",e,o.mid(l),"yc"),a.nonPosition("size",e,{defaultValue:function(e){var t=e.config,n=e.markDef.orient,r=e.getScaleComponent("horizontal"===n?"x":"y");if(void 0!==t.tick.bandSize)return t.tick.bandSize;var a=r?r.get("range"):void 0,o=a&&i.isVgRangeStep(a)?a.step:t.scale.rangeStep;if("number"!=typeof o)throw new Error("Function does not handle non-numeric rangeStep");return o/1.5}(e),vgChannel:u}),(d={},d[f]={value:t.tick.thickness},d),a.color(e),a.nonPosition("opacity",e));var d}}},{"../../vega.schema":120,"./mixins":59,"./valueref":65}],65:[function(e,t,n){"use strict";function r(e,t,n,r){var i={scale:t,field:s.field(e,n)};return r?a({},i,r):i}function i(e,t,n,i,a,f){if(t){if(s.isFieldDef(t)){if(t.bin)return c.contains(["x","y"],e)&&"quantitative"===t.type?a&&a.impute?r(t,n,{binSuffix:"mid"}):function(e,t){return{signal:'(scale("'+t+'", '+s.field(e,{expr:"datum"})+') + scale("'+t+'", '+s.field(e,{binSuffix:"end",expr:"datum"})+"))/2"}}(t,n):r(t,n,u.binRequiresRange(t,e)?{binSuffix:"range"}:{});var d=i.get("type");return l.hasDiscreteDomain(d)?"band"===d?r(t,n,{binSuffix:"range"},{band:.5}):r(t,n,{binSuffix:"range"}):r(t,n,{})}return s.isValueDef(t)?{value:t.value}:void 0}if("zeroOrMin"===f){if(e===o.X||e===o.X2)return function(e,t){if(e&&!c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],t.get("type"))&&!1!==t.get("zero"))return{scale:e,value:0};return{value:0}}(n,i);if(e===o.Y||e===o.Y2)return function(e,t){if(e&&!c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],t.get("type"))&&!1!==t.get("zero"))return{scale:e,value:0};return{field:{group:"height"}}}(n,i);throw new Error("Unsupported channel "+e+" for base function")}if("zeroOrMax"===f){if(e===o.X||e===o.X2)return function(e,t){if(e&&!c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],t.get("type"))&&!1!==t.get("zero"))return{scale:e,value:0};return{field:{group:"width"}}}(n,i);if(e===o.Y||e===o.Y2)return function(e,t){if(e&&!c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],t.get("type"))&&!1!==t.get("zero"))return{scale:e,value:0};return{value:0}}(n,i);throw new Error("Unsupported channel "+e+" for base function")}return f}var a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../channel"),s=e("../../fielddef"),l=e("../../scale"),c=e("../../util"),u=e("../common");n.stackable=function(e,t,n,a,o,l){return s.isFieldDef(t)&&o&&e===o.fieldChannel?r(t,n,{suffix:"end"}):i(e,t,n,a,o,l)},n.stackable2=function(e,t,n,a,o,l,c){return s.isFieldDef(t)&&l&&e.charAt(0)===l.fieldChannel.charAt(0)?r(t,a,{suffix:"start"}):i(e,n,a,o,l,c)},n.bin=function(e,t,n,i){return r(e,t,{binSuffix:"start"===n?void 0:"end"},i?{offset:i}:{})},n.fieldRef=r,n.band=function(e,t){return void 0===t&&(t=!0),{scale:e,band:t}},n.midPoint=i,n.text=function(e,t){if(e){if(s.isFieldDef(e))return u.formatSignalRef(e,e.format,"datum",t);if(s.isValueDef(e))return{value:e.value}}},n.mid=function(e){return a({},e,{mult:.5})}},{"../../channel":15,"../../fielddef":100,"../../scale":108,"../../util":118,"../common":24}],66:[function(e,t,n){"use strict";function r(e){return e&&"unit"===e.type}function i(e){return e&&"facet"===e.type}var a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var s=e("vega-util"),l=e("../channel"),c=e("../encoding"),u=e("../fielddef"),f=e("../log"),d=e("../scale"),p=e("../title"),m=e("../transform"),g=e("../util"),h=e("../vega.schema"),v=e("./axis/assemble"),y=e("./layout/header"),b=e("./layoutsize/assemble"),_=e("./legend/assemble"),O=e("./legend/parse"),S=e("./scale/assemble"),x=e("./scale/domain"),w=e("./scale/parse"),E=e("./split"),N=function(){function e(){this.nameMap={}}return e.prototype.rename=function(e,t){this.nameMap[e]=t},e.prototype.has=function(e){return void 0!==this.nameMap[e]},e.prototype.get=function(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e},e}();n.NameMap=N,n.isUnitModel=r,n.isFacetModel=i,n.isRepeatModel=function(e){return e&&"repeat"===e.type},n.isConcatModel=function(e){return e&&"concat"===e.type},n.isLayerModel=function(e){return e&&"layer"===e.type};var T=function(){function e(e,t,n,r,i){var a=this;this.children=[],this.correctDataNames=function(e){return e.from&&e.from.data&&(e.from.data=a.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=a.lookupDataSource(e.from.facet.data)),e},this.parent=t,this.config=r,this.name=e.name||n,this.title=s.isString(e.title)?{text:e.title}:e.title,this.scaleNameMap=t?t.scaleNameMap:new N,this.layoutSizeNameMap=t?t.layoutSizeNameMap:new N,this.data=e.data,this.description=e.description,this.transforms=m.normalizeTransform(e.transform||[]),this.component={data:{sources:t?t.component.data.sources:{},outputNodes:t?t.component.data.outputNodes:{},outputNodeRefCounts:t?t.component.data.outputNodeRefCounts:{},ancestorParse:t?o({},t.component.data.ancestorParse):{}},layoutSize:new E.Split,layoutHeaders:{row:{},column:{}},mark:null,resolve:o({scale:{},axis:{},legend:{}},i||{}),selection:null,scales:null,axes:{},legends:{}}}return Object.defineProperty(e.prototype,"width",{get:function(){return this.getSizeSignalRef("width")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.getSizeSignalRef("height")},enumerable:!0,configurable:!0}),e.prototype.initSize=function(e){var t=e.width,n=e.height;t&&this.component.layoutSize.set("width",t,!0),n&&this.component.layoutSize.set("height",n,!0)},e.prototype.parse=function(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSize(),this.parseSelection(),this.parseData(),this.parseAxisAndHeader(),this.parseLegend(),this.parseMarkGroup()},e.prototype.parseScale=function(){w.parseScale(this)},e.prototype.renameTopLevelLayoutSize=function(){"width"!==this.getName("width")&&this.renameLayoutSize(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameLayoutSize(this.getName("height"),"height")},e.prototype.parseLegend=function(){O.parseLegend(this)},e.prototype.assembleGroupStyle=function(){if("unit"===this.type||"layer"===this.type)return"cell"},e.prototype.assembleLayoutSize=function(){if("unit"===this.type||"layer"===this.type)return{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")}},e.prototype.assembleHeaderMarks=function(){for(var e=this.component.layoutHeaders,t=[],n=0,r=y.HEADER_CHANNELS;n<r.length;n++){e[o=r[n]].title&&t.push(y.getTitleGroup(this,o))}for(var i=0,a=y.HEADER_CHANNELS;i<a.length;i++)for(var o=a[i],s=e[o],l=0,c=y.HEADER_TYPES;l<c.length;l++){var u=c[l];if(s[u])for(var f=0,d=s[u];f<d.length;f++){var p=d[f],m=y.getHeaderGroup(this,o,u,s,p);m&&t.push(m)}}return t},e.prototype.assembleAxes=function(){return v.assembleAxes(this.component.axes)},e.prototype.assembleLegends=function(){return _.assembleLegends(this)},e.prototype.assembleTitle=function(){var e=o({},p.extractTitleConfig(this.config.title).nonMark,this.title);if(e.text)return g.contains(["unit","layer"],this.type)||(e.anchor&&"start"!==e.anchor&&f.warn(f.message.cannotSetTitleAnchor(this.type)),e.anchor="start"),g.keys(e).length>0?e:void 0},e.prototype.assembleGroup=function(e){void 0===e&&(e=[]);var t={};(e=e.concat(this.assembleSelectionSignals())).length>0&&(t.signals=e);var n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());var r=!this.parent||i(this.parent)?S.assembleScales(this):[];r.length>0&&(t.scales=r);var a=this.assembleAxes();a.length>0&&(t.axes=a);var o=this.assembleLegends();return o.length>0&&(t.legends=o),t},e.prototype.hasDescendantWithFieldOnChannel=function(e){for(var t=0,n=this.children;t<n.length;t++){var i=n[t];if(r(i)){if(i.channelHasField(e))return!0}else if(i.hasDescendantWithFieldOnChannel(e))return!0}return!1},e.prototype.getName=function(e){return g.varName((this.name?this.name+"_":"")+e)},e.prototype.requestDataName=function(e){var t=this.getName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t},e.prototype.getSizeSignalRef=function(e){if(i(this.parent)){var t="width"===e?"x":"y",n=this.component.scales[t];if(n&&!n.merged){var r=n.get("type"),a=n.get("range");if(d.hasDiscreteDomain(r)&&h.isVgRangeStep(a)){var o=n.get("name"),s=x.assembleDomain(this,t),l=x.getFieldFromDomain(s);if(l){var c=u.field({aggregate:"distinct",field:l},{expr:"datum"});return{signal:b.sizeExpr(o,n,c)}}return f.warn("Unknown field for ${channel}.  Cannot calculate view size."),null}}}return{signal:this.layoutSizeNameMap.get(this.getName(e))}},e.prototype.lookupDataSource=function(e){var t=this.component.data.outputNodes[e];return t?t.getSource():e},e.prototype.getSizeName=function(e){return this.layoutSizeNameMap.get(e)},e.prototype.renameLayoutSize=function(e,t){this.layoutSizeNameMap.rename(e,t)},e.prototype.renameScale=function(e,t){this.scaleNameMap.rename(e,t)},e.prototype.scaleName=function(e,t){return t?this.getName(e):l.isChannel(e)&&l.isScaleChannel(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0},e.prototype.getScaleComponent=function(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale().  Make sure you have called parseScale or use parseUnitModelWithScale().");var t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0},e.prototype.getSelectionComponent=function(e,t){var n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(f.message.selectionNotFound(t));return n},e}();n.Model=T;var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.field=function(e,t){void 0===t&&(t={});var n=this.fieldDef(e);if(n)return u.field(n,t)},t.prototype.reduceFieldDef=function(e,t,n){return c.reduce(this.getMapping(),function(t,n,r){var i=u.getFieldDef(n);return i?e(t,i,r):t},t,n)},t.prototype.forEachFieldDef=function(e,t){c.forEach(this.getMapping(),function(t,n){var r=u.getFieldDef(t);r&&e(r,n)},t)},t}(T);n.ModelWithField=P},{"../channel":15,"../encoding":98,"../fielddef":100,"../log":105,"../scale":108,"../title":114,"../transform":116,"../util":118,"../vega.schema":120,"./axis/assemble":16,"./layout/header":46,"./layoutsize/assemble":47,"./legend/assemble":49,"./legend/parse":52,"./scale/assemble":70,"./scale/domain":72,"./scale/parse":73,"./split":89,"vega-util":10}],67:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=e("../log"),a=e("./baseconcat"),o=e("./buildmodel"),s=e("./layoutsize/parse"),l=function(e){function t(t,n,r,a,o){var s=e.call(this,t,n,r,o,t.resolve)||this;return s.type="repeat",t.resolve&&t.resolve.axis&&("shared"===t.resolve.axis.x||"shared"===t.resolve.axis.y)&&i.warn(i.message.REPEAT_CANNOT_SHARE_AXIS),s.repeat=t.repeat,s.children=s._initChildren(t,s.repeat,a,o),s}return r(t,e),t.prototype._initChildren=function(e,t,n,r){for(var i=[],a=t.row||[n?n.row:null],s=t.column||[n?n.column:null],l=0,c=a;l<c.length;l++)for(var u=c[l],f=0,d=s;f<d.length;f++){var p=d[f],m=(u?"_"+u:"")+(p?"_"+p:""),g={row:u,column:p};i.push(o.buildModel(e.spec,this,this.getName("child"+m),void 0,g,r,!1))}return i},t.prototype.parseLayoutSize=function(){s.parseRepeatLayoutSize(this)},t.prototype.assembleLayout=function(){return{padding:{row:10,column:10},offset:10,columns:this.repeat&&this.repeat.column?this.repeat.column.length:1,bounds:"full",align:"all"}},t}(a.BaseConcatModel);n.RepeatModel=l},{"../log":105,"./baseconcat":22,"./buildmodel":23,"./layoutsize/parse":48}],68:[function(e,t,n){"use strict";function r(e,t){return c.isRepeatRef(e.field)?e.field.repeat in t?s({},e,{field:t[e.field.repeat]}):void u.warn(u.message.noSuchRepeatedValue(e.field.repeat)):e}function i(e,t){if(void 0!==(e=r(e,t))){if(e.sort&&f.isSortField(e.sort)){var n=r(e.sort,t);e=s({},e,n?{sort:n}:{})}return e}}function a(e,t){if(!c.isFieldDef(e)){if(c.hasConditionalFieldDef(e)){n=i(e.condition,t);if(n)return s({},e,{condition:n});e.condition;return l(e,["condition"])}return e}var n;return(n=i(e,t))?n:c.isConditionalDef(e)?{condition:e.condition}:void 0}function o(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(d.isArray(i))n[r]=i.map(function(e){return a(e,t)}).filter(function(e){return e});else{var o=a(i,t);o&&(n[r]=o)}}return n}var s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var c=e("../fielddef"),u=e("../log"),f=e("../sort"),d=e("../util");n.replaceRepeaterInFacet=function(e,t){return o(e,t)},n.replaceRepeaterInEncoding=function(e,t){return o(e,t)}},{"../fielddef":100,"../log":105,"../sort":110,"../util":118}],69:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../channel"),i=e("../log"),a=e("../util"),o=e("./model");n.defaultScaleResolve=function(e,t){if(o.isLayerModel(t)||o.isFacetModel(t))return"shared";if(o.isConcatModel(t)||o.isRepeatModel(t))return a.contains(r.POSITION_SCALE_CHANNELS,e)?"independent":"shared";throw new Error("invalid model type for resolve")},n.parseGuideResolve=function(e,t){var n=e.scale[t],o=a.contains(r.POSITION_SCALE_CHANNELS,t)?"axis":"legend";return"independent"===n?("shared"===e[o][t]&&i.warn(i.message.independentScaleMeansIndependentGuide(t)),"independent"):e[o][t]||"shared"}},{"../channel":15,"../log":105,"../util":118,"./model":66}],70:[function(e,t,n){"use strict";function r(e){return f.isLayerModel(e)||f.isConcatModel(e)||f.isRepeatModel(e)?e.children.reduce(function(e,t){return e.concat(r(t))},i(e)):i(e)}function i(e){return c.keys(e.component.scales).reduce(function(t,n){var r=e.component.scales[n];if(r.merged)return t;var i=r.combine(),l=i.domainRaw,c=i.range,u=i.name,f=i.type,m=(i.domainRaw,i.range,s(i,["name","type","domainRaw","range"]));return c=a(c,u,e,n),l&&d.isRawSelectionDomain(l)&&(l=d.selectionScaleDomain(e,l)),t.push(o({name:u,type:f,domain:p.assembleDomain(e,n)},l?{domainRaw:l}:{},{range:c},m)),t},[])}function a(e,t,n,r){if("x"===r||"y"===r){if(u.isVgRangeStep(e))return{step:{signal:t+"_step"}};if(l.isArray(e)&&2===e.length){var i=e[0],a=e[1];if(0===i&&u.isVgSignalRef(a))return[0,{signal:n.getSizeName(a.signal)}];if(u.isVgSignalRef(i)&&0===a)return[{signal:n.getSizeName(i.signal)},0]}}return e}var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var l=e("vega-util"),c=e("../../util"),u=e("../../vega.schema"),f=e("../model"),d=e("../selection/selection"),p=e("./domain");n.assembleScales=r,n.assembleScalesForModel=i,n.assembleScaleRange=a},{"../../util":118,"../../vega.schema":120,"../model":66,"../selection/selection":79,"./domain":72,"vega-util":10}],71:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=function(e){function t(t,n){var r=e.call(this,{},{name:t})||this;return r.merged=!1,r.domains=[],r.setWithExplicit("type",n),r}return r(t,e),t}(e("../split").Split);n.ScaleComponent=i},{"../split":89}],72:[function(e,t,n){"use strict";function r(e){E.isUnitModel(e)?function(e){var t=e.specifiedScales,n=e.component.scales;_.keys(n).forEach(function(r){var i=t[r],o=i?i.domain:void 0,s=a(e,r),l=n[r];l.domains=s,y.isSelectionDomain(o)&&l.set("domainRaw",{signal:N.SELECTION_DOMAIN+JSON.stringify(o)},!0)})}(e):function(e){for(var t=0,n=e.children;t<n.length;t++){r(n[t])}var i=e.component.scales;_.keys(i).forEach(function(t){for(var n,r=0,a=e.children;r<a.length;r++){var o=a[r].component.scales[t];o&&(n=void 0===n?o.domains:n.concat(o.domains))}E.isFacetModel(e)&&n.forEach(function(e){O.isDataRefDomain(e)&&(e.data=w.FACET_SCALE_PREFIX+e.data.replace(w.FACET_SCALE_PREFIX,""))}),i[t].domains=n})}(e)}function i(e,t,n,r){if("unaggregated"===e){var i=l(t,n),a=i.valid,o=i.reason;if(!a)return void v.warn(o)}else if(void 0===e&&r.useUnaggregatedDomain){if(a=l(t,n).valid)return"unaggregated"}return e}function a(e,t){var n=e.getScaleComponent(t).get("type"),r=i(e.scaleDomain(t),e.fieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]=u({},e.specifiedScales[t],{domain:r})),"x"===t&&e.channelHasField("x2")?e.channelHasField("x")?o(n,r,e,"x").concat(o(n,r,e,"x2")):o(n,r,e,"x2"):"y"===t&&e.channelHasField("y2")?e.channelHasField("y")?o(n,r,e,"y").concat(o(n,r,e,"y2")):o(n,r,e,"y2"):o(n,r,e,t)}function o(e,t,n,r){var i=n.fieldDef(r);if(t&&"unaggregated"!==t&&!y.isSelectionDomain(t)){if(!i.bin)return h.isDateTime(t[0])?t.map(function(e){return{signal:"{data: "+h.dateTimeExpr(e,!0)+"}"}}):[t];v.warn(v.message.conflictedDomain(r))}var a=n.stack;if(a&&r===a.fieldChannel){if("normalize"===a.offset)return[[0,1]];return[{data:c=n.requestDataName(g.MAIN),field:n.field(r,{suffix:"start"})},{data:c,field:n.field(r,{suffix:"end"})}]}var o=m.isScaleChannel(r)?s(n,r,e):void 0;if("unaggregated"===t){return[{data:c=n.requestDataName(g.MAIN),field:n.field(r,{aggregate:"min"})},{data:c,field:n.field(r,{aggregate:"max"})}]}if(i.bin){if(y.isBinScale(e)){var l=n.getName(p.binToString(i.bin)+"_"+i.field+"_bins");return[{signal:"sequence("+l+".start, "+l+".stop + "+l+".step, "+l+".step)"}]}if(y.hasDiscreteDomain(e))return[{data:_.isBoolean(o)?n.requestDataName(g.MAIN):n.requestDataName(g.RAW),field:n.field(r,x.binRequiresRange(i,r)?{binSuffix:"range"}:{}),sort:!0!==o&&b.isSortField(o)?o:{field:n.field(r,{}),op:"min"}}];if("x"===r||"y"===r){var c=n.requestDataName(g.MAIN);return[{data:c,field:n.field(r,{})},{data:c,field:n.field(r,{binSuffix:"end"})}]}return[{data:n.requestDataName(g.MAIN),field:n.field(r,{})}]}return o?[{data:_.isBoolean(o)?n.requestDataName(g.MAIN):n.requestDataName(g.RAW),field:n.field(r),sort:o}]:[{data:n.requestDataName(g.MAIN),field:n.field(r)}]}function s(e,t,n){if(y.hasDiscreteDomain(n)){var r=e.sort(t);return b.isSortField(r)?r:"descending"===r?{op:"min",field:e.field(t),order:"descending"}:!!_.contains(["ascending",void 0],r)||void 0}}function l(e,t){return e.aggregate?d.SHARED_DOMAIN_OP_INDEX[e.aggregate]?"quantitative"===e.type&&"log"===t?{valid:!1,reason:v.message.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:v.message.unaggregateDomainWithNonSharedDomainOp(e.aggregate)}:{valid:!1,reason:v.message.unaggregateDomainHasNoEffectForRawField(e)}}function c(e){var t=_.unique(e.map(function(e){if(O.isDataRefDomain(e)){e.sort;return f(e,["sort"])}return e}),_.hash),n=_.unique(e.map(function(e){if(O.isDataRefDomain(e)){var t=e.sort;return void 0===t||_.isBoolean(t)||("count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(function(e){return void 0!==e}),_.hash);if(1===t.length){s=e[0];if(O.isDataRefDomain(s)&&n.length>0){var r=n[0];return n.length>1&&(v.warn(v.message.MORE_THAN_ONE_SORT),r=!0),u({},s,{sort:r})}return s}var i=_.unique(n.map(function(e){return!0===e?e:"count"===e.op?e:(v.warn(v.message.domainSortDropped(e)),!0)}),_.hash),a=void 0;1===i.length?a=i[0]:i.length>1&&(v.warn(v.message.MORE_THAN_ONE_SORT),a=!0);var o=_.unique(e.map(function(e){return O.isDataRefDomain(e)?e.data:null}),function(e){return e});if(1===o.length&&null!==o[0]){var s;return s=u({data:o[0],fields:t.map(function(e){return e.field})},a?{sort:a}:{})}return u({fields:t},a?{sort:a}:{})}var u=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},f=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var d=e("../../aggregate"),p=e("../../bin"),m=e("../../channel"),g=e("../../data"),h=e("../../datetime"),v=e("../../log"),y=e("../../scale"),b=e("../../sort"),_=e("../../util"),O=e("../../vega.schema"),S=e("../../vega.schema"),x=e("../common"),w=e("../data/optimize"),E=e("../model"),N=e("../selection/selection");n.parseScaleDomain=r,n.parseDomainForChannel=a,n.domainSort=s,n.canUseUnaggregatedDomain=l,n.mergeDomains=c,n.getFieldFromDomain=function(e){if(O.isDataRefDomain(e)&&_.isString(e.field))return e.field;if(S.isDataRefUnionedDomain(e)){for(var t=void 0,n=0,r=e.fields;n<r.length;n++){var i=r[n];if(O.isDataRefDomain(i)&&_.isString(i.field))if(t){if(t!==i.field)return v.warn("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."),t}else t=i.field}return v.warn("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."),t}if(S.isFieldRefUnionDomain(e))return v.warn("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."),t=e.fields[0],_.isString(t)?t:void 0},n.assembleDomain=function(e,t){return c(e.component.scales[t].domains.map(function(t){return O.isDataRefDomain(t)&&(t.data=e.lookupDataSource(t.data)),t}))}},{"../../aggregate":12,"../../bin":14,"../../channel":15,"../../data":96,"../../datetime":97,"../../log":105,"../../scale":108,"../../sort":110,"../../util":118,"../../vega.schema":120,"../common":24,"../data/optimize":38,"../model":66,"../selection/selection":79}],73:[function(e,t,n){"use strict";function r(e){l.isUnitModel(e)?e.component.scales=function(e){var t=e.encoding,n=e.config,r=e.mark();return i.SCALE_CHANNELS.reduce(function(i,o){var s,l={},c=t[o];if(a.isFieldDef(c)?(s=c,l=c.scale||{}):a.hasConditionalFieldDef(c)?(s=c.condition,l=c.condition.scale||{}):"x"===o?s=a.getFieldDef(t.x2):"y"===o&&(s=a.getFieldDef(t.y2)),s){var u=l.type,d=g.scaleType(l.type,o,s,r,n.scale);i[o]=new f.ScaleComponent(e.scaleName(o+"",!0),{value:d,explicit:u===d})}return i},{})}(e):e.component.scales=function(e){for(var t=e.component.scales={},n={},i=e.component.resolve,a=function(t){r(t),s.keys(t.component.scales).forEach(function(r){if(i.scale[r]=i.scale[r]||c.defaultScaleResolve(r,e),"shared"===i.scale[r]){var a=n[r],s=t.component.scales[r].getWithExplicit("type");a?o.scaleCompatible(a.value,s.value)?n[r]=u.mergeValuesWithExplicit(a,s,"type","scale",h):(i.scale[r]="independent",delete n[r]):n[r]=s}})},l=0,d=e.children;l<d.length;l++){var p=d[l];a(p)}return s.keys(n).forEach(function(r){var i=e.scaleName(r,!0),a=n[r];t[r]=new f.ScaleComponent(i,a);for(var o=0,s=e.children;o<s.length;o++){var l=s[o],c=l.component.scales[r];c&&(l.renameScale(c.get("name"),i),c.merged=!0)}}),t}(e)}Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../channel"),a=e("../../fielddef"),o=e("../../scale"),s=e("../../util"),l=e("../model"),c=e("../resolve"),u=e("../split"),f=e("./component"),d=e("./domain"),p=e("./properties"),m=e("./range"),g=e("./type");n.parseScale=function(e){r(e),d.parseScaleDomain(e);for(var t=0,n=o.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES;t<n.length;t++){var i=n[t];p.parseScaleProperty(e,i)}m.parseScaleRange(e)},n.parseScaleCore=r;var h=u.tieBreakByComparing(function(e,t){return o.scaleTypePrecedence(e)-o.scaleTypePrecedence(t)})},{"../../channel":15,"../../fielddef":100,"../../scale":108,"../../util":118,"../model":66,"../resolve":69,"../split":89,"./component":71,"./domain":72,"./properties":74,"./range":75,"./type":76}],74:[function(e,t,n){"use strict";function r(e,t){v.isUnitModel(e)?function(e,t){var n=e.component.scales;g.keys(n).forEach(function(r){var a=e.specifiedScales[r],o=n[r],s=e.getScaleComponent(r),l=e.fieldDef(r),c=e.sort(r),u=e.config,f=a[t],d=s.get("type"),g=m.scaleTypeSupportProperty(d,t),h=m.channelScalePropertyIncompatability(r,t);if(void 0!==f&&(g?h&&p.warn(h):p.warn(p.message.scalePropertyNotWorkWithScaleType(d,t,r))),g&&void 0===h)if(void 0!==f)o.copyKeyFromObject(t,a);else{var v=i(t,r,l,c,s.get("type"),s.get("padding"),s.get("paddingInner"),a.domain,e.markDef,u);void 0!==v&&o.set(t,v,!1)}})}(e,t):a(e,t)}function i(e,t,n,r,i,a,d,p,m,g){var h=g.scale;switch(e){case"nice":return o(i,t,n);case"padding":return s(t,i,h,n,m,g.bar);case"paddingInner":return l(a,t,h);case"paddingOuter":return c(a,t,i,d,h);case"reverse":return u(i,r);case"zero":return f(t,n,p)}return h[e]}function a(e,t){for(var n=e.component.scales,i=0,a=e.children;i<a.length;i++){var o=a[i];"range"===t?b.parseScaleRange(o):r(o,t)}g.keys(n).forEach(function(r){for(var i,a=0,o=e.children;a<o.length;a++){var s=o[a].component.scales[r];if(s){var l=s.getWithExplicit(t);i=y.mergeValuesWithExplicit(i,l,t,"scale",y.tieBreakByComparing(function(e,n){switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0}))}}n[r].setWithExplicit(t,i)})}function o(e,t,n){if(!n.bin&&!h.contains([m.ScaleType.TIME,m.ScaleType.UTC],e))return h.contains([d.X,d.Y],t)}function s(e,t,n,r,i,a){if(h.contains([d.X,d.Y],e)){if(m.isContinuousToContinuous(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;var o=i.type,s=i.orient;if("bar"===o&&!r.bin&&("vertical"===s&&"x"===e||"horizontal"===s&&"y"===e))return a.continuousBandSize}if(t===m.ScaleType.POINT)return n.pointPadding}}function l(e,t,n){if(void 0===e)return h.contains([d.X,d.Y],t)?n.bandPaddingInner:void 0}function c(e,t,n,r,i){if(void 0===e)return h.contains([d.X,d.Y],t)&&n===m.ScaleType.BAND?void 0!==i.bandPaddingOuter?i.bandPaddingOuter:r/2:void 0}function u(e,t){if(m.hasContinuousDomain(e)&&"descending"===t)return!0}function f(e,t,n){if("size"===e&&"quantitative"===t.type)return!0;return!(!!n&&"unaggregated"!==n||t.bin||!h.contains([d.X,d.Y],e))}Object.defineProperty(n,"__esModule",{value:!0});var d=e("../../channel"),p=e("../../log"),m=e("../../scale"),g=e("../../util"),h=e("../../util"),v=e("../model"),y=e("../split"),b=e("./range");n.parseScaleProperty=r,n.getDefaultValue=i,n.parseNonUnitScaleProperty=a,n.nice=o,n.padding=s,n.paddingInner=l,n.paddingOuter=c,n.reverse=u,n.zero=f},{"../../channel":15,"../../log":105,"../../scale":108,"../../util":118,"../model":66,"../split":89,"./range":75}],75:[function(e,t,n){"use strict";function r(e,t,r,a,o,s,u,f,d,p){for(var g=f||null===a.rangeStep,h=0,v=n.RANGE_PROPERTIES;h<v.length;h++){var y=v[h];if(void 0!==a[y]){var b=c.scaleTypeSupportProperty(t,y),_=c.channelScalePropertyIncompatability(e,y);if(b)if(_)l.warn(_);else switch(y){case"range":return m.makeExplicit(a[y]);case"scheme":return m.makeExplicit(function(e){if(c.isExtendedScheme(e)){var t={scheme:e.name};return e.count&&(t.count=e.count),e.extent&&(t.extent=e.extent),t}return{scheme:e}}(a[y]));case"rangeStep":var O=a[y];if(null!==O){if(!f)return m.makeExplicit({step:O});l.warn(l.message.rangeStepDropped(e))}}else l.warn(l.message.scalePropertyNotWorkWithScaleType(t,y,e))}}return m.makeImplicit(i(e,t,r,o,s,u,d,p,g))}function i(e,t,n,r,i,o,c,d,p){switch(e){case s.X:case s.Y:if(f.contains(["point","band"],t)&&!p)if(e===s.X&&"text"===o){if(r.scale.textXRangeStep)return{step:r.scale.textXRangeStep}}else if(r.scale.rangeStep)return{step:r.scale.rangeStep};return e===s.Y&&u.hasContinuousDomain(t)?[{signal:c},0]:[0,{signal:c}];case s.SIZE:return[function(e,t,n){if(t)return 0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":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(l.message.incompatibleChannel("size",e))}(o,i,r),function(e,t,n){var r=n.scale;switch(e){case"bar":case"tick":return void 0!==n.scale.maxBandSize?n.scale.maxBandSize:a(t,n.scale)-1;case"line":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;var i=a(t,r);return(i-2)*(i-2)}throw new Error(l.message.incompatibleChannel("size",e))}(o,d,r)];case s.SHAPE:return"symbol";case s.COLOR:return"ordinal"===t?"nominal"===n?"category":"ordinal":"rect"===o?"heatmap":"ramp";case s.OPACITY:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+e)}function a(e,t){return e.length>0?Math.min.apply(null,e):t.rangeStep?t.rangeStep:21}Object.defineProperty(n,"__esModule",{value:!0});var o=e("vega-util"),s=e("../../channel"),l=e("../../log"),c=e("../../scale"),u=e("../../scale"),f=e("../../util"),d=e("../../vega.schema"),p=e("../model"),m=e("../split"),g=e("./properties");n.RANGE_PROPERTIES=["range","rangeStep","scheme"],n.parseScaleRange=function(e){p.isUnitModel(e)?function(e){var t=e.component.scales;s.SCALE_CHANNELS.forEach(function(n){var i=t[n];if(i){var a=e.getScaleComponent(n),s=e.specifiedScales[n],c=e.fieldDef(n),u="x"===n?"width":"y"===n?"height":void 0,p=u?!!e.component.layoutSize.get(u):void 0,m=a.get("type"),g=f.contains(["point","band"],m)||!!s.rangeStep;u&&e.fit&&!p&&g&&(l.warn(l.message.CANNOT_FIX_RANGE_STEP_WITH_FIT),p=!0);var h=function(e){var t=[],n=e.getScaleComponent("x"),r=n&&n.get("range");r&&d.isVgRangeStep(r)&&o.isNumber(r.step)&&t.push(r.step);var i=e.getScaleComponent("y"),a=i&&i.get("range");return a&&d.isVgRangeStep(a)&&o.isNumber(a.step)&&t.push(a.step),t}(e),v=r(n,m,c.type,s,e.config,i.get("zero"),e.mark(),p,e.getName(u),h);i.setWithExplicit("range",v)}})}(e):g.parseNonUnitScaleProperty(e,"range")},n.parseRangeForChannel=r,n.defaultRange=i},{"../../channel":15,"../../log":105,"../../scale":108,"../../util":118,"../../vega.schema":120,"../model":66,"../split":89,"./properties":74,"vega-util":10}],76:[function(e,t,n){"use strict";function r(e,t){var n=t.type;return u.contains([l.Type.ORDINAL,l.Type.NOMINAL],n)?void 0===e||s.hasDiscreteDomain(e):n===l.Type.TEMPORAL?u.contains([o.ScaleType.TIME,o.ScaleType.UTC,o.ScaleType.SEQUENTIAL,void 0],e):n!==l.Type.QUANTITATIVE||(t.bin?u.contains([o.ScaleType.BIN_LINEAR,o.ScaleType.BIN_ORDINAL,o.ScaleType.LINEAR],e):u.contains([o.ScaleType.LOG,o.ScaleType.POW,o.ScaleType.SQRT,o.ScaleType.QUANTILE,o.ScaleType.QUANTIZE,o.ScaleType.LINEAR,o.ScaleType.SEQUENTIAL,void 0],e))}Object.defineProperty(n,"__esModule",{value:!0});var i=e("../../channel"),a=e("../../log"),o=e("../../scale"),s=e("../../scale"),l=e("../../type"),c=e("../../util"),u=e("../../util");n.scaleType=function(e,t,n,s,l){var u=function(e,t,n,r){switch(t.type){case"nominal":case"ordinal":if("color"===e||"discrete"===i.rangeType(e))return"shape"===e&&"ordinal"===t.type&&a.warn(a.message.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if(c.contains(["x","y"],e)){if("rect"===n)return"band";if("bar"===n)return"band"}return"point";case"temporal":return"color"===e?"sequential":"discrete"===i.rangeType(e)?(a.warn(a.message.discreteChannelCannotEncode(e,"temporal")),"ordinal"):"time";case"quantitative":return"color"===e?t.bin?"bin-ordinal":"sequential":"discrete"===i.rangeType(e)?(a.warn(a.message.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):t.bin&&"x"!==e&&"y"!==e?"bin-linear":"linear"}throw new Error(a.message.invalidFieldType(t.type))}(t,n,s);return i.isScaleChannel(t)?void 0!==e?o.channelSupportScaleType(t,e)?r(e,n)?e:(a.warn(a.message.scaleTypeNotWorkWithFieldDef(e,u)),u):(a.warn(a.message.scaleTypeNotWorkWithChannel(t,e,u)),u):u:null},n.fieldDefMatchScaleType=r},{"../../channel":15,"../../log":105,"../../scale":108,"../../type":117,"../../util":118}],77:[function(e,t,n){"use strict";function r(e,t){return e.events.reduce(function(e,n){return n.between?t(e,n):(s.warn(n+" is not an ordered event stream for interval selections"),e)},[])}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../../channel"),s=e("../../log"),l=e("../../scale"),c=e("../../util"),u=e("./selection"),f=e("./transforms/scales");n.BRUSH="_brush",n.SCALE_TRIGGER="_scale_trigger";var d={predicate:"vlInterval",scaleDomain:"vlIntervalDomain",signals:function(e,t){var i=t.name,a=f.default.has(t),d=[],p=[],m=[],g=[];if(t.translate&&!a){var h="!event.item || event.item.mark.name !== "+c.stringValue(i+n.BRUSH);r(t,function(e,t){var n=t.between[0].filter||(t.between[0].filter=[]);n.indexOf(h)<0&&n.push(h)})}return t.project.forEach(function(i){var a=i.channel;if(a===o.X||a===o.Y){var h=function(e,t,i){var a=u.channelSignalName(t,i,"visual"),s=u.channelSignalName(t,i,"data"),d=f.default.has(t),p=e.scaleName(i),m=c.stringValue(p),g=e.getScaleComponent(i),h=g?g.get("type"):void 0,v=e.getSizeSignalRef(i===o.X?"width":"height").signal,y=i+"(unit)",b=r(t,function(e,t){return e.concat({events:t.between[0],update:"["+y+", "+y+"]"},{events:t,update:"["+a+"[0], clamp("+y+", 0, "+v+")]"})});return b.push({events:{signal:t.name+n.SCALE_TRIGGER},update:l.hasContinuousDomain(h)&&!l.isBinScale(h)?"[scale("+m+", "+s+"[0]), scale("+m+", "+s+"[1])]":"[0, 0]"}),d?[{name:s,on:[]}]:[{name:a,value:[],on:b},{name:s,on:[{events:{signal:a},update:a+"[0] === "+a+"[1] ? null : invert("+m+", "+a+")"}]}]}(e,t,a),v=u.channelSignalName(t,a,"data"),y=u.channelSignalName(t,a,"visual"),b=c.stringValue(e.scaleName(a)),_=e.getScaleComponent(a).get("type"),O=l.hasContinuousDomain(_)?"+":"";d.push.apply(d,h),m.push(v),p.push("{encoding: "+c.stringValue(a)+", field: "+c.stringValue(i.field)+", extent: "+v+"}"),g.push({scaleName:e.scaleName(a),expr:"(!isArray("+v+") || ("+O+"invert("+b+", "+y+")[0] === "+O+v+"[0] && "+O+"invert("+b+", "+y+")[1] === "+O+v+"[1]))"})}else s.warn("Interval selections only support x and y encoding channels.")}),a||d.push({name:i+n.SCALE_TRIGGER,update:g.map(function(e){return e.expr}).join(" && ")+" ? "+(i+n.SCALE_TRIGGER)+" : {}"}),d.concat({name:i+u.TUPLE,on:[{events:m.map(function(e){return{signal:e}}),update:m.join(" && ")+" ? {unit: "+u.unitName(e)+", intervals: ["+p.join(", ")+"]} : null"}]})},modifyExpr:function(e,t){return t.name+u.TUPLE+", "+("global"===t.resolve?"true":"{unit: "+u.unitName(e)+"}")},marks:function(e,t,r){var o=t.name,s=u.positionalProjections(t),l=s.xi,d=s.yi,p="data("+c.stringValue(t.name+u.STORE)+")";if(f.default.has(t))return r;var m={x:null!==l?{signal:o+"_x[0]"}:{value:0},y:null!==d?{signal:o+"_y[0]"}:{value:0},x2:null!==l?{signal:o+"_x[1]"}:{field:{group:"width"}},y2:null!==d?{signal:o+"_y[1]"}:{field:{group:"height"}}};if("global"===t.resolve)for(var g=0,h=c.keys(m);g<h.length;g++){var v=h[g];m[v]=[i({test:p+".length && "+p+"[0].unit === "+u.unitName(e)},m[v]),{value:0}]}var y=t.mark,b=y.fill,_=y.fillOpacity,O=a(y,["fill","fillOpacity"]),S=c.keys(O).reduce(function(e,t){return e[t]={value:O[t]},e},{});return[{name:o+n.BRUSH+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:b},fillOpacity:{value:_}},update:m}}].concat(r,{name:o+n.BRUSH,type:"rect",clip:!0,encode:{enter:i({fill:{value:"transparent"}},S),update:m}})}};n.default=d},{"../../channel":15,"../../log":105,"../../scale":108,"../../util":118,"./selection":79,"./transforms/scales":84}],78:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../util"),i=e("./selection"),a=e("./transforms/nearest"),o={predicate:"vlMulti",scaleDomain:"vlMultiDomain",signals:function(e,t){var n=t.project,o=a.default.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum",s=[],l=n.map(function(e){return r.stringValue(e.channel)}).filter(function(e){return e}).join(", "),c=n.map(function(e){return r.stringValue(e.field)}).join(", "),u=n.map(function(t){var n=t.channel,i=e.fieldDef(n);return i&&i.bin?(s.push(t.field),"["+o+r.accessPath(e.field(n,{}))+", "+o+r.accessPath(e.field(n,{binSuffix:"end"}))+"]"):""+o+r.accessPath(t.field)}).join(", ");return[{name:t.name+i.TUPLE,value:{},on:[{events:t.events,update:"datum && item().mark.marktype !== 'group' ? {unit: "+i.unitName(e)+", encodings: ["+l+"], fields: ["+c+"], values: ["+u+"]"+(s.length?", "+s.map(function(e){return r.stringValue("bin_"+e)+": 1"}).join(", "):"")+"} : null",force:!0}]}]},modifyExpr:function(e,t){return t.name+i.TUPLE+", "+("global"===t.resolve?"null":"{unit: "+i.unitName(e)+"}")}};n.default=o},{"../../util":118,"./selection":79,"./transforms/nearest":82}],79:[function(e,t,n){"use strict";function r(e,t){return i(e,function(n,r){t=r.marks?r.marks(e,n,t):t,v.forEachTransform(n,function(r){r.marks&&(t=r.marks(e,n,t))})}),t}function i(e,t){var n=e.component.selection;for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];t(i,a(i.type))}}function a(e){switch(e){case"single":return h.default;case"multi":return g.default;case"interval":return m.default}return null}function o(e){for(var t=e.parent;t&&!p.isFacetModel(t);)t=t.parent;return t}var s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var l=e("vega-event-selector"),c=e("../../channel"),u=e("../../log"),f=e("../../selection"),d=e("../../util"),p=e("../model"),m=e("./interval"),g=e("./multi"),h=e("./single"),v=e("./transforms/transforms");n.STORE="_store",n.TUPLE="_tuple",n.MODIFY="_modify",n.SELECTION_DOMAIN="_selection_domain_",n.parseUnitSelection=function(e,t){var n={},r=e.config.selection,i=function(i){if(!t.hasOwnProperty(i))return"continue";var a=t[i],o=r[a.type];for(var c in o)"encodings"===c&&a.fields||"fields"===c&&a.encodings||("mark"===c&&(a[c]=s({},o[c],a[c])),void 0!==a[c]&&!0!==a[c]||(a[c]=o[c]||a[c]));i=d.varName(i);var u=n[i]=s({},a,{name:i,events:d.isString(a.on)?l.selector(a.on,"scope"):a.on});v.forEachTransform(u,function(t){t.parse&&t.parse(e,a,u)})};for(var a in t)i(a);return n},n.assembleUnitSelectionSignals=function(e,t){i(e,function(r,i){var a=r.name,o=i.modifyExpr(e,r);t.push.apply(t,i.signals(e,r)),v.forEachTransform(r,function(n){n.signals&&(t=n.signals(e,r,t)),n.modifyExpr&&(o=n.modifyExpr(e,r,o))}),t.push({name:a+n.MODIFY,on:[{events:{signal:a+n.TUPLE},update:"modify("+d.stringValue(r.name+n.STORE)+", "+o+")"}]})});var r=o(e);if(t.length&&r){var a=d.stringValue(r.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:l.selector("mousemove","scope"),update:"isTuple(facet) ? facet : group("+a+").datum"}]})}return t},n.assembleTopLevelSignals=function(e,t){var n=!1;i(e,function(r,i){i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),v.forEachTransform(r,function(n){n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}),n=!0}),n&&(t.filter(function(e){return"unit"===e.name}).length||t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}));return t},n.assembleUnitSelectionData=function(e,t){return i(e,function(e){t.filter(function(t){return t.name===e.name+n.STORE}).length||t.push({name:e.name+n.STORE})}),t},n.assembleUnitSelectionMarks=r,n.assembleLayerSelectionMarks=function(e,t){return e.children.forEach(function(e){p.isUnitModel(e)&&(t=r(e,t))}),t},n.predicate=function(e,t,r){var i=[],o=d.logicalExpr(t,function(t){var o=d.varName(t),s=e.getSelectionComponent(o,t),l=d.stringValue(o+n.STORE);if(s.timeUnit){var c=r||e.component.data.raw,u=s.timeUnit.clone();c.parent?u.insertAsParentOf(c):c.parent=u}return"none"!==s.empty&&i.push(l),a(s.type).predicate+"("+l+", datum"+("global"===s.resolve?")":", "+d.stringValue(s.resolve)+")")});return(i.length?"!("+i.map(function(e){return"length(data("+e+"))"}).join(" || ")+") || ":"")+"("+o+")"},n.isRawSelectionDomain=function(e){return e.signal.indexOf(n.SELECTION_DOMAIN)>=0},n.selectionScaleDomain=function(e,t){var r=JSON.parse(t.signal.replace(n.SELECTION_DOMAIN,"")),i=d.varName(r.selection),o=e.component.selection&&e.component.selection[i];return o?(u.warn('Use "bind": "scales" to setup a binding for scales and selections within the same view.'),{signal:"null"}):(o=e.getSelectionComponent(i,r.selection),r.encoding||r.field||(r.field=o.project[0].field,o.project.length>1&&u.warn('A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": '+d.stringValue(r.field)+".")),{signal:a(o.type).scaleDomain+"("+d.stringValue(i+n.STORE)+", "+d.stringValue(r.encoding||null)+", "+d.stringValue(r.field||null)+("global"===o.resolve?")":", "+d.stringValue(o.resolve)+")")})},n.unitName=function(e){var t=d.stringValue(e.name),n=o(e);return n&&(t+=(n.facet.row?" + '_' + facet"+d.accessPath(n.field("row")):"")+(n.facet.column?" + '_' + facet"+d.accessPath(n.field("column")):"")),t},n.requiresSelectionId=function(e){var t=!1;return i(e,function(e){t=t||e.project.some(function(e){return e.field===f.SELECTION_ID})}),t},n.channelSignalName=function(e,t,n){return d.varName(e.name+"_"+("visual"===n?t:e.fields[t]))},n.positionalProjections=function(e){var t=null,n=null,r=null,i=null;return e.project.forEach(function(e,a){e.channel===c.X?(t=e,n=a):e.channel===c.Y&&(r=e,i=a)}),{x:t,xi:n,y:r,yi:i}}},{"../../channel":15,"../../log":105,"../../selection":109,"../../util":118,"../model":66,"./interval":77,"./multi":78,"./single":80,"./transforms/transforms":86,"vega-event-selector":9}],80:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../util"),i=e("./multi"),a=e("./selection"),o={predicate:"vlSingle",scaleDomain:"vlSingleDomain",signals:i.default.signals,topLevelSignals:function(e,t,n){var i=n.filter(function(e){return e.name===t.name}),o="data("+r.stringValue(t.name+a.STORE)+")",s=o+"[0].values";return i.length?n:n.concat({name:t.name,update:o+".length && {"+t.project.map(function(e,t){return e.field+": "+s+"["+t+"]"}).join(", ")+"}"})},modifyExpr:function(e,t){return t.name+a.TUPLE+", "+("global"===t.resolve?"true":"{unit: "+a.unitName(e)+"}")}};n.default=o},{"../../util":118,"./multi":78,"./selection":79}],81:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../../util"),i=e("../selection"),a=e("./nearest"),o={has:function(e){return"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind},topLevelSignals:function(e,t,n){var i=t.name,o=t.project,s=t.bind,l=a.default.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return o.forEach(function(e){var a=r.varName(i+"_"+e.field);n.filter(function(e){return e.name===a}).length||n.unshift({name:a,value:"",on:[{events:t.events,update:"datum && item().mark.marktype !== 'group' ? "+l+r.accessPath(e.field)+" : null"}],bind:s[e.field]||s[e.channel]||s})}),n},signals:function(e,t,n){var a=t.name,o=t.project,s=n.filter(function(e){return e.name===a+i.TUPLE})[0],l=o.map(function(e){return r.stringValue(e.field)}).join(", "),c=o.map(function(e){return r.varName(a+"_"+e.field)});return s.update=c.join(" && ")+" ? {fields: ["+l+"], values: ["+c.join(", ")+"]} : null",delete s.value,delete s.on,n}};n.default=o},{"../../../util":118,"../selection":79,"./nearest":82}],82:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../../log"),i=e("../selection"),a={has:function(e){return"interval"!==e.type&&e.nearest},marks:function(e,t,n){var a=i.positionalProjections(t),o=a.x,s=a.y,l=e.mark();if("line"===l||"area"===l)return r.warn(r.message.nearestNotSupportForContinuous(l)),n;var c={name:e.getName("voronoi"),type:"path",from:{data:e.getName("marks")},encode:{enter:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}}},transform:[{type:"voronoi",x:o||!o&&!s?"datum.x":{expr:"0"},y:s||!o&&!s?"datum.y":{expr:"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]},u=0,f=!1;return n.forEach(function(t,n){var r=t.name||"";r===e.component.mark[0].name?u=n:r.indexOf("voronoi")>=0&&(f=!0)}),f||n.splice(u+1,0,c),n}};n.default=a},{"../../../log":105,"../selection":79}],83:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../../log"),i=e("../../../util"),a=e("../../data/timeunit"),o={has:function(e){var t=e;return void 0!==t.fields||void 0!==t.encodings},parse:function(e,t,n){var o={},s={};(t.fields||[]).forEach(function(e){return o[e]=null}),(t.encodings||[]).forEach(function(t){var n=e.fieldDef(t);if(n)if(n.timeUnit){var i=e.field(t);o[i]=t,s[i]={as:i,field:n.field,timeUnit:n.timeUnit}}else o[n.field]=t;else r.warn(r.message.cannotProjectOnChannelWithoutField(t))});var l=n.project||(n.project=[]);for(var c in o)o.hasOwnProperty(c)&&l.push({field:c,channel:o[c]});var u=n.fields||(n.fields={});l.filter(function(e){return e.channel}).forEach(function(e){return u[e.channel]=e.field}),i.keys(s).length&&(n.timeUnit=new a.TimeUnitNode(s))}};n.default=o},{"../../../log":105,"../../../util":118,"../../data/timeunit":43}],84:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../../../log"),i=e("../../../scale"),a=e("../../../util"),o=e("../selection"),s={has:function(e){return"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind},parse:function(e,t,n){var a=n.scales=[];n.project.forEach(function(t){var s=t.channel,l=e.getScaleComponent(s),c=l?l.get("type"):void 0;l&&i.hasContinuousDomain(c)&&!i.isBinScale(c)?(l.set("domainRaw",{signal:o.channelSignalName(n,s,"data")},!0),a.push(s)):r.warn(r.message.SCALE_BINDINGS_CONTINUOUS)})},topLevelSignals:function(e,t,n){if(!e.parent)return n;var r=t.scales.filter(function(e){return!n.filter(function(n){return n.name===o.channelSignalName(t,e,"data")}).length});return n.concat(r.map(function(e){return{name:o.channelSignalName(t,e,"data")}}))},signals:function(e,t,n){return e.parent&&t.scales.forEach(function(e){var r=n.filter(function(n){return n.name===o.channelSignalName(t,e,"data")})[0];r.push="outer",delete r.value,delete r.update}),n}};n.default=s,n.domain=function(e,t){return"domain("+a.stringValue(e.scaleName(t))+")"}},{"../../../log":105,"../../../scale":108,"../../../util":118,"../selection":79}],85:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../selection"),i={has:function(e){return"multi"===e.type&&e.toggle},signals:function(e,t,n){return n.concat({name:t.name+"_toggle",value:!1,on:[{events:t.events,update:t.toggle}]})},modifyExpr:function(e,t,n){var i=t.name+r.TUPLE,a=t.name+"_toggle";return a+" ? null : "+i+", "+("global"===t.resolve?a+" ? null : true, ":a+" ? null : {unit: "+r.unitName(e)+"}, ")+a+" ? "+i+" : null"}};n.default=i},{"../selection":79}],86:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./inputs"),i=e("./nearest"),a=e("./project"),o=e("./scales"),s=e("./toggle"),l=e("./translate"),c=e("./zoom"),u={project:a.default,toggle:s.default,scales:o.default,translate:l.default,zoom:c.default,inputs:r.default,nearest:i.default};n.forEachTransform=function(e,t){for(var n in u)u[n].has(e)&&t(u[n])}},{"./inputs":81,"./nearest":82,"./project":83,"./scales":84,"./toggle":85,"./translate":87,"./zoom":88}],87:[function(e,t,n){"use strict";function r(e,t,n,r,i){var o=t.name,f=l.default.has(t),d=i.filter(function(e){return e.name===s.channelSignalName(t,n,f?"data":"visual")})[0],p=o+c,m=o+u,g=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(n),v=h.get("type"),y=f&&n===a.X?"-":"",b=p+".extent_"+n,_=(f?"log"===v?"panLog":"pow"===v?"panPow":"panLinear":"panLinear")+"("+b+", "+(""+y+m+"."+n+" / "+(f?""+g:"span("+b+")"))+(f&&"pow"===v?", "+(h.get("exponent")||1):"")+")";d.on.push({events:{signal:m},update:f?_:"clampRange("+_+", 0, "+g+")"})}Object.defineProperty(n,"__esModule",{value:!0});var i=e("vega-event-selector"),a=e("../../../channel"),o=e("../interval"),s=e("../selection"),l=e("./scales"),c="_translate_anchor",u="_translate_delta",f={has:function(e){return"interval"===e.type&&e.translate},signals:function(e,t,n){var f=t.name,d=l.default.has(t),p=f+c,m=s.positionalProjections(t),g=m.x,h=m.y,v=i.selector(t.translate,"scope");return d||(v=v.map(function(e){return e.between[0].markname=f+o.BRUSH,e})),n.push({name:p,value:{},on:[{events:v.map(function(e){return e.between[0]}),update:"{x: x(unit), y: y(unit)"+(null!==g?", extent_x: "+(d?l.domain(e,a.X):"slice("+s.channelSignalName(t,"x","visual")+")"):"")+(null!==h?", extent_y: "+(d?l.domain(e,a.Y):"slice("+s.channelSignalName(t,"y","visual")+")"):"")+"}"}]},{name:f+u,value:{},on:[{events:v,update:"{x: "+p+".x - x(unit), y: "+p+".y - y(unit)}"}]}),null!==g&&r(e,t,a.X,"width",n),null!==h&&r(e,t,a.Y,"height",n),n}};n.default=f},{"../../../channel":15,"../interval":77,"../selection":79,"./scales":84,"vega-event-selector":9}],88:[function(e,t,n){"use strict";function r(e,t,n,r,i){var a=t.name,o=c.default.has(t),s=i.filter(function(e){return e.name===l.channelSignalName(t,n,o?"data":"visual")})[0],d=e.getSizeSignalRef(r).signal,p=e.getScaleComponent(n),m=p.get("type"),g=o?c.domain(e,n):s.name,h=a+f,v=(o?"log"===m?"zoomLog":"pow"===m?"zoomPow":"zoomLinear":"zoomLinear")+"("+g+", "+(""+a+u+"."+n)+", "+h+(o&&"pow"===m?", "+(p.get("exponent")||1):"")+")";s.on.push({events:{signal:h},update:o?v:"clampRange("+v+", 0, "+d+")"})}Object.defineProperty(n,"__esModule",{value:!0});var i=e("vega-event-selector"),a=e("../../../channel"),o=e("../../../util"),s=e("../interval"),l=e("../selection"),c=e("./scales"),u="_zoom_anchor",f="_zoom_delta",d={has:function(e){return"interval"===e.type&&e.zoom},signals:function(e,t,n){var d=t.name,p=c.default.has(t),m=d+f,g=l.positionalProjections(t),h=g.x,v=g.y,y=o.stringValue(e.scaleName(a.X)),b=o.stringValue(e.scaleName(a.Y)),_=i.selector(t.zoom,"scope");return p||(_=_.map(function(e){return e.markname=d+s.BRUSH,e})),n.push({name:d+u,on:[{events:_,update:p?"{"+[y?"x: invert("+y+", x(unit))":"",b?"y: invert("+b+", y(unit))":""].filter(function(e){return!!e}).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:m,on:[{events:_,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),null!==h&&r(e,t,"x","width",n),null!==v&&r(e,t,"y","height",n),n}};n.default=d},{"../../../channel":15,"../../../util":118,"../interval":77,"../selection":79,"./scales":84,"vega-event-selector":9}],89:[function(e,t,n){"use strict";function r(e,t,n,r){return e.explicit&&t.explicit&&a.warn(a.message.mergeConflictingProperty(n,r,e.value,t.value)),e}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../log"),o=e("../util"),s=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.explicit=e,this.implicit=t}return e.prototype.clone=function(){return new e(o.duplicate(this.explicit),o.duplicate(this.implicit))},e.prototype.combine=function(){return i({},this.explicit,this.implicit)},e.prototype.get=function(e){return void 0!==this.explicit[e]?this.explicit[e]:this.implicit[e]},e.prototype.getWithExplicit=function(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}},e.prototype.setWithExplicit=function(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)},e.prototype.set=function(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this},e.prototype.copyKeyFromSplit=function(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)},e.prototype.copyKeyFromObject=function(e,t){void 0!==t[e]&&this.set(e,t[e],!0)},e}();n.Split=s,n.makeExplicit=function(e){return{explicit:!0,value:e}},n.makeImplicit=function(e){return{explicit:!1,value:e}},n.tieBreakByComparing=function(e){return function(t,n,i,a){var o=e(t.value,n.value);return o>0?t:o<0?n:r(t,n,i,a)}},n.defaultTieBreaker=r,n.mergeValuesWithExplicit=function(e,t,n,i,a){return void 0===a&&(a=r),void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:e.value===t.value?e:a(e,t,n,i)}},{"../log":105,"../util":118}],90:[function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("../channel"),o=e("../encoding"),s=e("../encoding"),l=e("../fielddef"),c=e("../mark"),u=e("../stack"),f=e("../util"),d=e("./axis/parse"),p=e("./data/parse"),m=e("./layoutsize/assemble"),g=e("./layoutsize/parse"),h=e("./mark/init"),v=e("./mark/mark"),y=e("./model"),b=e("./repeater"),_=e("./selection/selection"),O=function(e){function t(t,n,r,a,o,l,f){void 0===a&&(a={});var d=e.call(this,t,n,r,l,void 0)||this;d.fit=f,d.type="unit",d.specifiedScales={},d.specifiedAxes={},d.specifiedLegends={},d.selection={},d.children=[],d.initSize(i({},a,t.width?{width:t.width}:{},t.height?{height:t.height}:{}));var p=c.isMarkDef(t.mark)?t.mark.type:t.mark,m=d.encoding=s.normalizeEncoding(b.replaceRepeaterInEncoding(t.encoding||{},o),p);return d.markDef=h.normalizeMarkDef(t.mark,m,l),d.stack=u.stack(p,m,d.config.stack),d.specifiedScales=d.initScales(p,m),d.specifiedAxes=d.initAxes(m),d.specifiedLegends=d.initLegend(m),d.selection=t.selection,d}return r(t,e),t.prototype.scaleDomain=function(e){var t=this.specifiedScales[e];return t?t.domain:void 0},t.prototype.sort=function(e){return(this.getMapping()[e]||{}).sort},t.prototype.axis=function(e){return this.specifiedAxes[e]},t.prototype.legend=function(e){return this.specifiedLegends[e]},t.prototype.initScales=function(e,t){return a.SCALE_CHANNELS.reduce(function(e,n){var r,i,a=t[n];return l.isFieldDef(a)?(r=a,i=a.scale):l.hasConditionalFieldDef(a)?(r=a.condition,i=a.condition.scale):"x"===n?r=l.getFieldDef(t.x2):"y"===n&&(r=l.getFieldDef(t.y2)),r&&(e[n]=i||{}),e},{})},t.prototype.initAxes=function(e){return[a.X,a.Y].reduce(function(t,n){var r=e[n];if(l.isFieldDef(r)||n===a.X&&l.isFieldDef(e.x2)||n===a.Y&&l.isFieldDef(e.y2)){var o=l.isFieldDef(r)?r.axis:null;null!==o&&!1!==o&&(t[n]=i({},o))}return t},{})},t.prototype.initLegend=function(e){return a.NONPOSITION_SCALE_CHANNELS.reduce(function(t,n){var r=e[n];if(r){var a=l.isFieldDef(r)?r.legend:l.hasConditionalFieldDef(r)?r.condition.legend:null;null!==a&&!1!==a&&(t[n]=i({},a))}return t},{})},t.prototype.parseData=function(){this.component.data=p.parseData(this)},t.prototype.parseLayoutSize=function(){g.parseUnitLayoutSize(this)},t.prototype.parseSelection=function(){this.component.selection=_.parseUnitSelection(this,this.selection)},t.prototype.parseMarkGroup=function(){this.component.mark=v.parseMarkGroup(this)},t.prototype.parseAxisAndHeader=function(){this.component.axes=d.parseUnitAxis(this)},t.prototype.assembleSelectionTopLevelSignals=function(e){return _.assembleTopLevelSignals(this,e)},t.prototype.assembleSelectionSignals=function(){return _.assembleUnitSelectionSignals(this,[])},t.prototype.assembleSelectionData=function(e){return _.assembleUnitSelectionData(this,e)},t.prototype.assembleLayout=function(){return null},t.prototype.assembleLayoutSignals=function(){return m.assembleLayoutSignals(this)},t.prototype.assembleMarks=function(){var e=this.component.mark||[];return this.parent&&y.isLayerModel(this.parent)||(e=_.assembleUnitSelectionMarks(this,e)),e.map(this.correctDataNames)},t.prototype.assembleLayoutSize=function(){return{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")}},t.prototype.getMapping=function(){return this.encoding},t.prototype.toSpec=function(e,t){var n,r=f.duplicate(this.encoding);return n={mark:this.markDef,encoding:r},e||(n.config=f.duplicate(this.config)),t||(n.data=f.duplicate(this.data)),n},t.prototype.mark=function(){return this.markDef.type},t.prototype.channelHasField=function(e){return o.channelHasField(this.encoding,e)},t.prototype.fieldDef=function(e){var t=this.encoding[e];return l.getFieldDef(t)},t}(y.ModelWithField);n.UnitModel=O},{"../channel":15,"../encoding":98,"../fielddef":100,"../mark":107,"../stack":112,"../util":118,"./axis/parse":20,"./data/parse":40,"./layoutsize/assemble":47,"./layoutsize/parse":48,"./mark/init":56,"./mark/mark":58,"./model":66,"./repeater":68,"./selection/selection":79}],91:[function(e,t,n){"use strict";function r(e){return!!e.type}function i(e){return a({},e,{encoding:l.reduce(e.encoding,function(e,t,r){return p.indexOf(r)>-1?e[r]=t:f.warn(f.message.incompatibleChannel(r,n.BOXPLOT)),e},{})})}var a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var s=e("vega-util"),l=e("../encoding"),c=e("./../encoding"),u=e("./../fielddef"),f=e("./../log"),d=e("./common");n.BOXPLOT="box-plot",n.isBoxPlotDef=r,n.BOXPLOT_STYLES=["boxWhisker","box","boxMid"],n.VL_ONLY_BOXPLOT_CONFIG_PROPERTY_INDEX={box:["size","color"],boxWhisker:["color"],boxMid:["color"]};var p=["x","y","color","detail","opacity","size"];n.filterUnsupportedChannels=i,n.normalizeBoxPlot=function(e,t){var l=(e=i(e)).mark,p=(e.encoding,e.selection),m=o(e,["mark","encoding","selection"]),g=void 0;r(l)&&l.extent&&s.isNumber(l.extent)&&(g=l.extent);var h=function(e,t,r){var i=function(e,t){e.mark;var r,i,a=e.encoding;if(o(e,["mark","encoding"]),"vertical"===t?(i="y",r=a.y):(i="x",r=a.x),r&&r.aggregate){var s=r.aggregate,l=o(r,["aggregate"]);s!==n.BOXPLOT&&f.warn("Continuous axis should not have customized aggregation function "+s),r=l}return{continuousAxisChannelDef:r,continuousAxis:i}}(e,t),a=i.continuousAxisChannelDef,s=i.continuousAxis,l=e.encoding,d=void 0===r,p=[{op:"q1",field:a.field,as:"lower_box_"+a.field},{op:"q3",field:a.field,as:"upper_box_"+a.field},{op:"median",field:a.field,as:"mid_box_"+a.field}],m=[];p.push({op:"min",field:a.field,as:(d?"lower_whisker_":"min_")+a.field}),p.push({op:"max",field:a.field,as:(d?"upper_whisker_":"max_")+a.field}),d||(m=[{calculate:"datum.upper_box_"+a.field+" - datum.lower_box_"+a.field,as:"iqr_"+a.field},{calculate:"min(datum.upper_box_"+a.field+" + datum.iqr_"+a.field+" * "+r+", datum.max_"+a.field+")",as:"upper_whisker_"+a.field},{calculate:"max(datum.lower_box_"+a.field+" - datum.iqr_"+a.field+" * "+r+", datum.min_"+a.field+")",as:"lower_whisker_"+a.field}]);var g=[],h=[],v=[],y={};return c.forEach(l,function(e,t){if(t!==s)if(u.isFieldDef(e)){if(e.aggregate&&e.aggregate!==n.BOXPLOT)p.push({op:e.aggregate,field:e.field,as:u.field(e)});else if(void 0===e.aggregate){var r=u.field(e),i=e.bin;if(i){var a=e.field;h.push({bin:i,field:a,as:r})}else if(e.timeUnit){var o=e.timeUnit,c=e.field;v.push({timeUnit:o,field:c,as:r})}g.push(r)}y[t]={field:u.field(e),type:e.type}}else y[t]=l[t]}),{transform:[].concat(h,v,[{aggregate:p,groupby:g}],m),continuousAxisChannelDef:a,continuousAxis:s,encodingWithoutContinuousAxis:y}}(e,function(e){var t=e.mark,i=e.encoding;if(o(e,["mark","encoding"]),u.isFieldDef(i.x)&&u.isContinuous(i.x)){if(u.isFieldDef(i.y)&&u.isContinuous(i.y)){if(void 0===i.x.aggregate&&i.y.aggregate===n.BOXPLOT)return"vertical";if(void 0===i.y.aggregate&&i.x.aggregate===n.BOXPLOT)return"horizontal";if(i.x.aggregate===n.BOXPLOT&&i.y.aggregate===n.BOXPLOT)throw new Error("Both x and y cannot have aggregate");return r(t)&&t.orient?t.orient:"vertical"}return"horizontal"}if(u.isFieldDef(i.y)&&u.isContinuous(i.y))return"vertical";throw new Error("Need a valid continuous axis for boxplots")}(e),g),v=h.transform,y=h.continuousAxisChannelDef,b=h.continuousAxis,_=h.encodingWithoutContinuousAxis,O=(_.color,_.size),S=o(_,["color","size"]),x=O?{size:O}:d.getMarkSpecificConfigMixins(t.box,"size"),w={};return y.scale&&(w.scale=y.scale),y.axis&&(w.axis=y.axis),a({},m,{transform:v,layer:[{mark:{type:"rule",style:"boxWhisker"},encoding:a((E={},E[b]=a({field:"lower_whisker_"+y.field,type:y.type},w),E[b+"2"]={field:"lower_box_"+y.field,type:y.type},E),S,d.getMarkSpecificConfigMixins(t.boxWhisker,"color"))},{mark:{type:"rule",style:"boxWhisker"},encoding:a((N={},N[b]={field:"upper_box_"+y.field,type:y.type},N[b+"2"]={field:"upper_whisker_"+y.field,type:y.type},N),S,d.getMarkSpecificConfigMixins(t.boxWhisker,"color"))},a({},p?{selection:p}:{},{mark:{type:"bar",style:"box"},encoding:a((T={},T[b]={field:"lower_box_"+y.field,type:y.type},T[b+"2"]={field:"upper_box_"+y.field,type:y.type},T),_,_.color?{}:d.getMarkSpecificConfigMixins(t.box,"color"),x)}),{mark:{type:"tick",style:"boxMid"},encoding:a((P={},P[b]={field:"mid_box_"+y.field,type:y.type},P),S,d.getMarkSpecificConfigMixins(t.boxMid,"color"),x)}]});var E,N,T,P}},{"../encoding":98,"./../encoding":98,"./../fielddef":100,"./../log":105,"./common":92,"vega-util":10}],92:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getMarkSpecificConfigMixins=function(e,t){var n=e[t];return void 0!==n?(r={},r[t]={value:n},r):{};var r}},{}],93:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0}),n.ERRORBAR="error-bar",n.normalizeErrorBar=function(e){e.mark,e.selection;var t=e.encoding,n=i(e,["mark","selection","encoding"]),a=(t.size,i(t,["size"])),o=(t.x2,t.y2,i(t,["x2","y2"])),s=(o.x,o.y,i(o,["x","y"]));if(!t.x2&&!t.y2)throw new Error("Neither x2 or y2 provided");return r({},n,{layer:[{mark:"rule",encoding:a},{mark:"tick",encoding:o},{mark:"tick",encoding:t.x2?r({x:t.x2,y:t.y},s):r({x:t.x,y:t.y2},s)}]})}},{}],94:[function(e,t,n){"use strict";function r(e,t){l[e]=t}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("./../mark"),o=e("./boxplot"),s=e("./errorbar"),l={};n.add=r,n.remove=function(e){delete l[e]},n.COMPOSITE_MARK_STYLES=o.BOXPLOT_STYLES,n.VL_ONLY_COMPOSITE_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX=i({},o.VL_ONLY_BOXPLOT_CONFIG_PROPERTY_INDEX),r(o.BOXPLOT,o.normalizeBoxPlot),r(s.ERRORBAR,s.normalizeErrorBar),n.normalize=function(e,t){var n=a.isMarkDef(e.mark)?e.mark.type:e.mark,r=l[n];if(r)return r(e,t);throw new Error("Unregistered composite mark "+n)}},{"./../mark":107,"./boxplot":91,"./errorbar":93}],95:[function(e,t,n){"use strict";function r(e,t,n){var r="title"===t?p.extractTitleConfig(e.title).mark:e[t];"view"===t&&(n="cell");var a=i({},r,e.style[t]);m.keys(a).length>0&&(e.style[n||t]=a),delete e[t]}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("./compositemark"),o=e("./compositemark/index"),s=e("./guide"),l=e("./legend"),c=e("./mark"),u=e("./mark"),f=e("./scale"),d=e("./selection"),p=e("./title"),m=e("./util");n.defaultViewConfig={width:200,height:200},n.defaultConfig={padding:5,timeFormat:"%b %d, %Y",countTitle:"Number of Records",invalidValues:"filter",view:n.defaultViewConfig,mark:u.defaultMarkConfig,area:{},bar:u.defaultBarConfig,circle:{},line:{},point:{},rect:{},rule:{color:"black"},square:{},text:{color:"black"},tick:u.defaultTickConfig,box:{size:14},boxWhisker:{},boxMid:{color:"white"},scale:f.defaultScaleConfig,axis:{},axisX:{},axisY:{minExtent:30},axisLeft:{},axisRight:{},axisTop:{},axisBottom:{},axisBand:{},legend:l.defaultLegendConfig,selection:d.defaultConfig,style:{},title:{}},n.initConfig=function(e){return m.mergeDeep(m.duplicate(n.defaultConfig),e)};var g=["view"].concat(c.PRIMITIVE_MARKS,a.COMPOSITE_MARK_STYLES),h=["padding","numberFormat","timeFormat","countTitle","stack","scale","selection","invalidValues","overlay"],v=i({view:["width","height"]},c.VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX,o.VL_ONLY_COMPOSITE_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX);n.stripAndRedirectConfig=function(e){e=m.duplicate(e);for(var t=0,n=h;t<n.length;t++)delete e[w=n[t]];if(e.axis)for(var i=0,a=s.VL_ONLY_GUIDE_CONFIG;i<a.length;i++)w=a[i],delete e.axis[w];if(e.legend)for(var o=0,l=s.VL_ONLY_GUIDE_CONFIG;o<l.length;o++)w=l[o],delete e.legend[w];if(e.mark)for(var u=0,f=c.VL_ONLY_MARK_CONFIG_PROPERTIES;u<f.length;u++)w=f[u],delete e.mark[w];for(var d=0,p=g;d<p.length;d++){for(var y=p[d],b=0,_=c.VL_ONLY_MARK_CONFIG_PROPERTIES;b<_.length;b++)w=_[b],delete e[y][w];var O=v[y];if(O)for(var S=0,x=O;S<x.length;S++)w=x[S],delete e[y][w];r(e,y)}r(e,"title","group-title");for(var w in e)m.isObject(e[w])&&0===m.keys(e[w]).length&&delete e[w];return m.keys(e).length>0?e:void 0}},{"./compositemark":94,"./compositemark/index":94,"./guide":102,"./legend":104,"./mark":107,"./scale":108,"./selection":109,"./title":114,"./util":118}],96:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isUrlData=function(e){return!!e.url},n.isInlineData=function(e){return!!e.values},n.isNamedData=function(e){return!!e.name},n.MAIN="main",n.RAW="raw"},{}],97:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./log"),i=e("./util"),a=2006;n.isDateTime=function(e){return!(!e||!(e.year||e.quarter||e.month||e.date||e.day||e.hours||e.minutes||e.seconds||e.milliseconds))},n.MONTHS=["january","february","march","april","may","june","july","august","september","october","november","december"],n.SHORT_MONTHS=n.MONTHS.map(function(e){return e.substr(0,3)}),n.DAYS=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n.SHORT_DAYS=n.DAYS.map(function(e){return e.substr(0,3)}),n.dateTimeExpr=function(e,t){void 0===t&&(t=!1);var o=[];if(t&&void 0!==e.day&&i.keys(e).length>1&&(r.warn(r.message.droppedDay(e)),delete(e=i.duplicate(e)).day),void 0!==e.year?o.push(e.year):void 0!==e.day?o.push(a):o.push(0),void 0!==e.month){var s=t?function(e){if(i.isNumber(e))return e-1+"";var t=e.toLowerCase(),a=n.MONTHS.indexOf(t);if(-1!==a)return a+"";var o=t.substr(0,3),s=n.SHORT_MONTHS.indexOf(o);if(-1!==s)return s+"";throw new Error(r.message.invalidTimeUnit("month",e))}(e.month):e.month;o.push(s)}else if(void 0!==e.quarter){var l=t?function(e){if(i.isNumber(e))return e>4&&r.warn(r.message.invalidTimeUnit("quarter",e)),e-1+"";throw new Error(r.message.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;o.push(l+"*3")}else o.push(0);if(void 0!==e.date)o.push(e.date);else if(void 0!==e.day){var c=t?function(e){if(i.isNumber(e))return e%7+"";var t=e.toLowerCase(),a=n.DAYS.indexOf(t);if(-1!==a)return a+"";var o=t.substr(0,3),s=n.SHORT_DAYS.indexOf(o);if(-1!==s)return s+"";throw new Error(r.message.invalidTimeUnit("day",e))}(e.day):e.day;o.push(c+"+1")}else o.push(1);for(var u=0,f=["hours","minutes","seconds","milliseconds"];u<f.length;u++){var d=f[u];void 0!==e[d]?o.push(e[d]):o.push(0)}return e.utc?"utc("+o.join(", ")+")":"datetime("+o.join(", ")+")"}},{"./log":105,"./util":118}],98:[function(e,t,n){"use strict";function r(e,t){var n=e&&e[t];return!!n&&(s.isArray(n)?s.some(n,function(e){return!!e.field}):a.isFieldDef(n)||a.hasConditionalFieldDef(n))}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./channel"),a=e("./fielddef"),o=e("./log"),s=e("./util");n.channelHasField=r,n.isAggregate=function(e){return s.some(i.CHANNELS,function(t){if(r(e,t)){var n=e[t];if(s.isArray(n))return s.some(n,function(e){return!!e.aggregate});var i=a.getFieldDef(n);return i&&!!i.aggregate}return!1})},n.normalizeEncoding=function(e,t){return s.keys(e).reduce(function(n,r){if(!i.supportMark(r,t))return o.warn(o.message.incompatibleChannel(r,t)),n;if("size"===r&&"line"===t){var l=a.getFieldDef(e[r]);if(l&&l.aggregate)return o.warn(o.message.incompatibleChannel(r,t,"when the field is aggregated.")),n}if("detail"===r||"order"===r)(c=e[r])&&(n[r]=(s.isArray(c)?c:[c]).reduce(function(e,t){return a.isFieldDef(t)?e.push(a.normalizeFieldDef(t,r)):o.warn(o.message.emptyFieldDef(t,r)),e},[]));else{var c=e[r];if(!a.isFieldDef(c)&&!a.isValueDef(c)&&!a.isConditionalDef(c))return o.warn(o.message.emptyFieldDef(c,r)),n;n[r]=a.normalize(c,r)}return n},{})},n.isRanged=function(e){return e&&(!!e.x&&!!e.x2||!!e.y&&!!e.y2)},n.fieldDefs=function(e){var t=[];return i.CHANNELS.forEach(function(n){if(r(e,n)){var i=e[n];(s.isArray(i)?i:[i]).forEach(function(e){a.isFieldDef(e)?t.push(e):a.hasConditionalFieldDef(e)&&t.push(e.condition)})}}),t},n.forEach=function(e,t,n){if(e)for(var r=function(r){s.isArray(e[r])?e[r].forEach(function(e){t.call(n,e,r)}):t.call(n,e[r],r)},i=0,a=s.keys(e);i<a.length;i++)r(a[i])},n.reduce=function(e,t,n,r){return e?s.keys(e).reduce(function(n,i){var a=e[i];return s.isArray(a)?a.reduce(function(e,n){return t.call(r,e,n,i)},n):t.call(r,n,a,i)},n):n}},{"./channel":15,"./fielddef":100,"./log":105,"./util":118}],99:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0})},{}],100:[function(e,t,n){"use strict";function r(e){return!!e&&!!e.condition&&!w.isArray(e.condition)&&i(e.condition)}function i(e){return!(!e||!e.field&&"count"!==e.aggregate)}function a(e){return e&&"value"in e&&void 0!==e.value}function o(e){switch(e.type){case"nominal":case"ordinal":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(O.message.invalidFieldType(e.type))}function s(e){return!o(e)}function l(e){return"count"===e.aggregate}function c(e,t){var n=e.field,r=e.bin,i=e.timeUnit,a=e.aggregate;if("count"===a)return t.countTitle;if(r)return n+" (binned)";if(i){return n+" ("+S.getTimeUnitParts(i).join("-")+")"}return a?w.titlecase(a)+" of "+n:n}function u(e,t){var n=e.aggregate||e.timeUnit||e.bin&&"bin";return n?n.toUpperCase()+"("+e.field+")":e.field}function f(e){E=e}function d(e,t){if(e.timeUnit)return"temporal";if(e.bin)return"quantitative";switch(_.rangeType(t)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}function p(e,t){if(e.aggregate&&!y.isAggregateOp(e.aggregate)){e.aggregate;var n=v(e,["aggregate"]);O.warn(O.message.invalidAggregate(e.aggregate)),e=n}if(e.timeUnit&&(e=h({},e,{timeUnit:S.normalizeTimeUnit(e.timeUnit)})),e.bin&&(e=h({},e,{bin:m(e.bin,t)})),e.type){var r=x.getFullName(e.type);e.type!==r&&(e=h({},e,{type:r})),"quantitative"!==e.type&&y.isCountingAggregateOp(e.aggregate)&&(O.warn(O.message.invalidFieldTypeForCountAggregate(e.type,e.aggregate)),e=h({},e,{type:"quantitative"}))}else{var i=d(e,t);O.warn(O.message.emptyOrInvalidFieldType(e.type,t,i)),e=h({},e,{type:i})}var a=g(e,t),o=a.compatible,s=a.warning;return o||O.warn(s),e}function m(e,t){return w.isBoolean(e)?{maxbins:b.autoMaxBins(t)}:e.maxbins||e.step?e:h({},e,{maxbins:b.autoMaxBins(t)})}function g(e,t){switch(t){case"row":case"column":return s(e)&&!e.timeUnit?{compatible:!1,warning:O.message.facetChannelShouldBeDiscrete(t)}:N;case"x":case"y":case"color":case"text":case"detail":case"tooltip":return N;case"opacity":case"size":case"x2":case"y2":return o(e)&&!e.bin?{compatible:!1,warning:"Channel "+t+" should not be used with discrete field."}:N;case"shape":return"nominal"!==e.type?{compatible:!1,warning:"Shape channel should be used with nominal data only"}:N;case"order":return"nominal"===e.type?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:N}throw new Error("channelCompatability not implemented for channel "+t)}var h=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},v=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var y=e("./aggregate"),b=e("./bin"),_=e("./channel"),O=e("./log"),S=e("./timeunit"),x=e("./type"),w=e("./util");n.isRepeatRef=function(e){return e&&!w.isString(e)&&"repeat"in e},n.isConditionalDef=function(e){return!!e&&!!e.condition},n.hasConditionalFieldDef=r,n.hasConditionalValueDef=function(e){return!!e&&!!e.condition&&(w.isArray(e.condition)||a(e.condition))},n.isFieldDef=i,n.isStringFieldDef=function(e){return i(e)&&w.isString(e.field)},n.isValueDef=a,n.isScaleFieldDef=function(e){return!(!e||!e.scale&&!e.sort)},n.field=function(e,t){void 0===t&&(t={});var n=e.field,r=t.prefix,i=t.suffix;if(l(e))n="count_*";else{var a=void 0;t.nofn||(e.bin?(a=b.binToString(e.bin),i=t.binSuffix||""):e.aggregate?a=String(t.aggregate||e.aggregate):e.timeUnit&&(a=String(e.timeUnit))),a&&(n=a+"_"+n)}return i&&(n=n+"_"+i),r&&(n=r+"_"+n),t.expr&&(n=""+t.expr+w.accessPath(n)),n},n.isDiscrete=o,n.isContinuous=s,n.isCount=l,n.verbalTitleFormatter=c,n.functionalTitleFormatter=u,n.defaultTitleFormatter=function(e,t){switch(t.fieldTitle){case"plain":return e.field;case"functional":return u(e);default:return c(e,t)}};var E=n.defaultTitleFormatter;n.setTitleFormatter=f,n.resetTitleFormatter=function(){f(n.defaultTitleFormatter)},n.title=function(e,t){return E(e,t)},n.defaultType=d,n.getFieldDef=function(e){return i(e)?e:r(e)?e.condition:void 0},n.normalize=function(e,t){if(w.isString(e)||w.isNumber(e)||w.isBoolean(e)){var n=w.isString(e)?"string":w.isNumber(e)?"number":"boolean";return O.warn(O.message.primitiveChannelDef(t,n,e)),{value:e}}return i(e)?p(e,t):r(e)?h({},e,{condition:p(e.condition,t)}):e},n.normalizeFieldDef=p,n.normalizeBin=m;var N={compatible:!0};n.channelCompatibility=g,n.isNumberFieldDef=function(e){return"quantitative"===e.type||!!e.bin},n.isTimeFieldDef=function(e){return"temporal"===e.type||!!e.timeUnit}},{"./aggregate":12,"./bin":14,"./channel":15,"./log":105,"./timeunit":113,"./type":117,"./util":118}],101:[function(e,t,n){"use strict";function r(e){return e&&e.selection}function i(e){return e&&!!e.field&&void 0!==e.equal}function a(e){return!!(e&&e.field&&g.isArray(e.range)&&2===e.range.length)}function o(e){return e&&!!e.field&&(g.isArray(e.oneOf)||g.isArray(e.in))}function s(e){return o(e)||i(e)||a(e)}function l(e,t){void 0===t&&(t=!0);var n=e.timeUnit?"time("+m.fieldExpr(e.timeUnit,e.field)+")":p.field(e,{expr:"datum"});if(i(e))return n+"==="+c(e.equal,e.timeUnit);if(o(e)){return"indexof(["+(e.oneOf||e.in).map(function(t){return c(t,e.timeUnit)}).join(",")+"], "+n+") !== -1"}if(a(e)){var r=e.range[0],s=e.range[1];if(null!==r&&null!==s&&t)return"inrange("+n+", ["+c(r,e.timeUnit)+", "+c(s,e.timeUnit)+"])";var l=[];return null!==r&&l.push(n+" >= "+c(r,e.timeUnit)),null!==s&&l.push(n+" <= "+c(s,e.timeUnit)),l.length>0?l.join(" && "):"true"}throw new Error("Invalid field filter: "+JSON.stringify(e))}function c(e,t){if(d.isDateTime(e)){return"time("+(r=d.dateTimeExpr(e,!0))+")"}if(m.isLocalSingleTimeUnit(t)){var n={};n[t]=e;var r=d.dateTimeExpr(n,!0);return"time("+r+")"}return m.isUtcSingleTimeUnit(t)?c(e,m.getLocalTimeUnit(t)):JSON.stringify(e)}var u=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var f=e("./compile/selection/selection"),d=e("./datetime"),p=e("./fielddef"),m=e("./timeunit"),g=e("./util");n.isSelectionFilter=r,n.isEqualFilter=i,n.isRangeFilter=a,n.isOneOfFilter=o,n.isFieldFilter=s,n.expression=function(e,t,n){return g.logicalExpr(t,function(t){return g.isString(t)?t:r(t)?f.predicate(e,t.selection,n):l(t)})},n.fieldFilterExpression=l,n.normalizeFilter=function(e){return s(e)&&e.timeUnit?u({},e,{timeUnit:m.normalizeTimeUnit(e.timeUnit)}):e}},{"./compile/selection/selection":79,"./datetime":97,"./fielddef":100,"./timeunit":113,"./util":118}],102:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.VL_ONLY_GUIDE_CONFIG=["shortTimeLabels"]},{}],103:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.axis=e("./axis"),n.aggregate=e("./aggregate"),n.bin=e("./bin"),n.channel=e("./channel"),n.compositeMark=e("./compositemark");var r=e("./compile/compile");n.compile=r.compile,n.config=e("./config"),n.data=e("./data"),n.datetime=e("./datetime"),n.encoding=e("./encoding"),n.facet=e("./facet"),n.fieldDef=e("./fielddef"),n.legend=e("./legend"),n.mark=e("./mark"),n.scale=e("./scale"),n.sort=e("./sort"),n.spec=e("./spec"),n.stack=e("./stack"),n.timeUnit=e("./timeunit"),n.transform=e("./transform"),n.type=e("./type"),n.util=e("./util"),n.validate=e("./validate"),n.version=e("../package.json").version},{"../package.json":11,"./aggregate":12,"./axis":13,"./bin":14,"./channel":15,"./compile/compile":25,"./compositemark":94,"./config":95,"./data":96,"./datetime":97,"./encoding":98,"./facet":99,"./fielddef":100,"./legend":104,"./mark":107,"./scale":108,"./sort":110,"./spec":111,"./stack":112,"./timeunit":113,"./transform":116,"./type":117,"./util":118,"./validate":119}],104:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./util");n.defaultLegendConfig={};var a={entryPadding:1,format:1,offset:1,orient:1,padding:1,tickCount:1,title:1,type:1,values:1,zindex:1},o=r({},a,{opacity:1,shape:1,stroke:1,fill:1,size:1,encode:1});n.LEGEND_PROPERTIES=i.flagKeys(a),n.VG_LEGEND_PROPERTIES=i.flagKeys(o)},{"./util":118}],105:[function(e,t,n){"use strict";function r(){return o=a}Object.defineProperty(n,"__esModule",{value:!0});var i=e("vega-util"),a=i.logger(i.Warn),o=a,s=function(){function e(){this.warns=[],this.infos=[],this.debugs=[]}return e.prototype.level=function(){return this},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(n=this.warns).push.apply(n,e),this;var n},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(n=this.infos).push.apply(n,e),this;var n},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(n=this.debugs).push.apply(n,e),this;var n},e}();n.LocalLogger=s,n.wrap=function(e){return function(){var t=o=new s;e(t),r()}},n.set=function(e){return o=e},n.reset=r,n.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o.warn.apply(o,arguments)},n.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o.info.apply(o,arguments)},n.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o.debug.apply(o,arguments)};!function(e){e.INVALID_SPEC="Invalid spec",e.FIT_NON_SINGLE='Autosize "fit" only works for single views and layered views.',e.CANNOT_FIX_RANGE_STEP_WITH_FIT='Cannot use a fixed value of "rangeStep" when "autosize" is "fit".',e.cannotProjectOnChannelWithoutField=function(e){return'Cannot project a selection on encoding channel "'+e+'", which has no field.'},e.nearestNotSupportForContinuous=function(e){return'The "nearest" transform is not supported for '+e+" marks."},e.selectionNotFound=function(e){return'Cannot find a selection named "'+e+'"'},e.SCALE_BINDINGS_CONTINUOUS="Scale bindings are currently only supported for scales with unbinned, continuous domains.",e.noSuchRepeatedValue=function(e){return'Unknown repeated value "'+e+'".'},e.CONCAT_CANNOT_SHARE_AXIS="Axes cannot be shared in concatenated views.",e.REPEAT_CANNOT_SHARE_AXIS="Axes cannot be shared in repeated views.",e.cannotSetTitleAnchor=function(e){return'Cannot set title "anchor" for a '+e+" spec"},e.unrecognizedParse=function(e){return'Unrecognized parse "'+e+'".'},e.differentParse=function(e,t,n){return'An ancestor parsed field "'+e+'" as '+n+" but a child wants to parse the field as "+t+"."},e.invalidTransformIgnored=function(e){return"Ignoring an invalid transform: "+JSON.stringify(e)+"."},e.NO_FIELDS_NEEDS_AS='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the the data from the secondary source.',e.primitiveChannelDef=function(e,t,n){return"Channel "+e+" is a "+t+". Converted to {value: "+n+"}."},e.invalidFieldType=function(e){return'Invalid field type "'+e+'"'},e.invalidFieldTypeForCountAggregate=function(e,t){return'Invalid field type "'+e+'" for aggregate: "'+t+'", using "quantitative" instead.'},e.invalidAggregate=function(e){return'Invalid aggregation operator "'+e+'"'},e.emptyOrInvalidFieldType=function(e,t,n){return'Invalid field type "'+e+'" for channel "'+t+'", using "'+n+'" instead.'},e.emptyFieldDef=function(e,t){return"Dropping "+JSON.stringify(e)+' from channel "'+t+'" since it does not contain data field or value.'},e.incompatibleChannel=function(e,t,n){return e+' dropped as it is incompatible with "'+t+'"'+(n?" when "+n:"")+"."},e.facetChannelShouldBeDiscrete=function(e){return e+" encoding should be discrete (ordinal / nominal / binned)."},e.discreteChannelCannotEncode=function(e,t){return'Using discrete channel "'+e+'" to encode "'+t+'" field can be misleading as it does not encode '+("ordinal"===t?"order":"magnitude")+"."},e.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL="Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.",e.unclearOrientContinuous=function(e){return'Cannot clearly determine orientation for "'+e+'" since both x and y channel encode continous fields. In this case, we use vertical by default'},e.unclearOrientDiscreteOrEmpty=function(e){return'Cannot clearly determine orientation for "'+e+'" since both x and y channel encode discrete or empty fields.'},e.orientOverridden=function(e,t){return'Specified orient "'+e+'" overridden with "'+t+'"'},e.CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN="custom domain scale cannot be unioned with default field-based domain",e.cannotUseScalePropertyWithNonColor=function(e){return'Cannot use the scale property "'+e+'" with non-color channel.'},e.unaggregateDomainHasNoEffectForRawField=function(e){return"Using unaggregated domain with raw field has no effect ("+JSON.stringify(e)+")."},e.unaggregateDomainWithNonSharedDomainOp=function(e){return'Unaggregated domain not applicable for "'+e+'" since it produces values outside the origin domain of the source data.'},e.unaggregatedDomainWithLogScale=function(e){return"Unaggregated domain is currently unsupported for log scale ("+JSON.stringify(e)+")."},e.cannotUseSizeFieldWithBandSize=function(e){return"Using size field when "+e+"-channel has a band scale is not supported."},e.cannotApplySizeToNonOrientedMark=function(e){return'Cannot apply size to non-oriented mark "'+e+'".'},e.rangeStepDropped=function(e){return'rangeStep for "'+e+'" is dropped as top-level '+("x"===e?"width":"height")+" is provided."},e.scaleTypeNotWorkWithChannel=function(e,t,n){return'Channel "'+e+'" does not work with "'+t+'" scale. We are using "'+n+'" scale instead.'},e.scaleTypeNotWorkWithFieldDef=function(e,t){return'FieldDef does not work with "'+e+'" scale. We are using "'+t+'" scale instead.'},e.scalePropertyNotWorkWithScaleType=function(e,t,n){return n+"-scale's \""+t+'" is dropped as it does not work with '+e+" scale."},e.scaleTypeNotWorkWithMark=function(e,t){return'Scale type "'+t+'" does not work with mark "'+e+'".'},e.mergeConflictingProperty=function(e,t,n,r){return"Conflicting "+t+' property "'+e+'" ("'+n+'" and "'+r+'").  Using "'+n+'".'},e.independentScaleMeansIndependentGuide=function(e){return'Setting the scale to be independent for "'+e+'" means we also have to set the guide (axis or legend) to be independent.'},e.conflictedDomain=function(e){return"Cannot set "+e+'-scale\'s "domain" as it is binned. Please use "bin"\'s "extent" instead.'},e.domainSortDropped=function(e){return'Dropping sort property "'+JSON.stringify(e)+"\" as unioned domains only support boolean or op 'count'."},e.UNABLE_TO_MERGE_DOMAINS="Unable to merge domains",e.MORE_THAN_ONE_SORT="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",e.INVALID_CHANNEL_FOR_AXIS="Invalid channel for axis.",e.cannotStackRangedMark=function(e){return'Cannot stack "'+e+'" if there is already "'+e+'2"'},e.cannotStackNonLinearScale=function(e){return"Cannot stack non-linear scale ("+e+")"},e.stackNonSummativeAggregate=function(e){return'Stacking is applied even though the aggregate function is non-summative ("'+e+'")'},e.invalidTimeUnit=function(e,t){return"Invalid "+e+': "'+t+'"'},e.dayReplacedWithDate=function(e){return'Time unit "'+e+'" is not supported. We are replacing it with '+e.replace("day","date")+"."},e.droppedDay=function(e){return"Dropping day from datetime "+JSON.stringify(e)+" as day cannot be combined with other units."}}(n.message||(n.message={}))},{"vega-util":10}],106:[function(e,t,n){"use strict";function r(e){return!!e.or}function i(e){return!!e.and}function a(e){return!!e.not}function o(e,t){if(a(e))o(e.not,t);else if(i(e))for(var n=0,s=e.and;n<s.length;n++){o(u=s[n],t)}else if(r(e))for(var l=0,c=e.or;l<c.length;l++){var u=c[l];o(u,t)}else t(e)}function s(e,t){return a(e)?{not:s(e.not,t)}:i(e)?{and:e.and.map(function(e){return s(e,t)})}:r(e)?{or:e.or.map(function(e){return s(e,t)})}:t(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.isLogicalOr=r,n.isLogicalAnd=i,n.isLogicalNot=a,n.forEachLeave=o,n.normalizeLogicalOperand=s},{}],107:[function(e,t,n){"use strict";function r(e){return e.type}Object.defineProperty(n,"__esModule",{value:!0});var i,a=e("./util");!function(e){e.AREA="area",e.BAR="bar",e.LINE="line",e.POINT="point",e.RECT="rect",e.RULE="rule",e.TEXT="text",e.TICK="tick",e.CIRCLE="circle",e.SQUARE="square"}(i=n.Mark||(n.Mark={})),n.AREA=i.AREA,n.BAR=i.BAR,n.LINE=i.LINE,n.POINT=i.POINT,n.TEXT=i.TEXT,n.TICK=i.TICK,n.RECT=i.RECT,n.RULE=i.RULE,n.CIRCLE=i.CIRCLE,n.SQUARE=i.SQUARE;var o={area:1,bar:1,line:1,point:1,text:1,tick:1,rect:1,rule:1,circle:1,square:1};n.isMark=function(e){return!!o[e]},n.PRIMITIVE_MARKS=a.flagKeys(o),n.isMarkDef=r;var s=a.toSet(n.PRIMITIVE_MARKS);n.isPrimitiveMark=function(e){return(r(e)?e.type:e)in s},n.STROKE_CONFIG=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity"],n.FILL_CONFIG=["fill","fillOpacity"],n.FILL_STROKE_CONFIG=[].concat(n.STROKE_CONFIG,n.FILL_CONFIG),n.VL_ONLY_MARK_CONFIG_PROPERTIES=["filled","color"],n.VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX={bar:["binSpacing","continuousBandSize","discreteBandSize"],text:["shortTimeLabels"],tick:["bandSize","thickness"]},n.defaultMarkConfig={color:"#4c78a8"},n.defaultBarConfig={binSpacing:1,continuousBandSize:5},n.defaultTickConfig={thickness:1}},{"./util":118}],108:[function(e,t,n){"use strict";function r(e){return e in d}function i(e){return e in f}var a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var o=e("./channel"),s=e("./log"),l=e("./util");!function(e){e.LINEAR="linear",e.BIN_LINEAR="bin-linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.TIME="time",e.UTC="utc",e.SEQUENTIAL="sequential",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.ORDINAL="ordinal",e.BIN_ORDINAL="bin-ordinal",e.POINT="point",e.BAND="band"}(n.ScaleType||(n.ScaleType={}));var c={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric","bin-linear":"bin-linear",time:"time",utc:"time",sequential:"sequential",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position"};n.SCALE_TYPES=l.keys(c),n.scaleCompatible=function(e,t){var n=c[e],r=c[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n};var u={linear:0,log:1,pow:1,sqrt:1,time:0,utc:0,point:10,band:11,"bin-linear":0,sequential:0,ordinal:0,"bin-ordinal":0};n.scaleTypePrecedence=function(e){return u[e]},n.CONTINUOUS_TO_CONTINUOUS_SCALES=["linear","bin-linear","log","pow","sqrt","time","utc"];var f=l.toSet(n.CONTINUOUS_TO_CONTINUOUS_SCALES);n.CONTINUOUS_DOMAIN_SCALES=n.CONTINUOUS_TO_CONTINUOUS_SCALES.concat(["sequential"]);var d=l.toSet(n.CONTINUOUS_DOMAIN_SCALES);n.DISCRETE_DOMAIN_SCALES=["ordinal","bin-ordinal","point","band"];var p=l.toSet(n.DISCRETE_DOMAIN_SCALES),m=l.toSet(["bin-linear","bin-ordinal"]);n.TIME_SCALE_TYPES=["time","utc"],n.hasDiscreteDomain=function(e){return e in p},n.isBinScale=function(e){return e in m},n.hasContinuousDomain=r,n.isContinuousToContinuous=i,n.defaultScaleConfig={textXRangeStep:90,rangeStep:21,pointPadding:.5,bandPaddingInner:.1,facetSpacing:16,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4},n.isExtendedScheme=function(e){return e&&!!e.name},n.isSelectionDomain=function(e){return e&&e.selection};var g={type:1,domain:1,range:1,rangeStep:1,scheme:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1};n.SCALE_PROPERTIES=l.flagKeys(g);var h=a(g,["type","domain","range","rangeStep","scheme"]);n.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES=l.flagKeys(h),n.scaleTypeSupportProperty=function(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":return l.contains(["sequential","ordinal","bin-ordinal","quantile","quantize"],e);case"interpolate":return l.contains(["linear","bin-linear","pow","log","sqrt","utc","time"],e);case"round":return i(e)||"band"===e||"point"===e;case"padding":return i(e)||l.contains(["point","band"],e);case"paddingOuter":case"rangeStep":return l.contains(["point","band"],e);case"paddingInner":return"band"===e;case"clamp":return i(e)||"sequential"===e;case"nice":return i(e)||"sequential"===e||"quantize"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"zero":return r(e)&&!l.contains(["log","time","utc","bin-linear","threshold","quantile"],e)}throw new Error("Invalid scale property "+t+".")},n.channelScalePropertyIncompatability=function(e,t){switch(t){case"interpolate":case"scheme":if("color"!==e)return s.message.cannotUseScalePropertyWithNonColor(e);return;case"type":case"domain":case"range":case"base":case"exponent":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}throw new Error('Invalid scale property "'+t+'".')},n.channelSupportScaleType=function(e,t){switch(e){case o.Channel.X:case o.Channel.Y:case o.Channel.SIZE:case o.Channel.OPACITY:return i(t)||l.contains(["band","point"],t);case o.Channel.COLOR:return"band"!==t;case o.Channel.SHAPE:return"ordinal"===t}return!1}},{"./channel":15,"./log":105,"./util":118}],109:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SELECTION_ID="_vgsid_",n.defaultConfig={single:{on:"click",fields:[n.SELECTION_ID],resolve:"global",empty:"all"},multi:{on:"click",fields:[n.SELECTION_ID],toggle:"event.shiftKey",resolve:"global",empty:"all"},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"}}},{}],110:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isSortField=function(e){return!(!e||"count"!==e.op&&!e.field||!e.op)}},{}],111:[function(e,t,n){"use strict";function r(e){return void 0!==e.facet}function i(e){return!!e.mark}function a(e){return void 0!==e.layer}function o(e){return void 0!==e.repeat}function s(e){return l(e)||c(e)}function l(e){return void 0!==e.vconcat}function c(e){return void 0!==e.hconcat}function u(e,t){if(r(e))return function(e,t){var n=e.spec,r=h(e,["spec"]);return g({},r,{spec:u(n,t)})}(e,t);if(a(e))return f(e,t);if(o(e))return function(e,t){var n=e.spec,r=h(e,["spec"]);return g({},r,{spec:u(n,t)})}(e,t);if(l(e))return function(e,t){var n=e.vconcat,r=h(e,["vconcat"]);return g({},r,{vconcat:n.map(function(e){return u(e,t)})})}(e,t);if(c(e))return function(e,t){var n=e.hconcat,r=h(e,["hconcat"]);return g({},r,{hconcat:n.map(function(e){return u(e,t)})})}(e,t);if(i(e)){var n=b.channelHasField(e.encoding,v.ROW),s=b.channelHasField(e.encoding,v.COLUMN);return n||s?function(e,t){var n=e.encoding,r=n.row,i=n.column,a=h(n,["row","column"]),o=e.mark,s=e.width,l=e.height,c=e.selection,u=(e.encoding,h(e,["mark","width","height","selection","encoding"]));return g({},u,{facet:g({},r?{row:r}:{},i?{column:i}:{}),spec:d(g({mark:o},s?{width:s}:{},l?{height:l}:{},{encoding:a},c?{selection:c}:{}),t)})}(e,t):d(e,t)}throw new Error(O.message.INVALID_SPEC)}function f(e,t){var n=e.layer,r=h(e,["layer"]);return g({},r,{layer:n.map(function(e){return a(e)?f(e,t):d(e,t)})})}function d(e,t){if(function(e){return S.isPrimitiveMark(e.mark)}(e)){if(b.isRanged(e.encoding))return function(e){var t=b.channelHasField(e.encoding,v.X),n=b.channelHasField(e.encoding,v.Y),r=b.channelHasField(e.encoding,v.X2),i=b.channelHasField(e.encoding,v.Y2);if(r&&!t||i&&!n){var a=w.duplicate(e);return r&&!t&&(a.encoding.x=a.encoding.x2,delete a.encoding.x2),i&&!n&&(a.encoding.y=a.encoding.y2,delete a.encoding.y2),a}return e}(e);var n=t&&t.overlay,r=n&&e.mark===S.AREA&&w.contains(["linepoint","line"],n.area),i=n&&(n.line&&e.mark===S.LINE||"linepoint"===n.area&&e.mark===S.AREA);return i||r?function(e,t,n,r){var i=e.mark,a=e.selection,o=e.encoding,s=h(e,["mark","selection","encoding"]),l=[{mark:i,encoding:o}],c=x.stack(i,o,r?r.stack:void 0),u=o;if(c){var f=c.fieldChannel,d=c.offset;u=g({},o,(p={},p[f]=g({},o[f],d?{stack:d}:{}),p))}n&&l.push(g({mark:{type:"line",style:"lineOverlay"}},a?{selection:a}:{},{encoding:u}));t&&l.push(g({mark:{type:"point",filled:!0,style:"pointOverlay"}},a?{selection:a}:{},{encoding:u}));return g({},s,{layer:l});var p}(e,i,r,t):e}return y.normalize(e,t)}function p(e,t){return t.forEach(function(t){var n=["field","type","value","timeUnit","bin","aggregate"].reduce(function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e},{}),r=w.hash(n);e[r]=e[r]||t}),e}function m(e,t){if(void 0===t&&(t={}),a(e))e.layer.forEach(function(e){i(e)?p(t,_.fieldDefs(e.encoding)):m(e,t)});else if(r(e))p(t,_.fieldDefs(e.facet)),m(e.spec,t);else if(o(e))m(e.spec,t);else if(s(e)){(l(e)?e.vconcat:e.hconcat).forEach(function(e){return m(e,t)})}else p(t,_.fieldDefs(e.encoding));return t}var g=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},h=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0});var v=e("./channel"),y=e("./compositemark"),b=e("./encoding"),_=e("./encoding"),O=e("./log"),S=e("./mark"),x=e("./stack"),w=e("./util");n.isFacetSpec=r,n.isUnitSpec=i,n.isLayerSpec=a,n.isRepeatSpec=o,n.isConcatSpec=s,n.isVConcatSpec=l,n.isHConcatSpec=c,n.normalize=u,n.fieldDefs=function(e){return w.vals(m(e))},n.isStacked=function(e,t){return t=t||e.config,!!S.isPrimitiveMark(e.mark)&&null!==x.stack(e.mark,e.encoding,t?t.stack:void 0)}},{"./channel":15,"./compositemark":94,"./encoding":98,"./log":105,"./mark":107,"./stack":112,"./util":118}],112:[function(e,t,n){"use strict";function r(e){return!!d[e]}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./aggregate"),a=e("./channel"),o=e("./encoding"),s=e("./fielddef"),l=e("./log"),c=e("./mark"),u=e("./scale"),f=e("./util"),d={zero:1,center:1,normalize:1};n.isStackOffset=r,n.STACKABLE_MARKS=[c.BAR,c.AREA,c.RULE,c.POINT,c.CIRCLE,c.SQUARE,c.LINE,c.TEXT,c.TICK],n.STACK_BY_DEFAULT_MARKS=[c.BAR,c.AREA],n.stack=function(e,t,d){var p=c.isMarkDef(e)?e.type:e;if(!f.contains(n.STACKABLE_MARKS,p))return null;var m=function(e){var t=e.x,n=e.y;if(s.isFieldDef(t)&&s.isFieldDef(n))if("quantitative"===t.type&&"quantitative"===n.type){if(t.stack)return"x";if(n.stack)return"y";if(!!t.aggregate!=!!n.aggregate)return t.aggregate?"x":"y"}else{if("quantitative"===t.type)return"x";if("quantitative"===n.type)return"y"}else{if(s.isFieldDef(t)&&"quantitative"===t.type)return"x";if(s.isFieldDef(n)&&"quantitative"===n.type)return"y"}}(t);if(!m)return null;var g=t[m],h=s.isStringFieldDef(g)?s.field(g,{}):void 0,v="x"===m?"y":"x",y=t[v],b=s.isStringFieldDef(y)?s.field(y,{}):void 0,_=a.NONPOSITION_CHANNELS.reduce(function(e,n){if(o.channelHasField(t,n)){var r=t[n];(f.isArray(r)?r:[r]).forEach(function(t){var r=s.getFieldDef(t);if(!r.aggregate){var i=s.isStringFieldDef(r)?s.field(r,{}):void 0;(!i||i!==b&&i!==h)&&e.push({channel:n,fieldDef:r})}})}return e},[]);if(0===_.length)return null;var O=void 0;return(O=void 0!==g.stack?g.stack:f.contains(n.STACK_BY_DEFAULT_MARKS,p)&&void 0===d?"zero":d)&&r(O)?g.scale&&g.scale.type&&g.scale.type!==u.ScaleType.LINEAR?(l.warn(l.message.cannotStackNonLinearScale(g.scale.type)),null):o.channelHasField(t,m===a.X?a.X2:a.Y2)?(l.warn(l.message.cannotStackRangedMark(m)),null):(g.aggregate&&!f.contains(i.SUM_OPS,g.aggregate)&&l.warn(l.message.stackNonSummativeAggregate(g.aggregate)),{groupbyChannel:y?v:void 0,fieldChannel:m,impute:f.contains(["area","line"],p),stackBy:_,offset:O}):null}},{"./aggregate":12,"./channel":15,"./encoding":98,"./fielddef":100,"./log":105,"./mark":107,"./scale":108,"./util":118}],113:[function(e,t,n){"use strict";function r(e){return!!m[e]}function i(e,t){var n=h[e];return{setDateMethod:t?"setUTC"+n.substr(3):n,getDateMethod:"get"+(t?"UTC":"")+n.substr(3)}}function a(e,t){var n=e.indexOf(t);return n>-1&&(t!==s.SECONDS||0===n||"i"!==e.charAt(n-1))}var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var s,l=e("./datetime"),c=e("./log"),u=e("./util");!function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(s=n.TimeUnit||(n.TimeUnit={}));var f={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};n.TIMEUNIT_PARTS=u.flagKeys(f),n.isLocalSingleTimeUnit=function(e){return!!f[e]};var d={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};n.isUtcSingleTimeUnit=function(e){return!!d[e]};var p={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},m=o({},d,p);n.isUTCTimeUnit=r,n.getLocalTimeUnit=function(e){return e.substr(3)};var g=o({},f,d,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},p);n.TIMEUNITS=u.flagKeys(g),n.isTimeUnit=function(e){return!!g[e]};var h={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};n.convert=function(e,t){for(var o=r(e),l=o?new Date(Date.UTC(0,0,1,0,0,0,0)):new Date(0,0,1,0,0,0,0),c=0,u=n.TIMEUNIT_PARTS;c<u.length;c++){var f=u[c];if(a(e,f))switch(f){case s.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case s.QUARTER:var d=i("month",o),p=d.getDateMethod;l[d.setDateMethod](3*Math.floor(t[p]()/3));break;default:var m=i(f,o),g=m.getDateMethod;l[m.setDateMethod](t[g]())}}return l},n.getTimeUnitParts=function(e){return n.TIMEUNIT_PARTS.reduce(function(t,n){return a(e,n)?t.concat(n):t},[])},n.containsTimeUnit=a,n.fieldExpr=function(e,t){var i="datum"+u.accessPath(t),o=r(e)?"utc":"",c=n.TIMEUNIT_PARTS.reduce(function(t,n){return a(e,n)&&(t[n]=function(e){return e===s.QUARTER?"("+o+"quarter("+i+")-1)":""+o+e+"("+i+")"}(n)),t},{});return l.dateTimeExpr(c)},n.formatExpression=function(e,t,n,r){if(e){var i=[],o="",l=a(e,s.YEAR);a(e,s.QUARTER)&&(o="'Q' + quarter("+t+")"),a(e,s.MONTH)&&i.push(!1!==n?"%b":"%B"),a(e,s.DAY)?i.push(n?"%a":"%A"):a(e,s.DATE)&&i.push("%d"+(l?",":"")),l&&i.push(n?"%y":"%Y");var c=[];a(e,s.HOURS)&&c.push("%H"),a(e,s.MINUTES)&&c.push("%M"),a(e,s.SECONDS)&&c.push("%S"),a(e,s.MILLISECONDS)&&c.push("%L");var u=[];return i.length>0&&u.push(i.join(" ")),c.length>0&&u.push(c.join(":")),u.length>0&&(o&&(o+=" + ' ' + "),o+=r?"utcFormat("+t+", '"+u.join(" ")+"')":"timeFormat("+t+", '"+u.join(" ")+"')"),o||void 0}},n.normalizeTimeUnit=function(e){return"day"!==e&&e.indexOf("day")>=0?(c.warn(c.message.dayReplacedWithDate(e)),e.replace("day","date")):e}},{"./datetime":97,"./log":105,"./util":118}],114:[function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0}),n.extractTitleConfig=function(e){var t=e.anchor,n=e.offset,a=e.orient,o=e.color,s=i(e,["anchor","offset","orient","color"]);return{mark:r({},s,o?{fill:o}:{}),nonMark:r({},t?{anchor:t}:{},n?{offset:n}:{},a?{orient:a}:{})}}},{}],115:[function(e,t,n){"use strict";function r(e){return a.isString(e)?{type:e}:e||{}}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(n,"__esModule",{value:!0});var a=e("util"),o=e("./log");n.normalizeAutoSize=function(e,t,n){void 0===n&&(n=!0);var a=i({type:"pad"},r(t),r(e));return"fit"===a.type&&(n||(o.warn(o.message.FIT_NON_SINGLE),a.type="pad")),a};var s=["background","padding"];n.extractTopLevelProperties=function(e){return s.reduce(function(t,n){return e&&void 0!==e[n]&&(t[n]=e[n]),t},{})}},{"./log":105,util:8}],116:[function(e,t,n){"use strict";function r(e){return void 0!==e.filter}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./filter"),a=e("./logical");n.isFilter=r,n.isLookup=function(e){return void 0!==e.lookup},n.isCalculate=function(e){return void 0!==e.calculate},n.isBin=function(e){return!!e.bin},n.isTimeUnit=function(e){return void 0!==e.timeUnit},n.isAggregate=function(e){return void 0!==e.aggregate},n.normalizeTransform=function(e){return e.map(function(e){return r(e)?{filter:a.normalizeLogicalOperand(e.filter,i.normalizeFilter)}:e})}},{"./filter":101,"./logical":106}],117:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r;!function(e){e.QUANTITATIVE="quantitative",e.ORDINAL="ordinal",e.TEMPORAL="temporal",e.NOMINAL="nominal"}(r=n.Type||(n.Type={}));var i={quantitative:1,ordinal:1,temporal:1,nominal:1};n.isType=function(e){return!!i[e]},n.QUANTITATIVE=r.QUANTITATIVE,n.ORDINAL=r.ORDINAL,n.TEMPORAL=r.TEMPORAL,n.NOMINAL=r.NOMINAL,n.getFullName=function(e){if(e)switch(e=e.toLowerCase()){case"q":case n.QUANTITATIVE:return"quantitative";case"t":case n.TEMPORAL:return"temporal";case"o":case n.ORDINAL:return"ordinal";case"n":case n.NOMINAL:return"nominal"}}},{}],118:[function(e,t,n){"use strict";function r(e,t){return e.indexOf(t)>-1}function i(e,t){return e.filter(function(e){return!r(t,e)})}function a(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++){e=function(e,t){if("object"!=typeof t||null===t)return e;for(var n in t)t.hasOwnProperty(n)&&void 0!==t[n]&&("object"!=typeof t[n]||u.isArray(t[n])||null===t[n]?e[n]=t[n]:"object"!=typeof e[n]||null===e[n]?e[n]=a(u.isArray(t[n].constructor)?[]:{},t[n]):a(e[n],t[n]));return e}(e,i[r])}return e}function o(e){return JSON.parse(JSON.stringify(e))}function s(e){return!0===e||!1===e}function l(e,t){return f.isLogicalNot(e)?"!("+l(e.not,t)+")":f.isLogicalAnd(e)?"("+e.and.map(function(e){return l(e,t)}).join(") && (")+")":f.isLogicalOr(e)?"("+e.or.map(function(e){return l(e,t)}).join(") || (")+")":t(e)}Object.defineProperty(n,"__esModule",{value:!0});var c=e("json-stable-stringify"),u=e("vega-util"),f=e("./logical"),d=e("vega-util");n.isArray=d.isArray,n.isObject=d.isObject,n.isNumber=d.isNumber,n.isString=d.isString,n.truncate=d.truncate,n.toSet=d.toSet,n.stringValue=d.stringValue,n.splitAccessPath=d.splitAccessPath,n.pick=function(e,t){for(var n={},r=0,i=t;r<i.length;r++){var a=i[r];e.hasOwnProperty(a)&&(n[a]=e[a])}return n},n.omit=function(e,t){for(var n=o(e),r=0,i=t;r<i.length;r++)delete n[i[r]];return n},n.hash=function(e){if(u.isString(e)||u.isNumber(e)||s(e))return String(e);var t=c(e);if(t.length<100)return t;for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n&=n;return n},n.contains=r,n.without=i,n.union=function(e,t){return e.concat(i(t,e))},n.some=function(e,t){for(var n=0,r=0;r<e.length;r++)if(t(e[r],r,n++))return!0;return!1},n.every=function(e,t){for(var n=0,r=0;r<e.length;r++)if(!t(e[r],r,n++))return!1;return!0},n.flatten=function(e){return[].concat.apply([],e)},n.mergeDeep=a,n.unique=function(e,t){for(var n,r=[],i={},a=0,o=e;a<o.length;a++){var s=o[a];(n=t(s))in i||(i[n]=1,r.push(s))}return r},n.differ=function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t[n]&&e[n]&&t[n]!==e[n])return!0;return!1},n.hasIntersection=function(e,t){for(var n in e)if(n in t)return!0;return!1},n.isNumeric=function(e){return!isNaN(e)},n.differArray=function(e,t){if(e.length!==t.length)return!0;e.sort(),t.sort();for(var n=0;n<e.length;n++)if(t[n]!==e[n])return!0;return!1},n.keys=Object.keys,n.vals=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t},n.flagKeys=function(e){return n.keys(e)},n.duplicate=o,n.isBoolean=s,n.varName=function(e){var t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t},n.logicalExpr=l,n.deleteNestedProperty=function(e,t){for(var r=!0;t.length>0&&r;){for(var i=e,a=0;a<t.length-1;a++)i=i[t[a]];delete i[t.pop()],0!==n.keys(i).length&&(r=!1)}},n.titlecase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},n.accessPath=function(e){return"["+u.splitAccessPath(e).map(u.stringValue).join("][")+"]"}},{"./logical":106,"json-stable-stringify":1,"vega-util":10}],119:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./mark"),i=e("./mark"),a=e("./util");n.DEFAULT_REQUIRED_CHANNEL_MAP={text:["text"],line:["x","y"],area:["x","y"]},n.DEFAULT_SUPPORTED_CHANNEL_TYPE={bar:a.toSet(["row","column","x","y","size","color","detail"]),line:a.toSet(["row","column","x","y","color","detail"]),area:a.toSet(["row","column","x","y","color","detail"]),tick:a.toSet(["row","column","x","y","color","detail"]),circle:a.toSet(["row","column","x","y","color","size","detail"]),square:a.toSet(["row","column","x","y","color","size","detail"]),point:a.toSet(["row","column","x","y","color","size","detail","shape"]),text:a.toSet(["row","column","size","color","text"])},n.getEncodingMappingError=function(e,t,a){void 0===t&&(t=n.DEFAULT_REQUIRED_CHANNEL_MAP),void 0===a&&(a=n.DEFAULT_SUPPORTED_CHANNEL_TYPE);var o=r.isMarkDef(e.mark)?e.mark.type:e.mark,s=e.encoding,l=t[o],c=a[o];for(var u in l)if(!(l[u]in s))return'Missing encoding channel "'+l[u]+'" for mark "'+o+'"';for(var f in s)if(!c[f])return'Encoding channel "'+f+'" is not supported by mark type "'+o+'"';return o!==i.BAR||s.x||s.y?null:"Missing both x and y for bar"}},{"./mark":107,"./util":118}],120:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./util");n.isVgSignalRef=function(e){return!!e.signal},n.isVgRangeStep=function(e){return!!e.step},n.isDataRefUnionedDomain=function(e){return!r.isArray(e)&&"fields"in e&&!("data"in e)},n.isFieldRefUnionDomain=function(e){return!r.isArray(e)&&"fields"in e&&"data"in e},n.isDataRefDomain=function(e){return!r.isArray(e)&&"field"in e&&"data"in e},n.isSignalRefDomain=function(e){return!r.isArray(e)&&"signal"in e};n.VG_MARK_CONFIGS=r.flagKeys({opacity:1,fill:1,fillOpacity:1,stroke:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,limit:1,dx:1,dy:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1})},{"./util":118}]},{},[103])(103)});