streamlit-nightly 1.33.1.dev20240501__py2.py3-none-any.whl → 1.34.1.dev20240503__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. streamlit/components/v1/custom_component.py +3 -9
  2. streamlit/delta_generator.py +32 -208
  3. streamlit/elements/lib/built_in_chart_utils.py +920 -0
  4. streamlit/elements/utils.py +1 -14
  5. streamlit/elements/{arrow_altair.py → vega_charts.py} +301 -836
  6. streamlit/static/asset-manifest.json +5 -5
  7. streamlit/static/index.html +1 -1
  8. streamlit/static/static/js/5441.71804c26.chunk.js +1 -0
  9. streamlit/static/static/js/7483.64f23be7.chunk.js +2 -0
  10. streamlit/static/static/js/{main.af77b7ba.js → main.3b0201f6.js} +2 -2
  11. {streamlit_nightly-1.33.1.dev20240501.dist-info → streamlit_nightly-1.34.1.dev20240503.dist-info}/METADATA +1 -1
  12. {streamlit_nightly-1.33.1.dev20240501.dist-info → streamlit_nightly-1.34.1.dev20240503.dist-info}/RECORD +19 -20
  13. streamlit/elements/altair_utils.py +0 -40
  14. streamlit/elements/arrow_vega_lite.py +0 -229
  15. streamlit/static/static/js/43.c6749504.chunk.js +0 -1
  16. streamlit/static/static/js/656.7150a933.chunk.js +0 -2
  17. /streamlit/static/static/css/{43.e3b876c5.chunk.css → 5441.e3b876c5.chunk.css} +0 -0
  18. /streamlit/static/static/js/{656.7150a933.chunk.js.LICENSE.txt → 7483.64f23be7.chunk.js.LICENSE.txt} +0 -0
  19. /streamlit/static/static/js/{main.af77b7ba.js.LICENSE.txt → main.3b0201f6.js.LICENSE.txt} +0 -0
  20. {streamlit_nightly-1.33.1.dev20240501.data → streamlit_nightly-1.34.1.dev20240503.data}/scripts/streamlit.cmd +0 -0
  21. {streamlit_nightly-1.33.1.dev20240501.dist-info → streamlit_nightly-1.34.1.dev20240503.dist-info}/WHEEL +0 -0
  22. {streamlit_nightly-1.33.1.dev20240501.dist-info → streamlit_nightly-1.34.1.dev20240503.dist-info}/entry_points.txt +0 -0
  23. {streamlit_nightly-1.33.1.dev20240501.dist-info → streamlit_nightly-1.34.1.dev20240503.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 656.7150a933.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[656],{86893:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(s){e=function(){}}try{n=Set}catch(s){n=function(){}}try{i=Promise}catch(s){i=function(){}}function r(o,s,c,l,u){"object"===typeof s&&(c=s.depth,l=s.prototype,u=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof c&&(c=1/0),function o(c,p){if(null===c)return null;if(0===p)return c;var m,g;if("object"!=typeof c)return c;if(t(c,e))m=new e;else if(t(c,n))m=new n;else if(t(c,i))m=new i((function(t,e){c.then((function(e){t(o(e,p-1))}),(function(t){e(o(t,p-1))}))}));else if(r.__isArray(c))m=[];else if(r.__isRegExp(c))m=new RegExp(c.source,a(c)),c.lastIndex&&(m.lastIndex=c.lastIndex);else if(r.__isDate(c))m=new Date(c.getTime());else{if(h&&Buffer.isBuffer(c))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(c.length):new Buffer(c.length),c.copy(m),m;t(c,Error)?m=Object.create(c):"undefined"==typeof l?(g=Object.getPrototypeOf(c),m=Object.create(g)):(m=Object.create(l),g=l)}if(s){var v=f.indexOf(c);if(-1!=v)return d[v];f.push(c),d.push(m)}for(var y in t(c,e)&&c.forEach((function(t,e){var n=o(e,p-1),i=o(t,p-1);m.set(n,i)})),t(c,n)&&c.forEach((function(t){var e=o(t,p-1);m.add(e)})),c){var b;g&&(b=Object.getOwnPropertyDescriptor(g,y)),b&&null==b.set||(m[y]=o(c[y],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(y=0;y<x.length;y++){var _=x[y];(!(k=Object.getOwnPropertyDescriptor(c,_))||k.enumerable||u)&&(m[_]=o(c[_],p-1),k.enumerable||Object.defineProperty(m,_,{enumerable:!1}))}}if(u){var w=Object.getOwnPropertyNames(c);for(y=0;y<w.length;y++){var k,E=w[y];(k=Object.getOwnPropertyDescriptor(c,E))&&k.enumerable||(m[E]=o(c[E],p-1),Object.defineProperty(m,E,{enumerable:!1}))}}return m}(o,c)}function o(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return r.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},r.__objToStr=o,r.__isDate=function(t){return"object"===typeof t&&"[object Date]"===o(t)},r.__isArray=function(t){return"object"===typeof t&&"[object Array]"===o(t)},r.__isRegExp=function(t){return"object"===typeof t&&"[object RegExp]"===o(t)},r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)},60473:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if((i=e.length)!=n.length)return!1;for(r=i;0!==r--;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!==r--;){var a=o[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}},4761:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"===typeof e&&(e={cmp:e});var n,i="boolean"===typeof e.cycles&&e.cycles,r=e.cmp&&(n=e.cmp,function(t){return function(e,i){var r={key:e,value:t[e]},o={key:i,value:t[i]};return n(r,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!==typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,c=Object.keys(e).sort(r&&r(e));for(a="",n=0;n<c.length;n++){var l=c[n],u=t(e[l]);u&&(a&&(a+=","),a+=JSON.stringify(l)+":"+u)}return o.splice(s,1),"{"+a+"}"}}(t)}},99394:(t,e,n)=>{var i=n(63256),r=n(80693)((function(t,e,n,r){i(t,e,n,r)}));t.exports=r},41558:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>oy});var i={};n.r(i),n.d(i,{JsonPatchError:()=>y,_areEquals:()=>C,applyOperation:()=>k,applyPatch:()=>E,applyReducer:()=>D,deepClone:()=>b,getValueByPointer:()=>w,validate:()=>S,validator:()=>A});var r={};n.r(r),n.d(r,{compare:()=>P,generate:()=>z,observe:()=>N,unobserve:()=>T});var o={};n.r(o),n.d(o,{accessPathDepth:()=>Nt,accessPathWithDatum:()=>St,compile:()=>pm,contains:()=>st,deepEqual:()=>Q,deleteNestedProperty:()=>Dt,duplicate:()=>tt,entries:()=>_t,every:()=>lt,fieldIntersection:()=>vt,flatAccessWithDatum:()=>Ct,getFirstDefined:()=>zt,hasIntersection:()=>mt,hash:()=>ot,internalField:()=>jt,isBoolean:()=>wt,isEmpty:()=>yt,isEqual:()=>ht,isInternalField:()=>Bt,isNullOrFalse:()=>at,isNumeric:()=>Ut,keys:()=>bt,logicalExpr:()=>Et,mergeDeep:()=>ut,never:()=>et,normalize:()=>Tl,normalizeAngle:()=>It,omit:()=>it,pick:()=>nt,prefixGenerator:()=>gt,removePathFromField:()=>Tt,replaceAll:()=>Ot,replacePathInField:()=>Mt,resetIdCounter:()=>Lt,setEqual:()=>pt,some:()=>ct,stringify:()=>rt,titleCase:()=>At,unique:()=>dt,uniqueId:()=>Pt,vals:()=>xt,varName:()=>kt,version:()=>mm});var a={};n.r(a),n.d(a,{carbong10:()=>mg,carbong100:()=>vg,carbong90:()=>gg,carbonwhite:()=>pg,dark:()=>xm,excel:()=>wm,fivethirtyeight:()=>Sm,ggplot2:()=>Fm,googlecharts:()=>Ym,latimes:()=>Rm,powerbi:()=>lg,quartz:()=>jm,urbaninstitute:()=>Jm,version:()=>yg,vox:()=>Im});var s=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),c=Object.prototype.hasOwnProperty;function l(t,e){return c.call(t,e)}function u(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);var i=[];for(var r in t)l(t,r)&&i.push(r);return i}function f(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function d(t){for(var e,n=0,i=t.length;n<i;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function h(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function p(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function m(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var e=0,n=t.length;e<n;e++)if(m(t[e]))return!0}else if("object"===typeof t)for(var i=u(t),r=i.length,o=0;o<r;o++)if(m(t[i[o]]))return!0;return!1}function g(t,e){var n=[t];for(var i in e){var r="object"===typeof e[i]?JSON.stringify(e[i],null,2):e[i];"undefined"!==typeof r&&n.push(i+": "+r)}return n.join("\n")}var v=function(t){function e(e,n,i,r,o){var a=this.constructor,s=t.call(this,g(e,{name:n,index:i,operation:r,tree:o}))||this;return s.name=n,s.index=i,s.operation=r,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=g(e,{name:n,index:i,operation:r,tree:o}),s}return s(e,t),e}(Error),y=v,b=f,x={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var i=t[e];return delete t[e],{newDocument:n,removed:i}},replace:function(t,e,n){var i=t[e];return t[e]=this.value,{newDocument:n,removed:i}},move:function(t,e,n){var i=w(n,this.path);i&&(i=f(i));var r=k(n,{op:"remove",path:this.from}).removed;return k(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(t,e,n){var i=w(n,this.from);return k(n,{op:"add",path:this.path,value:f(i)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:C(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},_={add:function(t,e,n){return d(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var i=t[e];return t[e]=this.value,{newDocument:n,removed:i}},move:x.move,copy:x.copy,test:x.test,_get:x._get};function w(t,e){if(""==e)return t;var n={op:"_get",path:e};return k(t,n),n.value}function k(t,e,n,i,r,o){if(void 0===n&&(n=!1),void 0===i&&(i=!0),void 0===r&&(r=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):A(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=w(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=C(t,e.value),!1===a.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}i||(t=f(t));var s=(e.path||"").split("/"),c=t,l=1,u=s.length,h=void 0,m=void 0,g=void 0;for(g="function"==typeof n?n:A;;){if((m=s[l])&&-1!=m.indexOf("~")&&(m=p(m)),r&&("__proto__"==m||"prototype"==m&&l>0&&"constructor"==s[l-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===h&&(void 0===c[m]?h=s.slice(0,l).join("/"):l==u-1&&(h=e.path),void 0!==h&&g(e,0,t,h)),l++,Array.isArray(c)){if("-"===m)m=c.length;else{if(n&&!d(m))throw new y("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);d(m)&&(m=~~m)}if(l>=u){if(n&&"add"===e.op&&m>c.length)throw new y("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=_[e.op].call(e,c,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(l>=u){if(!1===(a=x[e.op].call(e,c,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}if(c=c[m],n&&l<u&&(!c||"object"!==typeof c))throw new y("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,t)}}function E(t,e,n,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),n&&!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(t=f(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=k(t,e[a],n,!0,r,a),t=o[a].newDocument;return o.newDocument=t,o}function D(t,e,n){var i=k(t,e);if(!1===i.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return i.newDocument}function A(t,e,n,i){if("object"!==typeof t||null===t||Array.isArray(t))throw new y("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!x[t.op])throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!==typeof t.path)throw new y("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new y('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!==typeof t.from)throw new y("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&m(t.value))throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var r=t.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new y("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==i)throw new y("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=S([{op:"_get",path:t.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new y("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function S(t,e,n){try{if(!Array.isArray(t))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)E(f(e),f(t),n||!0);else{n=n||A;for(var i=0;i<t.length;i++)n(t[i],i,e,void 0)}}catch(r){if(r instanceof y)return r;throw r}}function C(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,i,r,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((i=t.length)!=e.length)return!1;for(n=i;0!==n--;)if(!C(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((i=s.length)!==Object.keys(e).length)return!1;for(n=i;0!==n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=i;0!==n--;)if(!C(t[r=s[n]],e[r]))return!1;return!0}return t!==t&&e!==e}var F=new WeakMap,M=function(t){this.observers=new Map,this.obj=t},O=function(t,e){this.callback=t,this.observer=e};function T(t,e){e.unobserve()}function N(t,e){var n,i=function(t){return F.get(t)}(t);if(i){var r=function(t,e){return t.observers.get(e)}(i,e);n=r&&r.observer}else i=new M(t),F.set(t,i);if(n)return n;if(n={},i.value=f(t),e){n.callback=e,n.next=null;var o=function(){z(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!==typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=t,n.unobserve=function(){z(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(i,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(e,new O(e,n)),n}function z(t,e){void 0===e&&(e=!1);var n=F.get(t.object);R(n.value,t.object,t.patches,"",e),t.patches.length&&E(n.value,t.patches);var i=t.patches;return i.length>0&&(t.patches=[],t.callback&&t.callback(i)),i}function R(t,e,n,i,r){if(e!==t){"function"===typeof e.toJSON&&(e=e.toJSON());for(var o=u(e),a=u(t),s=!1,c=a.length-1;c>=0;c--){var d=t[m=a[c]];if(!l(e,m)||void 0===e[m]&&void 0!==d&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"remove",path:i+"/"+h(m)}),s=!0):(r&&n.push({op:"test",path:i,value:t}),n.push({op:"replace",path:i,value:e}),!0);else{var p=e[m];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?R(d,p,n,i+"/"+h(m),r):d!==p&&(!0,r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"replace",path:i+"/"+h(m),value:f(p)}))}}if(s||o.length!=a.length)for(c=0;c<o.length;c++){var m;l(t,m=o[c])||void 0===e[m]||n.push({op:"add",path:i+"/"+h(m),value:f(e[m])})}}}function P(t,e,n){void 0===n&&(n=!1);var i=[];return R(t,e,i,"",n),i}Object.assign({},i,r,{JsonPatchError:v,deepClone:f,escapePathComponent:h,unescapePathComponent:p});var L=n(76248),j=n.n(L),B=n(91149),I=n(60784);var U=n(15721),q=n(86893),W=n.n(q),H=n(60473),X=n.n(H),J=n(4761),G=n.n(J);function $(t){return!!t.or}function Z(t){return!!t.and}function Y(t){return!!t.not}function V(t,e){if(Y(t))V(t.not,e);else if(Z(t))for(const n of t.and)V(n,e);else if($(t))for(const n of t.or)V(n,e);else e(t)}function K(t,e){return Y(t)?{not:K(t.not,e)}:Z(t)?{and:t.and.map((t=>K(t,e)))}:$(t)?{or:t.or.map((t=>K(t,e)))}:e(t)}const Q=X(),tt=W();function et(t){throw new Error(t)}function nt(t,e){const n={};for(const i of e)(0,U.nr)(t,i)&&(n[i]=t[i]);return n}function it(t,e){const n={...t};for(const i of e)delete n[i];return n}Set.prototype.toJSON=function(){return"Set(".concat([...this].map((t=>G()(t))).join(","),")")};const rt=G();function ot(t){if((0,U.hj)(t))return t;const e=(0,U.HD)(t)?t:G()(t);if(e.length<250)return e;let n=0;for(let i=0;i<e.length;i++){n=(n<<5)-n+e.charCodeAt(i),n|=0}return n}function at(t){return!1===t||null===t}function st(t,e){return t.includes(e)}function ct(t,e){let n=0;for(const[i,r]of t.entries())if(e(r,i,n++))return!0;return!1}function lt(t,e){let n=0;for(const[i,r]of t.entries())if(!e(r,i,n++))return!1;return!0}function ut(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(const r of n)ft(t,null!==r&&void 0!==r?r:{});return t}function ft(t,e){for(const n of bt(e))(0,U.iL)(t,n,e[n],!0)}function dt(t,e){const n=[],i={};let r;for(const o of t)r=e(o),r in i||(i[r]=1,n.push(o));return n}function ht(t,e){const n=bt(t),i=bt(e);if(n.length!==i.length)return!1;for(const r of n)if(t[r]!==e[r])return!1;return!0}function pt(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function mt(t,e){for(const n of t)if(e.has(n))return!0;return!1}function gt(t){const e=new Set;for(const n of t){const t=(0,U._k)(n).map(((t,e)=>0===e?t:"[".concat(t,"]"))),i=t.map(((e,n)=>t.slice(0,n+1).join("")));for(const n of i)e.add(n)}return e}function vt(t,e){return void 0===t||void 0===e||mt(gt(t),gt(e))}function yt(t){return 0===bt(t).length}const bt=Object.keys,xt=Object.values,_t=Object.entries;function wt(t){return!0===t||!1===t}function kt(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function Et(t,e){return Y(t)?"!(".concat(Et(t.not,e),")"):Z(t)?"(".concat(t.and.map((t=>Et(t,e))).join(") && ("),")"):$(t)?"(".concat(t.or.map((t=>Et(t,e))).join(") || ("),")"):e(t)}function Dt(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&Dt(t[n],e)&&delete t[n],yt(t)}function At(t){return t.charAt(0).toUpperCase()+t.substr(1)}function St(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const n=(0,U._k)(t),i=[];for(let r=1;r<=n.length;r++){const t="[".concat(n.slice(0,r).map(U.m8).join("]["),"]");i.push("".concat(e).concat(t))}return i.join(" && ")}function Ct(t){return"".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum","[").concat((0,U.m8)((0,U._k)(t).join(".")),"]")}function Ft(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Mt(t){return"".concat((0,U._k)(t).map(Ft).join("\\."))}function Ot(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Tt(t){return"".concat((0,U._k)(t).join("."))}function Nt(t){return t?(0,U._k)(t).length:0}function zt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)if(void 0!==i)return i}let Rt=42;function Pt(t){const e=++Rt;return t?String(t)+e:e}function Lt(){Rt=42}function jt(t){return Bt(t)?t:"__".concat(t)}function Bt(t){return t.startsWith("__")}function It(t){if(void 0!==t)return(t%360+360)%360}function Ut(t){return!!(0,U.hj)(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const qt="row",Wt="column",Ht="facet",Xt="x",Jt="y",Gt="x2",$t="y2",Zt="xOffset",Yt="yOffset",Vt="radius",Kt="radius2",Qt="theta",te="theta2",ee="latitude",ne="longitude",ie="latitude2",re="longitude2",oe="color",ae="fill",se="stroke",ce="shape",le="size",ue="angle",fe="opacity",de="fillOpacity",he="strokeOpacity",pe="strokeWidth",me="strokeDash",ge="text",ve="order",ye="detail",be="key",xe="tooltip",_e="href",we="url",ke="description",Ee={theta:1,theta2:1,radius:1,radius2:1};function De(t){return t in Ee}const Ae={longitude:1,longitude2:1,latitude:1,latitude2:1};function Se(t){switch(t){case ee:return"y";case ie:return"y2";case ne:return"x";case re:return"x2"}}function Ce(t){return t in Ae}const Fe=bt(Ae),Me={x:1,y:1,x2:1,y2:1,...Ee,...Ae,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Oe(t){return t===oe||t===ae||t===se}const Te={row:1,column:1,facet:1},Ne=bt(Te),ze={...Me,...Te},Re=bt(ze),{order:Pe,detail:Le,tooltip:je,...Be}=ze,{row:Ie,column:Ue,facet:qe,...We}=Be;bt(Be),bt(We);function He(t){return!!ze[t]}const Xe=[Gt,$t,ie,re,te,Kt];function Je(t){return Ge(t)!==t}function Ge(t){switch(t){case Gt:return Xt;case $t:return Jt;case ie:return ee;case re:return ne;case te:return Qt;case Kt:return Vt}return t}function $e(t){if(De(t))switch(t){case Qt:return"startAngle";case te:return"endAngle";case Vt:return"outerRadius";case Kt:return"innerRadius"}return t}function Ze(t){switch(t){case Xt:return Gt;case Jt:return $t;case ee:return ie;case ne:return re;case Qt:return te;case Vt:return Kt}}function Ye(t){switch(t){case Xt:case Gt:return"width";case Jt:case $t:return"height"}}function Ve(t){switch(t){case Xt:return"xOffset";case Jt:return"yOffset";case Gt:return"x2Offset";case $t:return"y2Offset";case Qt:return"thetaOffset";case Vt:return"radiusOffset";case te:return"theta2Offset";case Kt:return"radius2Offset"}}function Ke(t){switch(t){case Xt:return"xOffset";case Jt:return"yOffset"}}function Qe(t){switch(t){case"xOffset":return"x";case"yOffset":return"y"}}const tn=bt(Me),{x:en,y:nn,x2:rn,y2:on,xOffset:an,yOffset:sn,latitude:cn,longitude:ln,latitude2:un,longitude2:fn,theta:dn,theta2:hn,radius:pn,radius2:mn,...gn}=Me,vn=bt(gn),yn={x:1,y:1},bn=bt(yn);function xn(t){return t in yn}const _n={theta:1,radius:1},wn=bt(_n);function kn(t){return"width"===t?Xt:Jt}const En={xOffset:1,yOffset:1};bt(En);function Dn(t){return t in En}const{text:An,tooltip:Sn,href:Cn,url:Fn,description:Mn,detail:On,key:Tn,order:Nn,...zn}=gn,Rn=bt(zn);const Pn={...yn,..._n,...En,...zn},Ln=bt(Pn);function jn(t){return!!Pn[t]}function Bn(t,e){return function(t){switch(t){case oe:case ae:case se:case ke:case ye:case be:case xe:case _e:case ve:case fe:case de:case he:case pe:case Ht:case qt:case Wt:return In;case Xt:case Jt:case Zt:case Yt:case ee:case ne:return qn;case Gt:case $t:case ie:case re:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case le:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case me:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case ce:return{point:"always",geoshape:"always"};case ge:return{text:"always"};case ue:return{point:"always",square:"always",text:"always"};case we:return{image:"always"};case Qt:case Vt:return{text:"always",arc:"always"};case te:case Kt:return{arc:"always"}}}(t)[e]}const In={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Un,...qn}=In;function Wn(t){switch(t){case Xt:case Jt:case Qt:case Vt:case Zt:case Yt:case le:case ue:case pe:case fe:case de:case he:case Gt:case $t:case te:case Kt:return;case Ht:case qt:case Wt:case ce:case me:case ge:case xe:case _e:case we:case ke:return"discrete";case oe:case ae:case se:return"flexible";case ee:case ne:case ie:case re:case ye:case be:case ve:return}}const Hn={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Xn={count:1,min:1,max:1};function Jn(t){return!!t&&!!t.argmin}function Gn(t){return!!t&&!!t.argmax}function $n(t){return(0,U.HD)(t)&&!!Hn[t]}const Zn=new Set(["count","valid","missing","distinct"]);function Yn(t){return(0,U.HD)(t)&&Zn.has(t)}const Vn=new Set(["count","sum","distinct","valid","missing"]),Kn=new Set(["mean","average","median","q1","q3","min","max"]);function Qn(t){return(0,U.jn)(t)&&(t=ss(t,void 0)),"bin"+bt(t).map((e=>ii(t[e])?kt("_".concat(e,"_").concat(_t(t[e]))):kt("_".concat(e,"_").concat(t[e])))).join("")}function ti(t){return!0===t||ni(t)&&!t.binned}function ei(t){return"binned"===t||ni(t)&&!0===t.binned}function ni(t){return(0,U.Kn)(t)}function ii(t){return null===t||void 0===t?void 0:t.param}function ri(t){switch(t){case qt:case Wt:case le:case oe:case ae:case se:case pe:case fe:case de:case he:case ce:return 6;case me:return 4;default:return 10}}function oi(t){return!(null===t||void 0===t||!t.expr)}function ai(t){const e=bt(t||{}),n={};for(const i of e)n[i]=gi(t[i]);return n}function si(t){const{anchor:e,frame:n,offset:i,orient:r,angle:o,limit:a,color:s,subtitleColor:c,subtitleFont:l,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=t,g={...e?{anchor:e}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},v={...c?{subtitleColor:c}:{},...l?{subtitleFont:l}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...m,...s?{fill:s}:{}},subtitleMarkConfig:nt(t,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:g,subtitle:v}}function ci(t){return(0,U.HD)(t)||(0,U.kJ)(t)&&(0,U.HD)(t[0])}function li(t){return!(null===t||void 0===t||!t.signal)}function ui(t){return!!t.step}function fi(t){return!(0,U.kJ)(t)&&("field"in t&&"data"in t)}const di=bt({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),hi={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},pi=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function mi(t){const e=(0,U.kJ)(t.condition)?t.condition.map(vi):vi(t.condition);return{...gi(t),condition:e}}function gi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function vi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function yi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return li(t)?t:void 0!==t?{value:t}:void 0}function bi(t){return li(t)?t.signal:(0,U.m8)(t.value)}function xi(t){return li(t)?t.signal:null==t?null:(0,U.m8)(t)}function _i(t,e,n){for(const i of n){const n=Ei(i,e.markDef,e.config);void 0!==n&&(t[i]=yi(n))}return t}function wi(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function ki(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:r,ignoreVgConfig:o}=i;return r&&void 0!==e[r]?e[r]:void 0!==e[t]?e[t]:!o||r&&r!==t?Ei(t,e,n,i):void 0}function Ei(t,e,n){let{vgChannel:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return zt(i?Di(t,e,n.style):void 0,Di(t,e,n.style),i?n[e.type][i]:void 0,n[e.type][t],i?n.mark[i]:n.mark[t])}function Di(t,e,n){return Ai(t,wi(e),n)}function Ai(t,e,n){let i;e=(0,U.IX)(e);for(const r of e){const e=n[r];e&&void 0!==e[t]&&(i=e[t])}return i}function Si(t,e){return(0,U.IX)(t).reduce(((t,n)=>{var i;return t.field.push(Ga(n,e)),t.order.push(null!==(i=n.sort)&&void 0!==i?i:"ascending"),t}),{field:[],order:[]})}function Ci(t,e){const n=[...t];return e.forEach((t=>{for(const e of n)if(Q(e,t))return;n.push(t)})),n}function Fi(t,e){return Q(t,e)||!e?t:t?[...(0,U.IX)(t),...(0,U.IX)(e)].join(", "):e}function Mi(t,e){const n=t.value,i=e.value;if(null==n||null===i)return{explicit:t.explicit,value:null};if((ci(n)||li(n))&&(ci(i)||li(i)))return{explicit:t.explicit,value:Fi(n,i)};if(ci(n)||li(n))return{explicit:t.explicit,value:n};if(ci(i)||li(i))return{explicit:t.explicit,value:i};if(!ci(n)&&!li(n)&&!ci(i)&&!li(i))return{explicit:t.explicit,value:Ci(n,i)};throw new Error("It should never reach here")}function Oi(t){return"Invalid specification ".concat(rt(t),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}const Ti='Autosize "fit" only works for single views and layered views.';function Ni(t){return"".concat("width"==t?"Width":"Height",' "container" only works for single views and layered views.')}function zi(t){const e="width"==t?"x":"y";return"".concat("width"==t?"Width":"Height",' "container" only works well with autosize "fit" or "fit-').concat(e,'".')}function Ri(t){return t?'Dropping "fit-'.concat(t,'" because spec has discrete ').concat(Ye(t),"."):'Dropping "fit" because spec has discrete size.'}function Pi(t){return"Unknown field for ".concat(t,". Cannot calculate view size.")}function Li(t){return'Cannot project a selection on encoding channel "'.concat(t,'", which has no field.')}function ji(t,e){return'Cannot project a selection on encoding channel "'.concat(t,'" as it uses an aggregate function ("').concat(e,'").')}function Bi(t){return"Selection not supported for ".concat(t," yet.")}const Ii="The same selection must be used to override scale domains in a layered view.";function Ui(t){return'The "columns" property cannot be used when "'.concat(t,'" has nested row/column.')}function qi(t,e,n){return'An ancestor parsed field "'.concat(t,'" as ').concat(n," but a child wants to parse the field as ").concat(e,".")}function Wi(t){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(t," are dropped.")}function Hi(t){return"".concat(t,"Offset dropped because ").concat(t," is continuous")}function Xi(t){return"There is no ".concat(t," encoding. Replacing ").concat(t,"Offset encoding as ").concat(t,".")}function Ji(t){return'Invalid field type "'.concat(t,'".')}function Gi(t,e){const{fill:n,stroke:i}=e;return"Dropping color ".concat(t," as the plot also has ").concat(n&&i?"fill and stroke":n?"fill":"stroke",".")}function $i(t,e){return"Dropping ".concat(rt(t),' from channel "').concat(e,'" since it does not contain any data field, datum, value, or signal.')}function Zi(t,e,n){return"".concat(t,' dropped as it is incompatible with "').concat(e,'"').concat(n?" when ".concat(n):"",".")}function Yi(t){return"".concat(t," encoding has no scale, so specified scale is ignored.")}function Vi(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned).")}function Ki(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).")}function Qi(t,e){return'Using discrete channel "'.concat(t,'" to encode "').concat(e,'" field can be misleading as it does not encode ').concat("ordinal"===e?"order":"magnitude",".")}function tr(t){return"Using unaggregated domain with raw field has no effect (".concat(rt(t),").")}function er(t){return'Unaggregated domain not applicable for "'.concat(t,'" since it produces values outside the origin domain of the source data.')}function nr(t){return"Unaggregated domain is currently unsupported for log scale (".concat(rt(t),").")}function ir(t,e,n){return"".concat(n,"-scale's \"").concat(e,'" is dropped as it does not work with ').concat(t," scale.")}function rr(t){return'The step for "'.concat(t,'" is dropped because the ').concat("width"===t?"x":"y"," is continuous.")}const or="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ar(t,e){return"Invalid ".concat(t,": ").concat(rt(e),".")}function sr(t){return"1D error band does not support ".concat(t,".")}function cr(t){return"Channel ".concat(t,' is required for "binned" bin.')}const lr=(0,U.kg)(U.uU);let ur=lr;function fr(){return ur=lr,ur}function dr(){ur.warn(...arguments)}function hr(t){if(t&&(0,U.Kn)(t))for(const e of _r)if(e in t)return!0;return!1}new WeakMap;const pr=["january","february","march","april","may","june","july","august","september","october","november","december"],mr=pr.map((t=>t.substr(0,3))),gr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],vr=gr.map((t=>t.substr(0,3)));function yr(t,e){const n=[];if(e&&void 0!==t.day&&bt(t).length>1&&(dr(function(t){return"Dropping day from datetime ".concat(rt(t)," as day cannot be combined with other units.")}(t)),delete(t=tt(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const i=e?function(t){if(Ut(t)&&(t=+t),(0,U.hj)(t))return t-1;{const e=t.toLowerCase(),n=pr.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=mr.indexOf(i);if(-1!==r)return r;throw new Error(ar("month",t))}}(t.month):t.month;n.push(i)}else if(void 0!==t.quarter){const i=e?function(t){if(Ut(t)&&(t=+t),(0,U.hj)(t))return t>4&&dr(ar("quarter",t)),t-1;throw new Error(ar("quarter",t))}(t.quarter):t.quarter;n.push((0,U.hj)(i)?3*i:"".concat(i,"*3"))}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const i=e?function(t){if(Ut(t)&&(t=+t),(0,U.hj)(t))return t%7;{const e=t.toLowerCase(),n=gr.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=vr.indexOf(i);if(-1!==r)return r;throw new Error(ar("day",t))}}(t.day):t.day;n.push((0,U.hj)(i)?i+1:"".concat(i,"+1"))}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const e=t[i];n.push("undefined"===typeof e?0:e)}return n}function br(t){const e=yr(t,!0).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}const xr={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},_r=bt(xr);function wr(t){return t.startsWith("utc")}const kr={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Er(t){return _r.filter((e=>Dr(t,e)))}function Dr(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function Ar(t,e){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const i=St(e),r=wr(t)?"utc":"";let o;const a={};for(const c of _r)Dr(t,c)&&(a[c]="quarter"===(s=c)?"(".concat(r,"quarter(").concat(i,")-1)"):"".concat(r).concat(s,"(").concat(i,")"),o=c);var s;return n&&(a[o]+="+1"),function(t){const e=yr(t,!1).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}(a)}function Sr(t){if(!t)return;const e=Er(t);return"timeUnitSpecifier(".concat(rt(e),", ").concat(rt(kr),")")}function Cr(t){if(!t)return;let e;return(0,U.HD)(t)?e={unit:t}:(0,U.Kn)(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),wr(e.unit)&&(e.utc=!0,e.unit=function(t){return t.substr(3)}(e.unit)),e}function Fr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;const n=Cr(t),i=function(t){const e=Er(t);return e[e.length-1]}(n.unit);if(i&&"day"!==i){const t={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},r=n.step||1,o={...t,..."quarter"===i?{month:+t.month+3*r}:"week"===i?{date:+t.date+7*r}:{[i]:+t[i]+r}};return"".concat(e(br(o))," - ").concat(e(br(t)))}}function Mr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.equal}function Or(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lt}function Tr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lte}function Nr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gt}function zr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gte}function Rr(t){if(null!==t&&void 0!==t&&t.field){if((0,U.kJ)(t.range)&&2===t.range.length)return!0;if(li(t.range))return!0}return!1}function Pr(t){return!(null===t||void 0===t||!t.field)&&((0,U.kJ)(t.oneOf)||(0,U.kJ)(t.in))}function Lr(t){return Pr(t)||Mr(t)||Rr(t)||Or(t)||Nr(t)||Tr(t)||zr(t)}function jr(t,e){return us(t,{timeUnit:e,wrapTime:!0})}function Br(t){var e;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:i}=t,r=null===(e=Cr(t.timeUnit))||void 0===e?void 0:e.unit,o=r?"time(".concat(Ar(r,i),")"):Ga(t,{expr:"datum"});if(Mr(t))return"".concat(o,"===").concat(jr(t.equal,r));if(Or(t)){const e=t.lt;return"".concat(o,"<").concat(jr(e,r))}if(Nr(t)){const e=t.gt;return"".concat(o,">").concat(jr(e,r))}if(Tr(t)){const e=t.lte;return"".concat(o,"<=").concat(jr(e,r))}if(zr(t)){const e=t.gte;return"".concat(o,">=").concat(jr(e,r))}if(Pr(t))return"indexof([".concat(function(t,e){return t.map((t=>jr(t,e)))}(t.oneOf,r).join(","),"], ").concat(o,") !== -1");if(function(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.valid}(t))return Ir(o,t.valid);if(Rr(t)){const{range:e}=t,i=li(e)?{signal:"".concat(e.signal,"[0]")}:e[0],a=li(e)?{signal:"".concat(e.signal,"[1]")}:e[1];if(null!==i&&null!==a&&n)return"inrange("+o+", ["+jr(i,r)+", "+jr(a,r)+"])";const s=[];return null!==i&&s.push("".concat(o," >= ").concat(jr(i,r))),null!==a&&s.push("".concat(o," <= ").concat(jr(a,r))),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(rt(t)))}function Ir(t){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"isValid(".concat(t,") && isFinite(+").concat(t,")"):"!isValid(".concat(t,") || !isFinite(+").concat(t,")")}function Ur(t){var e;return Lr(t)&&t.timeUnit?{...t,timeUnit:null===(e=Cr(t.timeUnit))||void 0===e?void 0:e.unit}:t}const qr={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Wr(t){return"quantitative"===t||"temporal"===t}function Hr(t){return"ordinal"===t||"nominal"===t}const Xr=qr.quantitative,Jr=qr.ordinal,Gr=qr.temporal,$r=qr.nominal,Zr=qr.geojson;bt(qr);const Yr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},Vr={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};bt(Vr);function Kr(t,e){const n=Vr[t],i=Vr[e];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Qr={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function to(t){return Qr[t]}const eo=new Set(["linear","log","pow","sqrt","symlog"]),no=new Set([...eo,"time","utc"]);function io(t){return eo.has(t)}const ro=new Set(["quantile","quantize","threshold"]),oo=new Set([...no,...ro,"sequential","identity"]),ao=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function so(t){return ao.has(t)}function co(t){return oo.has(t)}function lo(t){return no.has(t)}function uo(t){return ro.has(t)}function fo(t){return null===t||void 0===t?void 0:t.param}const ho={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:po,domain:mo,range:go,rangeMax:vo,rangeMin:yo,scheme:bo,...xo}=(bt(ho),ho),_o=bt(xo);function wo(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return lo(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return lo(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"clamp":return lo(t);case"nice":return lo(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return co(t)&&!st(["log","time","utc","threshold","quantile"],t)}}function ko(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return Oe(t)?void 0:'Cannot use the scale property "'.concat(e,'" with non-color channel.');case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const Eo={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Do=Eo.arc,Ao=Eo.area,So=Eo.bar,Co=Eo.image,Fo=Eo.line,Mo=Eo.point,Oo=Eo.rect,To=Eo.rule,No=Eo.text,zo=Eo.tick,Ro=Eo.trail,Po=Eo.circle,Lo=Eo.square,jo=Eo.geoshape;function Bo(t){return["line","area","trail"].includes(t)}function Io(t){return["rect","bar","image","arc"].includes(t)}const Uo=new Set(bt(Eo));function qo(t){return t.type}const Wo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Ho=bt({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Xo=bt({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Jo(t){return t&&void 0!=t.band}const Go={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$o={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},Zo={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function Yo(t){const{channel:e,channelDef:n,markDef:i,scale:r,config:o}=t,a=ea(t);return Na(n)&&!Yn(n.aggregate)&&r&&lo(r.get("type"))?function(t){let{fieldDef:e,channel:n,markDef:i,ref:r,config:o}=t;if(Bo(i.type))return r;const a=ki("invalid",i,o);if(null===a)return[Vo(e,n),r];return r}({fieldDef:n,channel:e,markDef:i,ref:a,config:o}):a}function Vo(t,e){return{test:Ko(t,!0),..."y"===Ge(e)?{field:{group:"height"}}:{value:0}}}function Ko(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ir((0,U.HD)(t)?t:Ga(t,{expr:"datum"}),!e)}function Qo(t,e,n,i){const r={};if(e&&(r.scale=e),Ra(t)){const{datum:e}=t;hr(e)?r.signal=br(e):li(e)?r.signal=e.signal:oi(e)?r.signal=e.expr:r.value=e}else r.field=Ga(t,n);if(i){const{offset:t,band:e}=i;t&&(r.offset=t),e&&(r.band=e)}return r}function ta(t){let{scaleName:e,fieldOrDatumDef:n,fieldOrDatumDef2:i,offset:r,startSuffix:o,bandPosition:a=.5}=t;const s=0<a&&a<1?"datum":void 0,c=Ga(n,{expr:s,suffix:o}),l=void 0!==i?Ga(i,{expr:s}):Ga(n,{suffix:"end",expr:s}),u={};if(0===a||1===a){u.scale=e;const t=0===a?c:l;u.field=t}else{const t=li(a)?"".concat(a.signal," * ").concat(c," + (1-").concat(a.signal,") * ").concat(l):"".concat(a," * ").concat(c," + ").concat(1-a," * ").concat(l);u.signal='scale("'.concat(e,'", ').concat(t,")")}return r&&(u.offset=r),u}function ea(t){let{channel:e,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:c,offset:l,defaultRef:u,bandPosition:f}=t;if(n){if(Ba(n)){var d,h;const t=null===s||void 0===s?void 0:s.get("type");if(Ia(n)){var p;null!==(p=f)&&void 0!==p||(f=Aa({fieldDef:n,fieldDef2:i,markDef:r,config:o}));const{bin:s,timeUnit:u,type:d}=n;if(ti(s)||f&&u&&d===Gr)return null!==c&&void 0!==c&&c.impute?Qo(n,a,{binSuffix:"mid"},{offset:l}):f&&!so(t)?ta({scaleName:a,fieldOrDatumDef:n,bandPosition:f,offset:l}):Qo(n,a,ds(n,e)?{binSuffix:"range"}:{},{offset:l});if(ei(s)){if(Na(i))return ta({scaleName:a,fieldOrDatumDef:n,fieldOrDatumDef2:i,bandPosition:f,offset:l});dr(cr(e===Xt?Gt:$t))}}return Qo(n,a,so(t)?{binSuffix:"range"}:{},{offset:l,band:"band"===t?null!==(d=null!==(h=f)&&void 0!==h?h:n.bandPosition)&&void 0!==d?d:.5:void 0})}if(Ua(n)){const t=l?{offset:l}:{};return{...na(e,n.value),...t}}}return(0,U.mf)(u)&&(u=u()),u?{...u,...l?{offset:l}:{}}:u}function na(t,e){return st(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:st(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:yi(e)}function ia(t){return t&&"number"!==t&&"time"!==t}function ra(t,e,n){return"".concat(t,"(").concat(e).concat(n?", ".concat(rt(n)):"",")")}const oa=" \u2013 ";function aa(t){let{fieldOrDatumDef:e,format:n,formatType:i,expr:r,normalizeStack:o,config:a}=t;if(ia(i))return ca({fieldOrDatumDef:e,format:n,formatType:i,expr:r,config:a});const s=sa(e,r,o),c=za(e);if(void 0===n&&void 0===i&&a.customFormatTypes){if("quantitative"===c){if(o&&a.normalizedNumberFormatType)return ca({fieldOrDatumDef:e,format:a.normalizedNumberFormat,formatType:a.normalizedNumberFormatType,expr:r,config:a});if(a.numberFormatType)return ca({fieldOrDatumDef:e,format:a.numberFormat,formatType:a.numberFormatType,expr:r,config:a})}if("temporal"===c&&a.timeFormatType&&Na(e)&&void 0===e.timeUnit)return ca({fieldOrDatumDef:e,format:a.timeFormat,formatType:a.timeFormatType,expr:r,config:a})}if(ls(e)){var l,u;const t=function(t){let{field:e,timeUnit:n,format:i,formatType:r,rawTimeFormat:o,isUTCScale:a}=t;return!n||i?!n&&r?"".concat(r,"(").concat(e,", '").concat(i,"')"):(i=(0,U.HD)(i)?i:o,"".concat(a?"utc":"time","Format(").concat(e,", '").concat(i,"')")):function(t,e,n){if(!t)return;const i=Sr(t),r=n||wr(t);return"".concat(r?"utc":"time","Format(").concat(e,", ").concat(i,")")}(n,e,a)}({field:s,timeUnit:Na(e)?null===(l=Cr(e.timeUnit))||void 0===l?void 0:l.unit:void 0,format:n,formatType:a.timeFormatType,rawTimeFormat:a.timeFormat,isUTCScale:qa(e)&&(null===(u=e.scale)||void 0===u?void 0:u.type)===Yr.UTC});return t?{signal:t}:void 0}if(n=fa({type:c,specifiedFormat:n,config:a,normalizeStack:o}),Na(e)&&ti(e.bin)){return{signal:pa(s,Ga(e,{expr:r,binSuffix:"end"}),n,i,a)}}return n||"quantitative"===za(e)?{signal:"".concat(da(s,n))}:{signal:"isValid(".concat(s,") ? ").concat(s,' : ""+').concat(s)}}function sa(t,e,n){return Na(t)?n?"".concat(Ga(t,{expr:e,suffix:"end"}),"-").concat(Ga(t,{expr:e,suffix:"start"})):Ga(t,{expr:e}):function(t){const{datum:e}=t;return hr(e)?br(e):"".concat(rt(e))}(t)}function ca(t){var e;let{fieldOrDatumDef:n,format:i,formatType:r,expr:o,normalizeStack:a,config:s,field:c}=t;if(null!==(e=c)&&void 0!==e||(c=sa(n,o,a)),"datum.value"!==c&&Na(n)&&ti(n.bin)){return{signal:pa(c,Ga(n,{expr:o,binSuffix:"end"}),i,r,s)}}return{signal:ra(r,c,i)}}function la(t,e,n,i,r,o){if(!(0,U.HD)(i)||!ia(i)){if(void 0===n&&void 0===i&&r.customFormatTypes&&"quantitative"===za(t)){if(r.normalizedNumberFormatType&&Wa(t)&&"normalize"===t.stack)return;if(r.numberFormatType)return}if(Wa(t)&&"normalize"===t.stack&&r.normalizedNumberFormat)return fa({type:"quantitative",config:r,normalizeStack:!0});if(ls(t)){var a;const e=Na(t)?null===(a=Cr(t.timeUnit))||void 0===a?void 0:a.unit:void 0;if(void 0===e&&r.customFormatTypes&&r.timeFormatType)return;return function(t){let{specifiedFormat:e,timeUnit:n,config:i,omitTimeFormatConfig:r}=t;if(e)return e;if(n)return{signal:Sr(n)};return r?void 0:i.timeFormat}({specifiedFormat:n,timeUnit:e,config:r,omitTimeFormatConfig:o})}return fa({type:e,specifiedFormat:n,config:r})}}function ua(t,e,n){return t&&(li(t)||"number"===t||"time"===t)?t:ls(e)&&"time"!==n&&"utc"!==n?Na(e)&&null!==(i=Cr(null===e||void 0===e?void 0:e.timeUnit))&&void 0!==i&&i.utc?"utc":"time":void 0;var i}function fa(t){let{type:e,specifiedFormat:n,config:i,normalizeStack:r}=t;return(0,U.HD)(n)?n:e===Xr?r?i.normalizedNumberFormat:i.numberFormat:void 0}function da(t,e){return"format(".concat(t,', "').concat(e||"",'")')}function ha(t,e,n,i){var r;return ia(n)?ra(n,t,e):da(t,null!==(r=(0,U.HD)(e)?e:void 0)&&void 0!==r?r:i.numberFormat)}function pa(t,e,n,i,r){if(void 0===n&&void 0===i&&r.customFormatTypes&&r.numberFormatType)return pa(t,e,r.numberFormat,r.numberFormatType,r);const o=ha(t,n,i,r),a=ha(e,n,i,r);return"".concat(Ir(t,!1),' ? "null" : ').concat(o,' + "').concat(oa,'" + ').concat(a)}const ma="min",ga={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function va(t){return t in ga}function ya(t){return!(null===t||void 0===t||!t.encoding)}function ba(t){return t&&("count"===t.op||!!t.field)}function xa(t){return t&&(0,U.kJ)(t)}function _a(t){return"row"in t||"column"in t}function wa(t){return!!t&&"header"in t}function ka(t){return"facet"in t}function Ea(t){const{field:e,timeUnit:n,bin:i,aggregate:r}=t;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:e}}function Da(t){return"sort"in t}function Aa(t){let{fieldDef:e,fieldDef2:n,markDef:i,config:r}=t;if(Ba(e)&&void 0!==e.bandPosition)return e.bandPosition;if(Na(e)){const{timeUnit:t,bin:o}=e;if(t&&!n)return Io(i.type)?0:Ei("timeUnitBandPosition",i,r);if(ti(o))return.5}}function Sa(t){let{channel:e,fieldDef:n,fieldDef2:i,markDef:r,config:o,scaleType:a,useVlSizeChannel:s}=t;const c=Ye(e),l=ki(s?"size":c,r,o,{vgChannel:c});if(void 0!==l)return l;if(Na(n)){const{timeUnit:t,bin:e}=n;if(t&&!i)return{band:Ei("timeUnitBandSize",r,o)};if(ti(e)&&!so(a))return{band:1}}var u,f,d;return Io(r.type)?a?so(a)?(null===(f=o[r.type])||void 0===f?void 0:f.discreteBandSize)||{band:1}:null===(d=o[r.type])||void 0===d?void 0:d.continuousBandSize:null===(u=o[r.type])||void 0===u?void 0:u.discreteBandSize:void 0}function Ca(t,e,n,i){return!!(ti(t.bin)||t.timeUnit&&Ia(t)&&"temporal"===t.type)&&void 0!==Aa({fieldDef:t,fieldDef2:e,markDef:n,config:i})}function Fa(t){return t&&!!t.sort&&!t.field}function Ma(t){return t&&"condition"in t}function Oa(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,U.kJ)(e)&&Na(e)}function Ta(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,U.kJ)(e)&&Ba(e)}function Na(t){return t&&(!!t.field||"count"===t.aggregate)}function za(t){return null===t||void 0===t?void 0:t.type}function Ra(t){return t&&"datum"in t}function Pa(t){return Ia(t)&&!$a(t)||ja(t)}function La(t){return Ia(t)&&"quantitative"===t.type&&!t.bin||ja(t)}function ja(t){return Ra(t)&&(0,U.hj)(t.datum)}function Ba(t){return Na(t)||Ra(t)}function Ia(t){return t&&("field"in t||"count"===t.aggregate)&&"type"in t}function Ua(t){return t&&"value"in t&&"value"in t}function qa(t){return t&&("scale"in t||"sort"in t)}function Wa(t){return t&&("axis"in t||"stack"in t||"impute"in t)}function Ha(t){return t&&"legend"in t}function Xa(t){return t&&("format"in t||"formatType"in t)}function Ja(t){return it(t,["legend","axis","header","scale"])}function Ga(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.field;const i=e.prefix;let r=e.suffix,o="";if(function(t){return"count"===t.aggregate}(t))n=jt("count");else{let i;if(!e.nofn)if(function(t){return"op"in t}(t))i=t.op;else{const{bin:l,aggregate:u,timeUnit:f}=t;var a,s;if(ti(l))i=Qn(l),r=(null!==(a=e.binSuffix)&&void 0!==a?a:"")+(null!==(s=e.suffix)&&void 0!==s?s:"");else if(u)Gn(u)?(o='["'.concat(n,'"]'),n="argmax_".concat(u.argmax)):Jn(u)?(o='["'.concat(n,'"]'),n="argmin_".concat(u.argmin)):i=String(u);else if(f){var c;i=function(t){const{utc:e,...n}=Cr(t);return n.unit?(e?"utc":"")+bt(n).map((t=>kt("".concat("unit"===t?"":"_".concat(t,"_")).concat(n[t])))).join(""):(e?"utc":"")+"timeunit"+bt(n).map((t=>kt("_".concat(t,"_").concat(n[t])))).join("")}(f),r=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(null!==(c=e.suffix)&&void 0!==c?c:"")}}i&&(n=n?"".concat(i,"_").concat(n):i)}return r&&(n="".concat(n,"_").concat(r)),i&&(n="".concat(i,"_").concat(n)),e.forAs?Tt(n):e.expr?Ct(n,e.expr)+o:Mt(n)+o}function $a(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Na(t)&&!!t.bin;case"temporal":return!1}throw new Error(Ji(t.type))}const Za=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:i,field:r}=t;if(Gn(e))return"".concat(r," for argmax(").concat(e.argmax,")");if(Jn(e))return"".concat(r," for argmin(").concat(e.argmin,")");const o=Cr(i),a=e||(null===o||void 0===o?void 0:o.unit)||(null===o||void 0===o?void 0:o.maxbins)&&"timeunit"||ti(n)&&"bin";return a?"".concat(a.toUpperCase(),"(").concat(r,")"):r}(t);default:return function(t,e){const{field:n,bin:i,timeUnit:r,aggregate:o}=t;if("count"===o)return e.countTitle;if(ti(i))return"".concat(n," (binned)");if(r){var a;const t=null===(a=Cr(r))||void 0===a?void 0:a.unit;if(t)return"".concat(n," (").concat(Er(t).join("-"),")")}else if(o)return Gn(o)?"".concat(n," for max ").concat(o.argmax):Jn(o)?"".concat(n," for min ").concat(o.argmin):"".concat(At(o)," of ").concat(n);return n}(t,e)}};let Ya=Za;function Va(t){Ya=t}function Ka(t,e,n){var i;let{allowDisabling:r,includeDefault:o=!0}=n;const a=null===(i=Qa(t))||void 0===i?void 0:i.title;if(!Na(t))return null!==a&&void 0!==a?a:t.title;const s=t,c=o?ts(s,e):void 0;return r?zt(a,s.title,c):null!==(l=null!==a&&void 0!==a?a:s.title)&&void 0!==l?l:c;var l}function Qa(t){return Wa(t)&&t.axis?t.axis:Ha(t)&&t.legend?t.legend:wa(t)&&t.header?t.header:void 0}function ts(t,e){return Ya(t,e)}function es(t){if(Xa(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{var e;const n=null!==(e=Qa(t))&&void 0!==e?e:{},{format:i,formatType:r}=n;return{format:i,formatType:r}}}function ns(t){return Na(t)?t:Oa(t)?t.condition:void 0}function is(t){return Ba(t)?t:Ta(t)?t.condition:void 0}function rs(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,U.HD)(t)||(0,U.hj)(t)||(0,U.jn)(t)){return dr(function(t,e,n){return"Channel ".concat(t," is a ").concat(e,". Converted to {value: ").concat(rt(n),"}.")}(e,(0,U.HD)(t)?"string":(0,U.hj)(t)?"number":"boolean",t)),{value:t}}return Ba(t)?os(t,e,n,i):Ta(t)?{...t,condition:os(t.condition,e,n,i)}:t}function os(t,e,n,i){if(Xa(t)){const{format:r,formatType:o,...a}=t;if(ia(o)&&!n.customFormatTypes)return dr(Wi(e)),os(a,e,n,i)}else{const r=Wa(t)?"axis":Ha(t)?"legend":wa(t)?"header":null;if(r&&t[r]){const{format:o,formatType:a,...s}=t[r];if(ia(a)&&!n.customFormatTypes)return dr(Wi(e)),os({...t,[r]:s},e,n,i)}}return Na(t)?as(t,e,i):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=(0,U.hj)(n)?"quantitative":(0,U.HD)(n)?"nominal":hr(n)?"temporal":void 0,{...t,type:e}}(t)}function as(t,e){let{compositeMark:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{aggregate:i,timeUnit:r,bin:o,field:a}=t,s={...t};if(n||!i||$n(i)||Gn(i)||Jn(i)||(dr(function(t){return'Invalid aggregation operator "'.concat(t,'".')}(i)),delete s.aggregate),r&&(s.timeUnit=Cr(r)),a&&(s.field="".concat(a)),ti(o)&&(s.bin=ss(o,e)),ei(o)&&!xn(e)&&dr(function(t){return"Channel ".concat(t,' should not be used with "binned" bin.')}(e)),Ia(s)){const{type:t}=s,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case Xr:return"quantitative";case"t":case Gr:return"temporal";case"o":case Jr:return"ordinal";case"n":case $r:return"nominal";case Zr:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&Yn(i)&&(dr(function(t,e){return'Invalid field type "'.concat(t,'" for aggregate: "').concat(e,'", using "quantitative" instead.')}(t,i)),s.type="quantitative")}else if(!Je(e)){const t=function(t,e){var n;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Da(t)&&(0,U.kJ)(t.sort))return"ordinal";const{aggregate:i,bin:r,timeUnit:o}=t;if(o)return"temporal";if(r||i&&!Gn(i)&&!Jn(i))return"quantitative";if(qa(t)&&null!==(n=t.scale)&&void 0!==n&&n.type)switch(Vr[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,e);s.type=t}if(Ia(s)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:"Channel ".concat(e," should not be used with a geojson data.")};switch(e){case qt:case Wt:case Ht:return $a(t)?cs:{compatible:!1,warning:Vi(e)};case Xt:case Jt:case Zt:case Yt:case oe:case ae:case se:case ge:case ye:case be:case xe:case _e:case we:case ue:case Qt:case Vt:case ke:return cs;case ne:case re:case ee:case ie:return n!==Xr?{compatible:!1,warning:"Channel ".concat(e," should be used with a quantitative field only, not ").concat(t.type," field.")}:cs;case fe:case de:case he:case pe:case le:case te:case Kt:case Gt:case $t:return"nominal"!==n||t.sort?cs:{compatible:!1,warning:"Channel ".concat(e," should not be used with an unsorted discrete field.")};case ce:case me:return $a(t)||function(t){var e;return qa(t)&&uo(null===(e=t.scale)||void 0===e?void 0:e.type)}(t)?cs:{compatible:!1,warning:Ki(e)};case ve:return"nominal"!==t.type||"sort"in t?cs:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,e)||{};!1===t&&dr(n)}if(Da(s)&&(0,U.HD)(s.sort)){const{sort:t}=s;if(va(t))return{...s,sort:{encoding:t}};const e=t.substr(1);if("-"===t.charAt(0)&&va(e))return{...s,sort:{encoding:e,order:"descending"}}}if(wa(s)){const{header:t}=s;if(t){const{orient:e,...n}=t;if(e)return{...s,header:{...n,labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e}}}}return s}function ss(t,e){return(0,U.jn)(t)?{maxbins:ri(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:{...t,maxbins:ri(e)}}const cs={compatible:!0};function ls(t){const{formatType:e}=es(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||Na(n)&&!!n.timeUnit));var n}function us(t,e){var n;let{timeUnit:i,type:r,wrapTime:o,undefinedIfExprNotRequired:a}=e;const s=i&&(null===(n=Cr(i))||void 0===n?void 0:n.unit);let c,l=s||"temporal"===r;return oi(t)?c=t.expr:li(t)?c=t.signal:hr(t)?(l=!0,c=br(t)):((0,U.HD)(t)||(0,U.hj)(t))&&l&&(c="datetime(".concat(rt(t),")"),function(t){return!!xr[t]}(s)&&((0,U.hj)(t)&&t<1e4||(0,U.HD)(t)&&isNaN(Date.parse(t)))&&(c=br({[s]:t}))),c?o&&l?"time(".concat(c,")"):c:a?void 0:rt(t)}function fs(t,e){const{type:n}=t;return e.map((e=>{const i=us(e,{timeUnit:Na(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:e}))}function ds(t,e){return ti(t.bin)?jn(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const hs={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ps(t){return null===t||void 0===t?void 0:t.condition}const ms=["domain","grid","labels","ticks","title"],gs={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},vs={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},ys={...vs,style:1,labelExpr:1,encoding:1};function bs(t){return!!ys[t]}bt(ys);const xs=bt({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function _s(t){return"mark"in t}class ws{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!_s(t)&&(qo(e=t.mark)?e.type:e)===this.name;var e}}function ks(t,e){const n=t&&t[e];return!!n&&((0,U.kJ)(n)?ct(n,(t=>!!t.field)):Na(n)||Oa(n))}function Es(t,e){const n=t&&t[e];return!!n&&((0,U.kJ)(n)?ct(n,(t=>!!t.field)):Na(n)||Ra(n)||Ta(n))}function Ds(t,e){if(xn(e)){const n=t[e];if((Na(n)||Ra(n))&&(Hr(n.type)||Na(n)&&n.timeUnit)){return Es(t,Ke(e))}}return!1}function As(t){return ct(Re,(e=>{if(ks(t,e)){const n=t[e];if((0,U.kJ)(n))return ct(n,(t=>!!t.aggregate));{const t=ns(n);return t&&!!t.aggregate}}return!1}))}function Ss(t,e){const n=[],i=[],r=[],o=[],a={};return Ms(t,((s,c)=>{if(Na(s)){const{field:l,aggregate:u,bin:f,timeUnit:d,...h}=s;if(u||d||f){const t=Qa(s),p=null===t||void 0===t?void 0:t.title;let m=Ga(s,{forAs:!0});const g={...p?[]:{title:Ka(s,e,{allowDisabling:!0})},...h,field:m};if(u){let t;if(Gn(u)?(t="argmax",m=Ga({op:"argmax",field:u.argmax},{forAs:!0}),g.field="".concat(m,".").concat(l)):Jn(u)?(t="argmin",m=Ga({op:"argmin",field:u.argmin},{forAs:!0}),g.field="".concat(m,".").concat(l)):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(t=u),t){const e={op:t,as:m};l&&(e.field=l),o.push(e)}}else if(n.push(m),Ia(s)&&ti(f)){if(i.push({bin:f,field:l,as:m}),n.push(Ga(s,{binSuffix:"end"})),ds(s,c)&&n.push(Ga(s,{binSuffix:"range"})),xn(c)){const t={field:"".concat(m,"_end")};a["".concat(c,"2")]=t}g.bin="binned",Je(c)||(g.type=Xr)}else if(d){r.push({timeUnit:d,field:l,as:m});const t=Ia(s)&&s.type!==Gr&&"time";t&&(c===ge||c===xe?g.formatType=t:!function(t){return!!gn[t]}(c)?xn(c)&&(g.axis={formatType:t,...g.axis}):g.legend={formatType:t,...g.legend})}a[c]=g}else n.push(l),a[c]=t[c]}else a[c]=t[c]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function Cs(t,e,n){const i=Bn(e,n);if(!i)return!1;if("binned"===i){const n=t[e===Gt?Xt:Jt];return!!(Na(n)&&Na(t[e])&&ei(n.bin))}return!0}function Fs(t,e){const n={};for(const i of bt(t)){const r=rs(t[i],i,e,{compositeMark:!0});n[i]=r}return n}function Ms(t,e,n){if(t)for(const i of bt(t)){const r=t[i];if((0,U.kJ)(r))for(const t of r)e.call(n,t,i);else e.call(n,r,i)}}function Os(t,e){return bt(e).reduce(((n,i)=>{switch(i){case Xt:case Jt:case _e:case ke:case we:case Gt:case $t:case Zt:case Yt:case Qt:case te:case Vt:case Kt:case ee:case ne:case ie:case re:case ge:case ce:case ue:case xe:return n;case ve:if("line"===t||"trail"===t)return n;case ye:case be:{const t=e[i];if((0,U.kJ)(t)||Na(t))for(const e of(0,U.IX)(t))e.aggregate||n.push(Ga(e,{}));return n}case le:if("trail"===t)return n;case oe:case ae:case se:case fe:case de:case he:case me:case pe:{const t=ns(e[i]);return t&&!t.aggregate&&n.push(Ga(t,{})),n}}}),[])}function Ts(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map((t=>{let{fieldPrefix:n,titlePrefix:r}=t;const o=i?" of ".concat(Ns(e)):"";return{field:n+e.field,type:e.type,title:li(r)?{signal:"".concat(r,'"').concat(escape(o),'"')}:r+o}})),...dt(function(t){const e=[];for(const n of bt(t))if(ks(t,n)){const i=t[n],r=(0,U.IX)(i);for(const t of r)Na(t)?e.push(t):Oa(t)&&e.push(t.condition)}return e}(n).map(Ja),ot)]}}function Ns(t){const{title:e,field:n}=t;return zt(e,n)}function zs(t,e,n,i,r){const{scale:o,axis:a}=n;return s=>{let{partName:c,mark:l,positionPrefix:u,endPositionPrefix:f,extraEncoding:d={}}=s;const h=Ns(n);return Rs(t,c,r,{mark:l,encoding:{[e]:{field:"".concat(u,"_").concat(n.field),type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...(0,U.HD)(f)?{["".concat(e,"2")]:{field:"".concat(f,"_").concat(n.field)}}:{},...i,...d}})}}function Rs(t,e,n,i){const{clip:r,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[{...i,mark:{...n[e],...r?{clip:r}:{},...o?{color:o}:{},...a?{opacity:a}:{},...qo(i.mark)?i.mark:{type:i.mark},style:"".concat(s,"-").concat(String(e)),...(0,U.jn)(t[e])?{}:t[e]}}]:[]}function Ps(t,e,n){const{encoding:i}=t,r="vertical"===e?"y":"x",o=i[r],a=i["".concat(r,"2")],s=i["".concat(r,"Error")],c=i["".concat(r,"Error2")];return{continuousAxisChannelDef:Ls(o,n),continuousAxisChannelDef2:Ls(a,n),continuousAxisChannelDefError:Ls(s,n),continuousAxisChannelDefError2:Ls(c,n),continuousAxis:r}}function Ls(t,e){if(null!==t&&void 0!==t&&t.aggregate){const{aggregate:n,...i}=t;return n!==e&&dr(function(t,e){return"Continuous axis should not have customized aggregation function ".concat(t,"; ").concat(e," already agregates the axis.")}(n,e)),i}return t}function js(t,e){const{mark:n,encoding:i}=t,{x:r,y:o}=i;if(qo(n)&&n.orient)return n.orient;if(Pa(r)){if(Pa(o)){const t=Na(r)&&r.aggregate,n=Na(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return ls(o)&&!ls(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Pa(o))return"vertical";throw new Error("Need a valid continuous axis for ".concat(e,"s"))}const Bs="boxplot",Is=new ws(Bs,qs);function Us(t){return(0,U.hj)(t)?"tukey":t}function qs(t,e){var n;let{config:i}=e;t={...t,encoding:Fs(t.encoding,i)};const{mark:r,encoding:o,params:a,projection:s,...c}=t,l=qo(r)?r:{type:r};a&&dr(Bi("boxplot"));const u=null!==(n=l.extent)&&void 0!==n?n:i.boxplot.extent,f=ki("size",l,i),d=l.invalid,h=Us(u),{bins:p,timeUnits:m,transform:g,continuousAxisChannelDef:v,continuousAxis:y,groupby:b,aggregate:x,encodingWithoutContinuousAxis:_,ticksOrient:w,boxOrient:k,customTooltipWithoutAggregatedField:E}=function(t,e,n){const i=js(t,Bs),{continuousAxisChannelDef:r,continuousAxis:o}=Ps(t,i,Bs),a=r.field,s=Us(e),c=[...Ws(a),{op:"median",field:a,as:"mid_box_".concat(a)},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:'datum["upper_box_'.concat(a,'"] - datum["lower_box_').concat(a,'"]'),as:"iqr_".concat(a)},{calculate:'min(datum["upper_box_'.concat(a,'"] + datum["iqr_').concat(a,'"] * ').concat(e,', datum["max_').concat(a,'"])'),as:"upper_whisker_".concat(a)},{calculate:'max(datum["lower_box_'.concat(a,'"] - datum["iqr_').concat(a,'"] * ').concat(e,', datum["min_').concat(a,'"])'),as:"lower_whisker_".concat(a)}],{[o]:u,...f}=t.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let i,r;if((0,U.kJ)(e)){for(const t of e)t.aggregate?(i||(i=[]),i.push(t)):(r||(r=[]),r.push(t));i&&(n.tooltip=i)}else e.aggregate?n.tooltip=e:r=e;return(0,U.kJ)(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(f),{bins:p,timeUnits:m,aggregate:g,groupby:v,encoding:y}=Ss(h,n),b="vertical"===i?"horizontal":"vertical",x=i,_=[...p,...m,{aggregate:[...g,...c],groupby:v},...l];return{bins:p,timeUnits:m,transform:_,groupby:v,aggregate:g,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(t,u,i),{color:D,size:A,...S}=_,C=t=>zs(l,y,v,t,i.boxplot),F=C(S),M=C(_),O=C({...S,...A?{size:A}:{}}),T=Ts([{fieldPrefix:"min-max"===h?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===h?"lower_whisker_":"min_",titlePrefix:"Min"}],v,_),N={type:"tick",color:"black",opacity:1,orient:w,invalid:d,aria:!1},z="min-max"===h?T:Ts([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,_),R=[...F({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...F({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...F({partName:"ticks",mark:N,positionPrefix:"lower_whisker",extraEncoding:z}),...F({partName:"ticks",mark:N,positionPrefix:"upper_whisker",extraEncoding:z})],P=[..."tukey"!==h?R:[],...M({partName:"box",mark:{type:"bar",...f?{size:f}:{},orient:k,invalid:d,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...O({partName:"median",mark:{type:"tick",invalid:d,...(0,U.Kn)(i.boxplot.median)&&i.boxplot.median.color?{color:i.boxplot.median.color}:{},...f?{size:f}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];var L;if("min-max"===h)return{...c,transform:(null!==(L=c.transform)&&void 0!==L?L:[]).concat(g),layer:P};const j='datum["lower_box_'.concat(v.field,'"]'),B='datum["upper_box_'.concat(v.field,'"]'),I="(".concat(B," - ").concat(j,")"),q="".concat(j," - ").concat(u," * ").concat(I),W="".concat(B," + ").concat(u," * ").concat(I),H='datum["'.concat(v.field,'"]'),X={joinaggregate:Ws(v.field),groupby:b},J={transform:[{filter:"(".concat(q," <= ").concat(H,") && (").concat(H," <= ").concat(W,")")},{aggregate:[{op:"min",field:v.field,as:"lower_whisker_".concat(v.field)},{op:"max",field:v.field,as:"upper_whisker_".concat(v.field)},{op:"min",field:"lower_box_".concat(v.field),as:"lower_box_".concat(v.field)},{op:"max",field:"upper_box_".concat(v.field),as:"upper_box_".concat(v.field)},...x],groupby:b}],layer:R},{tooltip:G,...$}=S,{scale:Z,axis:Y}=v,V=Ns(v),K=it(Y,["title"]),Q=Rs(l,"outliers",i.boxplot,{transform:[{filter:"(".concat(H," < ").concat(q,") || (").concat(H," > ").concat(W,")")}],mark:"point",encoding:{[y]:{field:v.field,type:v.type,...void 0!==V?{title:V}:{},...void 0!==Z?{scale:Z}:{},...yt(K)?{}:{axis:K}},...$,...D?{color:D}:{},...E?{tooltip:E}:{}}})[0];let tt;const et=[...p,...m,X];return Q?tt={transform:et,layer:[Q,J]}:(tt=J,tt.transform.unshift(...et)),{...c,layer:[tt,{transform:g,layer:P}]}}function Ws(t){return[{op:"q1",field:t,as:"lower_box_".concat(t)},{op:"q3",field:t,as:"upper_box_".concat(t)}]}const Hs="errorbar",Xs=new ws(Hs,Js);function Js(t,e){let{config:n}=e;t={...t,encoding:Fs(t.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:c,outerSpec:l,tooltipEncoding:u}=$s(t,Hs,n);delete a.size;const f=zs(c,o,r,a,n.errorbar),d=c.thickness,h=c.size,p={type:"tick",orient:s,aria:!1,...void 0!==d?{thickness:d}:{},...void 0!==h?{size:h}:{}},m=[...f({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...f({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...f({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==d?{size:d}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:i,...m.length>1?{layer:m}:{...m[0]}}}function Gs(t,e){const{encoding:n}=t;if(function(t){return(Ba(t.x)||Ba(t.y))&&!Ba(t.x2)&&!Ba(t.y2)&&!Ba(t.xError)&&!Ba(t.xError2)&&!Ba(t.yError)&&!Ba(t.yError2)}(n))return{orient:js(t,e),inputType:"raw"};const i=function(t){return Ba(t.x2)||Ba(t.y2)}(n),r=function(t){return Ba(t.xError)||Ba(t.xError2)||Ba(t.yError)||Ba(t.yError2)}(n),o=n.x,a=n.y;if(i){if(r)throw new Error("".concat(e," cannot be both type aggregated-upper-lower and aggregated-error"));const t=n.x2,i=n.y2;if(Ba(t)&&Ba(i))throw new Error("".concat(e," cannot have both x2 and y2"));if(Ba(t)){if(Pa(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(e))}if(Ba(i)){if(Pa(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in ".concat(e))}throw new Error("No ranged axis")}{const t=n.xError,i=n.xError2,r=n.yError,s=n.yError2;if(Ba(i)&&!Ba(t))throw new Error("".concat(e," cannot have xError2 without xError"));if(Ba(s)&&!Ba(r))throw new Error("".concat(e," cannot have yError2 without yError"));if(Ba(t)&&Ba(r))throw new Error("".concat(e," cannot have both xError and yError with both are quantiative"));if(Ba(t)){if(Pa(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Ba(r)){if(Pa(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function $s(t,e,n){var i;const{mark:r,encoding:o,params:a,projection:s,...c}=t,l=qo(r)?r:{type:r};a&&dr(Bi(e));const{orient:u,inputType:f}=Gs(t,e),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:g}=Ps(t,u,e),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(t,e,n,i,r,o,a,s){let c=[],l=[];const u=e.field;let f,d=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!==("iqr"===n)&&dr(function(t,e,n){return"".concat(t," is not usually used with ").concat(e," for ").concat(n,".")}(e,n,a)),"stderr"===n||"stdev"===n)c=[{op:n,field:u,as:"extent_".concat(u)},{op:e,field:u,as:"center_".concat(u)}],l=[{calculate:'datum["center_'.concat(u,'"] + datum["extent_').concat(u,'"]'),as:"upper_".concat(u)},{calculate:'datum["center_'.concat(u,'"] - datum["extent_').concat(u,'"]'),as:"lower_".concat(u)}],f=[{fieldPrefix:"center_",titlePrefix:At(e)},{fieldPrefix:"upper_",titlePrefix:Zs(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:Zs(e,n,"-")}],d=!0;else{let t,e,i;"ci"===n?(t="mean",e="ci0",i="ci1"):(t="median",e="q1",i="q3"),c=[{op:e,field:u,as:"lower_".concat(u)},{op:i,field:u,as:"upper_".concat(u)},{op:t,field:u,as:"center_".concat(u)}],f=[{fieldPrefix:"upper_",titlePrefix:Ka({field:u,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Ka({field:u,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Ka({field:u,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&dr((h=t.center,p=t.extent,"".concat(p?"extent ":"").concat(p&&h?"and ":"").concat(h?"center ":"").concat(p&&h?"are ":"is ","not needed when data are aggregated."))),"aggregated-upper-lower"===o?(f=[],l=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_".concat(u)},{calculate:'datum["'.concat(u,'"]'),as:"lower_".concat(u)}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:u}],l=[{calculate:'datum["'.concat(u,'"] + datum["').concat(i.field,'"]'),as:"upper_".concat(u)}],r?l.push({calculate:'datum["'.concat(u,'"] + datum["').concat(r.field,'"]'),as:"lower_".concat(u)}):l.push({calculate:'datum["'.concat(u,'"] - datum["').concat(i.field,'"]'),as:"lower_".concat(u)}));for(const t of l)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:Ot(Ot(t.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,m,f,e,n),{[g]:_,["x"===g?"x2":"y2"]:w,["x"===g?"xError":"yError"]:k,["x"===g?"xError2":"yError2"]:E,...D}=o,{bins:A,timeUnits:S,aggregate:C,groupby:F,encoding:M}=Ss(D,n),O=[...C,...v],T="raw"!==f?[]:F,N=Ts(b,d,M,x);return{transform:[...null!==(i=c.transform)&&void 0!==i?i:[],...A,...S,...0===O.length?[]:[{aggregate:O,groupby:T}],...y],groupby:T,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:c,tooltipEncoding:N}}function Zs(t,e,n){return"".concat(At(t)," ").concat(n," ").concat(e)}const Ys="errorband",Vs=new ws(Ys,Ks);function Ks(t,e){let{config:n}=e;t={...t,encoding:Fs(t.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:c,tooltipEncoding:l}=$s(t,Ys,n),u=s,f=zs(u,o,r,a,n.errorband),d=void 0!==t.encoding.x&&void 0!==t.encoding.y;let h={type:d?"area":"rect"},p={type:d?"line":"rule"};const m={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return d?(h={...h,...m,ariaRoleDescription:"errorband"},p={...p,...m,aria:!1}):u.interpolate?dr(sr("interpolate")):u.tension&&dr(sr("tension")),{...c,transform:i,layer:[...f({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...f({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:l}),...f({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:l})]}}const Qs={};function tc(t,e,n){const i=new ws(t,e);Qs[t]={normalizer:i,parts:n}}tc(Bs,qs,["box","median","outliers","rule","ticks"]),tc(Hs,Js,["ticks","rule"]),tc(Ys,Ks,["band","borders"]);const ec=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],nc={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},ic={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},rc=bt(nc),oc=bt(ic),ac=bt({header:1,headerRow:1,headerColumn:1,headerFacet:1}),sc=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],cc={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},lc=(bt(cc),"_vgsid_"),uc={point:{on:"click",fields:[lc],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function fc(t){return"legend"===t||!(null===t||void 0===t||!t.legend)}function dc(t){return fc(t)&&(0,U.Kn)(t)}function hc(t){return!(null===t||void 0===t||!t.select)}function pc(t){const e=[];for(const n of t||[]){if(hc(n))continue;const{expr:t,bind:i,...r}=n;if(i&&t){const n={...r,bind:i,init:t};e.push(n)}else{const n={...r,...t?{update:t}:{},...i?{bind:i}:{}};e.push(n)}}return e}function mc(t){return"concat"in t}function gc(t){return"vconcat"in t}function vc(t){return"hconcat"in t}function yc(t){let{step:e,offsetIsDiscrete:n}=t;var i;return n?null!==(i=e.for)&&void 0!==i?i:"offset":"position"}function bc(t){return(0,U.Kn)(t)&&void 0!==t.step}function xc(t){return t.view||t.width||t.height}const _c=bt({align:1,bounds:1,center:1,columns:1,spacing:1});function wc(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function kc(t,e){const n=Ec(t,e);return bc(n)?n.step:Dc}function Ec(t,e){var n;return zt(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const Dc=20;const Ac={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Dc},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:$o,circle:{},geoshape:{},image:{},line:{},point:{},rect:Zo,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:uc,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Sc=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Cc={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Fc={blue:Sc[0],orange:Sc[1],red:Sc[2],teal:Sc[3],green:Sc[4],yellow:Sc[5],purple:Sc[6],pink:Sc[7],brown:Sc[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Mc(t){const e=bt(t||{}),n={};for(const i of e){const e=t[i];n[i]=ps(e)?mi(e):gi(e)}return n}const Oc=[...Xo,...xs,...ac,"background","padding","legend","lineBreak","scale","style","title","view"];function Tc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,font:n,fontSize:i,selection:r,...o}=t,a=(0,U.fE)({},tt(Ac),n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{signals:[{name:"color",value:(0,U.Kn)(t)?{...Fc,...t}:Fc}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(e):{},i?function(t){return{signals:[{name:"fontSize",value:(0,U.Kn)(t)?{...Cc,...t}:Cc}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},o||{});r&&(0,B.writeConfig)(a,"selection",r,!0);const s=it(a,Oc);for(const c of["background","lineBreak","padding"])a[c]&&(s[c]=gi(a[c]));for(const c of Xo)a[c]&&(s[c]=ai(a[c]));for(const c of xs)a[c]&&(s[c]=Mc(a[c]));for(const c of ac)a[c]&&(s[c]=ai(a[c]));return a.legend&&(s.legend=ai(a.legend)),a.scale&&(s.scale=ai(a.scale)),a.style&&(s.style=function(t){const e=bt(t),n={};for(const i of e)n[i]=Mc(t[i]);return n}(a.style)),a.title&&(s.title=ai(a.title)),a.view&&(s.view=ai(a.view)),s}const Nc=new Set(["view",...Uo]),zc=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Rc={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};function Pc(t){t=tt(t);for(const e of zc)delete t[e];if(t.axis)for(const e in t.axis)ps(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of ec)delete t.legend[e];if(t.mark){for(const e of Ho)delete t.mark[e];t.mark.tooltip&&(0,U.Kn)(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(pc(t.params)),delete t.params);for(const e of Nc){for(const i of Ho)delete t[e][i];const n=Rc[e];if(n)for(const i of n)delete t[e][i];Lc(t,e)}for(const e of bt(Qs))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:i}=si(t.title);yt(e)||(t.style["group-title"]={...t.style["group-title"],...e});yt(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n});yt(i)?delete t.title:t.title=i}(t);for(const e in t)(0,U.Kn)(t[e])&&yt(t[e])&&delete t[e];return yt(t)?void 0:t}function Lc(t,e,n,i){var r;"view"===e&&(n="cell");const o={...i?t[e][i]:t[e],...t.style[null!==(r=n)&&void 0!==r?r:e]};var a;yt(o)||(t.style[null!==(a=n)&&void 0!==a?a:e]=o);i||delete t[e]}function jc(t){return"layer"in t}class Bc{map(t,e){return ka(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):vc(t)?this.mapHConcat(t,e):gc(t)?this.mapVConcat(t,e):mc(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(jc(t))return this.mapLayer(t,e);if(_s(t))return this.mapUnit(t,e);throw new Error(Oi(t))}mapLayer(t,e){return{...t,layer:t.layer.map((t=>this.mapLayerOrUnit(t,e)))}}mapHConcat(t,e){return{...t,hconcat:t.hconcat.map((t=>this.map(t,e)))}}mapVConcat(t,e){return{...t,vconcat:t.vconcat.map((t=>this.map(t,e)))}}mapConcat(t,e){const{concat:n,...i}=t;return{...i,concat:n.map((t=>this.map(t,e)))}}mapFacet(t,e){return{...t,spec:this.map(t.spec,e)}}mapRepeat(t,e){return{...t,spec:this.map(t.spec,e)}}}const Ic={zero:1,center:1,normalize:1};const Uc=new Set([Do,So,Ao,To,Mo,Po,Lo,Fo,No,zo]),qc=new Set([So,Ao,Do]);function Wc(t){return Na(t)&&"quantitative"===za(t)&&!t.bin}function Hc(t,e,n){let{orient:i,type:r}=n;const o="x"===e?"y":"radius",a="x"===e,s=t[e],c=t[o];if(Na(s)&&Na(c))if(Wc(s)&&Wc(c)){if(s.stack)return e;if(c.stack)return o;const t=Na(s)&&!!s.aggregate;if(t!==(Na(c)&&!!c.aggregate))return t?e:o;if(a&&"bar"===r){if("vertical"===i)return o;if("horizontal"===i)return e}}else{if(Wc(s))return e;if(Wc(c))return o}else{if(Wc(s))return e;if(Wc(c))return o}}function Xc(t,e){var n,i;const r=qo(t)?t:{type:t},o=r.type;if(!Uc.has(o))return null;const a=Hc(e,"x",r)||Hc(e,"theta",r);if(!a)return null;const s=e[a],c=Na(s)?Ga(s,{}):void 0,l=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(a),u=[],f=new Set;if(e[l]){const t=e[l],n=Na(t)?Ga(t,{}):void 0;n&&n!==c&&(u.push(l),f.add(n));const i="x"===l?"xOffset":"yOffset",r=e[i],o=Na(r)?Ga(r,{}):void 0;o&&o!==c&&(u.push(i),f.add(o))}const d=vn.reduce(((t,n)=>{if("tooltip"!==n&&ks(e,n)){const i=e[n];for(const e of(0,U.IX)(i)){const i=ns(e);if(i.aggregate)continue;const r=Ga(i,{});r&&f.has(r)||t.push({channel:n,fieldDef:i})}}return t}),[]);let h;return void 0!==s.stack?h=(0,U.jn)(s.stack)?s.stack?"zero":null:s.stack:qc.has(o)&&(h="zero"),h&&h in Ic?As(e)&&0===d.length?null:null!==s&&void 0!==s&&null!==(n=s.scale)&&void 0!==n&&n.type&&(null===s||void 0===s||null===(i=s.scale)||void 0===i?void 0:i.type)!==Yr.LINEAR?(null!==s&&void 0!==s&&s.stack&&dr(function(t){return"Cannot stack non-linear scale (".concat(t,").")}(s.scale.type)),null):Ba(e[Ze(a)])?(void 0!==s.stack&&dr('Cannot stack "'.concat(p=a,'" if there is already "').concat(p,'2".')),null):(Na(s)&&s.aggregate&&!Vn.has(s.aggregate)&&dr((m=s.aggregate,'Stacking is applied even though the aggregate function is non-summative ("'.concat(m,'").'))),{groupbyChannels:u,groupbyFields:f,fieldChannel:a,impute:null!==s.impute&&Bo(o),stackBy:d,offset:h}):null;var p,m}function Jc(t){const{point:e,line:n,...i}=t;return bt(i).length>1?i:i.type}function Gc(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:it(t[e],["point","line"])});return t}function $c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"transparent"===t.point?{opacity:0}:t.point?(0,U.Kn)(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?(0,U.Kn)(e.point)?e.point:{}:void 0}function Zc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class Yc{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(_s(t)){const{mark:n,encoding:i}=t,r=qo(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!$c(r,e[r.type],i);case"area":return!!$c(r,e[r.type],i)||!!Zc(r,e[r.type])}}return!1}run(t,e,n){const{config:i}=e,{params:r,projection:o,mark:a,name:s,encoding:c,...l}=t,u=Fs(c,i),f=qo(a)?a:{type:a},d=$c(f,i[f.type],u),h="area"===f.type&&Zc(f,i[f.type]),p=[{name:s,...r?{params:r}:{},mark:Jc({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:it(u,["shape"])}],m=Xc(f,u);let g=u;if(m){const{fieldChannel:t,offset:e}=m;g={...u,[t]:{...u[t],...e?{stack:e}:{}}}}return g=it(g,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...nt(f,["clip","interpolate","tension","tooltip"]),...h},encoding:g}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...nt(f,["clip","tooltip"]),...d},encoding:g}),n({...l,layer:p},{...e,config:Gc(i)})}}function Vc(t,e){return e?_a(t)?il(t,e):tl(t,e):t}function Kc(t,e){return e?il(t,e):t}function Qc(t,e,n){const i=e[t];return(r=i)&&!(0,U.HD)(r)&&"repeat"in r?i.repeat in n?{...e,[t]:n[i.repeat]}:void dr(function(t){return'Unknown repeated value "'.concat(t,'".')}(i.repeat)):e;var r}function tl(t,e){if(void 0!==(t=Qc("field",t,e))){if(null===t)return null;if(Da(t)&&ba(t.sort)){const n=Qc("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function el(t,e){if(Na(t))return tl(t,e);{const n=Qc("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function nl(t,e){if(!Ba(t)){if(Ta(t)){const n=el(t.condition,e);if(n)return{...t,condition:n};{const{condition:e,...n}=t;return n}}return t}{const n=el(t,e);if(n)return n;if(Ma(t))return{condition:t.condition}}}function il(t,e){const n={};for(const i in t)if((0,U.nr)(t,i)){const r=t[i];if((0,U.kJ)(r))n[i]=r.map((t=>nl(t,e))).filter((t=>t));else{const t=nl(r,e);void 0!==t&&(n[i]=t)}}return n}class rl{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(_s(t)){const{encoding:e,mark:n}=t;if("line"===n||qo(n)&&"line"===n.type)for(const t of Xe){const n=e[Ge(t)];if(e[t]&&(Na(n)&&!ei(n.bin)||Ra(n)))return!0}}return!1}run(t,e,n){const{encoding:i,mark:r}=t;var o,a;return dr((o=!!i.x2,a=!!i.y2,"Line mark is for continuous lines and thus cannot be used with ".concat(o&&a?"x2 and y2":o?"x2":"y2",". We will use the rule mark (line segments) instead."))),n({...t,mark:(0,U.Kn)(r)?{...r,type:"rule"}:"rule"},e)}}function ol(t){let{parentEncoding:e,encoding:n={},layer:i}=t,r={};if(e){const t=new Set([...bt(e),...bt(n)]);for(const o of t){const t=n[o],a=e[o];if(Ba(t)){const e={...a,...t};r[o]=e}else Ta(t)?r[o]={...t,condition:{...a,...t.condition}}:t||null===t?r[o]=t:(i||Ua(a)||li(a)||Ba(a)||(0,U.kJ)(a))&&(r[o]=a)}}else r=n;return!r||yt(r)?void 0:r}function al(t){const{parentProjection:e,projection:n}=t;return e&&n&&dr(function(t){const{parentProjection:e,projection:n}=t;return"Layer's shared projection ".concat(rt(e)," is overridden by a child projection ").concat(rt(n),".")}({parentProjection:e,projection:n})),null!==n&&void 0!==n?n:e}function sl(t){return"filter"in t}function cl(t){return void 0!==(null===t||void 0===t?void 0:t.stop)}function ll(t){return"lookup"in t}function ul(t){return"pivot"in t}function fl(t){return"density"in t}function dl(t){return"quantile"in t}function hl(t){return"regression"in t}function pl(t){return"loess"in t}function ml(t){return"sample"in t}function gl(t){return"window"in t}function vl(t){return"joinaggregate"in t}function yl(t){return"flatten"in t}function bl(t){return"calculate"in t}function xl(t){return"bin"in t}function _l(t){return"impute"in t}function wl(t){return"timeUnit"in t}function kl(t){return"aggregate"in t}function El(t){return"stack"in t}function Dl(t){return"fold"in t}function Al(t,e){const{transform:n,...i}=t;if(n){const t=n.map((t=>{if(sl(t))return{filter:Fl(t,e)};if(xl(t)&&ni(t.bin))return{...t,bin:Cl(t.bin)};if(ll(t)){const{selection:e,...n}=t.from;return e?{...t,from:{param:e,...n}}:t}return t}));return{...i,transform:t}}return t}function Sl(t,e){var n,i;const r=tt(t);if(Na(r)&&ni(r.bin)&&(r.bin=Cl(r.bin)),qa(r)&&null!==(n=r.scale)&&void 0!==n&&null!==(i=n.domain)&&void 0!==i&&i.selection){const{selection:t,...e}=r.scale.domain;r.scale.domain={...e,...t?{param:t}:{}}}if(Ma(r))if((0,B.isArray)(r.condition))r.condition=r.condition.map((t=>{const{selection:n,param:i,test:r,...o}=t;return i?t:{...o,test:Fl(t,e)}}));else{const{selection:t,param:n,test:i,...o}=Sl(r.condition,e);r.condition=n?r.condition:{...o,test:Fl(r.condition,e)}}return r}function Cl(t){const e=t.extent;if(null!==e&&void 0!==e&&e.selection){const{selection:n,...i}=e;return{...t,extent:{...i,param:n}}}return t}function Fl(t,e){const n=t=>K(t,(t=>{var n,i,r;const o={param:t,empty:null===(n=e.emptySelections[t])||void 0===n||n};return null!==(i=(r=e.selectionPredicates)[t])&&void 0!==i||(r[t]=[]),e.selectionPredicates[t].push(o),o}));return t.selection?n(t.selection):K(t.test||t.filter,(t=>t.selection?n(t.selection):t))}class Ml extends Bc{map(t,e){var n;const i=null!==(n=e.selections)&&void 0!==n?n:[];if(t.params&&!_s(t)){const e=[];for(const n of t.params)hc(n)?i.push(n):e.push(n);t.params=e}return e.selections=i,super.map(t,e)}mapUnit(t,e){var n;const i=e.selections;if(!i||!i.length)return t;const r=(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name),o=[];for(const a of i)if(a.views&&a.views.length)for(const e of a.views)((0,B.isString)(e)&&(e===t.name||r.includes(e))||(0,B.isArray)(e)&&e.map((t=>r.indexOf(t))).every(((t,e,n)=>-1!==t&&(0===e||t>n[e-1]))))&&o.push(a);else o.push(a);return o.length&&(t.params=o),t}}for(const cy of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Ml.prototype[cy];Ml.prototype[cy]=function(e,n){return t.call(this,e,Ol(e,n))}}function Ol(t,e){var n;return t.name?{...e,path:(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name)}:e}function Tl(t,e){void 0===e&&(e=Tc(t.config));const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={config:e};return Rl.map(Nl.map(zl.map(t,n),n),n)}(t,e),{width:i,height:r}=t,o=function(t,e,n){let{width:i,height:r}=e;const o=_s(t)||jc(t),a={};o?"container"==i&&"container"==r?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==r&&(a.type="fit-y",a.contains="padding"):("container"==i&&(dr(Ni("width")),i=void 0),"container"==r&&(dr(Ni("height")),r=void 0));const s={type:"pad",...a,...n?Pl(n.autosize):{},...Pl(t.autosize)};"fit"!==s.type||o||(dr(Ti),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&dr(zi("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&dr(zi("height"));if(Q(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const Nl=new class extends Bc{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Is,Xs,Vs,new Yc,new rl]}map(t,e){if(_s(t)){const n=ks(t.encoding,qt),i=ks(t.encoding,Wt),r=ks(t.encoding,Ht);if(n||i||r)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:i}=e,r=Kc(t.encoding,e.repeater),o={...t,...t.name?{name:[e.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{},...r?{encoding:r}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(o,e);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(o,e.config))return s.run(o,e,a);return o}mapRepeat(t,e){return function(t){return!(0,U.kJ)(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:i,...r}=t,{row:o,column:a,layer:s}=n,{repeater:c={},repeaterPrefix:l=""}=e;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},e):{...r,layer:s.map((t=>{const n={...c,layer:t},r="".concat((i.name?"".concat(i.name,"_"):"")+l,"child__layer_").concat(kt(t)),o=this.mapLayerOrUnit(i,{...e,repeater:n,repeaterPrefix:r});return o.name=r,o}))}}mapNonLayerRepeat(t,e){var n;const{repeat:i,spec:r,data:o,...a}=t;!(0,U.kJ)(i)&&t.columns&&(t=it(t,["columns"]),dr(Ui("repeat")));const s=[],{repeater:c={},repeaterPrefix:l=""}=e,u=!(0,U.kJ)(i)&&i.row||[c?c.row:null],f=!(0,U.kJ)(i)&&i.column||[c?c.column:null],d=(0,U.kJ)(i)&&i||[c?c.repeat:null];for(const p of d)for(const t of u)for(const n of f){const o={repeat:p,row:t,column:n,layer:c.layer},a=(r.name?"".concat(r.name,"_"):"")+l+"child__"+((0,U.kJ)(i)?"".concat(kt(p)):(i.row?"row_".concat(kt(t)):"")+(i.column?"column_".concat(kt(n)):"")),u=this.map(r,{...e,repeater:o,repeaterPrefix:a});u.name=a,s.push(it(u,["data"]))}const h=(0,U.kJ)(i)?t.columns:i.column?i.column.length:1;return{data:null!==(n=r.data)&&void 0!==n?n:o,align:"all",...a,columns:h,concat:s}}mapFacet(t,e){const{facet:n}=t;return _a(n)&&t.columns&&(t=it(t,["columns"]),dr(Ui("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:i}=t,{parentEncoding:r,parentProjection:o,config:a}=e,s=al({parentProjection:o,projection:i}),c=ol({parentEncoding:r,encoding:Kc(n,e.repeater)});return this.mapUnit({...t,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(t,e){const{row:n,column:i,facet:r,...o}=t.encoding,{mark:a,width:s,projection:c,height:l,view:u,params:f,encoding:d,...h}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},e),g=Kc(o,e.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...l?{height:l}:{},...u?{view:u}:{},...c?{projection:c}:{},mark:a,encoding:g,...f?{params:f}:{}}},e)}getFacetMappingAndLayout(t,e){const{row:n,column:i,facet:r}=t;if(n||i){r&&dr((a=[...n?[qt]:[],...i?[Wt]:[]],"Facet encoding dropped as ".concat(a.join(" and ")," ").concat(a.length>1?"are":"is"," also specified.")));const e={},s={};for(const n of[qt,Wt]){const i=t[n];if(i){const{align:t,center:r,spacing:a,columns:c,...l}=i;e[n]=l;for(const e of["align","center","spacing"]){var o;if(void 0!==i[e])null!==(o=s[e])&&void 0!==o||(s[e]={}),s[e][n]=i[e]}}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:i,columns:o,...a}=r;return{facetMapping:Vc(a,e.repeater),layout:{...t?{align:t}:{},...n?{center:n}:{},...i?{spacing:i}:{},...o?{columns:o}:{}}}}var a}mapLayer(t,e){let{parentEncoding:n,parentProjection:i,...r}=e;const{encoding:o,projection:a,...s}=t,c={...r,parentEncoding:ol({parentEncoding:n,encoding:o,layer:!0}),parentProjection:al({parentProjection:i,projection:a})};return super.mapLayer({...s,...t.name?{name:[c.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{}},c)}},zl=new class extends Bc{map(t,e){var n,i;return null!==(n=e.emptySelections)&&void 0!==n||(e.emptySelections={}),null!==(i=e.selectionPredicates)&&void 0!==i||(e.selectionPredicates={}),t=Al(t,e),super.map(t,e)}mapLayerOrUnit(t,e){if((t=Al(t,e)).encoding){const n={};for(const[i,r]of _t(t.encoding))n[i]=Sl(r,e);t={...t,encoding:n}}return super.mapLayerOrUnit(t,e)}mapUnit(t,e){const{selection:n,...i}=t;return n?{...i,params:_t(n).map((t=>{let[n,i]=t;const{init:r,bind:o,empty:a,...s}=i;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),e.emptySelections[n]="none"!==a;for(const l of xt(null!==(c=e.selectionPredicates[n])&&void 0!==c?c:{})){var c;l.empty="none"!==a}return{name:n,value:r,select:s,bind:o}}))}:t}},Rl=new Ml;function Pl(t){return(0,U.HD)(t)?{type:t}:null!==t&&void 0!==t?t:{}}const Ll=["background","padding"];function jl(t,e){const n={};for(const i of Ll)t&&void 0!==t[i]&&(n[i]=gi(t[i]));return e&&(n.params=t.params),n}class Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.explicit=t,this.implicit=e}clone(){return new Bl(tt(this.explicit),tt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return zt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,e){let{value:n,explicit:i}=e;void 0!==n&&this.set(t,n,i)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,e){let{explicit:n,implicit:i}=e;void 0!==n[t]?this.set(t,n[t],!0):void 0!==i[t]&&this.set(t,i[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of bt(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function Il(t){return{explicit:!0,value:t}}function Ul(t){return{explicit:!1,value:t}}function ql(t){return(e,n,i,r)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:Wl(e,n,i,r)}}function Wl(t,e,n,i){return t.explicit&&e.explicit&&dr(function(t,e,n,i){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(rt(n)," and ").concat(rt(i),"). Using ").concat(rt(n),".")}(n,i,t.value,e.value)),t}function Hl(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Wl;return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:Q(t.value,e.value)?t:r(t,e,n,i)}class Xl extends Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Jl(t){return"url"in t}function Gl(t){return"values"in t}function $l(t){return"name"in t&&!Jl(t)&&!Gl(t)&&!Zl(t)}function Zl(t){return t&&(Yl(t)||Vl(t)||Kl(t))}function Yl(t){return"sequence"in t}function Vl(t){return"sphere"in t}function Kl(t){return"graticule"in t}var Ql;!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(Ql||(Ql={}));var tu=n(77155);function eu(t){const{signals:e,hasLegend:n,index:i,...r}=t;return r.field=Mt(r.field),r}function nu(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U.yR;if((0,U.kJ)(t)){const i=t.map((t=>nu(t,e,n)));return e?"[".concat(i.join(", "),"]"):i}return hr(t)?n(e?br(t):function(t){const e=yr(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(rt(t)):t}function iu(t,e){for(const i of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const r=i.name;let o="".concat(r).concat(wf,", ").concat("global"===i.resolve?"true":"{unit: ".concat(Af(t),"}"));for(const n of Df)n.defined(i)&&(n.signals&&(e=n.signals(t,i,e)),n.modifyExpr&&(o=n.modifyExpr(t,i,o)));e.push({name:r+kf,on:[{events:{signal:i.name+wf},update:"modify(".concat((0,U.m8)(i.name+_f),", ").concat(o,")")}]})}return au(e)}function ru(t,e){if(t.component.selection&&bt(t.component.selection).length){const n=(0,U.m8)(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:(0,tu.r)("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(n,").datum")}]})}return au(e)}function ou(t,e){for(const i of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;for(const n of Df)n.defined(i)&&n.marks&&(e=n.marks(t,i,e))}return e}function au(t){return t.map((t=>(t.on&&!t.on.length&&delete t.on,t)))}class su{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.includes(t)?dr("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const n=t.parent.removeChild(t);this._parent=e,e.addChild(this,n),t.parent=this}}class cu extends su{clone(){const t=new this.constructor;return t.debugName="clone_".concat(this.debugName),t._source=this._source,t._name="clone_".concat(this._name),t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,e,n,i){super(t,e),this.type=n,this.refCounts=i,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output ".concat(Pt())),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class lu extends su{clone(){return new lu(null,tt(this.formula))}constructor(t,e){super(t),this.formula=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,e)=>{const{field:n,timeUnit:i}=e;if(i){const r=Ga(e,{forAs:!0});t[ot({as:r,field:n,timeUnit:i})]={as:r,field:n,timeUnit:i}}return t}),{});return yt(n)?null:new lu(t,n)}static makeFromTransform(t,e){const{timeUnit:n,...i}={...e},r={...i,timeUnit:Cr(n)};return new lu(t,{[ot(r)]:r})}merge(t){this.formula={...this.formula};for(const e in t.formula)this.formula[e]||(this.formula[e]=t.formula[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,i]of _t(this.formula))t.has(i.as)||(e[n]=i);this.formula=e}producedFields(){return new Set(xt(this.formula).map((t=>t.as)))}dependentFields(){return new Set(xt(this.formula).map((t=>t.field)))}hash(){return"TimeUnit ".concat(ot(this.formula))}assemble(){const t=[];for(const e of xt(this.formula)){const{field:n,as:i,timeUnit:r}=e,{unit:o,utc:a,...s}=Cr(r);t.push({field:Mt(n),type:"timeunit",...o?{units:Er(o)}:{},...a?{timezone:"utc"}:{},...s,as:[i,"".concat(i,"_end")]})}return t}}const uu="_tuple_fields";class fu{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const du={defined:()=>!0,parse:(t,e,n)=>{var i;const r=e.name,o=null!==(i=e.project)&&void 0!==i?i:e.project=new fu,a={},s={},c=new Set,l=(t,e)=>{const n="visual"===e?t.channel:t.field;let i=kt("".concat(r,"_").concat(n));for(let o=1;c.has(i);o++)i=kt("".concat(r,"_").concat(n,"_").concat(o));return c.add(i),{[e]:i}},u=e.type,f=t.config.selection[u],d=void 0!==n.value?(0,U.IX)(n.value):null;let{fields:h,encodings:p}=(0,U.Kn)(n.select)?n.select:{};if(!h&&!p&&d)for(const y of d)if((0,U.Kn)(y))for(const t of bt(y)){var m;if(We[t])(p||(p=[])).push(t);else if("interval"===u)dr('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),p=f.encodings;else(null!==(m=h)&&void 0!==m?m:h=[]).push(t)}h||p||(p=f.encodings,"fields"in f&&(h=f.fields));for(const y of null!==(g=p)&&void 0!==g?g:[]){var g;const e=t.fieldDef(y);if(e){let n=e.field;if(e.aggregate){dr(ji(y,e.aggregate));continue}if(!n){dr(Li(y));continue}if(e.timeUnit){n=t.vgField(y);const i={timeUnit:e.timeUnit,as:n,field:e.field};s[ot(i)]=i}if(!a[n]){const i={field:n,channel:y,type:"interval"===u&&jn(y)&&co(t.getScaleComponent(y).get("type"))?"R":e.bin?"R-RE":"E",index:o.items.length};i.signals={...l(i,"data"),...l(i,"visual")},o.items.push(a[n]=i),o.hasField[n]=a[n],o.hasSelectionId=o.hasSelectionId||n===lc,Ce(y)?(i.geoChannel=y,i.channel=Se(y),o.hasChannel[i.channel]=a[n]):o.hasChannel[y]=a[n]}}else dr(Li(y))}for(const y of null!==(v=h)&&void 0!==v?v:[]){var v;if(o.hasField[y])continue;const t={type:"E",field:y,index:o.items.length};t.signals={...l(t,"data")},o.items.push(t),o.hasField[y]=t,o.hasSelectionId=o.hasSelectionId||y===lc}d&&(e.init=d.map((t=>o.items.map((e=>(0,U.Kn)(t)?void 0!==t[e.geoChannel||e.channel]?t[e.geoChannel||e.channel]:t[e.field]:t))))),yt(s)||(o.timeUnit=new lu(null,s))},signals:(t,e,n)=>{const i=e.name+uu;return n.filter((t=>t.name===i)).length>0||e.project.hasSelectionId?n:n.concat({name:i,value:e.project.items.map(eu)})}},hu=du,pu={defined:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const i of e.project.items){const r=i.channel;if(!jn(r))continue;const o=t.getScaleComponent(r),a=o?o.get("type"):void 0;o&&co(a)?(o.set("selectionExtent",{param:e.name,field:i.field},!0),n.push(i)):dr("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(t,e,n)=>{const i=e.scales.filter((t=>0===n.filter((e=>e.name===t.signals.data)).length));if(!t.parent||vu(t)||0===i.length)return n;const r=n.filter((t=>t.name===e.name))[0];let o=r.update;if(o.indexOf(Ef)>=0)r.update="{".concat(i.map((t=>"".concat((0,U.m8)(Mt(t.field)),": ").concat(t.signals.data))).join(", "),"}");else{for(const t of i){const e="".concat((0,U.m8)(Mt(t.field)),": ").concat(t.signals.data);o.includes(e)||(o="".concat(o.substring(0,o.length-1),", ").concat(e,"}"))}r.update=o}return n.concat(i.map((t=>({name:t.signals.data}))))},signals:(t,e,n)=>{if(t.parent&&!vu(t))for(const i of e.scales){const t=n.filter((t=>t.name===i.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},mu=pu;function gu(t,e){const n=(0,U.m8)(t.scaleName(e));return"domain(".concat(n,")")}function vu(t){var e;return t.parent&&pp(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:vu(t.parent.parent))}const yu="_brush",bu="_scale_trigger",xu="geo_interval_init_tick",_u="_init",wu={defined:t=>"interval"===t.type,parse:(t,e,n)=>{var i;if(t.hasProjection){const t={...(0,B.isObject)(n.select)?n.select:{}};t.fields=[lc],t.encodings||(t.encodings=n.value?bt(n.value):[ne,ee]),n.select={type:"interval",...t}}if(e.translate&&!mu.defined(e)){const t="!event.item || event.item.mark.name !== ".concat((0,U.m8)(e.name+yu));for(const n of e.events){var r;if(!n.between){dr("".concat(n," is not an ordered event stream for interval selections."));continue}const e=(0,U.IX)(null!==(r=(i=n.between[0]).filter)&&void 0!==r?r:i.filter=[]);e.indexOf(t)<0&&e.push(t)}}},signals:(t,e,n)=>{const i=e.name,r=i+wf,o=xt(e.project.hasChannel).filter((t=>t.channel===Xt||t.channel===Jt)),a=e.init?e.init[0]:null;if(n.push(...o.reduce(((n,i)=>n.concat(function(t,e,n,i){const r=!t.hasProjection,o=n.channel,a=n.signals.visual,s=(0,U.m8)(r?t.scaleName(o):t.projectionName()),c=t=>"scale(".concat(s,", ").concat(t,")"),l=t.getSizeSignalRef(o===Xt?"width":"height").signal,u="".concat(o,"(unit)"),f=e.events.reduce(((t,e)=>[...t,{events:e.between[0],update:"[".concat(u,", ").concat(u,"]")},{events:e,update:"[".concat(a,"[0], clamp(").concat(u,", 0, ").concat(l,")]")}]),[]);if(r){const r=n.signals.data,l=mu.defined(e),u=t.getScaleComponent(o),d=u?u.get("type"):void 0,h=i?{init:nu(i,!0,c)}:{value:[]};return f.push({events:{signal:e.name+bu},update:co(d)?"[".concat(c("".concat(r,"[0]")),", ").concat(c("".concat(r,"[1]")),"]"):"[0, 0]"}),l?[{name:r,on:[]}]:[{name:a,...h,on:f},{name:r,...i?{init:nu(i)}:{},on:[{events:{signal:a},update:"".concat(a,"[0] === ").concat(a,"[1] ? null : invert(").concat(s,", ").concat(a,")")}]}]}{const t=o===Xt?0:1,n=e.name+_u,r=i?{init:"[".concat(n,"[0][").concat(t,"], ").concat(n,"[1][").concat(t,"]]")}:{value:[]};return[{name:a,...r,on:f}]}}(t,e,i,a&&a[i.index]))),[])),t.hasProjection){const s=(0,U.m8)(t.projectionName()),c=t.projectionName()+"_center",{x:l,y:u}=e.project.hasChannel,f=l&&l.signals.visual,d=u&&u.signals.visual,h=l?a&&a[l.index]:"".concat(c,"[0]"),p=u?a&&a[u.index]:"".concat(c,"[1]"),m=e=>t.getSizeSignalRef(e).signal,g="["+"[".concat(f?f+"[0]":"0",", ").concat(d?d+"[0]":"0","],")+"[".concat(f?f+"[1]":m("width"),", ")+"".concat(d?d+"[1]":m("height"),"]")+"]";if(a&&(n.unshift({name:i+_u,init:"[scale(".concat(s,", [").concat(l?h[0]:h,", ").concat(u?p[0]:p,"]), ")+"scale(".concat(s,", [").concat(l?h[1]:h,", ").concat(u?p[1]:p,"])]")}),!l||!u)){n.find((t=>t.name===c))||n.unshift({name:c,update:"invert(".concat(s,", [").concat(m("width"),"/2, ").concat(m("height"),"/2])")})}const v="intersect(".concat(g,", {markname: ").concat((0,U.m8)(t.getName("marks")),"}, unit.mark)"),y="{unit: ".concat(Af(t),"}"),b="vlSelectionTuples(".concat(v,", ").concat(y,")"),x=o.map((t=>t.signals.visual));return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...a?[{signal:xu}]:[]],update:b}]})}{if(!mu.defined(e)){const e=i+bu,r=o.map((e=>{const n=e.channel,{data:i,visual:r}=e.signals,o=(0,U.m8)(t.scaleName(n)),a=co(t.getScaleComponent(n).get("type"))?"+":"";return"(!isArray(".concat(i,") || ")+"(".concat(a,"invert(").concat(o,", ").concat(r,")[0] === ").concat(a).concat(i,"[0] && ")+"".concat(a,"invert(").concat(o,", ").concat(r,")[1] === ").concat(a).concat(i,"[1]))")}));r.length&&n.push({name:e,value:{},on:[{events:o.map((e=>({scale:t.scaleName(e.channel)}))),update:r.join(" && ")+" ? ".concat(e," : {}")}]})}const s=o.map((t=>t.signals.data)),c="unit: ".concat(Af(t),", fields: ").concat(i+uu,", values");return n.concat({name:r,...a?{init:"{".concat(c,": ").concat(nu(a),"}")}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:"".concat(s.join(" && ")," ? {").concat(c,": [").concat(s,"]} : null")}]}:{}})}},topLevelSignals:(t,e,n)=>{if(fp(t)&&t.hasProjection&&e.init){n.filter((t=>t.name===xu)).length||n.unshift({name:xu,value:null,on:[{events:"timer{1}",update:"".concat(xu," === null ? {} : ").concat(xu)}]})}return n},marks:(t,e,n)=>{const i=e.name,{x:r,y:o}=e.project.hasChannel,a=null===r||void 0===r?void 0:r.signals.visual,s=null===o||void 0===o?void 0:o.signals.visual,c="data(".concat((0,U.m8)(e.name+_f),")");if(mu.defined(e)||!r&&!o)return n;const l={x:void 0!==r?{signal:"".concat(a,"[0]")}:{value:0},y:void 0!==o?{signal:"".concat(s,"[0]")}:{value:0},x2:void 0!==r?{signal:"".concat(a,"[1]")}:{field:{group:"width"}},y2:void 0!==o?{signal:"".concat(s,"[1]")}:{field:{group:"height"}}};if("global"===e.resolve)for(const m of bt(l))l[m]=[{test:"".concat(c,".length && ").concat(c,"[0].unit === ").concat(Af(t)),...l[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=bt(h).reduce(((t,e)=>(t[e]=[{test:[void 0!==r&&"".concat(a,"[0] !== ").concat(a,"[1]"),void 0!==o&&"".concat(s,"[0] !== ").concat(s,"[1]")].filter((t=>t)).join(" && "),value:h[e]},{value:null}],t)),{});return[{name:"".concat(i+yu,"_bg"),type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:l}},...n,{name:i+yu,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}},ku=wu;const Eu={defined:t=>"point"===t.type,signals:(t,e,n)=>{var i;const r=e.name,o=r+uu,a=e.project,s="(item().isVoronoi ? datum.datum : datum)",c=xt(null!==(i=t.component.selection)&&void 0!==i?i:{}).reduce(((t,e)=>"interval"===e.type?t.concat(e.name+yu):t),[]).map((t=>"indexof(item().mark.name, '".concat(t,"') < 0"))).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0".concat(c?" && ".concat(c):"");let u="unit: ".concat(Af(t),", ");if(e.project.hasSelectionId)u+="".concat(lc,": ").concat(s,"[").concat((0,U.m8)(lc),"]");else{const e=a.items.map((e=>{const n=t.fieldDef(e.channel);return null!==n&&void 0!==n&&n.bin?"[".concat(s,"[").concat((0,U.m8)(t.vgField(e.channel,{})),"], ")+"".concat(s,"[").concat((0,U.m8)(t.vgField(e.channel,{binSuffix:"end"})),"]]"):"".concat(s,"[").concat((0,U.m8)(e.field),"]")})).join(", ");u+="fields: ".concat(o,", values: [").concat(e,"]")}const f=e.events;return n.concat([{name:r+wf,on:f?[{events:f,update:"".concat(l," ? {").concat(u,"} : null"),force:!0}]:[]}])}},Du=Eu;function Au(t,e,n,i){const r=Ma(e)&&e.condition,o=i(e);if(r){return{[n]:[...(0,U.IX)(r).map((e=>{const n=i(e);if(function(t){return t.param}(e)){const{param:i,empty:r}=e;return{test:zf(t,{param:i,empty:r}),...n}}return{test:Pf(t,e.test),...n}})),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Su(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=t.encoding[e];return Au(t,n,e,(e=>Cu(e,t.config)))}function Cu(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(t){if(Ua(t))return yi(t.value);if(Ba(t)){const{format:i,formatType:r}=es(t);return aa({fieldOrDatumDef:t,format:i,formatType:r,expr:n,config:e})}}}function Fu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{encoding:n,markDef:i,config:r,stack:o}=t,a=n.tooltip;if((0,U.kJ)(a))return{tooltip:Ou({tooltip:a},o,r,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return Au(t,a,"tooltip",(t=>{const a=Cu(t,r,s);if(a)return a;if(null===t)return;let c=ki("tooltip",i,r);return!0===c&&(c={content:"encoding"}),(0,U.HD)(c)?{value:c}:(0,U.Kn)(c)?li(c)?c:"encoding"===c.content?Ou(n,o,r,e):{signal:s}:void 0}))}}function Mu(t,e,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r={...n,...n.tooltipFormat},o={},a=i?"datum.datum":"datum",s=[];function c(n,i){var c;const l=Ge(i),u=Ia(n)?n:{...n,type:t[l].type},f=u.title||ts(u,r),d=(0,U.IX)(f).join(", ");let h;if(xn(i)){const e="x"===i?"x2":"y2",n=ns(t[e]);if(ei(u.bin)&&n){const t=Ga(u,{expr:a}),i=Ga(n,{expr:a}),{format:s,formatType:c}=es(u);h=pa(t,i,s,c,r),o[e]=!0}}if((xn(i)||i===Qt||i===Vt)&&e&&e.fieldChannel===i&&"normalize"===e.offset){const{format:t,formatType:e}=es(u);h=aa({fieldOrDatumDef:u,format:t,formatType:e,expr:a,config:r,normalizeStack:!0}).signal}null!==(c=h)&&void 0!==c||(h=Cu(u,r,a).signal),s.push({channel:i,key:d,value:h})}Ms(t,((t,e)=>{Na(t)?c(t,e):Oa(t)&&c(t.condition,e)}));const l={};for(const{channel:u,key:f,value:d}of s)o[u]||l[f]||(l[f]=d);return l}function Ou(t,e,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Mu(t,e,n,{reactiveGeom:i}),o=_t(r).map((t=>{let[e,n]=t;return'"'.concat(e,'": ').concat(n)}));return o.length>0?{signal:"{".concat(o.join(", "),"}")}:void 0}function Tu(t){const{markDef:e,config:n}=t,i=ki("aria",e,n);return!1===i?{}:{...i?{aria:i}:{},...Nu(t),...zu(t)}}function Nu(t){const{mark:e,markDef:n,config:i}=t;if(!1===i.aria)return{};const r=ki("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:e in hi?{}:{ariaRoleDescription:{value:e}}}function zu(t){const{encoding:e,markDef:n,config:i,stack:r}=t,o=e.description;if(o)return Au(t,o,"description",(e=>Cu(e,t.config)));const a=ki("description",n,i);if(null!=a)return{description:yi(a)};if(!1===i.aria)return{};const s=Mu(e,r,i);return yt(s)?void 0:{description:{signal:_t(s).map(((t,e)=>{let[n,i]=t;return'"'.concat(e>0?"; ":"").concat(n,': " + (').concat(i,")")})).join(" + ")}}}function Ru(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markDef:i,encoding:r,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:c}=n;var l;void 0===s&&(null!==(l=c)&&void 0!==l||(c=ki(t,i,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==c&&(s=yi(c)));const u=r[t];return Au(e,u,null!==a&&void 0!==a?a:t,(n=>ea({channel:t,channelDef:n,markDef:i,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s})))}function Pu(t){var e,n,i,r;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0};const{markDef:a,encoding:s,config:c}=t,{type:l}=a,u=null!==(e=o.filled)&&void 0!==e?e:ki("filled",a,c),f=st(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(n=null!==(i=ki(!0===u?"color":void 0,a,c,{vgChannel:"fill"}))&&void 0!==i?i:c.mark[!0===u&&"color"])&&void 0!==n?n:f,h=null!==(r=ki(!1===u?"color":void 0,a,c,{vgChannel:"stroke"}))&&void 0!==r?r:c.mark[!1===u&&"color"],p=u?"fill":"stroke",m={...d?{fill:yi(d)}:{},...h?{stroke:yi(h)}:{}};return a.color&&(u?a.fill:a.stroke)&&dr(Gi("property",{fill:"fill"in a,stroke:"stroke"in a})),{...m,...Ru("color",t,{vgChannel:p,defaultValue:u?d:h}),...Ru("fill",t,{defaultValue:s.fill?d:void 0}),...Ru("stroke",t,{defaultValue:s.stroke?h:void 0})}}function Lu(t){const{encoding:e,mark:n}=t,i=e.order;return!Bo(n)&&Ua(i)?Au(t,i,"zindex",(t=>yi(t.value))):{}}function ju(t){let{channel:e,markDef:n,encoding:i={},model:r,bandPosition:o}=t;const a="".concat(e,"Offset"),s=n[a],c=i[a];if(("xOffset"===a||"yOffset"===a)&&c){return{offsetType:"encoding",offset:ea({channel:a,channelDef:c,markDef:n,config:null===r||void 0===r?void 0:r.config,scaleName:r.scaleName(a),scale:r.getScaleComponent(a),stack:null,defaultRef:yi(s),bandPosition:o})}}const l=n[a];return l?{offsetType:"visual",offset:l}:{}}function Bu(t,e,n){let{defaultPos:i,vgChannel:r}=n;const{encoding:o,markDef:a,config:s,stack:c}=e,l=o[t],u=o[Ze(t)],f=e.scaleName(t),d=e.getScaleComponent(t),{offset:h,offsetType:p}=ju({channel:t,markDef:a,encoding:o,model:e,bandPosition:.5}),m=Iu({model:e,defaultPos:i,channel:t,scaleName:f,scale:d}),g=!l&&xn(t)&&(o.latitude||o.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,scaleName:i,stack:r,offset:o,markDef:a}=t;if(Ba(n)&&r&&e===r.fieldChannel){if(Na(n)){let t=n.bandPosition;if(void 0!==t||"text"!==a.type||"radius"!==e&&"theta"!==e||(t=.5),void 0!==t)return ta({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:t,offset:o})}return Qo(n,i,{suffix:"end"},{offset:o})}return Yo(t)}({channel:t,channelDef:l,channel2Def:u,markDef:a,config:s,scaleName:f,scale:d,stack:c,offset:h,defaultRef:m,bandPosition:"encoding"===p?0:void 0});return g?{[r||t]:g}:void 0}function Iu(t){let{model:e,defaultPos:n,channel:i,scaleName:r,scale:o}=t;const{markDef:a,config:s}=e;return()=>{const t=Ge(i),c=$e(i),l=ki(i,a,s,{vgChannel:c});if(void 0!==l)return na(i,l);switch(n){case"zeroOrMin":case"zeroOrMax":if(r){const t=o.get("type");if(st([Yr.LOG,Yr.TIME,Yr.UTC],t));else if(o.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===n)return"y"===t?{field:{group:"height"}}:{value:0};switch(t){case"radius":return{signal:"min(".concat(e.width.signal,",").concat(e.height.signal,")/2")};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Ye(i)],mult:.5}}}}const Uu={left:"x",center:"xc",right:"x2"},qu={top:"y",middle:"yc",bottom:"y2"};function Wu(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===t||"theta"===t)return $e(t);const r="x"===t?"align":"baseline",o=ki(r,e,n);let a;return li(o)?(dr(function(t){return"The ".concat(t," for range marks cannot be an expression")}(r)),a=void 0):a=o,"x"===t?Uu[a||("top"===i?"left":"center")]:qu[a||i]}function Hu(t,e,n){let{defaultPos:i,defaultPos2:r,range:o}=n;return o?Xu(t,e,{defaultPos:i,defaultPos2:r}):Bu(t,e,{defaultPos:i})}function Xu(t,e,n){let{defaultPos:i,defaultPos2:r}=n;const{markDef:o,config:a}=e,s=Ze(t),c=Ye(t),l=function(t,e,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=t,c=Ge(n),l=Ye(n),u=$e(n),f=i[c],d=t.scaleName(c),h=t.getScaleComponent(c),{offset:p}=ju(n in i||n in o?{channel:n,markDef:o,encoding:i,model:t}:{channel:c,markDef:o,encoding:i,model:t});if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const e=Ye(n),i=t.markDef[e];return null!=i?{[e]:{value:i}}:{[u]:{field:t.getName(n)}}}const m=function(t){let{channel:e,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:c,offset:l,defaultRef:u}=t;if(Ba(n)&&c&&e.charAt(0)===c.fieldChannel.charAt(0))return Qo(n,a,{suffix:"start"},{offset:l});return Yo({channel:e,channelDef:i,scaleName:a,scale:s,stack:c,markDef:r,config:o,offset:l,defaultRef:u})}({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==m)return{[u]:m};return Ju(n,o)||Ju(n,{[n]:Di(n,o,s.style),[l]:Di(l,o,s.style)})||Ju(n,s[r])||Ju(n,s.mark)||{[u]:Iu({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}(e,r,s);return{...Bu(t,e,{defaultPos:i,vgChannel:l[c]?Wu(t,o,a):$e(t)}),...l}}function Ju(t,e){const n=Ye(t),i=$e(t);if(void 0!==e[i])return{[i]:na(t,e[i])};if(void 0!==e[t])return{[i]:na(t,e[t])};if(e[n]){const i=e[n];if(!Jo(i))return{[n]:na(t,i)};dr(function(t){return"Position range does not support relative band size for ".concat(t,".")}(n))}}function Gu(t,e){var n,i;const{config:r,encoding:o,markDef:a}=t,s=a.type,c=Ze(e),l=Ye(e),u=o[e],f=o[c],d=t.getScaleComponent(e),h=d?d.get("type"):void 0,p=a.orient,m=null!==(n=null!==(i=o[l])&&void 0!==i?i:o.size)&&void 0!==n?n:ki("size",a,r,{vgChannel:l}),g=Ve(e),v="bar"===s&&("x"===e?"vertical"===p:"horizontal"===p);return!Na(u)||!(ti(u.bin)||ei(u.bin)||u.timeUnit&&!f)||m&&!Jo(m)||o[g]||so(h)?(Ba(u)&&so(h)||v)&&!f?function(t,e,n){const{markDef:i,encoding:r,config:o,stack:a}=n,s=i.orient,c=n.scaleName(e),l=n.getScaleComponent(e),u=Ye(e),f=Ze(e),d=Ve(e),h=n.scaleName(d),p=n.getScaleComponent(Ke(e)),m="horizontal"===s&&"y"===e||"vertical"===s&&"x"===e;let g;(r.size||i.size)&&(m?g=Ru("size",n,{vgChannel:u,defaultRef:yi(i.size)}):dr(function(t){return'Cannot apply size to non-oriented mark "'.concat(t,'".')}(i.type)));const v=!!g,y=Sa({channel:e,fieldDef:t,markDef:i,config:o,scaleType:null===l||void 0===l?void 0:l.get("type"),useVlSizeChannel:m});g=g||{[u]:$u(u,h||c,p||l,o,y,!!t,i.type)};const b="band"===(null===l||void 0===l?void 0:l.get("type"))&&Jo(y)&&!v?"top":"middle",x=Wu(e,i,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:k}=ju({channel:e,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),E=Yo({channel:e,channelDef:t,markDef:i,config:o,scaleName:c,scale:l,stack:a,offset:w,defaultRef:Iu({model:n,defaultPos:"mid",channel:e,scaleName:c,scale:l}),bandPosition:_?"encoding"===k?0:.5:li(y)?{signal:"(1-".concat(y,")/2")}:Jo(y)?(1-y.band)/2:0});if(u)return{[x]:E,...g};{const t=$e(f),e=g[u],n=w?{...e,offset:w}:e;return{[x]:E,[t]:(0,U.kJ)(E)?[E[0],{...E[1],offset:n}]:{...E,offset:n}}}}(u,e,t):Xu(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function(t){var e,n,i;let{fieldDef:r,fieldDef2:o,channel:a,model:s}=t;const{config:c,markDef:l,encoding:u}=s,f=s.getScaleComponent(a),d=s.scaleName(a),h=f?f.get("type"):void 0,p=f.get("reverse"),m=Sa({channel:a,fieldDef:r,markDef:l,config:c,scaleType:h}),g=null===(e=s.component.axes[a])||void 0===e?void 0:e[0],v=null!==(n=null===g||void 0===g?void 0:g.get("translate"))&&void 0!==n?n:.5,y=xn(a)&&null!==(i=ki("binSpacing",l,c))&&void 0!==i?i:0,b=Ze(a),x=$e(a),_=$e(b),{offset:w}=ju({channel:a,markDef:l,encoding:u,model:s,bandPosition:0}),k=li(m)?{signal:"(1-".concat(m.signal,")/2")}:Jo(m)?(1-m.band)/2:.5;if(ti(r.bin)||r.timeUnit)return{[_]:Yu({fieldDef:r,scaleName:d,bandPosition:k,offset:Zu(b,y,p,v,w)}),[x]:Yu({fieldDef:r,scaleName:d,bandPosition:li(k)?{signal:"1-".concat(k.signal)}:1-k,offset:Zu(a,y,p,v,w)})};if(ei(r.bin)){const t=Qo(r,d,{},{offset:Zu(b,y,p,v,w)});if(Na(o))return{[_]:t,[x]:Qo(o,d,{},{offset:Zu(a,y,p,v,w)})};if(ni(r.bin)&&r.bin.step)return{[_]:t,[x]:{signal:'scale("'.concat(d,'", ').concat(Ga(r,{expr:"datum"})," + ").concat(r.bin.step,")"),offset:Zu(a,y,p,v,w)}}}return void dr(cr(b))}({fieldDef:u,fieldDef2:f,channel:e,model:t})}function $u(t,e,n,i,r,o,a){if(Jo(r)){if(!n)return{mult:r.band,field:{group:t}};{const t=n.get("type");if("band"===t){let t="bandwidth('".concat(e,"')");return 1!==r.band&&(t="".concat(r.band," * ").concat(t)),{signal:"max(0.25, ".concat(t,")")}}1!==r.band&&(dr(function(t){return"Cannot use the relative band size with ".concat(t," scale.")}(t)),r=void 0)}}else{if(li(r))return r;if(r)return{value:r}}if(n){const t=n.get("range");if(ui(t)&&(0,U.hj)(t.step))return{value:t.step-2}}if(!o){const{bandPaddingInner:e,barBandPaddingInner:n,rectBandPaddingInner:r}=i.scale,o=zt(e,"bar"===a?n:r);if(li(o))return{signal:"(1 - (".concat(o.signal,")) * ").concat(t)};if((0,U.hj)(o))return{signal:"".concat(1-o," * ").concat(t)};if(oi(o))return{signal:"(1 - (".concat(o.expr,")) * ").concat(t)}}return{value:kc(i.view,t)-2}}function Zu(t,e,n,i,r){if(De(t))return 0;const o="x"===t||"y2"===t?-e/2:e/2;if(li(n)||li(r)||li(i)){const t=xi(n),e=xi(r),a=xi(i);return{signal:(a?"".concat(a," + "):"")+(t?"(".concat(t," ? -1 : 1) * "):"")+(e?"(".concat(e," + ").concat(o,")"):o)}}return r=r||0,i+(n?-r-o:+r+o)}function Yu(t){let{fieldDef:e,scaleName:n,bandPosition:i,offset:r}=t;return ta({scaleName:n,fieldOrDatumDef:e,bandPosition:i,offset:r})}const Vu=new Set(["aria","width","height"]);function Ku(t,e){const{fill:n,stroke:i}="include"===e.color?Pu(t):{};return{...tf(t.markDef,e),...Qu(t,"fill",n),...Qu(t,"stroke",i),...Ru("opacity",t),...Ru("fillOpacity",t),...Ru("strokeOpacity",t),...Ru("strokeWidth",t),...Ru("strokeDash",t),...Lu(t),...Fu(t),...Su(t,"href"),...Tu(t)}}function Qu(t,e,n){const{config:i,mark:r,markDef:o}=t;if("hide"===ki("invalid",o,i)&&n&&!Bo(r)){const i=function(t,e){let{invalid:n=!1,channels:i}=e;const r=i.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){const r=i.get("type"),o=t.vgField(n,{expr:"datum"});o&&co(r)&&(e[o]=!0)}return e}),{}),o=bt(r);if(o.length>0){const t=n?"||":"&&";return o.map((t=>Ko(t,n))).join(" ".concat(t," "))}return}(t,{invalid:!0,channels:Ln});if(i)return{[e]:[{test:i,value:null},...(0,U.IX)(n)]}}return n?{[e]:n}:{}}function tf(t,e){return di.reduce(((n,i)=>(Vu.has(i)||void 0===t[i]||"ignore"===e[i]||(n[i]=yi(t[i])),n)),{})}function ef(t){const{config:e,markDef:n}=t;if(ki("invalid",n,e)){const e=function(t,e){let{invalid:n=!1,channels:i}=e;const r=i.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){var r;const o=i.get("type"),a=t.vgField(n,{expr:"datum",binSuffix:null!==(r=t.stack)&&void 0!==r&&r.impute?"mid":void 0});a&&co(o)&&(e[a]=!0)}return e}),{}),o=bt(r);if(o.length>0){const t=n?"||":"&&";return o.map((t=>Ko(t,n))).join(" ".concat(t," "))}return}(t,{channels:bn});if(e)return{defined:{signal:e}}}return{}}function nf(t,e){if(void 0!==e)return{[t]:yi(e)}}const rf="voronoi",of={defined:t=>"point"===t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(rf)},marks:(t,e,n)=>{const{x:i,y:r}=e.project.hasChannel,o=t.mark;if(Bo(o))return dr('The "nearest" transform is not supported for '.concat(o," marks.")),n;const a={name:t.getName(rf),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Fu(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,c=!1;return n.forEach(((e,n)=>{var i;const r=null!==(i=e.name)&&void 0!==i?i:"";r===t.component.mark[0].name?s=n:r.indexOf(rf)>=0&&(c=!0)})),c||n.splice(s+1,0,a),n}},af=of,sf={defined:t=>"point"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!fc(t.bind),parse:(t,e,n)=>Cf(e,n),topLevelSignals:(t,e,n)=>{const i=e.name,r=e.project,o=e.bind,a=e.init&&e.init[0],s=af.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((t,r)=>{const c=kt("".concat(i,"_").concat(t.field));var l,u;n.filter((t=>t.name===c)).length||n.unshift({name:c,...a?{init:nu(a[r])}:{value:null},on:e.events?[{events:e.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(s,"[").concat((0,U.m8)(t.field),"] : null")}]:[],bind:null!==(l=null!==(u=o[t.field])&&void 0!==u?u:o[t.channel])&&void 0!==l?l:o})})),n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.filter((t=>t.name===i+wf))[0],a=i+uu,s=r.items.map((t=>kt("".concat(i,"_").concat(t.field)))),c=s.map((t=>"".concat(t," !== null"))).join(" && ");return s.length&&(o.update="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null")),delete o.value,delete o.on,n}},cf=sf,lf="_toggle",uf={defined:t=>"point"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+lf,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+wf,i=e.name+lf;return"".concat(i," ? null : ").concat(n,", ")+("global"===e.resolve?"".concat(i," ? null : true, "):"".concat(i," ? null : {unit: ").concat(Af(t),"}, "))+"".concat(i," ? ").concat(n," : null")}},ff={defined:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e)=>{e.clear&&(e.clear=(0,U.HD)(e.clear)?(0,tu.r)(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(cf.defined(e))for(const i of e.project.items){const t=n.findIndex((t=>t.name===kt("".concat(e.name,"_").concat(i.field))));-1!==t&&n[t].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function i(t,i){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:i})}if("interval"===e.type)for(const r of e.project.items){const t=n.findIndex((t=>t.name===r.signals.visual));if(i(t,"[0, 0]"),-1===t){i(n.findIndex((t=>t.name===r.signals.data)),"null")}}else{let t=n.findIndex((t=>t.name===e.name+wf));i(t,"null"),uf.defined(e)&&(t=n.findIndex((t=>t.name===e.name+lf)),i(t,"false"))}return n}},df={defined:t=>{const e="global"===t.resolve&&t.bind&&fc(t.bind),n=1===t.project.items.length&&t.project.items[0].field!==lc;return e&&!n&&dr("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n)=>{const i=tt(n);if(i.select=(0,U.HD)(i.select)?{type:i.select,toggle:e.toggle}:{...i.select,toggle:e.toggle},Cf(e,i),(0,B.isObject)(n.select)&&(n.select.on||n.select.clear)){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events){var r;n.filter=(0,U.IX)(null!==(r=n.filter)&&void 0!==r?r:[]),n.filter.includes(t)||n.filter.push(t)}}const o=dc(e.bind)?e.bind.legend:"click",a=(0,U.HD)(o)?(0,tu.r)(o,"view"):(0,U.IX)(o);e.bind={legend:{merge:a}}},topLevelSignals:(t,e,n)=>{const i=e.name,r=dc(e.bind)&&e.bind.legend,o=t=>e=>{const n=tt(e);return n.markname=t,n};for(const a of e.project.items){if(!a.hasLegend)continue;const t="".concat(kt(a.field),"_legend"),s="".concat(i,"_").concat(t);if(0===n.filter((t=>t.name===s)).length){const i=r.merge.map(o("".concat(t,"_symbols"))).concat(r.merge.map(o("".concat(t,"_labels")))).concat(r.merge.map(o("".concat(t,"_entries"))));n.unshift({name:s,...e.init?{}:{value:null},on:[{events:i,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]})}}return n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.find((t=>t.name===i+wf)),a=i+uu,s=r.items.filter((t=>t.hasLegend)).map((t=>kt("".concat(i,"_").concat(kt(t.field),"_legend")))),c=s.map((t=>"".concat(t," !== null"))).join(" && "),l="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null");e.events&&s.length>0?o.on.push({events:s.map((t=>({signal:t}))),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);const u=n.find((t=>t.name===i+lf)),f=dc(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};const hf="_translate_anchor",pf="_translate_delta",mf={defined:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const i=e.name,r=mu.defined(e),o=i+hf,{x:a,y:s}=e.project.hasChannel;let c=(0,tu.r)(e.translate,"scope");return r||(c=c.map((t=>(t.between[0].markname=i+yu,t)))),n.push({name:o,value:{},on:[{events:c.map((t=>t.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: ".concat(r?gu(t,Xt):"slice(".concat(a.signals.visual,")")):"")+(void 0!==s?", extent_y: ".concat(r?gu(t,Jt):"slice(".concat(s.signals.visual,")")):"")+"}"}]},{name:i+pf,value:{},on:[{events:c,update:"{x: ".concat(o,".x - x(unit), y: ").concat(o,".y - y(unit)}")}]}),void 0!==a&&gf(t,e,a,"width",n),void 0!==s&&gf(t,e,s,"height",n),n}};function gf(t,e,n,i,r){var o,a;const s=e.name,c=s+hf,l=s+pf,u=n.channel,f=mu.defined(e),d=r.filter((t=>t.name===n.signals[f?"data":"visual"]))[0],h=t.getSizeSignalRef(i).signal,p=t.getScaleComponent(u),m=p&&p.get("type"),g=p&&p.get("reverse"),v=f?u===Xt?g?"":"-":g?"-":"":"",y="".concat(c,".extent_").concat(u),b="".concat(v).concat(l,".").concat(u," / ").concat(f?"".concat(h):"span(".concat(y,")")),x=f&&p?"log"===m?"panLog":"symlog"===m?"panSymlog":"pow"===m?"panPow":"panLinear":"panLinear",_=f?"pow"===m?", ".concat(null!==(o=p.get("exponent"))&&void 0!==o?o:1):"symlog"===m?", ".concat(null!==(a=p.get("constant"))&&void 0!==a?a:1):"":"",w="".concat(x,"(").concat(y,", ").concat(b).concat(_,")");d.on.push({events:{signal:l},update:f?w:"clampRange(".concat(w,", 0, ").concat(h,")")})}const vf="_zoom_anchor",yf="_zoom_delta",bf={defined:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const i=e.name,r=mu.defined(e),o=i+yf,{x:a,y:s}=e.project.hasChannel,c=(0,U.m8)(t.scaleName(Xt)),l=(0,U.m8)(t.scaleName(Jt));let u=(0,tu.r)(e.zoom,"scope");return r||(u=u.map((t=>(t.markname=i+yu,t)))),n.push({name:i+vf,on:[{events:u,update:r?"{"+[c?"x: invert(".concat(c,", x(unit))"):"",l?"y: invert(".concat(l,", y(unit))"):""].filter((t=>t)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&xf(t,e,a,"width",n),void 0!==s&&xf(t,e,s,"height",n),n}};function xf(t,e,n,i,r){var o,a;const s=e.name,c=n.channel,l=mu.defined(e),u=r.filter((t=>t.name===n.signals[l?"data":"visual"]))[0],f=t.getSizeSignalRef(i).signal,d=t.getScaleComponent(c),h=d&&d.get("type"),p=l?gu(t,c):u.name,m=s+yf,g="".concat(s).concat(vf,".").concat(c),v=l&&d?"log"===h?"zoomLog":"symlog"===h?"zoomSymlog":"pow"===h?"zoomPow":"zoomLinear":"zoomLinear",y=l?"pow"===h?", ".concat(null!==(o=d.get("exponent"))&&void 0!==o?o:1):"symlog"===h?", ".concat(null!==(a=d.get("constant"))&&void 0!==a?a:1):"":"",b="".concat(v,"(").concat(p,", ").concat(g,", ").concat(m).concat(y,")");u.on.push({events:{signal:m},update:l?b:"clampRange(".concat(b,", 0, ").concat(f,")")})}const _f="_store",wf="_tuple",kf="_modify",Ef="vlSelectionResolve",Df=[Du,ku,hu,uf,cf,mu,df,ff,mf,bf,af];function Af(t){let{escape:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},n=e?(0,U.m8)(t.name):t.name;const i=function(t){let e=t.parent;for(;e&&!dp(e);)e=e.parent;return e}(t);if(i){const{facet:t}=i;for(const e of Ne)t[e]&&(n+=" + '__facet_".concat(e,"_' + (facet[").concat((0,U.m8)(i.vgField(e)),"])"))}return n}function Sf(t){var e;return xt(null!==(e=t.component.selection)&&void 0!==e?e:{}).reduce(((t,e)=>t||e.project.hasSelectionId),!1)}function Cf(t,e){!(0,B.isString)(e.select)&&e.select.on||delete t.events,!(0,B.isString)(e.select)&&e.select.clear||delete t.clear,!(0,B.isString)(e.select)&&e.select.toggle||delete t.toggle}var Ff=n(88120);function Mf(t){const e=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(e.push(...Mf(t.object)),e.push(...Mf(t.property))),e)}function Of(t){return"MemberExpression"===t.object.type?Of(t.object):"datum"===t.object.name}function Tf(t){const e=(0,Ff.BJ)(t),n=new Set;return e.visit((t=>{"MemberExpression"===t.type&&Of(t)&&n.add(Mf(t).slice(1).join("."))})),n}class Nf extends su{clone(){return new Nf(null,this.model,tt(this.filter))}constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=Pf(this.model,this.filter,this),this._dependentFields=Tf(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter ".concat(this.expr)}}function zf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const r=(0,U.HD)(e)?e:e.param,o=kt(r),a=(0,U.m8)(o+_f);let s;try{s=t.getSelectionComponent(o,r)}catch(d){return"!!".concat(o)}if(s.project.timeUnit){const e=null!==n&&void 0!==n?n:t.component.data.raw,i=s.project.timeUnit.clone();e.parent?i.insertAsParentOf(e):e.parent=i}const c=s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l="global"===s.resolve?")":", ".concat((0,U.m8)(s.resolve),")"),u="".concat(c).concat(a,", ").concat(i).concat(l),f="length(data(".concat(a,"))");return!1===e.empty?"".concat(f," && ").concat(u):"!".concat(f," || ").concat(u)}function Rf(t,e,n){const i=kt(e),r=n.encoding;let o,a=n.field;try{o=t.getSelectionComponent(i,e)}catch(s){return i}if(r||a){if(r&&!a){const t=o.project.items.filter((t=>t.channel===r));!t.length||t.length>1?(a=o.project.items[0].field,dr((t.length?"Multiple ":"No ")+"matching ".concat((0,U.m8)(r)," encoding found for selection ").concat((0,U.m8)(n.param),". ")+'Using "field": '.concat((0,U.m8)(a),"."))):a=t[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&dr('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat((0,U.m8)(a),"."));return"".concat(o.name,"[").concat((0,U.m8)(Mt(a)),"]")}function Pf(t,e,n){return Et(e,(e=>(0,U.HD)(e)?e:function(t){return null===t||void 0===t?void 0:t.param}(e)?zf(t,e,n):Br(e)))}function Lf(t,e,n,i){var r,o,a,s,c;null!==(r=t.encode)&&void 0!==r||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(c=t.encode[e]).update)&&void 0!==a||(c.update={}),t.encode[e].update[n]=i}function jf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1};const{disable:r,orient:o,scale:a,labelExpr:s,title:c,zindex:l,...u}=t.combine();if(!r){for(const t in u){const n=gs[t],i=u[t];if(n&&n!==e&&"both"!==n)delete u[t];else if(ps(i)){const{condition:e,...n}=i,r=(0,U.IX)(e),o=hs[t];if(o){const{vgProp:e,part:i}=o;Lf(u,i,e,[...r.map((t=>{const{test:e,...n}=t;return{test:Pf(null,e),...n}})),n]),delete u[t]}else if(null===o){const e={signal:r.map((t=>{const{test:e,...n}=t;return"".concat(Pf(null,e)," ? ").concat(bi(n)," : ")})).join("")+bi(n)};u[t]=e}}else if(li(i)){const e=hs[t];if(e){const{vgProp:n,part:r}=e;Lf(u,r,n,i),delete u[t]}}st(["labelAlign","labelBaseline"],t)&&null===u[t]&&delete u[t]}if("grid"===e){if(!u.grid)return;if(u.encode){const{grid:t}=u.encode;u.encode={...t?{grid:t}:{}},yt(u.encode)&&delete u.encode}return{scale:a,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:zt(l,0)}}{if(!i.header&&t.mainExtracted)return;if(void 0!==s){var f,d;let t=s;null!==(f=u.encode)&&void 0!==f&&null!==(d=f.labels)&&void 0!==d&&d.update&&li(u.encode.labels.update.text)&&(t=Ot(s,"datum.label",u.encode.labels.update.text.signal)),Lf(u,"labels","text",{signal:t})}if(null===u.labelAlign&&delete u.labelAlign,u.encode){for(const e of ms)t.hasAxisPart(e)||delete u.encode[e];yt(u.encode)&&delete u.encode}const e=function(t,e){if(t)return(0,U.kJ)(t)&&!ci(t)?t.map((t=>ts(t,e))).join(", "):t}(c,n);return{scale:a,orient:o,grid:!1,...e?{title:e}:{},...u,...!1===n.aria?{aria:!1}:{},zindex:zt(l,0)}}}}function Bf(t){const{axes:e}=t.component,n=[];for(const i of bn)if(e[i])for(const r of e[i])if(!r.get("disable")&&!r.get("gridScale")){const e="x"===i?"height":"width",r=t.getSizeSignalRef(e).signal;e!==r&&n.push({name:e,update:r})}return n}function If(t,e,n,i){return Object.assign.apply(null,[{},...t.map((t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",r=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...bt(r),...bt(o)]),s={};for(const e of a.values())s[e]={signal:"".concat(i.signal,' === "').concat(t,'" ? ').concat(xi(r[e])," : ").concat(xi(o[e]))};return s}return e[t]}))])}function Uf(t,e){const n=[{}];for(const r of t){var i;let t=null===(i=e[r])||void 0===i?void 0:i.style;if(t){t=(0,U.IX)(t);for(const i of t)n.push(e.style[i])}}return Object.assign.apply(null,n)}function qf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Ai(t,n,e);if(void 0!==r)return{configFrom:"style",configValue:r};for(const a of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){var o;if(void 0!==(null===(o=i[a])||void 0===o?void 0:o[t]))return{configFrom:a,configValue:i[a][t]}}return{}}const Wf={scale:t=>{let{model:e,channel:n}=t;return e.scaleName(n)},format:t=>{let{format:e}=t;return e},formatType:t=>{let{formatType:e}=t;return e},grid:t=>{var e;let{fieldOrDatumDef:n,axis:i,scaleType:r}=t;return null!==(e=i.grid)&&void 0!==e?e:function(t,e){return!so(t)&&Na(e)&&!ti(null===e||void 0===e?void 0:e.bin)&&!ei(null===e||void 0===e?void 0:e.bin)}(r,n)},gridScale:t=>{let{model:e,channel:n}=t;return function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(e,n)},labelAlign:t=>{let{axis:e,labelAngle:n,orient:i,channel:r}=t;return e.labelAlign||Jf(n,i,r)},labelAngle:t=>{let{labelAngle:e}=t;return e},labelBaseline:t=>{let{axis:e,labelAngle:n,orient:i,channel:r}=t;return e.labelBaseline||Xf(n,i,r)},labelFlush:t=>{var e;let{axis:n,fieldOrDatumDef:i,channel:r}=t;return null!==(e=n.labelFlush)&&void 0!==e?e:function(t,e){if("x"===e&&st(["quantitative","temporal"],t))return!0;return}(i.type,r)},labelOverlap:t=>{var e;let{axis:n,fieldOrDatumDef:i,scaleType:r}=t;return null!==(e=n.labelOverlap)&&void 0!==e?e:function(t,e,n,i){if(n&&!(0,U.Kn)(i)||"nominal"!==t&&"ordinal"!==t)return"log"!==e&&"symlog"!==e||"greedy";return}(i.type,r,Na(i)&&!!i.timeUnit,Na(i)?i.sort:void 0)},orient:t=>{let{orient:e}=t;return e},tickCount:t=>{var e;let{channel:n,model:i,axis:r,fieldOrDatumDef:o,scaleType:a}=t;const s="x"===n?"width":"y"===n?"height":void 0,c=s?i.getSizeSignalRef(s):void 0;return null!==(e=r.tickCount)&&void 0!==e?e:function(t){let{fieldOrDatumDef:e,scaleType:n,size:i,values:r}=t;if(!r&&!so(n)&&"log"!==n){if(Na(e)){var o;if(ti(e.bin))return{signal:"ceil(".concat(i.signal,"/10)")};if(e.timeUnit&&st(["month","hours","day","quarter"],null===(o=Cr(e.timeUnit))||void 0===o?void 0:o.unit))return}return{signal:"ceil(".concat(i.signal,"/40)")}}return}({fieldOrDatumDef:o,scaleType:a,size:c,values:r.values})},tickMinStep:function(t){let{format:e,fieldOrDatumDef:n}=t;if("d"===e)return 1;if(Na(n)){const{timeUnit:t}=n;if(t){const e=Fr(t);if(e)return{signal:e}}}return},title:t=>{let{axis:e,model:n,channel:i}=t;if(void 0!==e.title)return e.title;const r=Gf(n,i);if(void 0!==r)return r;const o=n.typedFieldDef(i),a="x"===i?"x2":"y2",s=n.fieldDef(a);return Ci(o?[Ea(o)]:[],Na(s)?[Ea(s)]:[])},values:t=>{let{axis:e,fieldOrDatumDef:n}=t;return function(t,e){const n=t.values;if((0,U.kJ)(n))return fs(e,n);if(li(n))return n;return}(e,n)},zindex:t=>{var e;let{axis:n,fieldOrDatumDef:i,mark:r}=t;return null!==(e=n.zindex)&&void 0!==e?e:function(t,e){if("rect"===t&&$a(e))return 1;return 0}(r,i)}};function Hf(t){return"(((".concat(t.signal," % 360) + 360) % 360)")}function Xf(t,e,n,i){if(void 0!==t){if("x"===n){if(li(t)){const n=Hf(t),i=li(e)?"(".concat(e.signal,' === "top")'):"top"===e;return{signal:"(45 < ".concat(n," && ").concat(n," < 135) || (225 < ").concat(n," && ").concat(n,' < 315) ? "middle" :')+"(".concat(n," <= 45 || 315 <= ").concat(n,") === ").concat(i,' ? "bottom" : "top"')}}if(45<t&&t<135||225<t&&t<315)return"middle";if(li(e)){const n=t<=45||315<=t?"===":"!==";return{signal:"".concat(e.signal," ").concat(n,' "top" ? "bottom" : "top"')}}return(t<=45||315<=t)===("top"===e)?"bottom":"top"}if(li(t)){const n=Hf(t),r=li(e)?"(".concat(e.signal,' === "left")'):"left"===e,o=i?'"middle"':"null";return{signal:"".concat(n," <= 45 || 315 <= ").concat(n," || (135 <= ").concat(n," && ").concat(n," <= 225) ? ").concat(o," : (45 <= ").concat(n," && ").concat(n," <= 135) === ").concat(r,' ? "top" : "bottom"')}}if(t<=45||315<=t||135<=t&&t<=225)return i?"middle":null;if(li(e)){const n=45<=t&&t<=135?"===":"!==";return{signal:"".concat(e.signal," ").concat(n,' "left" ? "top" : "bottom"')}}return(45<=t&&t<=135)===("left"===e)?"top":"bottom"}}function Jf(t,e,n){if(void 0===t)return;const i="x"===n,r=i?0:90,o=i?"bottom":"left";if(li(t)){const n=Hf(t),a=li(e)?"(".concat(e.signal,' === "').concat(o,'")'):e===o;return{signal:"(".concat(r?"(".concat(n," + 90)"):n," % 180 === 0) ? ").concat(i?null:'"center"'," :")+"(".concat(r," < ").concat(n," && ").concat(n," < ").concat(180+r,") === ").concat(a,' ? "left" : "right"')}}if((t+r)%180===0)return i?null:"center";if(li(e)){const n=r<t&&t<180+r?"===":"!==",i="".concat(e.signal," ").concat(n,' "').concat(o,'"');return{signal:"".concat(i,' ? "left" : "right"')}}return(r<t&&t<180+r)===(e===o)?"left":"right"}function Gf(t,e){const n="x"===e?"x2":"y2",i=t.fieldDef(e),r=t.fieldDef(n),o=i?i.title:void 0,a=r?r.title:void 0;return o&&a?Fi(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class $f extends su{clone(){return new $f(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this._dependentFields=Tf(this.transform.calculate)}static parseAllForSortIndex(t,e){return e.forEachFieldDef(((e,n)=>{if(qa(e)&&xa(e.sort)){const{field:i,timeUnit:r}=e,o=e.sort,a=o.map(((t,e)=>"".concat(Br({field:i,timeUnit:r,equal:t})," ? ").concat(e," : "))).join("")+o.length;t=new $f(t,{calculate:a,as:Zf(e,n,{forAs:!0})})}})),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate ".concat(ot(this.transform))}}function Zf(t,e,n){return Ga(t,{prefix:e,suffix:"sort_index",...null!==n&&void 0!==n?n:{}})}function Yf(t,e){return st(["top","bottom"],e)?"column":st(["left","right"],e)||"row"===t?"row":"column"}function Vf(t,e,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return zt((e||{})[t],r[t],n.header[t])}function Kf(t,e,n,i){const r={};for(const o of t){const t=Vf(o,e||{},n,i);void 0!==t&&(r[o]=t)}return r}const Qf=["row","column"],td=["header","footer"];function ed(t,e){const n=t.component.layoutHeaders[e].title,i=t.config?t.config:void 0,r=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Kf(["titleAnchor","titleAngle","titleOrient"],r.header,i,e),c=Yf(e,s),l=It(a);return{name:"".concat(e,"-title"),type:"group",role:"".concat(c,"-title"),title:{text:n,..."row"===e?{orient:"left"}:{},style:"guide-title",...id(l,c),...nd(c,l,o),...ud(i,r,e,rc,nc)}}}function nd(t,e){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle"){case"start":return{align:"left"};case"end":return{align:"right"}}const n=Jf(e,"row"===t?"left":"top","row"===t?"y":"x");return n?{align:n}:{}}function id(t,e){const n=Xf(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function rd(t,e){const n=t.component.layoutHeaders[e],i=[];for(const r of td)if(n[r])for(const o of n[r]){const a=sd(t,e,r,n,o);null!=a&&i.push(a)}return i}function od(t,e){const{sort:n}=t;var i;return ba(n)?{field:Ga(n,{expr:"datum"}),order:null!==(i=n.order)&&void 0!==i?i:"ascending"}:(0,U.kJ)(n)?{field:Zf(t,e,{expr:"datum"}),order:"ascending"}:{field:Ga(t,{expr:"datum"}),order:null!==n&&void 0!==n?n:"ascending"}}function ad(t,e,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:c}=Kf(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),l=aa({fieldOrDatumDef:t,format:i,formatType:r,expr:"parent",config:n}).signal,u=Yf(e,s);return{text:{signal:c?Ot(Ot(c,"datum.label",l),"datum.value",Ga(t,{expr:"parent"})):l},..."row"===e?{orient:"left"}:{},style:"guide-label",frame:"group",...id(o,u),...nd(u,o,a),...ud(n,t,e,oc,ic)}}function sd(t,e,n,i,r){if(r){let o=null;const{facetFieldDef:a}=i,s=t.config?t.config:void 0;if(a&&r.labels){const{labelOrient:t}=Kf(["labelOrient"],a.header,s,e);("row"===e&&!st(["top","bottom"],t)||"column"===e&&!st(["left","right"],t))&&(o=ad(a,e,s))}const c=dp(t)&&!_a(t.facet),l=r.axes,u=(null===l||void 0===l?void 0:l.length)>0;if(o||u){const s="row"===e?"height":"width";return{name:t.getName("".concat(e,"_").concat(n)),type:"group",role:"".concat(e,"-").concat(n),...i.facetFieldDef?{from:{data:t.getName("".concat(e,"_domain"))},sort:od(a,e)}:{},...u&&c?{from:{data:t.getName("facet_domain_".concat(e))}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{},...u?{axes:l}:{}}}}return null}const cd={column:{start:0,end:1},row:{start:1,end:0}};function ld(t,e){return cd[e][t]}function ud(t,e,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=Vf(a,null===e||void 0===e?void 0:e.header,t,n);void 0!==i&&(o[r[a]]=i)}return o}function fd(t){return[...dd(t,"width"),...dd(t,"height"),...dd(t,"childWidth"),...dd(t,"childHeight")]}function dd(t,e){const n="width"===e?"x":"y",i=t.component.layoutSize.get(e);if(!i||"merged"===i)return[];const r=t.getSizeSignalRef(e).signal;if("step"===i){const e=t.getScaleComponent(n);if(e){const i=e.get("type"),o=e.get("range");if(so(i)&&ui(o)){const i=t.scaleName(n);if(dp(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[hd(i,o)]}return[hd(i,o),{name:r,update:pd(i,e,"domain('".concat(i,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const e=r.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",i=wc(t.config.view,e?"width":"height"),o="isFinite(".concat(n,") ? ").concat(n," : ").concat(i);return[{name:r,init:o,on:[{update:o,events:"window:resize"}]}]}return[{name:r,value:i}]}function hd(t,e){const n="".concat(t,"_step");return li(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function pd(t,e,n){const i=e.get("type"),r=e.get("padding"),o=zt(e.get("paddingOuter"),r);let a=e.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,"bandspace(".concat(n,", ").concat(xi(a),", ").concat(xi(o),") * ").concat(t,"_step")}function md(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function gd(t,e){return bt(t).reduce(((n,i)=>{const r=t[i];return{...n,...Au(e,r,i,(t=>yi(t.value)))}}),{})}function vd(t,e){if(dp(e))return"theta"===t?"independent":"shared";if(pp(e))return"shared";if(hp(e))return xn(t)||"theta"===t||"radius"===t?"independent":"shared";throw new Error("invalid model type for resolve")}function yd(t,e){const n=t.scale[e],i=xn(e)?"axis":"legend";return"independent"===n?("shared"===t[i][e]&&dr(function(t){return'Setting the scale to be independent for "'.concat(t,'" means we also have to set the guide (axis or legend) to be independent.')}(e)),"independent"):t[i][e]||"shared"}const bd={...cc,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},xd=bt(bd);class _d extends Bl{}const wd={symbols:function(t,e){var n,i,r,o;let{fieldOrDatumDef:a,model:s,channel:c,legendCmpt:l,legendType:u}=e;if("symbol"!==u)return;const{markDef:f,encoding:d,config:h,mark:p}=s,m=f.filled&&"trail"!==p;let g={..._i({},s,Wo),...Pu(s,{filled:m})};const v=null!==(n=l.get("symbolOpacity"))&&void 0!==n?n:h.legend.symbolOpacity,y=null!==(i=l.get("symbolFillColor"))&&void 0!==i?i:h.legend.symbolFillColor,b=null!==(r=l.get("symbolStrokeColor"))&&void 0!==r?r:h.legend.symbolStrokeColor,x=void 0===v?null!==(o=kd(d.opacity))&&void 0!==o?o:f.opacity:void 0;if(g.fill){var _;if("fill"===c||m&&c===oe)delete g.fill;else if(g.fill.field)if(y)delete g.fill;else g.fill=yi(null!==(_=h.legend.symbolBaseFillColor)&&void 0!==_?_:"black"),g.fillOpacity=yi(null!==x&&void 0!==x?x:1);else if((0,U.kJ)(g.fill)){var w,k,E;const t=null!==(w=null!==(k=Ed(null!==(E=d.fill)&&void 0!==E?E:d.color))&&void 0!==k?k:f.fill)&&void 0!==w?w:m&&f.color;t&&(g.fill=yi(t))}}if(g.stroke)if("stroke"===c||!m&&c===oe)delete g.stroke;else if(g.stroke.field||b)delete g.stroke;else if((0,U.kJ)(g.stroke)){const t=zt(Ed(d.stroke||d.color),f.stroke,m?f.color:void 0);t&&(g.stroke={value:t})}if(c!==fe){const t=Na(a)&&Ad(s,l,a);t?g.opacity=[{test:t,...yi(null!==x&&void 0!==x?x:1)},yi(h.legend.unselectedOpacity)]:x&&(g.opacity=yi(x))}return g={...g,...t},yt(g)?void 0:g},gradient:function(t,e){var n;let{model:i,legendType:r,legendCmpt:o}=e;if("gradient"!==r)return;const{config:a,markDef:s,encoding:c}=i;let l={};const u=void 0===(null!==(n=o.get("gradientOpacity"))&&void 0!==n?n:a.legend.gradientOpacity)?kd(c.opacity)||s.opacity:void 0;u&&(l.opacity=yi(u));return l={...l,...t},yt(l)?void 0:l},labels:function(t,e){let{fieldOrDatumDef:n,model:i,channel:r,legendCmpt:o}=e;const a=i.legend(r)||{},s=i.config,c=Na(n)?Ad(i,o,n):void 0,l=c?[{test:c,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:f}=a;let d;ia(f)?d=ca({fieldOrDatumDef:n,field:"datum.value",format:u,formatType:f,config:s}):void 0===u&&void 0===f&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?d=ca({fieldOrDatumDef:n,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===n.type&&s.timeFormatType&&Na(n)&&void 0===n.timeUnit&&(d=ca({fieldOrDatumDef:n,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const h={...l?{opacity:l}:{},...d?{text:d}:{},...t};return yt(h)?void 0:h},entries:function(t,e){let{legendCmpt:n}=e;const i=n.get("selections");return null!==i&&void 0!==i&&i.length?{...t,fill:{value:"transparent"}}:t}};function kd(t){return Dd(t,((t,e)=>Math.max(t,e.value)))}function Ed(t){return Dd(t,((t,e)=>zt(t,e.value)))}function Dd(t,e){return function(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&((0,U.kJ)(e)||Ua(e))}(t)?(0,U.IX)(t.condition).reduce(e,t.value):Ua(t)?t.value:void 0}function Ad(t,e,n){const i=e.get("selections");if(null===i||void 0===i||!i.length)return;const r=(0,U.m8)(n.field);return i.map((t=>{const e=(0,U.m8)(kt(t)+_f);return"(!length(data(".concat(e,")) || (").concat(t,"[").concat(r,"] && indexof(").concat(t,"[").concat(r,"], datum.value) >= 0))")})).join(" || ")}const Sd={direction:t=>{let{direction:e}=t;return e},format:t=>{let{fieldOrDatumDef:e,legend:n,config:i}=t;const{format:r,formatType:o}=n;return la(e,e.type,r,o,i,!1)},formatType:t=>{let{legend:e,fieldOrDatumDef:n,scaleType:i}=t;const{formatType:r}=e;return ua(r,n,i)},gradientLength:t=>{var e,n;const{legend:i,legendConfig:r}=t;return null!==(e=null!==(n=i.gradientLength)&&void 0!==n?n:r.gradientLength)&&void 0!==e?e:function(t){let{legendConfig:e,model:n,direction:i,orient:r,scaleType:o}=t;const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:c,gradientVerticalMinLength:l}=e;if(lo(o))return"horizontal"===i?"top"===r||"bottom"===r?Md(n,"width",s,a):s:Md(n,"height",l,c);return}(t)},labelOverlap:t=>{var e,n;let{legend:i,legendConfig:r,scaleType:o}=t;return null!==(e=null!==(n=i.labelOverlap)&&void 0!==n?n:r.labelOverlap)&&void 0!==e?e:function(t){if(st(["quantile","threshold","log","symlog"],t))return"greedy";return}(o)},symbolType:t=>{var e;let{legend:n,markDef:i,channel:r,encoding:o}=t;return null!==(e=n.symbolType)&&void 0!==e?e:function(t,e,n,i){if("shape"!==e){var r;const t=null!==(r=Ed(n))&&void 0!==r?r:i;if(t)return t}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(i.type,r,o.shape,i.shape)},title:t=>{let{fieldOrDatumDef:e,config:n}=t;return Ka(e,n,{allowDisabling:!0})},type:t=>{let{legendType:e,scaleType:n,channel:i}=t;if(Oe(i)&&lo(n)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:t=>{let{fieldOrDatumDef:e,legend:n}=t;return function(t,e){const n=t.values;if((0,U.kJ)(n))return fs(e,n);if(li(n))return n;return}(n,e)}};function Cd(t){const{legend:e}=t;return zt(e.type,function(t){let{channel:e,timeUnit:n,scaleType:i}=t;if(Oe(e)){if(st(["quarter","month","day"],n))return"symbol";if(lo(i))return"gradient"}return"symbol"}(t))}function Fd(t){var e,n;let{legendConfig:i,legendType:r,orient:o,legend:a}=t;return null!==(e=null!==(n=a.direction)&&void 0!==n?n:i[r?"gradientDirection":"symbolDirection"])&&void 0!==e?e:function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(o,r)}function Md(t,e,n,i){const r=t.getSizeSignalRef(e).signal;return{signal:"clamp(".concat(r,", ").concat(n,", ").concat(i,")")}}function Od(t){const e=fp(t)?function(t){const{encoding:e}=t,n={};for(const i of[oe,...sc]){const r=is(e[i]);r&&t.getScaleComponent(i)&&(i===ce&&Na(r)&&r.type===Zr||(n[i]=Nd(t,i)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const i of t.children){Od(i);for(const r of bt(i.component.legends))n.legend[r]=yd(t.component.resolve,r),"shared"===n.legend[r]&&(e[r]=zd(e[r],i.component.legends[r]),e[r]||(n.legend[r]="independent",delete e[r]))}for(const i of bt(e))for(const e of t.children)e.component.legends[i]&&"shared"===n.legend[i]&&delete e.component.legends[i];return e}(t);return t.component.legends=e,e}function Td(t,e,n,i){switch(e){case"disable":return void 0!==n;case"values":return!(null===n||void 0===n||!n.values);case"title":if("title"===e&&t===(null===i||void 0===i?void 0:i.title))return!0}return t===(n||{})[e]}function Nd(t,e){var n,i,r;let o=t.legend(e);const{markDef:a,encoding:s,config:c}=t,l=c.legend,u=new _d({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){var i;const r=null===(i=t.fieldDef(e))||void 0===i?void 0:i.field;for(const c of xt(null!==(o=t.component.selection)&&void 0!==o?o:{})){var o,a;const t=null!==(a=c.project.hasField[r])&&void 0!==a?a:c.project.hasChannel[e];if(t&&df.defined(c)){var s;const e=null!==(s=n.get("selections"))&&void 0!==s?s:[];e.push(c.name),n.set("selections",e,!1),t.hasLegend=!0}}}(t,e,u);const f=void 0!==o?!o:l.disable;if(u.set("disable",f,void 0!==o),f)return u;o=o||{};const d=t.getScaleComponent(e).get("type"),h=is(s[e]),p=Na(h)?null===(n=Cr(h.timeUnit))||void 0===n?void 0:n.unit:void 0,m=o.orient||c.legend.orient||"right",g=Cd({legend:o,channel:e,timeUnit:p,scaleType:d}),v={legend:o,channel:e,model:t,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:c,scaleType:d,orient:m,legendType:g,direction:Fd({legend:o,legendType:g,orient:m,legendConfig:l})};for(const E of xd){if("gradient"===g&&E.startsWith("symbol")||"symbol"===g&&E.startsWith("gradient"))continue;const n=E in Sd?Sd[E](v):o[E];if(void 0!==n){const i=Td(n,E,o,t.fieldDef(e));(i||void 0===c.legend[E])&&u.set(E,n,i)}}const y=null!==(i=null===(r=o)||void 0===r?void 0:r.encoding)&&void 0!==i?i:{},b=u.get("selections"),x={},_={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:u,legendType:g};for(const E of["labels","legend","title","symbols","gradient","entries"]){var w;const e=gd(null!==(w=y[E])&&void 0!==w?w:{},t),n=E in wd?wd[E](e,_):e;void 0===n||yt(n)||(x[E]={...null!==b&&void 0!==b&&b.length&&Na(h)?{name:"".concat(kt(h.field),"_legend_").concat(E)}:{},...null!==b&&void 0!==b&&b.length?{interactive:!!b}:{},update:n})}var k;yt(x)||u.set("encode",x,!(null===(k=o)||void 0===k||!k.encoding));return u}function zd(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),i=e.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of xd){const n=Hl(t.getWithExplicit(l),e.getWithExplicit(l),l,"legend",((t,e)=>{switch(l){case"symbolType":return Rd(t,e);case"title":return Mi(t,e);case"type":return r=!0,Ul("symbol")}return Wl(t,e,l,"legend")}));t.setWithExplicit(l,n)}var o,a,s,c;r&&(null!==(o=t.implicit)&&void 0!==o&&null!==(a=o.encode)&&void 0!==a&&a.gradient&&Dt(t.implicit,["encode","gradient"]),null!==(s=t.explicit)&&void 0!==s&&null!==(c=s.encode)&&void 0!==c&&c.gradient&&Dt(t.explicit,["encode","gradient"]));return t}function Rd(t,e){return"circle"===e.value?e:t}function Pd(t){const e=t.component.legends,n={};for(const i of bt(e)){const r=t.getScaleComponent(i),o=rt(r.get("domains"));if(n[o])for(const t of n[o]){zd(t,e[i])||n[o].push(e[i])}else n[o]=[e[i].clone()]}return xt(n).flat().map((e=>function(t,e){var n;const{disable:i,labelExpr:r,selections:o,...a}=t.combine();if(i)return;!1===e.aria&&void 0==a.aria&&(a.aria=!1);if(null!==(n=a.encode)&&void 0!==n&&n.symbols){const t=a.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||a.stroke||(t.stroke={value:"transparent"});for(const e of sc)a[e]&&delete t[e]}a.title||delete a.title;if(void 0!==r){var s,c;let t=r;null!==(s=a.encode)&&void 0!==s&&null!==(c=s.labels)&&void 0!==c&&c.update&&li(a.encode.labels.update.text)&&(t=Ot(r,"datum.label",a.encode.labels.update.text.signal)),function(t,e,n,i){var r,o,a,s,c;null!==(r=t.encode)&&void 0!==r||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(c=t.encode[e]).update)&&void 0!==a||(c.update={}),t.encode[e].update[n]=i}(a,"labels","text",{signal:t})}return a}(e,t.config))).filter((t=>void 0!==t))}function Ld(t){return pp(t)||hp(t)?function(t){return t.children.reduce(((t,e)=>t.concat(e.assembleProjections())),jd(t))}(t):jd(t)}function jd(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:i}=n;if(e.data){const r={signal:"[".concat(e.size.map((t=>t.signal)).join(", "),"]")},o=e.data.reduce(((e,n)=>{const i=li(n)?n.signal:"data('".concat(t.lookupDataSource(n),"')");return st(e,i)||e.push(i),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?"[".concat(o.join(", "),"]"):o[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Bd=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Id extends Bl{constructor(t,e,n,i){super({...e},{name:t}),this.specifiedProjection=e,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Ud(t){t.component.projection=fp(t)?function(t){if(t.hasProjection){var e;const n=ai(t.specifiedProjection),i=!(n&&(null!=n.scale||null!=n.translate)),r=i?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=i?function(t){const e=[],{encoding:n}=t;for(const i of[[ne,ee],[re,ie]])(is(n[i[0]])||is(n[i[1]]))&&e.push({signal:t.getName("geojson_".concat(e.length))});t.channelHasField(ce)&&t.typedFieldDef(ce).type===Zr&&e.push({signal:t.getName("geojson_".concat(e.length))});0===e.length&&e.push(t.requestDataName(Ql.Main));return e}(t):void 0,a=new Id(t.projectionName(!0),{...null!==(e=ai(t.config.projection))&&void 0!==e?e:{},...null!==n&&void 0!==n?n:{}},r,o);return a.get("type")||a.set("type","equalEarth",!1),a}return}(t):function(t){if(0===t.children.length)return;let e;for(const i of t.children)Ud(i);const n=lt(t.children,(t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=lt(Bd,(n=>!(0,U.nr)(t.explicit,n)&&!(0,U.nr)(e.explicit,n)||!!((0,U.nr)(t.explicit,n)&&(0,U.nr)(e.explicit,n)&&Q(t.get(n),e.get(n)))));if(Q(t.size,e.size)){if(n)return t;if(Q(t.explicit,{}))return e;if(Q(e.explicit,{}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0}));if(e&&n){const n=t.projectionName(!0),i=new Id(n,e.specifiedProjection,e.size,tt(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&i.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return i}return}(t)}function qd(t,e,n,i){if(ds(e,n)){var r,o;const a=fp(t)&&null!==(r=null!==(o=t.axis(n))&&void 0!==o?o:t.legend(n))&&void 0!==r?r:{},s=Ga(e,{expr:"datum"}),c=Ga(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Ga(e,{binSuffix:"range",forAs:!0}),formula:pa(s,c,a.format,a.formatType,i)}}return{}}function Wd(t,e){return"".concat(Qn(t),"_").concat(e)}function Hd(t,e,n){var i;const r=Wd(null!==(i=ss(n,void 0))&&void 0!==i?i:{},e);return t.getName("".concat(r,"_bins"))}function Xd(t,e,n){let i,r;i=function(t){return"as"in t}(t)?(0,U.HD)(t.as)?[t.as,"".concat(t.as,"_end")]:[t.as[0],t.as[1]]:[Ga(t,{forAs:!0}),Ga(t,{binSuffix:"end",forAs:!0})];const o={...ss(e,void 0)},a=Wd(o,t.field),{signal:s,extentSignal:c}=function(t,e){return{signal:t.getName("".concat(e,"_bins")),extentSignal:t.getName("".concat(e,"_extent"))}}(n,a);if(ii(o.extent)){const t=o.extent;r=Rf(n,t.param,t),delete o.extent}return{key:a,binComponent:{bin:o,field:t.field,as:[i],...s?{signal:s}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}}}}class Jd extends su{clone(){return new Jd(null,tt(this.bins))}constructor(t,e){super(t),this.bins=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,i)=>{if(Ia(n)&&ti(n.bin)){const{key:r,binComponent:o}=Xd(n,n.bin,e);t[r]={...o,...t[r],...qd(e,n,i,e.config)}}return t}),{});return yt(n)?null:new Jd(t,n)}static makeFromTransform(t,e,n){const{key:i,binComponent:r}=Xd(e,e.bin,n);return new Jd(t,{[i]:r})}merge(t,e){for(const n of bt(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=dt([...this.bins[n].as,...t.bins[n].as],ot)):this.bins[n]=t.bins[n];for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}producedFields(){return new Set(xt(this.bins).map((t=>t.as)).flat(2))}dependentFields(){return new Set(xt(this.bins).map((t=>t.field)))}hash(){return"Bin ".concat(ot(this.bins))}assemble(){return xt(this.bins).flatMap((t=>{const e=[],[n,...i]=t.as,{extent:r,...o}=t.bin,a={type:"bin",field:Mt(t.field),as:n,signal:t.signal,...ii(r)?{extent:null}:{extent:r},...t.span?{span:{signal:"span(".concat(t.span,")")}}:{},...o};!r&&t.extentSignal&&(e.push({type:"extent",field:Mt(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),e.push(a);for(const s of i)for(let t=0;t<2;t++)e.push({type:"formula",expr:Ga({field:n[t]},{expr:"datum"}),as:s[t]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}function Gd(t,e,n,i){var r;const o=fp(i)?i.encoding[Ze(e)]:void 0;if(Ia(n)&&fp(i)&&Ca(n,o,i.markDef,i.config))t.add(Ga(n,{})),t.add(Ga(n,{suffix:"end"})),n.bin&&ds(n,e)&&t.add(Ga(n,{binSuffix:"range"}));else if(Ce(e)){const n=Se(e);t.add(i.getName(n))}else t.add(Ga(n));return qa(n)&&function(t){return(0,B.isObject)(t)&&"field"in t}(null===(r=n.scale)||void 0===r?void 0:r.range)&&t.add(n.scale.range.field),t}class $d extends su{clone(){return new $d(null,new Set(this.dimensions),tt(this.measures))}constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef((t=>{t.aggregate&&(n=!0)}));const i={},r=new Set;return n?(e.forEachFieldDef(((t,n)=>{const{aggregate:o,field:a}=t;if(o)if("count"===o){var s;null!==(s=i["*"])&&void 0!==s||(i["*"]={}),i["*"].count=new Set([Ga(t,{forAs:!0})])}else{if(Jn(o)||Gn(o)){var c;const t=Jn(o)?"argmin":"argmax",e=o[t];null!==(c=i[e])&&void 0!==c||(i[e]={}),i[e][t]=new Set([Ga({op:t,field:e},{forAs:!0})])}else{var l;null!==(l=i[a])&&void 0!==l||(i[a]={}),i[a][o]=new Set([Ga(t,{forAs:!0})])}var u;if(jn(n)&&"unaggregated"===e.scaleDomain(n))null!==(u=i[a])&&void 0!==u||(i[a]={}),i[a].min=new Set([Ga({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Ga({field:a,aggregate:"max"},{forAs:!0})])}else Gd(r,n,t,e)})),r.size+bt(i).length===0?null:new $d(t,r,i)):null}static makeFromTransform(t,e){const n=new Set,i={};for(const s of e.aggregate){const{op:t,field:e,as:n}=s;var r,o;if(t)if("count"===t)null!==(r=i["*"])&&void 0!==r||(i["*"]={}),i["*"].count=new Set([n||Ga(s,{forAs:!0})]);else null!==(o=i[e])&&void 0!==o||(i[e]={}),i[e][t]=new Set([n||Ga(s,{forAs:!0})])}for(const s of null!==(a=e.groupby)&&void 0!==a?a:[]){var a;n.add(s)}return n.size+bt(i).length===0?null:new $d(t,n,i)}merge(t){return pt(this.dimensions,t.dimensions)?(function(t,e){for(const i of bt(e)){const r=e[i];for(const e of bt(r)){var n;i in t?t[i][e]=new Set([...null!==(n=t[i][e])&&void 0!==n?n:[],...r[e]]):t[i]={[e]:r[e]}}}}(this.measures,t.measures),!0):(function(){ur.debug(...arguments)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...bt(this.measures)])}producedFields(){const t=new Set;for(const e of bt(this.measures))for(const n of bt(this.measures[e])){const i=this.measures[e][n];0===i.size?t.add("".concat(n,"_").concat(e)):i.forEach(t.add,t)}return t}hash(){return"Aggregate ".concat(ot({dimensions:this.dimensions,measures:this.measures}))}assemble(){const t=[],e=[],n=[];for(const i of bt(this.measures))for(const r of bt(this.measures[i]))for(const o of this.measures[i][r])n.push(o),t.push(r),e.push("*"===i?null:Mt(i));return{type:"aggregate",groupby:[...this.dimensions].map(Mt),ops:t,fields:e,as:n}}}class Zd extends su{constructor(t,e,n,i){super(t),this.model=e,this.name=n,this.data=i;for(const r of Ne){const t=e.facet[r];if(t){const{bin:n,sort:i}=t;this[r]={name:e.getName("".concat(r,"_domain")),fields:[Ga(t),...ti(n)?[Ga(t,{binSuffix:"end"})]:[]],...ba(i)?{sortField:i}:(0,U.kJ)(i)?{sortIndexField:Zf(t,r)}:{}}}}this.childModel=e.child}hash(){let t="Facet";for(const e of Ne)this[e]&&(t+=" ".concat(e.charAt(0),":").concat(ot(this[e])));return t}get fields(){const t=[];for(const n of Ne){var e;null!==(e=this[n])&&void 0!==e&&e.fields&&t.push(...this[n].fields)}return t}dependentFields(){const t=new Set(this.fields);for(const e of Ne)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of bn){const n=this.childModel.component.scales[e];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(so(i)&&ui(r)){const n=qh(Wh(this.childModel,e));n?t[e]=n:dr(Pi(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const i={row:"y",column:"x",facet:void 0}[t],r=[],o=[],a=[];i&&n&&n[i]&&(e?(r.push("distinct_".concat(n[i])),o.push("max")):(r.push(n[i]),o.push("distinct")),a.push("distinct_".concat(n[i])));const{sortField:s,sortIndexField:c}=this[t];if(s){const{op:t=ma,field:e}=s;r.push(e),o.push(t),a.push(Ga(s,{forAs:!0}))}else c&&(r.push(c),o.push("max"),a.push(c));return{name:this[t].name,source:null!==e&&void 0!==e?e:this.data,transform:[{type:"aggregate",groupby:this[t].fields,...r.length?{fields:r,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],r={};for(const l of Qf){for(const t of td){var o;const e=null!==(o=n[l]&&n[l][t])&&void 0!==o?o:[];for(const t of e){var a;if((null===(a=t.axes)||void 0===a?void 0:a.length)>0){r[l]=!0;break}}}if(r[l]){const t='length(data("'.concat(this.facet.name,'"))'),n="row"===l?e?{signal:"ceil(".concat(t," / ").concat(e,")")}:1:e?{signal:"min(".concat(t,", ").concat(e,")")}:{signal:t};i.push({name:"".concat(this.facet.name,"_").concat(l),transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:c}=r;return(s||c)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:r,facet:o}=this;if(i&&r&&(n.x||n.y)){var a,s;e="cross_".concat(this.column.name,"_").concat(this.row.name);const i=[].concat(null!==(a=n.x)&&void 0!==a?a:[],null!==(s=n.y)&&void 0!==s?s:[]),r=i.map((()=>"distinct"));t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:r}]})}for(const c of[Wt,qt])this[c]&&t.push(this.assembleRowColumnHeaderData(c,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}function Yd(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Vd(t){const e={};return V(t.filter,(t=>{if(Lr(t)){let i=null;if(Mr(t))i=gi(t.equal);else if(Tr(t))i=gi(t.lte);else if(Or(t))i=gi(t.lt);else if(Nr(t))i=gi(t.gt);else if(zr(t))i=gi(t.gte);else if(Rr(t))i=t.range[0];else if(Pr(t)){var n;i=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]}i&&(hr(i)?e[t.field]="date":(0,U.hj)(i)?e[t.field]="number":(0,U.HD)(i)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function Kd(t){const e={};function n(t){var n;ls(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,(0,U.HD)(n)&&st(["min","max"],n))?e[t.field]="number":Nt(t.field)>1?t.field in e||(e[t.field]="flatten"):qa(t)&&ba(t.sort)&&Nt(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((fp(t)||dp(t))&&t.forEachFieldDef(((e,i)=>{if(Ia(e))n(e);else{const r=Ge(i),o=t.fieldDef(r);n({...e,type:o.type})}})),fp(t)){const{mark:n,markDef:i,encoding:r}=t;if(Bo(n)&&!t.encoding.order){const t=r["horizontal"===i.orient?"y":"x"];Na(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class Qd extends su{clone(){return new Qd(null,tt(this._parse))}constructor(t,e){super(t),this._parse=e}hash(){return"Parse ".concat(ot(this._parse))}static makeExplicit(t,e,n){var i;let r={};const o=e.data;return!Zl(o)&&null!==o&&void 0!==o&&null!==(i=o.format)&&void 0!==i&&i.parse&&(r=o.format.parse),this.makeWithAncestors(t,r,{},n)}static makeWithAncestors(t,e,n,i){for(const a of bt(n)){const t=i.getWithExplicit(a);void 0!==t.value&&(t.explicit||t.value===n[a]||"derived"===t.value||"flatten"===n[a]?delete n[a]:dr(qi(a,n[a],t.value)))}for(const a of bt(e)){const t=i.get(a);void 0!==t&&(t===e[a]?delete e[a]:dr(qi(a,e[a],t)))}const r=new Bl(e,n);i.copyAll(r);const o={};for(const a of bt(r.combine())){const t=r.get(a);null!==t&&(o[a]=t)}return 0===bt(o).length||i.parseNothing?null:new Qd(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const e of bt(this._parse)){const n=this._parse[e];1===Nt(e)&&(t[e]=n)}return t}producedFields(){return new Set(bt(this._parse))}dependentFields(){return new Set(bt(this._parse))}assembleTransforms(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bt(this._parse).filter((e=>!t||Nt(e)>1)).map((t=>{const e=function(t,e){const n=St(t);if("number"===e)return"toNumber(".concat(n,")");if("boolean"===e)return"toBoolean(".concat(n,")");if("string"===e)return"toString(".concat(n,")");if("date"===e)return"toDate(".concat(n,")");if("flatten"===e)return n;if(e.startsWith("date:")){const t=Yd(e.slice(5,e.length));return"timeParse(".concat(n,",'").concat(t,"')")}if(e.startsWith("utc:")){const t=Yd(e.slice(4,e.length));return"utcParse(".concat(n,",'").concat(t,"')")}return dr('Unrecognized parse "'.concat(e,'".')),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:Tt(t)}})).filter((t=>null!==t))}}class th extends su{clone(){return new th(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([lc])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:lc}}}class eh extends su{clone(){return new eh(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule ".concat(ot(this.params))}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class nh extends su{clone(){return new nh(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){var t;return new Set([null!==(t=this.params.as)&&void 0!==t?t:"data"])}hash(){return"Hash ".concat(ot(this.params))}assemble(){return{type:"sequence",...this.params}}}class ih extends su{constructor(t){var e;let n;if(super(null),null!==(e=t)&&void 0!==e||(t={name:"source"}),Zl(t)||(n=t.format?{...it(t.format,["parse"])}:{}),Gl(t))this._data={values:t.values};else if(Jl(t)){if(this._data={url:t.url},!n.type){let e=/(?:\.([^.]+))?$/.exec(t.url)[1];st(["json","csv","tsv","dsv","topojson"],e)||(e="json"),n.type=e}}else Vl(t)?this._data={values:[{type:"Sphere"}]}:($l(t)||Zl(t))&&(this._data={});this._generator=Zl(t),t.name&&(this._name=t.name),n&&!yt(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var rh,oh=function(t,e,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,n):r?r.value=n:e.set(t,n),n},ah=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)};function sh(t){return t instanceof ih||t instanceof eh||t instanceof nh}class ch{constructor(){rh.set(this,void 0),oh(this,rh,!1,"f")}setModified(){oh(this,rh,!0,"f")}get modifiedFlag(){return ah(this,rh,"f")}}rh=new WeakMap;class lh extends ch{getNodeDepths(t,e,n){n.set(t,e);for(const i of t.children)this.getNodeDepths(i,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort(((t,e)=>e[1]-t[1]));for(const n of e)this.run(n[0]);return this.modifiedFlag}}class uh extends ch{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class fh extends uh{mergeNodes(t,e){const n=e.shift();for(const i of e)t.removeChild(i),i.parent=n,i.remove()}run(t){const e=t.children.map((t=>t.hash())),n={};for(let i=0;i<e.length;i++)void 0===n[e[i]]?n[e[i]]=[t.children[i]]:n[e[i]].push(t.children[i]);for(const i of bt(n))n[i].length>1&&(this.setModified(),this.mergeNodes(t,n[i]))}}class dh extends uh{constructor(t){super(),this.requiresSelectionId=t&&Sf(t)}run(t){t instanceof th&&(this.requiresSelectionId&&(sh(t.parent)||t.parent instanceof $d||t.parent instanceof Qd)||(this.setModified(),t.remove()))}}class hh extends ch{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof lu&&(n=t.producedFields(),mt(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const i of t.children)this.run(i,new Set([...e,...n]))}}class ph extends uh{constructor(){super()}run(t){t instanceof cu&&!t.isRequired()&&(this.setModified(),t.remove())}}class mh extends lh{run(t){if(!sh(t)&&!(t.numChildren()>1))for(const e of t.children)if(e instanceof Qd)if(t instanceof Qd)this.setModified(),t.merge(e);else{if(vt(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class gh extends lh{run(t){const e=[...t.children],n=t.children.filter((t=>t instanceof Qd));if(t.numChildren()>1&&n.length>=1){const i={},r=new Set;for(const t of n){const e=t.parse;for(const t of bt(e))t in i?i[t]!==e[t]&&r.add(t):i[t]=e[t]}for(const t of r)delete i[t];if(!yt(i)){this.setModified();const n=new Qd(t,i);for(const r of e){if(r instanceof Qd)for(const t of bt(i))delete r.parse[t];t.removeChild(r),r.parent=n,r instanceof Qd&&0===bt(r.parse).length&&r.remove()}}}}}class vh extends lh{run(t){t instanceof cu||t.numChildren()>0||t instanceof Zd||t instanceof ih||(this.setModified(),t.remove())}}class yh extends lh{run(t){const e=t.children.filter((t=>t instanceof lu)),n=e.pop();for(const i of e)this.setModified(),n.merge(i)}}class bh extends lh{run(t){const e=t.children.filter((t=>t instanceof $d)),n={};for(const i of e){const t=ot(i.groupBy);t in n||(n[t]=[]),n[t].push(i)}for(const i of bt(n)){const e=n[i];if(e.length>1){const n=e.pop();for(const i of e)n.merge(i)&&(t.removeChild(i),i.parent=n,i.remove(),this.setModified())}}}}class xh extends lh{constructor(t){super(),this.model=t}run(t){const e=!(sh(t)||t instanceof Nf||t instanceof Qd||t instanceof th),n=[],i=[];for(const r of t.children)r instanceof Jd&&(e&&!vt(t.producedFields(),r.dependentFields())?n.push(r):i.push(r));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Jd?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(i.length>1){const t=i.pop();for(const e of i)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class _h extends lh{run(t){const e=[...t.children];if(!ct(e,(t=>t instanceof cu))||t.numChildren()<=1)return;const n=[];let i;for(const r of e)if(r instanceof cu){let e=r;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof cu))break;e=t}n.push(...e.children),i?(t.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=e,this.setModified()):i=e}else n.push(r);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=i}}}class wh extends su{clone(){return new wh(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=dt(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Ga(t)}hash(){return"JoinAggregateTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[];for(const r of this.transform.joinaggregate)e.push(r.op),n.push(this.getDefaultName(r)),t.push(void 0===r.field?null:r.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==i?{groupby:i}:{}}}}class kh extends su{clone(){return new kh(null,tt(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:i,as:r,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const u of e.sort)a.push(u.field),s.push(zt(u.order,"ascending"));const c={field:a,order:s};let l;return l=function(t){return(0,U.kJ)(t)&&t.every((t=>(0,U.HD)(t)))&&t.length>1}(r)?r:(0,U.HD)(r)?[r,"".concat(r,"_end")]:["".concat(e.stack,"_start"),"".concat(e.stack,"_end")],new kh(t,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:c,facetby:[],as:l})}static makeFromEncoding(t,e){const n=e.stack,{encoding:i}=e;if(!n)return null;const{groupbyChannels:r,fieldChannel:o,offset:a,impute:s}=n,c=r.map((t=>ns(i[t]))).filter((t=>!!t)),l=function(t){return t.stack.stackBy.reduce(((t,e)=>{const n=Ga(e.fieldDef);return n&&t.push(n),t}),[])}(e),u=e.encoding.order;let f;if((0,U.kJ)(u)||Na(u))f=Si(u);else{const t=Fa(u)?u.sort:"y"===o?"descending":"ascending";f=l.reduce(((e,n)=>(e.field.push(n),e.order.push(t),e)),{field:[],order:[]})}return new kh(t,{dimensionFieldDefs:c,stackField:e.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return"Stack ".concat(ot(this._stack))}getGroupbyFields(){const{dimensionFieldDefs:t,impute:e,groupby:n}=this._stack;return t.length>0?t.map((t=>t.bin?e?[Ga(t,{binSuffix:"mid"})]:[Ga(t,{}),Ga(t,{binSuffix:"end"})]:[Ga(t)])).flat():null!==n&&void 0!==n?n:[]}assemble(){const t=[],{facetby:e,dimensionFieldDefs:n,stackField:i,stackby:r,sort:o,offset:a,impute:s,as:c}=this._stack;if(s)for(const l of n){const{bandPosition:n=.5,bin:o}=l;if(o){const e=Ga(l,{expr:"datum"}),i=Ga(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:"".concat(n,"*").concat(e,"+").concat(1-n,"*").concat(i),as:Ga(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...r,...e],key:Ga(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:i,sort:o,as:c,offset:a}),t}}class Eh extends su{clone(){return new Eh(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=dt(this.transform.groupby.concat(t),(t=>t))}dependentFields(){var t,e;const n=new Set;return(null!==(t=this.transform.groupby)&&void 0!==t?t:[]).forEach(n.add,n),(null!==(e=this.transform.sort)&&void 0!==e?e:[]).forEach((t=>n.add(t.field))),this.transform.window.map((t=>t.field)).filter((t=>void 0!==t)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Ga(t)}hash(){return"WindowTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[],i=[];for(const f of this.transform.window)e.push(f.op),n.push(this.getDefaultName(f)),i.push(void 0===f.param?null:f.param),t.push(void 0===f.field?null:f.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&e.every((t=>$n(t))))return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==o?{groupby:o}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const f of this.transform.sort){var c;a.push(f.field),s.push(null!==(c=f.order)&&void 0!==c?c:"ascending")}const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:e,fields:t,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function Dh(t){if(t instanceof Zd)if(1!==t.numChildren()||t.children[0]instanceof cu){const n=t.model.component.data.main;Ah(n);const i=(e=t,function t(n){if(!(n instanceof Zd)){const i=n.clone();if(i instanceof cu){const t=Sh+i.getSource();i.setSource(t),e.model.component.data.outputNodes[t]=i}else(i instanceof $d||i instanceof kh||i instanceof Eh||i instanceof wh)&&i.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=i;return[i]}return n.children.flatMap(t)}),r=t.children.map(i).flat();for(const t of r)t.parent=n}else{const e=t.children[0];(e instanceof $d||e instanceof kh||e instanceof Eh||e instanceof wh)&&e.addDimensions(t.fields),e.swapWithParent(),Dh(t)}else t.children.map(Dh);var e}function Ah(t){if(t instanceof cu&&t.type===Ql.Main&&1===t.numChildren()){const e=t.children[0];e instanceof Zd||(e.swapWithParent(),Ah(t))}}const Sh="scale_",Ch=5;function Fh(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!Fh(e.children))return!1}return!0}function Mh(t,e){let n=!1;for(const i of e)n=t.optimize(i)||n;return n}function Oh(t,e,n){let i=t.sources,r=!1;return r=Mh(new ph,i)||r,r=Mh(new dh(e),i)||r,i=i.filter((t=>t.numChildren()>0)),r=Mh(new vh,i)||r,i=i.filter((t=>t.numChildren()>0)),n||(r=Mh(new mh,i)||r,r=Mh(new xh(e),i)||r,r=Mh(new hh,i)||r,r=Mh(new gh,i)||r,r=Mh(new bh,i)||r,r=Mh(new yh,i)||r,r=Mh(new fh,i)||r,r=Mh(new _h,i)||r),t.sources=i,r}class Th{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new Th((()=>t(e)))}}function Nh(t){fp(t)?function(t){const e=t.component.scales;for(const n of bt(e)){const i=zh(t,n);if(e[n].setWithExplicit("domains",i),jh(t,n),t.component.data.isFaceted){let e=t;for(;!dp(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of i.value)fi(t)&&(t.data=Sh+t.data.replace(Sh,""))}}}(t):function(t){for(const n of t.children)Nh(n);const e=t.component.scales;for(const n of bt(e)){let i,r=null;for(const e of t.children){const t=e.component.scales[n];if(t){i=void 0===i?t.getWithExplicit("domains"):Hl(i,t.getWithExplicit("domains"),"domains","scale",Ih);const e=t.get("selectionExtent");r&&e&&r.param!==e.param&&dr(Ii),r=e}}e[n].setWithExplicit("domains",i),r&&e[n].set("selectionExtent",r,!0)}}(t)}function zh(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:i}=t,r=function(t,e,n,i){if("unaggregated"===t){const{valid:t,reason:i}=Bh(e,n);if(!t)return void dr(i)}else if(void 0===t&&i.useUnaggregatedDomain){const{valid:t}=Bh(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return r!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:r}),"x"===e&&is(i.x2)?is(i.x)?Hl(Ph(n,r,t,"x"),Ph(n,r,t,"x2"),"domain","scale",Ih):Ph(n,r,t,"x2"):"y"===e&&is(i.y2)?is(i.y)?Hl(Ph(n,r,t,"y"),Ph(n,r,t,"y2"),"domain","scale",Ih):Ph(n,r,t,"y2"):Ph(n,r,t,e)}function Rh(t,e,n){var i;const r=null===(i=Cr(n))||void 0===i?void 0:i.unit;return"temporal"===e||r?function(t,e,n){return t.map((t=>{const i=us(t,{timeUnit:n,type:e});return{signal:"{data: ".concat(i,"}")}}))}(t,e,r):[t]}function Ph(t,e,n,i){const{encoding:r}=n,o=is(r[i]),{type:a}=o,s=o.timeUnit;if(function(t){return null===t||void 0===t?void 0:t.unionWith}(e)){const r=Ph(t,void 0,n,i);return Il([...Rh(e.unionWith,a,s),...r.value])}if(li(e))return Il([e]);if(e&&"unaggregated"!==e&&!fo(e))return Il(Rh(e,a,s));const c=n.stack;if(c&&i===c.fieldChannel){if("normalize"===c.offset)return Ul([[0,1]]);const t=n.requestDataName(Ql.Main);return Ul([{data:t,field:n.vgField(i,{suffix:"start"})},{data:t,field:n.vgField(i,{suffix:"end"})}])}const l=jn(i)&&Na(o)?function(t,e,n){if(!so(n))return;const i=t.fieldDef(e),r=i.sort;if(xa(r))return{op:"min",field:Zf(i,e),order:"ascending"};const{stack:o}=t,a=o?new Set([...o.groupbyFields,...o.stackBy.map((t=>t.fieldDef.field))]):void 0;if(ba(r)){return Lh(r,o&&!a.has(r.field))}if(ya(r)){const{encoding:e,order:n}=r,i=t.fieldDef(e),{aggregate:s,field:c}=i,l=o&&!a.has(c);if(Jn(s)||Gn(s))return Lh({field:Ga(i),order:n},l);if($n(s)||!s)return Lh({op:s,field:c,order:n},l)}else{if("descending"===r)return{op:"min",field:t.vgField(e),order:"descending"};if(st(["ascending",void 0],r))return!0}return}(n,i,t):void 0;if(Ra(o)){return Ul(Rh([o.datum],a,s))}const u=o;if("unaggregated"===e){const t=n.requestDataName(Ql.Main),{field:e}=o;return Ul([{data:t,field:Ga({field:e,aggregate:"min"})},{data:t,field:Ga({field:e,aggregate:"max"})}])}if(ti(u.bin)){if(so(t))return Ul("bin-ordinal"===t?[]:[{data:wt(l)?n.requestDataName(Ql.Main):n.requestDataName(Ql.Raw),field:n.vgField(i,ds(u,i)?{binSuffix:"range"}:{}),sort:!0!==l&&(0,U.Kn)(l)?l:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:t}=u;if(ti(t)){const e=Hd(n,u.field,t);return Ul([new Th((()=>{const t=n.getSignalName(e);return"[".concat(t,".start, ").concat(t,".stop]")}))])}return Ul([{data:n.requestDataName(Ql.Main),field:n.vgField(i,{})}])}}if(u.timeUnit&&st(["time","utc"],t)&&Ca(u,fp(n)?n.encoding[Ze(i)]:void 0,n.markDef,n.config)){const t=n.requestDataName(Ql.Main);return Ul([{data:t,field:n.vgField(i)},{data:t,field:n.vgField(i,{suffix:"end"})}])}return Ul(l?[{data:wt(l)?n.requestDataName(Ql.Main):n.requestDataName(Ql.Raw),field:n.vgField(i),sort:l}]:[{data:n.requestDataName(Ql.Main),field:n.vgField(i)}])}function Lh(t,e){const{op:n,field:i,order:r}=t;return{op:null!==n&&void 0!==n?n:e?"sum":ma,...i?{field:Mt(i)}:{},...r?{order:r}:{}}}function jh(t,e){var n;const i=t.component.scales[e],r=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=fo(r)&&r,s=ni(o)&&ii(o.extent)&&o.extent;(a||s)&&i.set("selectionExtent",null!==a&&void 0!==a?a:s,!0)}function Bh(t,e){const{aggregate:n,type:i}=t;return n?(0,U.HD)(n)&&!Kn.has(n)?{valid:!1,reason:er(n)}:"quantitative"===i&&"log"===e?{valid:!1,reason:nr(t)}:{valid:!0}:{valid:!1,reason:tr(t)}}function Ih(t,e,n,i){return t.explicit&&e.explicit&&dr(function(t,e,n,i){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(rt(n)," and ").concat(rt(i),"). Using the union of the two domains.")}(n,i,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function Uh(t){const e=dt(t.map((t=>{if(fi(t)){const{sort:e,...n}=t;return n}return t})),ot),n=dt(t.map((t=>{if(fi(t)){const e=t.sort;return void 0===e||wt(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}})).filter((t=>void 0!==t)),ot);if(0===e.length)return;if(1===e.length){const e=t[0];if(fi(e)&&n.length>0){let t=n[0];if(n.length>1){dr(or);const e=n.filter((t=>(0,U.Kn)(t)&&"op"in t&&"min"!==t.op));t=!n.every((t=>(0,U.Kn)(t)&&"op"in t))||1!==e.length||e[0]}else if((0,U.Kn)(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return{...e,sort:t}}return e}const i=dt(n.map((t=>wt(t)||!("op"in t)||(0,U.HD)(t.op)&&t.op in Xn?t:(dr(function(t){return"Dropping sort property ".concat(rt(t),' as unioned domains only support boolean or op "count", "min", and "max".')}(t)),!0))),ot);let r;1===i.length?r=i[0]:i.length>1&&(dr(or),r=!0);const o=dt(t.map((t=>fi(t)?t.data:null)),(t=>t));if(1===o.length&&null!==o[0]){return{data:o[0],fields:e.map((t=>t.field)),...r?{sort:r}:{}}}return{fields:e,...r?{sort:r}:{}}}function qh(t){if(fi(t)&&(0,U.HD)(t.field))return t.field;if(function(t){return!(0,U.kJ)(t)&&"fields"in t&&!("data"in t)}(t)){let e;for(const n of t.fields)if(fi(n)&&(0,U.HD)(n.field))if(e){if(e!==n.field)return dr("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),e}else e=n.field;return dr("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),e}if(function(t){return!(0,U.kJ)(t)&&"fields"in t&&"data"in t}(t)){dr("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const e=t.fields[0];return(0,U.HD)(e)?e:void 0}}function Wh(t,e){const n=t.component.scales[e].get("domains").map((e=>(fi(e)&&(e.data=t.lookupDataSource(e.data)),e)));return Uh(n)}function Hh(t){return pp(t)||hp(t)?t.children.reduce(((t,e)=>t.concat(Hh(e))),Xh(t)):Xh(t)}function Xh(t){return bt(t.component.scales).reduce(((e,n)=>{const i=t.component.scales[n];if(i.merged)return e;const r=i.combine(),{name:o,type:a,selectionExtent:s,domains:c,range:l,reverse:u,...f}=r,d=function(t,e,n,i){if(xn(n)){if(ui(t))return{step:{signal:"".concat(e,"_step")}}}else if((0,U.Kn)(t)&&fi(t))return{...t,data:i.lookupDataSource(t.data)};return t}(r.range,o,n,t),h=Wh(t,n),p=s?function(t,e,n,i){const r=Rf(t,e.param,e);return{signal:co(n.get("type"))&&(0,U.kJ)(i)&&i[0]>i[1]?"isValid(".concat(r,") && reverse(").concat(r,")"):r}}(t,s,i,h):null;return e.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==u?{reverse:u}:{},...f}),e}),[])}class Jh extends Bl{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||ct(this.get("domains"),(t=>(0,U.kJ)(t)&&2===t.length&&t[0]<=0&&t[1]>=0))}}const Gh=["range","scheme"];function $h(t,e){const n=t.fieldDef(e);if(null!==n&&void 0!==n&&n.bin){const{bin:i,field:r}=n,o=Ye(e),a=t.getName(o);if((0,U.Kn)(i)&&i.binned&&void 0!==i.step)return new Th((()=>{const n=t.scaleName(e),r='(domain("'.concat(n,'")[1] - domain("').concat(n,'")[0]) / ').concat(i.step);return"".concat(t.getSignalName(a)," / (").concat(r,")")}));if(ti(i)){const e=Hd(t,r,i);return new Th((()=>{const n=t.getSignalName(e),i="(".concat(n,".stop - ").concat(n,".start) / ").concat(n,".step");return"".concat(t.getSignalName(a)," / (").concat(i,")")}))}}}function Zh(t,e){const n=e.specifiedScales[t],{size:i}=e,r=e.getScaleComponent(t).get("type");for(const u of Gh)if(void 0!==n[u]){const i=wo(r,u),o=ko(t,u);if(i)if(o)dr(o);else switch(u){case"range":{const i=n.range;if((0,U.kJ)(i)){if(xn(t))return Il(i.map((t=>{if("width"===t||"height"===t){const n=e.getName(t),i=e.getSignalName.bind(e);return Th.fromName(i,n)}return t})))}else if((0,U.Kn)(i))return Il({data:e.requestDataName(Ql.Main),field:i.field,sort:{op:"min",field:e.vgField(t)}});return Il(i)}case"scheme":return Il(Yh(n[u]))}else dr(ir(r,u,t))}const o=t===Xt||"xOffset"===t?"width":"height",a=i[o];if(bc(a))if(xn(t))if(so(r)){const n=Vh(a,e,t);if(n)return Il({step:n})}else dr(rr(o));else if(Dn(t)){const n=t===Zt?"x":"y";if("band"===e.getScaleComponent(n).get("type")){const t=Kh(a,r);if(t)return Il(t)}}const{rangeMin:s,rangeMax:c}=n,l=function(t,e){const{size:n,config:i,mark:r,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=is(o[t]),c=e.getScaleComponent(t),l=c.get("type"),{domain:u,domainMid:f}=e.specifiedScales[t];switch(t){case Xt:case Jt:{if(st(["point","band"],l)){const r=Qh(t,n,i.view);if(bc(r)){return{step:Vh(r,e,t)}}}const r=Ye(t),o=e.getName(r);return t===Jt&&co(l)?[Th.fromName(a,o),0]:[0,Th.fromName(a,o)]}case Zt:case Yt:return function(t,e,n){const i=t===Zt?"x":"y",r=e.getScaleComponent(i),o=r.get("type"),a=e.scaleName(i);if("band"===o){const t=Qh(i,e.size,e.config.view);if(bc(t)){const e=Kh(t,n);if(e)return e}return[0,{signal:"bandwidth('".concat(a,"')")}]}{const n=e.encoding[i];if(Na(n)&&n.timeUnit){const t=Fr(n.timeUnit,(t=>"scale('".concat(a,"', ").concat(t,")"))),i=e.config.scale.bandWithNestedOffsetPaddingInner;if(i){const e=li(i)?"".concat(i.signal,"/2"):"".concat(i/2),n=li(i)?"(1 - ".concat(i.signal,"/2)"):"".concat(1-i/2);return[{signal:"".concat(e," * (").concat(t,")")},{signal:"".concat(n," * (").concat(t,")")}]}return[0,{signal:t}]}return et("Cannot use ".concat(t," scale if ").concat(i," scale is not discrete."))}}(t,e,l);case le:{const o=tp(r,e.component.scales[t].get("zero"),i),a=function(t,e,n,i){const r={x:$h(n,"x"),y:$h(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const t=np(e,r,i.view);return(0,U.hj)(t)?t-1:new Th((()=>"".concat(t.signal," - 1")))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const t=np(e,r,i.view);return(0,U.hj)(t)?Math.pow(ep*t,2):new Th((()=>"pow(".concat(ep," * ").concat(t.signal,", 2)")))}}throw new Error(Zi("size",t))}(r,n,e,i);return uo(l)?function(t,e,n){const i=()=>{const i=xi(e),r=xi(t),o="(".concat(i," - ").concat(r,") / (").concat(n," - 1)");return"sequence(".concat(r,", ").concat(i," + ").concat(o,", ").concat(o,")")};return li(e)?new Th(i):{signal:i()}}(o,a,function(t,e,n,i){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&(0,U.kJ)(n)?n.length+1:(dr(function(t){return"Domain for ".concat(t," is required for threshold scale.")}(i)),3)}}(l,i,u,t)):[o,a]}case Qt:return[0,2*Math.PI];case ue:return[0,360];case Vt:return[0,new Th((()=>{const t=e.getSignalName("width"),n=e.getSignalName("height");return"min(".concat(t,",").concat(n,")/2")}))];case pe:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case me:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ce:return"symbol";case oe:case ae:case se:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case fe:case de:case he:return[i.scale.minOpacity,i.scale.maxOpacity]}}(t,e);return(void 0!==s||void 0!==c)&&wo(r,"rangeMin")&&(0,U.kJ)(l)&&2===l.length?Il([null!==s&&void 0!==s?s:l[0],null!==c&&void 0!==c?c:l[1]]):Ul(l)}function Yh(t){return function(t){return!(0,U.HD)(t)&&!!t.name}(t)?{scheme:t.name,...it(t,["name"])}:{scheme:t}}function Vh(t,e,n){const{encoding:i}=e,r=e.getScaleComponent(n),o=Ke(n),a=i[o];if("offset"===yc({step:t,offsetIsDiscrete:Ba(a)&&Hr(a.type)})&&Es(i,o)){var s;const n=e.getScaleComponent(o),i=e.scaleName(o);let a="domain('".concat(i,"').length");if("band"===n.get("type")){var c,l,u,f;const t=null!==(c=null!==(l=n.get("paddingInner"))&&void 0!==l?l:n.get("padding"))&&void 0!==c?c:0,e=null!==(u=null!==(f=n.get("paddingOuter"))&&void 0!==f?f:n.get("padding"))&&void 0!==u?u:0;a="bandspace(".concat(a,", ").concat(t,", ").concat(e,")")}const h=null!==(s=r.get("paddingInner"))&&void 0!==s?s:r.get("padding");return{signal:"".concat(t.step," * ").concat(a," / (1-").concat((d=h,li(d)?d.signal:(0,U.m8)(d)),")")}}return t.step;var d}function Kh(t,e){if("offset"===yc({step:t,offsetIsDiscrete:so(e)}))return{step:t.step}}function Qh(t,e,n){const i=t===Xt?"width":"height",r=e[i];return r||Ec(n,i)}function tp(t,e,n){if(e)return li(e)?{signal:"".concat(e.signal," ? 0 : ").concat(tp(t,!1,n))}:0;switch(t){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Zi("size",t))}const ep=.95;function np(t,e,n){const i=bc(t.width)?t.width.step:kc(n,"width"),r=bc(t.height)?t.height.step:kc(n,"height");return e.x||e.y?new Th((()=>{const t=[e.x?e.x.signal:i,e.y?e.y.signal:r];return"min(".concat(t.join(", "),")")})):Math.min(i,r)}function ip(t,e){fp(t)?function(t,e){const n=t.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:a}=t;for(const s of bt(n)){const c=a[s],l=n[s],u=t.getScaleComponent(s),f=is(r[s]),d=c[e],h=u.get("type"),p=u.get("padding"),m=u.get("paddingInner"),g=wo(h,e),v=ko(s,e);if(void 0!==d&&(g?v&&dr(v):dr(ir(h,e,s))),g&&void 0===v)if(void 0!==d){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":hr(c[e])||"temporal"===n||t?l.set(e,{signal:us(c[e],{type:n,timeUnit:t})},!0):l.set(e,c[e],!0);break;default:l.copyKeyFromObject(e,c)}}else{const n=e in rp?rp[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:o,config:i,hasNestedOffsetScale:Ds(r,s),hasSecondaryRangeChannel:!!r[Ze(s)]}):i.scale[e];void 0!==n&&l.set(e,n,!1)}}}(t,e):ap(t,e)}const rp={bins:t=>{let{model:e,fieldOrDatumDef:n}=t;return Na(n)?function(t,e){const n=e.bin;if(ti(n)){const i=Hd(t,e.field,n);return new Th((()=>t.getSignalName(i)))}if(ei(n)&&ni(n)&&void 0!==n.step)return{step:n.step};return}(e,n):void 0},interpolate:t=>{let{channel:e,fieldOrDatumDef:n}=t;return function(t,e){if(st([oe,ae,se],t)&&"nominal"!==e)return"hcl";return}(e,n.type)},nice:t=>{let{scaleType:e,channel:n,domain:i,domainMin:r,domainMax:o,fieldOrDatumDef:a}=t;return function(t,e,n,i,r,o){var a;if(null!==(a=ns(o))&&void 0!==a&&a.bin||(0,U.kJ)(n)||null!=r||null!=i||st([Yr.TIME,Yr.UTC],t))return;return!!xn(e)||void 0}(e,n,i,r,o,a)},padding:t=>{let{channel:e,scaleType:n,fieldOrDatumDef:i,markDef:r,config:o}=t;return function(t,e,n,i,r,o){if(xn(t)){if(lo(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=r;if("bar"===e&&(!Na(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===Yr.POINT)return n.pointPadding}return}(e,n,o.scale,i,r,o.bar)},paddingInner:t=>{let{scalePadding:e,channel:n,markDef:i,scaleType:r,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==t)return;if(xn(e)){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:a}=r;return o?a:zt(t,"bar"===n?e:i)}if(Dn(e)&&i===Yr.BAND)return r.offsetBandPaddingInner;return}(e,n,i.type,r,o.scale,a)},paddingOuter:t=>{let{scalePadding:e,channel:n,scaleType:i,scalePaddingInner:r,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==t)return;if(xn(e)){const{bandPaddingOuter:t,bandWithNestedOffsetPaddingOuter:e}=r;if(o)return e;if(n===Yr.BAND)return zt(t,li(i)?{signal:"".concat(i.signal,"/2")}:i/2)}else if(Dn(e)){if(n===Yr.POINT)return.5;if(n===Yr.BAND)return r.offsetBandPaddingOuter}return}(e,n,i,r,o.scale,a)},reverse:t=>{let{fieldOrDatumDef:e,scaleType:n,channel:i,config:r}=t;return function(t,e,n,i){if("x"===n&&void 0!==i.xReverse)return co(t)&&"descending"===e?li(i.xReverse)?{signal:"!".concat(i.xReverse.signal)}:!i.xReverse:i.xReverse;if(co(t)&&"descending"===e)return!0;return}(n,Na(e)?e.sort:void 0,i,r.scale)},zero:t=>{let{channel:e,fieldOrDatumDef:n,domain:i,markDef:r,scaleType:o,config:a,hasSecondaryRangeChannel:s}=t;return function(t,e,n,i,r,o,a){if(n&&"unaggregated"!==n&&co(r)){if((0,U.kJ)(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!uo(r))return!0;if((!Na(e)||!e.bin)&&st([...bn,...wn],t)){const{orient:e,type:n}=i;return(!st(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t))&&(!(!st(["bar","area"],n)||a)||(null===o||void 0===o?void 0:o.zero))}return!1}(e,n,i,r,o,a.scale,s)}};function op(t){fp(t)?function(t){const e=t.component.scales;for(const n of Ln){const i=e[n];if(!i)continue;const r=Zh(n,t);i.setWithExplicit("range",r)}}(t):ap(t,"range")}function ap(t,e){const n=t.component.scales;for(const i of t.children)"range"===e?op(i):ip(i,e);for(const i of bt(n)){let r;for(const n of t.children){const t=n.component.scales[i];if(t){r=Hl(r,t.getWithExplicit(e),e,"scale",ql(((t,n)=>"range"===e&&t.step&&n.step?t.step-n.step:0)))}}n[i].setWithExplicit(e,r)}}function sp(t,e,n,i){const r=function(t,e,n,i){switch(e.type){case"nominal":case"ordinal":var r;if(Oe(t)||"discrete"===Wn(t))return"shape"===t&&"ordinal"===e.type&&dr(Qi(t,"ordinal")),"ordinal";if(xn(t)||Dn(t)){if(st(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&t in _n)return"band";return Jo(n[Ye(t)])||Wa(e)&&null!==(r=e.axis)&&void 0!==r&&r.tickBand?"band":"point";case"temporal":return Oe(t)?"time":"discrete"===Wn(t)?(dr(Qi(t,"temporal")),"ordinal"):Na(e)&&e.timeUnit&&Cr(e.timeUnit).utc?"utc":"time";case"quantitative":return Oe(t)?Na(e)&&ti(e.bin)?"bin-ordinal":"linear":"discrete"===Wn(t)?(dr(Qi(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Ji(e.type))}(e,n,i,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:o}=t;return jn(e)?void 0!==o?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!jn(t))return!1;switch(t){case Xt:case Jt:case Zt:case Yt:case Qt:case Vt:return!!lo(e)||"band"===e||"point"===e&&!n;case le:case pe:case fe:case de:case he:case ue:return lo(e)||uo(e)||st(["band","point","ordinal"],e);case oe:case ae:case se:return"band"!==e;case me:case ce:return"ordinal"===e||uo(e)}}(e,o)?Na(n)&&(a=o,s=n.type,!(st([Jr,$r],s)?void 0===a||so(a):s===Gr?st([Yr.TIME,Yr.UTC,void 0],a):s!==Xr||io(a)||uo(a)||void 0===a))?(dr(function(t,e){return'FieldDef does not work with "'.concat(t,'" scale. We are using "').concat(e,'" scale instead.')}(o,r)),r):o:(dr(function(t,e,n){return'Channel "'.concat(t,'" does not work with "').concat(e,'" scale. We are using "').concat(n,'" scale instead.')}(e,o,r)),r):r:null;var a,s}function cp(t){fp(t)?t.component.scales=function(t){const{encoding:e,mark:n,markDef:i}=t,r={};for(const a of Ln){const s=is(e[a]);if(s&&n===jo&&a===ce&&s.type===Zr)continue;let c=s&&s.scale;if(Dn(a)){if(!Ds(e,Qe(a))){c&&dr(Yi(a));continue}}if(s&&null!==c&&!1!==c){var o;null!==(o=c)&&void 0!==o||(c={});const n=sp(c,a,s,i,Ds(e,a));r[a]=new Jh(t.scaleName("".concat(a),!0),{value:n,explicit:c.type===n})}}return r}(t):t.component.scales=function(t){var e;const n=t.component.scales={},i={},r=t.component.resolve;for(const a of t.children){cp(a);for(const n of bt(a.component.scales)){var o;if(null!==(o=(e=r.scale)[n])&&void 0!==o||(e[n]=vd(n,t)),"shared"===r.scale[n]){const t=i[n],e=a.component.scales[n].getWithExplicit("type");t?Kr(t.value,e.value)?i[n]=Hl(t,e,"type","scale",lp):(r.scale[n]="independent",delete i[n]):i[n]=e}}}for(const a of bt(i)){const e=t.scaleName(a,!0),r=i[a];n[a]=new Jh(e,r);for(const n of t.children){const t=n.component.scales[a];t&&(n.renameScale(t.get("name"),e),t.merged=!0)}}return n}(t)}const lp=ql(((t,e)=>to(t)-to(e)));class up{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function fp(t){return"unit"===(null===t||void 0===t?void 0:t.type)}function dp(t){return"facet"===(null===t||void 0===t?void 0:t.type)}function hp(t){return"concat"===(null===t||void 0===t?void 0:t.type)}function pp(t){return"layer"===(null===t||void 0===t?void 0:t.type)}class mp{constructor(t,e,n,i,r,o,a){var s,c;this.type=e,this.parent=n,this.config=r,this.correctDataNames=t=>{var e,n,i;return null!==(e=t.from)&&void 0!==e&&e.data&&(t.from.data=this.lookupDataSource(t.from.data)),null!==(n=t.from)&&void 0!==n&&null!==(i=n.facet)&&void 0!==i&&i.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t},this.parent=n,this.config=r,this.view=ai(a),this.name=null!==(s=t.name)&&void 0!==s?s:i,this.title=ci(t.title)?{text:t.title}:t.title?ai(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new up,this.projectionNameMap=n?n.projectionNameMap:new up,this.signalNameMap=n?n.signalNameMap:new up,this.data=t.data,this.description=t.description,this.transforms=(null!==(c=t.transform)&&void 0!==c?c:[]).map((t=>sl(t)?{filter:K(t.filter,Ur)}:t)),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){const i=n[e],r={},{spacing:o,columns:a}=i;void 0!==o&&(r.spacing=o),void 0!==a&&(ka(t)&&!_a(t.facet)||mc(t))&&(r.columns=a),gc(t)&&(r.columns=1);for(const l of _c)if(void 0!==t[l])if("spacing"===l){var s,c;const e=t[l];r[l]=(0,U.hj)(e)?e:{row:null!==(s=e.row)&&void 0!==s?s:o,column:null!==(c=e.column)&&void 0!==c?c:o}}else r[l]=t[l];return r}(t,e,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:ka(t)||(null===n||void 0===n?void 0:n.component.data.isFaceted)&&void 0===t.data},layoutSize:new Bl,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?tt(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(t){let{ignoreRange:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cp(t),Nh(t);for(const n of _o)ip(t,n);e||op(t)}(this)}parseProjection(){Ud(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Od(this)}assembleEncodeFromView(t){const{style:e,...n}=t,i={};for(const r of bt(n)){const t=n[r];void 0!==t&&(i[r]=yi(t))}return i}assembleGroupEncodeEntry(t){let e={};var n;if((this.view&&(e=this.assembleEncodeFromView(this.view)),!t)&&(this.description&&(e.description=yi(this.description)),"unit"===this.type||"layer"===this.type))return{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...null!==(n=e)&&void 0!==n?n:{}};return yt(e)?void 0:e}assembleLayout(){if(!this.layout)return;const{spacing:t,...e}=this.layout,{component:n,config:i}=this,r=function(t,e){const n={};for(const i of Ne){const r=t[i];if(null!==r&&void 0!==r&&r.facetFieldDef){const{titleAnchor:t,titleOrient:o}=Kf(["titleAnchor","titleOrient"],r.facetFieldDef.header,e,i),a=Yf(i,o),s=ld(t,a);void 0!==s&&(n[a]=s)}}return yt(n)?void 0:n}(n.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...e,...r?{titleBand:r}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of Ne)t[n].title&&e.push(ed(this,n));for(const n of Qf)e=e.concat(rd(this,n));return e}assembleAxes(){return function(t,e){const{x:n=[],y:i=[]}=t;return[...n.map((t=>jf(t,"grid",e))),...i.map((t=>jf(t,"grid",e))),...n.map((t=>jf(t,"main",e))),...i.map((t=>jf(t,"main",e)))].filter((t=>t))}(this.component.axes,this.config)}assembleLegends(){return Pd(this)}assembleProjections(){return Ld(this)}assembleTitle(){var t;const{encoding:e,...n}=null!==(t=this.title)&&void 0!==t?t:{},i={...si(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(i.text){var r,o;if(st(["unit","layer"],this.type)){if(st(["middle",void 0],i.anchor))null!==(r=i.frame)&&void 0!==r||(i.frame="group")}else null!==(o=i.anchor)&&void 0!==o||(i.anchor="start");return yt(i)?void 0:i}}assembleGroup(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={};t=t.concat(this.assembleSignals()),t.length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||dp(this.parent)?Hh(this):[];i.length>0&&(e.scales=i);const r=this.assembleAxes();r.length>0&&(e.axes=r);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return kt((this.name?"".concat(this.name,"_"):"")+t)}getDataName(t){return this.getName(Ql[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(dp(this.parent)){const e=kn(md(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),i=n.get("range");if(so(t)&&ui(i)){const t=n.get("name"),i=qh(Wh(this,e));if(i){return{signal:pd(t,n,Ga({aggregate:"distinct",field:i},{expr:"datum"}))}}return dr(Pi(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):He(t)&&jn(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error('Cannot find a selection named "'.concat(e,'".'));return n}hasAxisOrientSignalRef(){var t,e;return(null===(t=this.component.axes.x)||void 0===t?void 0:t.some((t=>t.hasOrientSignalRef())))||(null===(e=this.component.axes.y)||void 0===e?void 0:e.some((t=>t.hasOrientSignalRef())))}}class gp extends mp{vgField(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(t);if(n)return Ga(n,e)}reduceFieldDef(t,e){return function(t,e,n,i){return t?bt(t).reduce(((n,r)=>{const o=t[r];return(0,U.kJ)(o)?o.reduce(((t,n)=>e.call(i,t,n,r)),n):e.call(i,n,o,r)}),n):n}(this.getMapping(),((e,n,i)=>{const r=ns(n);return r?t(e,r,i):e}),e)}forEachFieldDef(t,e){Ms(this.getMapping(),((e,n)=>{const i=ns(e);i&&t(i,n)}),e)}}class vp extends su{clone(){return new vp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"value",null!==(r=o[1])&&void 0!==r?r:"density"],e.groupby&&null==e.minsteps&&null==e.maxsteps&&null==e.steps&&(this.transform.steps=200)}dependentFields(){var t;return new Set([this.transform.density,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform ".concat(ot(this.transform))}assemble(){const{density:t,...e}=this.transform;return{type:"kde",field:t,...e}}}class yp extends su{clone(){return new yp(null,{...this.filter})}constructor(t,e){super(t),this.filter=e}static make(t,e){const{config:n,mark:i,markDef:r}=e;if("filter"!==ki("invalid",r,n))return null;const o=e.reduceFieldDef(((t,n,r)=>{const o=jn(r)&&e.getScaleComponent(r);if(o){co(o.get("type"))&&"count"!==n.aggregate&&!Bo(i)&&(t[n.field]=n)}return t}),{});return bt(o).length?new yp(t,o):null}dependentFields(){return new Set(bt(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid ".concat(ot(this.filter))}assemble(){const t=bt(this.filter).reduce(((t,e)=>{const n=this.filter[e],i=Ga(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push("(isDate(".concat(i,") || (isValid(").concat(i,") && isFinite(+").concat(i,")))")):"quantitative"===n.type&&(t.push("isValid(".concat(i,")")),t.push("isFinite(+".concat(i,")")))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class bp extends su{clone(){return new bp(this.parent,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=tt(e);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((t,e)=>{var n;return null!==(n=i[e])&&void 0!==n?n:t}))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform ".concat(ot(this.transform))}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class xp extends su{clone(){return new xp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"key",null!==(r=o[1])&&void 0!==r?r:"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform ".concat(ot(this.transform))}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class _p extends su{clone(){return new _p(null,tt(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const i of[[ne,ee],[re,ie]]){const r=i.map((t=>{const n=is(e.encoding[t]);return Na(n)?n.field:Ra(n)?{expr:"".concat(n.datum)}:Ua(n)?{expr:"".concat(n.value)}:void 0}));(r[0]||r[1])&&(t=new _p(t,r,null,e.getName("geojson_".concat(n++))))}if(e.channelHasField(ce)){const i=e.typedFieldDef(ce);i.type===Zr&&(t=new _p(t,null,i.field,e.getName("geojson_".concat(n++))))}return t}constructor(t,e,n,i){super(t),this.fields=e,this.geojson=n,this.signal=i}dependentFields(){var t;const e=(null!==(t=this.fields)&&void 0!==t?t:[]).filter(U.HD);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return"GeoJSON ".concat(this.geojson," ").concat(this.signal," ").concat(ot(this.fields))}assemble(){return[...this.geojson?[{type:"filter",expr:'isValid(datum["'.concat(this.geojson,'"])')}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class wp extends su{clone(){return new wp(null,this.projection,tt(this.fields),tt(this.as))}constructor(t,e,n,i){super(t),this.projection=e,this.fields=n,this.as=i}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[[ne,ee],[re,ie]]){const i=n.map((t=>{const n=is(e.encoding[t]);return Na(n)?n.field:Ra(n)?{expr:"".concat(n.datum)}:Ua(n)?{expr:"".concat(n.value)}:void 0})),r=n[0]===re?"2":"";(i[0]||i[1])&&(t=new wp(t,e.projectionName(),i,[e.getName("x".concat(r)),e.getName("y".concat(r))]))}return t}dependentFields(){return new Set(this.fields.filter(U.HD))}producedFields(){return new Set(this.as)}hash(){return"Geopoint ".concat(this.projection," ").concat(ot(this.fields)," ").concat(ot(this.as))}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class kp extends su{clone(){return new kp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){var t;return new Set([this.transform.impute,this.transform.key,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:i}=t,r=[e,n,...i?[i]:[]].join(",");return{signal:"sequence(".concat(r,")")}}static makeFromTransform(t,e){return new kp(t,e)}static makeFromEncoding(t,e){const n=e.encoding,i=n.x,r=n.y;if(Na(i)&&Na(r)){const o=i.impute?i:r.impute?r:void 0;if(void 0===o)return;const a=i.impute?r:r.impute?i:void 0,{method:s,value:c,frame:l,keyvals:u}=o.impute,f=Os(e.mark,n);return new kp(t,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==c?{value:c}:{},...l?{frame:l}:{},...void 0!==u?{keyvals:u}:{},...f.length?{groupby:f}:{}})}return null}hash(){return"Impute ".concat(ot(this.transform))}assemble(){const{impute:t,key:e,keyvals:n,method:i,groupby:r,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:t,key:e,...n?{keyvals:cl(n)?this.processSequence(n):n}:{},method:"value",...r?{groupby:r}:{},value:i&&"value"!==i?null:o};if(i&&"value"!==i){return[s,{type:"window",as:["imputed_".concat(t,"_value")],ops:[i],fields:[t],frame:a,ignorePeers:!1,...r?{groupby:r}:{}},{type:"formula",expr:"datum.".concat(t," === null ? datum.imputed_").concat(t,"_value : datum.").concat(t),as:t}]}return[s]}}class Ep extends su{clone(){return new Ep(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:e.on,null!==(r=o[1])&&void 0!==r?r:e.loess]}dependentFields(){var t;return new Set([this.transform.loess,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform ".concat(ot(this.transform))}assemble(){const{loess:t,on:e,...n}=this.transform;return{type:"loess",x:e,y:t,...n}}}class Dp extends su{clone(){return new Dp(null,tt(this.transform),this.secondary)}constructor(t,e,n){super(t),this.transform=e,this.secondary=n}static make(t,e,n,i){const r=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=Ip(o.data,r);t||(t=new ih(o.data),r.push(t));const n=e.getName("lookup_".concat(i));a=new cu(t,n,Ql.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=a}else if(function(t){return"param"in t}(o)){const t=o.param;let i;n={as:t,...n};try{i=e.getSelectionComponent(kt(t),t)}catch(s){throw new Error('Lookups can only be performed on selection parameters. "'.concat(t,'" is a variable parameter.'))}if(a=i.materialized,!a)throw new Error(function(t){return'Cannot define and lookup the "'.concat(t,'" selection in the same view. ')+"Try moving the lookup into a second, layered view?"}(t))}return new Dp(t,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,U.IX)(this.transform.as):this.transform.from.fields)}hash(){return"Lookup ".concat(ot({transform:this.transform,secondary:this.secondary}))}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:(0,U.IX)(this.transform.as)}:{}};else{let e=this.transform.as;(0,U.HD)(e)||(dr('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),e="_lookup"),t={as:[e]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Ap extends su{clone(){return new Ap(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"prob",null!==(r=o[1])&&void 0!==r?r:"value"]}dependentFields(){var t;return new Set([this.transform.quantile,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform ".concat(ot(this.transform))}assemble(){const{quantile:t,...e}=this.transform;return{type:"quantile",field:t,...e}}}class Sp extends su{clone(){return new Sp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:e.on,null!==(r=o[1])&&void 0!==r?r:e.regression]}dependentFields(){var t;return new Set([this.transform.regression,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform ".concat(ot(this.transform))}assemble(){const{regression:t,on:e,...n}=this.transform;return{type:"regression",x:e,y:t,...n}}}class Cp extends su{clone(){return new Cp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){var e;this.transform.groupby=dt((null!==(e=this.transform.groupby)&&void 0!==e?e:[]).concat(t),(t=>t))}producedFields(){}dependentFields(){var t;return new Set([this.transform.pivot,this.transform.value,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}hash(){return"PivotTransform ".concat(ot(this.transform))}assemble(){const{pivot:t,value:e,groupby:n,limit:i,op:r}=this.transform;return{type:"pivot",field:t,value:e,...void 0!==i?{limit:i}:{},...void 0!==r?{op:r}:{},...void 0!==n?{groupby:n}:{}}}}class Fp extends su{clone(){return new Fp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform ".concat(ot(this.transform))}assemble(){return{type:"sample",size:this.transform.sample}}}function Mp(t){let e=0;return function n(i,r){if(i instanceof ih&&!i.isGenerator&&!Jl(i.data)){t.push(r);r={name:null,source:r.name,transform:[]}}var o;if(i instanceof Qd&&(i.parent instanceof ih&&!r.source?(r.format={...null!==(o=r.format)&&void 0!==o?o:{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Zd)return r.name||(r.name="data_".concat(e++)),!r.source||r.transform.length>0?(t.push(r),i.data=r.name):i.data=r.source,void t.push(...i.assemble());if((i instanceof eh||i instanceof nh||i instanceof yp||i instanceof Nf||i instanceof $f||i instanceof wp||i instanceof $d||i instanceof Dp||i instanceof Eh||i instanceof wh||i instanceof xp||i instanceof bp||i instanceof vp||i instanceof Ep||i instanceof Ap||i instanceof Sp||i instanceof th||i instanceof Fp||i instanceof Cp)&&r.transform.push(i.assemble()),(i instanceof Jd||i instanceof lu||i instanceof kp||i instanceof kh||i instanceof _p)&&r.transform.push(...i.assemble()),i instanceof cu)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof cu)i.setSource(r.name);else if(r.name||(r.name="data_".concat(e++)),i.setSource(r.name),1===i.numChildren()){t.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof cu&&(!r.source||r.transform.length>0)&&t.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_".concat(e++));let o=r.name;!r.source||r.transform.length>0?t.push(r):o=r.source;for(const t of i.children){n(t,{name:null,source:o,transform:[]})}break}}}}function Op(t){return"top"===t||"left"===t||li(t)?"header":"footer"}function Tp(t,e){const{facet:n,config:i,child:r,component:o}=t;if(t.channelHasField(e)){var a;const s=n[e],c=Vf("title",null,i,e);let l=Ka(s,i,{allowDisabling:!0,includeDefault:void 0===c||!!c});r.component.layoutHeaders[e].title&&(l=(0,U.kJ)(l)?l.join(", "):l,l+=" / ".concat(r.component.layoutHeaders[e].title),r.component.layoutHeaders[e].title=null);const u=Vf("labelOrient",s.header,i,e),f=null!==s.header&&zt(null===(a=s.header)||void 0===a?void 0:a.labels,i.header.labels,!0),d=st(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:null!==s.header?l:null,facetFieldDef:s,[d]:"facet"===e?[]:[Np(t,e,f)]}}}function Np(t,e,n){const i="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(i)?t.child.getSizeSignalRef(i):void 0,axes:[]}}function zp(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:o}=t.component;if(o.axis[e]=yd(o,e),"shared"===o.axis[e]){const o="x"===e?"column":"row",a=r[o];for(const r of n.component.axes[e]){var i;const e=Op(r.get("orient"));null!==(i=a[e])&&void 0!==i||(a[e]=[Np(t,o,!1)]);const n=jf(r,"main",t.config,{header:!0});n&&a[e][0].axes.push(n),r.mainExtracted=!0}}}}function Rp(t){for(const e of t.children)e.parseLayoutSize()}function Pp(t,e){const n=md(e),i=kn(n),r=t.component.resolve,o=t.component.layoutSize;let a;for(const c of t.children){var s;const e=c.component.layoutSize.getWithExplicit(n),o=null!==(s=r.scale[i])&&void 0!==s?s:vd(i,t);if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Hl(a,e,n,"")}else a=e}if(a){for(const i of t.children)t.renameSignal(i.getName(n),t.getName(e)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Lp(t,e){const n="width"===e?"x":"y",i=t.config,r=t.getScaleComponent(n);if(r){const t=r.get("type"),n=r.get("range");if(so(t)){const t=Ec(i.view,e);return ui(n)||bc(t)?"step":t}return wc(i.view,e)}if(t.hasProjection||"arc"===t.mark)return wc(i.view,e);{const t=Ec(i.view,e);return bc(t)?t.step:t}}function jp(t,e,n){return Ga(e,{suffix:"by_".concat(Ga(t)),...null!==n&&void 0!==n?n:{}})}class Bp extends gp{constructor(t,e,n,i){super(t,"facet",e,n,i,t.resolve),this.child=hm(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!_a(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=bt(t),n={};for(const i of e){if(![qt,Wt].includes(i)){dr(Zi(i,"facet"));break}const e=t[i];if(void 0===e.field){dr($i(e,i));break}n[i]=this.initFacetFieldDef(e,i)}return n}initFacetFieldDef(t,e){const n=as(t,e);return n.header?n.header=ai(n.header):null===n.header&&(n.header=null),n}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Up(this),this.child.parseData()}parseLayoutSize(){Rp(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of Ne)Tp(t,e);zp(t,"x"),zp(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const r of Ne)for(const o of td){const a=this.component.layoutHeaders[r],s=a[o],{facetFieldDef:c}=a;if(c){const n=Vf("titleOrient",c.header,this.config,r);if(["right","bottom"].includes(n)){var e;const i=Yf(r,n);null!==(e=t.titleAnchor)&&void 0!==e||(t.titleAnchor={}),t.titleAnchor[i]="end"}}if(null!==s&&void 0!==s&&s[0]){const e="row"===r?"height":"width",s="header"===o?"headerBand":"footerBand";var n,i;if("facet"!==r&&!this.child.component.layoutSize.get(e))null!==(n=t[s])&&void 0!==n||(t[s]={}),t[s][r]=.5;if(a.title)null!==(i=t.offset)&&void 0!==i||(t.offset={}),t.offset["row"===r?"rowTitle":"columnTitle"]=10}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let i="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Bp)){const t=this.getName("column_domain");return{signal:"length(data('".concat(t,"'))")}}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Bp?{...this.channelHasField("column")?{encode:{update:{columns:{field:Ga(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof Bp){if(this.child.channelHasField("column")){const i=Ga(this.child.facet.column);t.push(i),e.push("distinct"),n.push("distinct_".concat(i))}}else for(const i of bn){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(so(o)&&ui(a)){const r=qh(Wh(this.child,i));r?(t.push(r),e.push("distinct"),n.push("distinct_".concat(r))):dr(Pi(i))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const l of Ne){const t=this.facet[l];if(t){s.push(Ga(t));const{bin:e,sort:c}=t;if(ti(e)&&s.push(Ga(t,{binSuffix:"end"})),ba(c)){const{field:e,op:s=ma}=c,l=jp(t,c);n&&i?(r.push(l),o.push("max"),a.push(l)):(r.push(e),o.push(s),a.push(l))}else if((0,U.kJ)(c)){const e=Zf(t,l);r.push(e),o.push("max"),a.push(e)}}}const c=!!n&&!!i;return{name:t,data:e,groupby:s,...c||r.length>0?{aggregate:{...c?{cross:c}:{},...r.length?{fields:r,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:e}=this,n=e[t];return n?ba(n.sort)?[jp(n,n.sort,{expr:"datum"})]:(0,U.kJ)(n.sort)?[Zf(n,t,{expr:"datum"})]:[Ga(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(ba(t)?t.order:!(0,U.kJ)(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:e}=this;if(t.facet)return ad(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const r of Qf)if(t[r]){var i;const o=Vf("labelOrient",null===(i=t[r])||void 0===i?void 0:i.header,e,r);if(n[r].includes(o))return ad(t[r],r,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=Mp(e);for(const i of t.children)n(i,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||t.assembleTitle(),r=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...r?{style:r}:{},from:{facet:this.assembleFacet()},sort:{field:Ne.map((t=>this.facetSortFields(t))).flat(),order:Ne.map((t=>this.facetSortOrder(t))).flat()},...e.length>0?{data:e}:{},...n?{encode:{update:n}}:{},...t.assembleGroup(ru(this,[]))}]}getMapping(){return this.facet}}function Ip(t,e){for(const a of e){var n,i,r,o;const e=a.data;if(t.name&&a.hasName()&&t.name!==a.dataName)continue;const s=null===(n=t.format)||void 0===n?void 0:n.mesh,c=null===(i=e.format)||void 0===i?void 0:i.feature;if(s&&c)continue;const l=null===(r=t.format)||void 0===r?void 0:r.feature;if((l||c)&&l!==c)continue;const u=null===(o=e.format)||void 0===o?void 0:o.mesh;if(!s&&!u||s===u)if(Gl(t)&&Gl(e)){if(Q(t.values,e.values))return a}else if(Jl(t)&&Jl(e)){if(t.url===e.url)return a}else if($l(t)&&t.name===a.dataName)return a}return null}function Up(t){var e,n,i;let r=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new ih({values:[]});return e.push(t),t}const n=Ip(t.data,e);if(n)return Zl(t.data)||(n.data.format=ut({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new ih(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:o,outputNodeRefCounts:a}=t.component.data,s=t.data,c=!(s&&(Zl(s)||Jl(s)||Gl(s)))&&t.parent?t.parent.component.data.ancestorParse.clone():new Xl;Zl(s)?(Yl(s)?r=new nh(r,s.sequence):Kl(s)&&(r=new eh(r,s.graticule)),c.parseNothing=!0):null===(null===s||void 0===s||null===(e=s.format)||void 0===e?void 0:e.parse)&&(c.parseNothing=!0),r=null!==(n=Qd.makeExplicit(r,t,c))&&void 0!==n?n:r,r=new th(r);const l=t.parent&&pp(t.parent);var u;(fp(t)||dp(t))&&(l&&(r=null!==(u=Jd.makeFromEncoding(r,t))&&void 0!==u?u:r));t.transforms.length>0&&(r=function(t,e,n){let i=0;for(const a of e.transforms){let s,c;if(bl(a))c=t=new $f(t,a),s="derived";else if(sl(a)){var r;const i=Vd(a);c=t=null!==(r=Qd.makeWithAncestors(t,{},i,n))&&void 0!==r?r:t,t=new Nf(t,e,a.filter)}else if(xl(a))c=t=Jd.makeFromTransform(t,a,e),s="number";else if(wl(a))s="date",void 0===n.getWithExplicit(a.field).value&&(t=new Qd(t,{[a.field]:s}),n.set(a.field,s,!1)),c=t=lu.makeFromTransform(t,a);else if(kl(a))c=t=$d.makeFromTransform(t,a),s="number",Sf(e)&&(t=new th(t));else if(ll(a))c=t=Dp.make(t,e,a,i++),s="derived";else if(gl(a))c=t=new Eh(t,a),s="number";else if(vl(a))c=t=new wh(t,a),s="number";else if(El(a))c=t=kh.makeFromTransform(t,a),s="derived";else if(Dl(a))c=t=new xp(t,a),s="derived";else if(yl(a))c=t=new bp(t,a),s="derived";else if(ul(a))c=t=new Cp(t,a),s="derived";else if(ml(a))t=new Fp(t,a);else if(_l(a))c=t=kp.makeFromTransform(t,a),s="derived";else if(fl(a))c=t=new vp(t,a),s="derived";else if(dl(a))c=t=new Ap(t,a),s="derived";else if(hl(a))c=t=new Sp(t,a),s="derived";else{if(!pl(a)){dr("Ignoring an invalid transform: ".concat(rt(a),"."));continue}c=t=new Ep(t,a),s="derived"}if(c&&void 0!==s)for(const t of null!==(o=c.producedFields())&&void 0!==o?o:[]){var o;n.set(t,s,!1)}}return t}(r,t,c));const f=function(t){const e={};if(fp(t)&&t.component.selection)for(const n of bt(t.component.selection)){const i=t.component.selection[n];for(const t of i.project.items)!t.channel&&Nt(t.field)>1&&(e[t.field]="flatten")}return e}(t),d=Kd(t);if(r=null!==(i=Qd.makeWithAncestors(r,{},{...f,...d},c))&&void 0!==i?i:r,fp(t)&&(r=_p.parseAll(r,t),r=wp.parseAll(r,t)),fp(t)||dp(t)){var h,p;if(!l)r=null!==(p=Jd.makeFromEncoding(r,t))&&void 0!==p?p:r;r=null!==(h=lu.makeFromEncoding(r,t))&&void 0!==h?h:r,r=$f.parseAllForSortIndex(r,t)}const m=t.getDataName(Ql.Raw),g=new cu(r,m,Ql.Raw,a);if(o[m]=g,r=g,fp(t)){var v,y;const e=$d.makeFromEncoding(r,t);e&&(r=e,Sf(t)&&(r=new th(r))),r=null!==(v=kp.makeFromEncoding(r,t))&&void 0!==v?v:r,r=null!==(y=kh.makeFromEncoding(r,t))&&void 0!==y?y:r}var b;fp(t)&&(r=null!==(b=yp.make(r,t))&&void 0!==b?b:r);const x=t.getDataName(Ql.Main),_=new cu(r,x,Ql.Main,a);o[x]=_,r=_,fp(t)&&function(t,e){for(const[i,r]of _t(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const o=t.getName("lookup_".concat(i));t.component.data.outputNodes[o]=r.materialized=new cu(new Nf(e,t,{param:i}),o,Ql.Lookup,t.component.data.outputNodeRefCounts)}}(t,_);let w=null;if(dp(t)){var k;const e=t.getName("facet");r=null!==(k=function(t,e){const{row:n,column:i}=e;if(n&&i){let e=null;for(const r of[n,i])if(ba(r.sort)){const{field:n,op:i=ma}=r.sort;t=e=new wh(t,{joinaggregate:[{op:i,field:n,as:jp(r,r.sort,{forAs:!0})}],groupby:[Ga(r)]})}return e}return null}(r,t.facet))&&void 0!==k?k:r,w=new Zd(r,t,e,_.getSource()),o[e]=w}return{...t.component.data,outputNodes:o,outputNodeRefCounts:a,raw:g,main:_,facetRoot:w,ancestorParse:c}}class qp extends mp{constructor(t,e,n,i){var r,o,a,s;super(t,"concat",e,n,i,t.resolve),"shared"!==(null===(r=t.resolve)||void 0===r||null===(o=r.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(a=t.resolve)||void 0===a||null===(s=a.axis)||void 0===s?void 0:s.y)||dr("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map(((t,e)=>hm(t,this,this.getName("concat_".concat(e)),void 0,i)))}parseData(){this.component.data=Up(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of bt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return gc(t)?t.vconcat:vc(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){Rp(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";Pp(t,e),Pp(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.forEach((t=>t.assembleSignals())),[]}assembleLayoutSignals(){const t=fd(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleMarks(){return this.children.map((t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...e?{title:e}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...null!=t?{columns:t}:{},bounds:"full",align:"each"}}}const Wp={disable:1,gridScale:1,scale:1,...vs,labelExpr:1,encode:1},Hp=bt(Wp);class Xp extends Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new Xp(tt(this.explicit),tt(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return li(this.explicit.orient)}}const Jp={bottom:"top",top:"bottom",left:"right",right:"left"};function Gp(t,e){if(!t)return e.map((t=>t.clone()));{if(t.length!==e.length)return;const n=t.length;for(let i=0;i<n;i++){const n=t[i],r=e[i];if(!!n!==!!r)return;if(n&&r){const e=n.getWithExplicit("orient"),o=r.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[i]=$p(n,r)}}}return t}function $p(t,e){for(const n of Hp){const i=Hl(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",((t,e)=>{switch(n){case"title":return Mi(t,e);case"gridScale":return{explicit:t.explicit,value:zt(t.value,e.value)}}return Wl(t,e,n,"axis")}));t.setWithExplicit(n,i)}return t}function Zp(t,e,n,i,r){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(li(n.labelAngle)?n.labelAngle:It(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===Gf(i,r))return!0}return t===n[e]}const Yp=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Vp(t,e){var n,i,r,o,a;let s=e.axis(t);const c=new Xp,l=is(e.encoding[t]),{mark:u,config:f}=e,d=(null===(n=s)||void 0===n?void 0:n.orient)||(null===(i=f["x"===t?"axisX":"axisY"])||void 0===i?void 0:i.orient)||(null===(r=f.axis)||void 0===r?void 0:r.orient)||function(t){return"x"===t?"bottom":"left"}(t),h=e.getScaleComponent(t).get("type"),p=function(t,e,n,i){const r="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:io(e)?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",a=li(n)?"axisOrient":"axis".concat(At(n)),s=[...r,...r.map((t=>o+t.substr(4)))],c=["axis",a,o];return{vlOnlyAxisConfig:If(s,i,t,n),vgAxisConfig:If(c,i,t,n),axisConfigStyle:Uf([...c,...s],i)}}(t,h,d,e.config),m=void 0!==s?!s:qf("disable",f.style,null===(o=s)||void 0===o?void 0:o.style,p).configValue;if(c.set("disable",m,void 0!==s),m)return c;s=s||{};const g=function(t,e,n,i,r){const o=null===e||void 0===e?void 0:e.labelAngle;if(void 0!==o)return li(o)?o:It(o);{const{configValue:o}=qf("labelAngle",i,null===e||void 0===e?void 0:e.style,r);return void 0!==o?It(o):n!==Xt||!st([$r,Jr],t.type)||Na(t)&&t.timeUnit?void 0:270}}(l,s,t,f.style,p),v=ua(s.formatType,l,h),y=la(l,l.type,s.format,s.formatType,f,!0),b={fieldOrDatumDef:l,axis:s,channel:t,model:e,scaleType:h,orient:d,labelAngle:g,format:y,formatType:v,mark:u,config:f};for(const w of Hp){const n=w in Wf?Wf[w](b):bs(w)?s[w]:void 0,i=void 0!==n,r=Zp(n,w,s,e,t);if(i&&r)c.set(w,n,r);else{const{configValue:t,configFrom:e}=bs(w)&&"values"!==w?qf(w,f.style,s.style,p):{},o=void 0!==t;i&&!o?c.set(w,n,r):("vgAxisConfig"!==e||Yp.has(w)&&o||ps(t)||li(t))&&c.set(w,t,!1)}}const x=null!==(a=s.encoding)&&void 0!==a?a:{},_=ms.reduce(((n,i)=>{var r;if(!c.hasAxisPart(i))return n;const o=gd(null!==(r=x[i])&&void 0!==r?r:{},e),a="labels"===i?function(t,e,n){var i;const{encoding:r,config:o}=t,a=null!==(i=is(r[e]))&&void 0!==i?i:is(r[Ze(e)]),s=t.axis(e)||{},{format:c,formatType:l}=s;if(ia(l))return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:c,formatType:l,config:o}),...n};if(void 0===c&&void 0===l&&o.customFormatTypes){if("quantitative"===za(a)){if(Wa(a)&&"normalize"===a.stack&&o.normalizedNumberFormatType)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,config:o}),...n};if(o.numberFormatType)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}),...n}}if("temporal"===za(a)&&o.timeFormatType&&Na(a)&&!a.timeUnit)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o}),...n}}return n}(e,t,o):o;return void 0===a||yt(a)||(n[i]={update:a}),n}),{});return yt(_)||c.set("encode",_,!!s.encoding||void 0!==s.labelAngle),c}function Kp(t,e,n){const i=ai(t),r=ki("orient",i,n);var o,a;if(i.orient=function(t,e,n){switch(t){case Mo:case Po:case Lo:case No:case Oo:case Co:return}const{x:i,y:r,x2:o,y2:a}=e;switch(t){case So:if(Na(i)&&(ei(i.bin)||Na(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Na(r)&&(ei(r.bin)||Na(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Na(i)&&i.type===Xr&&!ti(i.bin)||ja(i))&&Na(r)&&ei(r.bin)?"horizontal":"vertical";if(!a)return(Na(r)&&r.type===Xr&&!ti(r.bin)||ja(r))&&Na(i)&&ei(i.bin)?"vertical":"horizontal"}case To:if(o&&(!Na(i)||!ei(i.bin))&&a&&(!Na(r)||!ei(r.bin)))return;case Ao:if(a)return Na(r)&&ei(r.bin)?"horizontal":"vertical";if(o)return Na(i)&&ei(i.bin)?"vertical":"horizontal";if(t===To){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Fo:case zo:{const e=La(i),o=La(r);if(n)return n;if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o)return"vertical";{const t=Ia(i)&&i.type===Gr,e=Ia(r)&&r.type===Gr;if(t&&!e)return"vertical";if(!t&&e)return"horizontal"}return}}return"vertical"}(i.type,e,r),void 0!==r&&r!==i.orient&&dr((o=i.orient,a=r,'Specified orient "'.concat(o,'" overridden with "').concat(a,'".'))),"bar"===i.type&&i.orient){const t=ki("cornerRadiusEnd",i,n);if(void 0!==t){const n="horizontal"===i.orient&&e.x2||"vertical"===i.orient&&e.y2?["cornerRadius"]:Go[i.orient];for(const e of n)i[e]=t;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===ki("opacity",i,n)&&(i.opacity=function(t,e){if(st([Mo,zo,Po,Lo],t)&&!As(e))return.7;return}(i.type,e));return void 0===ki("cursor",i,n)&&(i.cursor=function(t,e,n){if(e.href||t.href||ki("href",t,n))return"pointer";return t.cursor}(i,e,n)),i}function Qp(t,e){const{config:n}=t;return{...Ku(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t),...Ru("angle",t),...tm(t,n,e)}}function tm(t,e,n){return n?{shape:{value:n}}:Ru("shape",t)}const em={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?{...Ku(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hu("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Hu("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...Ru("size",t,{vgChannel:"strokeWidth"})}:{}}};function nm(t,e,n){if(void 0===ki("align",t,n))return"center"}function im(t,e,n){if(void 0===ki("baseline",t,n))return"middle"}const rm={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return{...Ku(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid",vgChannel:"xc"}),...Bu("y",t,{defaultPos:"mid",vgChannel:"yc"}),...Ru("size",t,{defaultValue:om(t),vgChannel:r}),[o]:yi(ki("thickness",n,e))}}};function om(t){var e;const{config:n,markDef:i}=t,{orient:r}=i,o="horizontal"===r?"width":"height",a=t.getScaleComponent("horizontal"===r?"x":"y"),s=null!==(e=ki("size",i,n,{vgChannel:o}))&&void 0!==e?e:n.tick.bandSize;if(void 0!==s)return s;{const t=a?a.get("range"):void 0;if(t&&ui(t)&&(0,U.hj)(t.step))return 3*t.step/4;return 3*kc(n.view,o)/4}}const am={arc:{vgMark:"arc",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Gu(t,"radius"),...Gu(t,"theta")})},area:{vgMark:"area",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Hu("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient}),...Hu("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient}),...ef(t)})},bar:{vgMark:"rect",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y")})},circle:{vgMark:"symbol",encodeEntry:t=>Qp(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Na(n)&&n.type===Zr?{field:Ga(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y"),...Su(t,"url")})},line:{vgMark:"line",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t,{vgChannel:"strokeWidth"}),...ef(t)})},point:{vgMark:"symbol",encodeEntry:t=>Qp(t)},rect:{vgMark:"rect",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y")})},rule:em,square:{vgMark:"symbol",encodeEntry:t=>Qp(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Ku(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Su(t),...Ru("size",t,{vgChannel:"fontSize"}),...Ru("angle",t),...nf("align",nm(t.markDef,n,e)),...nf("baseline",im(t.markDef,n,e)),...Bu("radius",t,{defaultPos:null}),...Bu("theta",t,{defaultPos:null})}}},tick:rm,trail:{vgMark:"trail",encodeEntry:t=>({...Ku(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t),...ef(t)})}};function sm(t){if(st([Fo,Ao,Ro],t.mark)){const e=Os(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:cm+t.requestDataName(Ql.Main),data:t.requestDataName(Ql.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:um(t,{fromPrefix:cm})}]}(t,e)}else if(t.mark===So){const e=pi.some((e=>ki(e,t.markDef,t.config)));if(t.stack&&!t.fieldDef("size")&&e)return function(t){var e;const[n]=um(t,{fromPrefix:lm}),i=t.scaleName(t.stack.fieldChannel),r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.vgField(t.stack.fieldChannel,e)},o=(t,e)=>{const n=[r({prefix:"min",suffix:"start",expr:e}),r({prefix:"max",suffix:"start",expr:e}),r({prefix:"min",suffix:"end",expr:e}),r({prefix:"max",suffix:"end",expr:e})];return"".concat(t,"(").concat(n.map((t=>"scale('".concat(i,"',").concat(t,")"))).join(","),")")};let a,s;"x"===t.stack.fieldChannel?(a={...nt(n.encode.update,["y","yc","y2","height",...pi]),x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},n.encode.update={...it(n.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(a={...nt(n.encode.update,["x","xc","x2","width"]),y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},n.encode.update={...it(n.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of pi){const e=Ei(l,t.markDef,t.config);n.encode.update[l]?(a[l]=n.encode.update[l],delete n.encode.update[l]):e&&(a[l]=yi(e)),e&&(n.encode.update[l]={value:0})}const c=[];if((null===(e=t.stack.groupbyChannels)||void 0===e?void 0:e.length)>0)for(const l of t.stack.groupbyChannels){const e=t.fieldDef(l),n=Ga(e);n&&c.push(n),(null!==e&&void 0!==e&&e.bin||null!==e&&void 0!==e&&e.timeUnit)&&c.push(Ga(e,{binSuffix:"end"}))}a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((e,i)=>{if(n.encode.update[i])return{...e,[i]:n.encode.update[i]};{const n=Ei(i,t.markDef,t.config);return void 0!==n?{...e,[i]:yi(n)}:e}}),a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(Ql.Main),name:lm+t.requestDataName(Ql.Main),groupby:c,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:s},marks:[n]}]}]}(t)}return um(t)}const cm="faceted_path_";const lm="stack_group_";function um(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:i,encoding:r,config:o}=t,a=zt(i.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(null!==e&&void 0!==e&&e.get("selectionExtent")||null!==n&&void 0!==n&&n.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),s=wi(i),c=r.key,l=function(t){const{encoding:e,stack:n,mark:i,markDef:r,config:o}=t,a=e.order;if(!(!(0,U.kJ)(a)&&Ua(a)&&at(a.value)||!a&&at(ki("order",r,o)))){if(((0,U.kJ)(a)||Na(a))&&!n)return Si(a,{expr:"datum"});if(Bo(i)){const n="horizontal"===r.orient?"y":"x",i=e[n];if(Na(i)){const e=i.sort;if((0,U.kJ)(e))return{field:Ga(i,{prefix:n,suffix:"sort_index",expr:"datum"})};if(ba(e))return{field:Ga({aggregate:As(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})};if(ya(e))return{field:Ga(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order};if(null===e)return;var s;return{field:Ga(i,{binSuffix:null!==(s=t.stack)&&void 0!==s&&s.impute?"mid":void 0,expr:"datum"})}}}}}(t),u=function(t){if(!t.component.selection)return null;const e=bt(t.component.selection).length;let n=e,i=t.parent;for(;i&&0===n;)n=bt(i.component.selection).length,i=i.parent;return n?{interactive:e>0||"geoshape"===t.mark||!!t.encoding.tooltip}:null}(t),f=ki("aria",i,o),d=am[n].postEncodingTransform?am[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:am[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...u||{},...!1===f?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Ql.Main)},encode:{update:am[n].encodeEntry(t)},...d?{transform:d}:{}}]}class fm extends gp{constructor(t,e,n){var i;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;super(t,"unit",e,n,o,void 0,xc(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const a=qo(t.mark)?{...t.mark}:{type:t.mark},s=a.type;void 0===a.filled&&(a.filled=function(t,e,n){let{graticule:i}=n;if(i)return!1;const r=Ei("filled",t,e),o=t.type;return zt(r,o!==Mo&&o!==Fo&&o!==To)}(a,o,{graticule:t.data&&Kl(t.data)}));const c=this.encoding=function(t,e,n,i){const r={};for(const a of bt(t))He(a)||dr("".concat(o=a,"-encoding is dropped as ").concat(o," is not a valid encoding channel."));var o;for(let a of tn){if(!t[a])continue;const o=t[a];if(Dn(a)){const t=Qe(a),e=r[t];if(Na(e)){if(Wr(e.type)&&Na(o)&&!e.timeUnit){dr(Hi(t));continue}}else a=t,dr(Xi(t))}if("angle"!==a||"arc"!==e||t.theta||(dr("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Qt),Cs(t,a,e)){if(a===le&&"line"===e){const e=ns(t[a]);if(null!==e&&void 0!==e&&e.aggregate){dr("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===oe&&(n?"fill"in t:"stroke"in t))dr(Gi("encoding",{fill:"fill"in t,stroke:"stroke"in t}));else if(a===ye||a===ve&&!(0,U.kJ)(o)&&!Ua(o)||a===xe&&(0,U.kJ)(o)){if(o){if(a===ve){const e=t[a];if(Fa(e)){r[a]=e;continue}}r[a]=(0,U.IX)(o).reduce(((t,e)=>(Na(e)?t.push(as(e,a)):dr($i(e,a)),t)),[])}}else{if(a===xe&&null===o)r[a]=null;else if(!Na(o)&&!Ra(o)&&!Ua(o)&&!Ma(o)&&!li(o)){dr($i(o,a));continue}r[a]=rs(o,a,i)}}else dr(Zi(a,e))}return r}(t.encoding||{},s,a.filled,o);this.markDef=Kp(a,c,o),this.size=function(t){let{encoding:e,size:n}=t;for(const i of bn){const t=Ye(i);bc(n[t])&&Pa(e[i])&&(delete n[t],dr(rr(t)))}return n}({encoding:c,size:xc(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=Xc(this.markDef,c),this.specifiedScales=this.initScales(s,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegends(c),this.specifiedProjection=t.projection,this.selection=(null!==(i=t.params)&&void 0!==i?i:[]).filter((t=>hc(t)))}get hasProjection(){const{encoding:t}=this,e=this.mark===jo,n=t&&Fe.some((e=>Ba(t[e])));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return Ln.reduce(((t,n)=>{const i=is(e[n]);var r;i&&(t[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{}));return t}),{})}initScale(t){const{domain:e,range:n}=t,i=ai(t);return(0,U.kJ)(e)&&(i.domain=e.map(gi)),(0,U.kJ)(n)&&(i.range=n.map(gi)),i}initAxes(t){return bn.reduce(((e,n)=>{const i=t[n];if(Ba(i)||n===Xt&&Ba(t.x2)||n===Jt&&Ba(t.y2)){const t=Ba(i)?i.axis:void 0;e[n]=t?this.initAxis({...t}):t}return e}),{})}initAxis(t){const e=bt(t),n={};for(const i of e){const e=t[i];n[i]=ps(e)?mi(e):gi(e)}return n}initLegends(t){return Rn.reduce(((e,n)=>{const i=is(t[n]);if(i&&function(t){switch(t){case oe:case ae:case se:case le:case ce:case fe:case pe:case me:return!0;case de:case he:case ue:return!1}}(n)){const t=i.legend;e[n]=t?ai(t):t}return e}),{})}parseData(){this.component.data=Up(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const i of bn){const r=Ye(i);if(e[r]){const t=e[r];n.layoutSize.set(r,bc(t)?"step":t,!0)}else{const e=Lp(t,r);n.layoutSize.set(r,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},i=t.config.selection;if(!e||!e.length)return n;for(const o of e){const e=kt(o.name),a=o.select,s=(0,U.HD)(a)?a:a.type,c=(0,U.Kn)(a)?tt(a):{type:s},l=i[s];for(const t in l){var r;"fields"!==t&&"encodings"!==t&&("mark"===t&&(c[t]={...l[t],...c[t]}),(void 0===c[t]||!0===c[t])&&(c[t]=tt(null!==(r=l[t])&&void 0!==r?r:c[t])))}const u=n[e]={...c,name:e,type:s,init:o.value,bind:o.bind,events:(0,U.HD)(c.on)?(0,tu.r)(c.on,"scope"):(0,U.IX)(tt(c.on))},f=tt(o);for(const n of Df)n.defined(u)&&n.parse&&n.parse(t,u,f)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=sm(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,bn.reduce(((e,n)=>(t.component.scales[n]&&(e[n]=[Vp(n,t)]),e)),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;for(const r of xt(null!==(i=t.component.selection)&&void 0!==i?i:{})){var i;const o=r.name,a=(0,U.m8)(o+_f);if(0===e.filter((t=>t.name===o)).length){const t="global"===r.resolve?"union":r.resolve,n="point"===r.type?", true, true)":")";e.push({name:r.name,update:"".concat(Ef,"(").concat(a,", ").concat((0,U.m8)(t)).concat(n)})}n=!0;for(const n of Df)n.defined(r)&&n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))}n&&0===e.filter((t=>"unit"===t.name)).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return au(e)}(this,t)}assembleSignals(){return[...Bf(this),...iu(this,[])]}assembleSelectionData(t){return function(t,e){const n=[...e],i=Af(t,{escape:!1});for(const o of xt(null!==(r=t.component.selection)&&void 0!==r?r:{})){var r;const t={name:o.name+_f};if(o.project.hasSelectionId&&(t.transform=[{type:"collect",sort:{field:lc}}]),o.init){const e=o.project.items.map(eu);t.values=o.project.hasSelectionId?o.init.map((t=>({unit:i,[lc]:nu(t,!1)[0]}))):o.init.map((t=>({unit:i,fields:e,values:nu(t,!1)})))}n.filter((t=>t.name===o.name+_f)).length||n.push(t)}return n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return fd(this)}assembleMarks(){var t;let e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&pp(this.parent)||(e=ou(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return void 0!==t?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return ks(this.encoding,t)}fieldDef(t){return ns(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Ia(e)?e:null}}class dm extends mp{constructor(t,e,n,i,r){super(t,"layer",e,n,r,t.resolve,t.view);const o={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map(((t,e)=>{if(jc(t))return new dm(t,this,this.getName("layer_".concat(e)),o,r);if(_s(t))return new fm(t,this,this.getName("layer_".concat(e)),o,r);throw new Error(Oi(t))}))}parseData(){this.component.data=Up(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;Rp(t=this),Pp(t,"width"),Pp(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of bt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){const{axes:e,resolve:n}=t.component,i={top:0,bottom:0,right:0,left:0};for(const o of t.children){o.parseAxesAndHeaders();for(const i of bt(o.component.axes))n.axis[i]=yd(t.component.resolve,i),"shared"===n.axis[i]&&(e[i]=Gp(e[i],o.component.axes[i]),e[i]||(n.axis[i]="independent",delete e[i]))}for(const o of bn){for(const a of t.children)if(a.component.axes[o]){if("independent"===n.axis[o]){var r;e[o]=(null!==(r=e[o])&&void 0!==r?r:[]).concat(a.component.axes[o]);for(const t of a.component.axes[o]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!li(e)){if(i[e]>0&&!n){const n=Jp[e];i[e]>i[n]&&t.set("orient",n,!1)}i[e]++}}}delete a.component.axes[o]}if("independent"===n.axis[o]&&e[o]&&e[o].length>1)for(const t of e[o])t.get("grid")&&!t.explicit.grid&&(t.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleSignals())),Bf(this))}assembleLayoutSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleLayoutSignals())),fd(this))}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleGroupStyle(){const t=new Set;for(const n of this.children)for(const e of(0,U.IX)(n.assembleGroupStyle()))t.add(e);const e=Array.from(t);return e.length>1?e:1===e.length?e[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)fp(n)&&(e=ou(n,e));return e}(this,this.children.flatMap((t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce(((t,e)=>t.concat(e.assembleLegends())),Pd(this))}}function hm(t,e,n,i,r){if(ka(t))return new Bp(t,e,n,r);if(jc(t))return new dm(t,e,n,i,r);if(_s(t))return new fm(t,e,n,i,r);if(function(t){return gc(t)||vc(t)||mc(t)}(t))return new qp(t,e,n,r);throw new Error(Oi(t))}function pm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;e.logger&&(n=e.logger,ur=n),e.fieldTitle&&Va(e.fieldTitle);try{const n=Tc((0,U.fE)(e.config,t.config)),i=Tl(t,n),r=hm(i,null,"",void 0,n);r.parse(),function(t,e){Fh(t.sources);let n=0,i=0;for(let r=0;r<Ch&&Oh(t,e,!0);r++)n++;t.sources.map(Dh);for(let r=0;r<Ch&&Oh(t,e,!1);r++)i++;Fh(t.sources),Math.max(n,i)===Ch&&dr("Maximum optimization runs(".concat(Ch,") reached."))}(r.component.data,r);const o=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;const r=t.config?Pc(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){const n=[],i=Mp(n);let r=0;for(const c of t.sources){c.hasName()||(c.dataName="source_".concat(r++));const t=c.assemble();i(c,t)}for(const c of n)0===c.transform.length&&delete c.transform;let o=0;for(const[c,l]of n.entries()){var a;0!==(null!==(a=l.transform)&&void 0!==a?a:[]).length||l.source||n.splice(o++,0,n.splice(c,1)[0])}for(const c of n)for(const e of null!==(s=c.transform)&&void 0!==s?s:[]){var s;"lookup"===e.type&&(e.from=t.outputNodes[e.from].getSource())}for(const c of n)c.name in e&&(c.values=e[c.name]);return n}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),c=t.assembleGroupStyle(),l=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter((t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)));const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...s?{title:s}:{},...c?{style:c}:{},...l?{encode:{update:l}}:{},data:o,...a.length>0?{projections:a}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...pc(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}(r,function(t,e,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===e?(e={type:"pad"},i.hasAxisOrientSignalRef()&&(e.resize=!0)):(0,U.HD)(e)&&(e={type:e});if(r&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===r&&"step"===o)dr(Ri()),e.type="pad";else if("step"===r||"step"===o){const t="step"===r?"width":"height";dr(Ri(kn(t)));const n="width"===t?"height":"width";e.type=function(t){return t?"fit-".concat(kn(t)):"fit"}(n)}var a;return{...1===bt(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e},...jl(n,!1),...jl(t,!0)}}(t,i.autosize,n,r),t.datasets,t.usermeta);return{spec:o,normalized:i}}finally{e.logger&&fr(),e.fieldTitle&&Va(Za)}}const mm="5.9.3";const gm=function(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};var vm="2.14.0";const ym="#fff",bm="#888",xm={background:"#333",view:{stroke:bm},title:{color:ym,subtitleColor:ym},style:{"guide-label":{fill:ym},"guide-title":{fill:ym}},axis:{domainColor:ym,gridColor:bm,tickColor:ym}},_m="#4572a7",wm={background:"#fff",arc:{fill:_m},area:{fill:_m},line:{stroke:_m,strokeWidth:2},path:{stroke:_m},rect:{fill:_m},shape:{stroke:_m},symbol:{fill:_m,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},km="#30a2da",Em="#cbcbcb",Dm="#f0f0f0",Am="#333",Sm={arc:{fill:km},area:{fill:km},axis:{domainColor:Em,grid:!0,gridColor:Em,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Em,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Dm,group:{fill:Dm},legend:{labelColor:Am,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Am,titleFontSize:14,titlePadding:10},line:{stroke:km,strokeWidth:2},path:{stroke:km,strokeWidth:.5},rect:{fill:km},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:km},bar:{binSpacing:2,fill:km,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Cm="#000",Fm={group:{fill:"#e5e5e5"},arc:{fill:Cm},area:{fill:Cm},line:{stroke:Cm},path:{stroke:Cm},rect:{fill:Cm},shape:{stroke:Cm},symbol:{fill:Cm,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Mm="Benton Gothic, sans-serif",Om="#82c6df",Tm="Benton Gothic Bold, sans-serif",Nm="normal",zm={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Rm={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Tm,fontSize:22,fontWeight:"normal"},arc:{fill:Om},area:{fill:Om},line:{stroke:Om,strokeWidth:2},path:{stroke:Om},rect:{fill:Om},shape:{stroke:Om},symbol:{fill:Om,size:30},axis:{labelFont:Mm,labelFontSize:11.5,labelFontWeight:"normal",titleFont:Tm,titleFontSize:13,titleFontWeight:Nm},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Mm,labelFontSize:11.5,symbolType:"square",titleFont:Tm,titleFontSize:13,titleFontWeight:Nm},range:{category:zm["category-6"],diverging:zm["fireandice-6"],heatmap:zm["fire-7"],ordinal:zm["fire-7"],ramp:zm["fire-7"]}},Pm="#ab5787",Lm="#979797",jm={background:"#f9f9f9",arc:{fill:Pm},area:{fill:Pm},line:{stroke:Pm},path:{stroke:Pm},rect:{fill:Pm},shape:{stroke:Pm},symbol:{fill:Pm,size:30},axis:{domainColor:Lm,domainWidth:.5,gridWidth:.2,labelColor:Lm,tickColor:Lm,tickWidth:.2,titleColor:Lm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Bm="#3e5c69",Im={background:"#fff",arc:{fill:Bm},area:{fill:Bm},line:{stroke:Bm},path:{stroke:Bm},rect:{fill:Bm},shape:{stroke:Bm},symbol:{fill:Bm},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Um="#1696d2",qm="#000000",Wm="Lato",Hm="Lato",Xm={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Jm={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Wm},axisX:{domain:!0,domainColor:qm,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Hm,labelAngle:0,tickColor:qm,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Wm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:Hm,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Wm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Hm,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Wm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Xm["six-groups-cat-1"],diverging:Xm["diverging-colors"],heatmap:Xm["diverging-colors"],ordinal:Xm["six-groups-seq"],ramp:Xm["shades-blue"]},area:{fill:Um},rect:{fill:Um},line:{color:Um,stroke:Um,strokeWidth:5},trail:{color:Um,stroke:Um,strokeWidth:0,size:1},path:{stroke:Um,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Um,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Um,stroke:null}},arc:{fill:Um},shape:{stroke:Um},symbol:{fill:Um,size:30}},Gm="#3366CC",$m="#ccc",Zm="Arial, sans-serif",Ym={arc:{fill:Gm},area:{fill:Gm},path:{stroke:Gm},rect:{fill:Gm},shape:{stroke:Gm},symbol:{stroke:Gm},circle:{fill:Gm},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Zm,fontSize:12},"guide-title":{font:Zm,fontSize:12},"group-title":{font:Zm,fontSize:12}},title:{font:Zm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:$m,tickColor:$m,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Vm=t=>t*(1/3+1),Km=Vm(9),Qm=Vm(10),tg=Vm(12),eg="Segoe UI",ng="wf_standard-font, helvetica, arial, sans-serif",ig="#252423",rg="#605E5C",og="transparent",ag="#118DFF",sg="#DEEFFF",cg=[sg,ag],lg={view:{stroke:og},background:og,font:eg,header:{titleFont:ng,titleFontSize:tg,titleColor:ig,labelFont:eg,labelFontSize:Qm,labelColor:rg},axis:{ticks:!1,grid:!1,domain:!1,labelColor:rg,labelFontSize:Km,titleFont:ng,titleColor:ig,titleFontSize:tg,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:ag},line:{stroke:ag,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:eg,fontSize:Km,fill:rg},arc:{fill:ag},area:{fill:ag,line:!0,opacity:.6},path:{stroke:ag},rect:{fill:ag},point:{fill:ag,filled:!0,size:75},shape:{stroke:ag},symbol:{fill:ag,strokeWidth:1.5,size:50},legend:{titleFont:eg,titleFontWeight:"bold",titleColor:rg,labelFont:eg,labelFontSize:Qm,labelColor:rg,symbolType:"circle",symbolSize:75},range:{category:[ag,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:cg,heatmap:cg,ordinal:[sg,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",ag]}},ug='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',fg=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],dg=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function hg(t){let{type:e,background:n}=t;const i="dark"===e?"#161616":"#ffffff",r="dark"===e?"#f4f4f4":"#161616",o="dark"===e?"#d4bbff":"#6929c4";return{background:n,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:ug,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:ug,fill:r,fontWeight:400},"guide-title":{font:ug,fill:r,fontWeight:400}},range:{category:"dark"===e?fg:dg,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const pg=hg({type:"light",background:"#ffffff"}),mg=hg({type:"light",background:"#f4f4f4"}),gg=hg({type:"dark",background:"#262626"}),vg=hg({type:"dark",background:"#161616"}),yg=vm;function bg(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,i){if("object"!==typeof i||null===i)return i;const r=e.indexOf(this)+1;return e.length=r,e.length>t?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}(e))}const xg="vg-tooltip-element",_g={offsetX:10,offsetY:10,id:xg,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2,formatTooltip:function(t,e,n){if((0,U.kJ)(t))return"[".concat(t.map((t=>e((0,U.HD)(t)?t:bg(t,n)))).join(", "),"]");if((0,U.Kn)(t)){let i="";const{title:r,image:o,...a}=t;r&&(i+="<h2>".concat(e(r),"</h2>")),o&&(i+='<img src="'.concat(e(o),'">'));const s=Object.keys(a);if(s.length>0){i+="<table>";for(const t of s){let r=a[t];void 0!==r&&((0,U.Kn)(r)&&(r=bg(r,n)),i+='<tr><td class="key">'.concat(e(t),'</td><td class="value">').concat(e(r),"</td></tr>"))}i+="</table>"}return i||"{}"}return e(t)}};class wg{constructor(t){this.options={..._g,...t};const e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n".toString().replace(xg,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}}tooltipHandler(t,e,n,i){if(this.el=document.getElementById(this.options.id),!this.el){var r;this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body).appendChild(this.el)}if(null==i||""===i)return void this.el.classList.remove("visible","".concat(this.options.theme,"-theme"));this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));const{x:o,y:a}=function(t,e,n,i){let r=t.clientX+n;r+e.width>window.innerWidth&&(r=+t.clientX-n-e.width);let o=t.clientY+i;return o+e.height>window.innerHeight&&(o=+t.clientY-i-e.height),{x:r,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top="".concat(a,"px"),this.el.style.left="".concat(o,"px")}}var kg,Eg,Dg;function Ag(t){return Ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ag(t)}function Sg(t){var e=function(t,e){if("object"!==Ag(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ag(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ag(e)?e:String(e)}function Cg(t,e,n){return(e=Sg(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mg=Og;function Og(t){var e=this;if(e instanceof Og||(e=new Og),e.tail=null,e.head=null,e.length=0,t&&"function"===typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)e.push(arguments[n]);return e}function Tg(t,e,n){var i=e===t.head?new Rg(n,null,e,t):new Rg(n,e,e.next,t);return null===i.next&&(t.tail=i),null===i.prev&&(t.head=i),t.length++,i}function Ng(t,e){t.tail=new Rg(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function zg(t,e){t.head=new Rg(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Rg(t,e,n,i){if(!(this instanceof Rg))return new Rg(t,e,n,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Og.Node=Rg,Og.create=Og,Og.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e},Og.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},Og.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},Og.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Ng(this,arguments[t]);return this.length},Og.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)zg(this,arguments[t]);return this.length},Og.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},Og.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},Og.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,i=0;null!==n;i++)t.call(e,n.value,i,this),n=n.next},Og.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,i=this.length-1;null!==n;i--)t.call(e,n.value,i,this),n=n.prev},Og.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},Og.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},Og.prototype.map=function(t,e){e=e||this;for(var n=new Og,i=this.head;null!==i;)n.push(t.call(e,i.value,this)),i=i.next;return n},Og.prototype.mapReverse=function(t,e){e=e||this;for(var n=new Og,i=this.tail;null!==i;)n.push(t.call(e,i.value,this)),i=i.prev;return n},Og.prototype.reduce=function(t,e){var n,i=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},Og.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},Og.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},Og.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},Og.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new Og;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,r=this.head;null!==r&&i<t;i++)r=r.next;for(;null!==r&&i<e;i++,r=r.next)n.push(r.value);return n},Og.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new Og;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,r=this.tail;null!==r&&i>e;i--)r=r.prev;for(;null!==r&&i>t;i--,r=r.prev)n.push(r.value);return n},Og.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;null!==i&&n<t;n++)i=i.next;var r=[];for(n=0;i&&n<e;n++)r.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<(arguments.length<=2?0:arguments.length-2);n++)i=Tg(this,i,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return r},Og.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=e,this.tail=t,this};try{(Dg||(Dg=1,Eg=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Eg)(Og)}catch(sy){}const Pg=Mg,Lg=Symbol("max"),jg=Symbol("length"),Bg=Symbol("lengthCalculator"),Ig=Symbol("allowStale"),Ug=Symbol("maxAge"),qg=Symbol("dispose"),Wg=Symbol("noDisposeOnSet"),Hg=Symbol("lruList"),Xg=Symbol("cache"),Jg=Symbol("updateAgeOnGet"),Gg=()=>1;const $g=(t,e,n)=>{const i=t[Xg].get(e);if(i){const e=i.value;if(Zg(t,e)){if(Vg(t,i),!t[Ig])return}else n&&(t[Jg]&&(i.value.now=Date.now()),t[Hg].unshiftNode(i));return e.value}},Zg=(t,e)=>{if(!e||!e.maxAge&&!t[Ug])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ug]&&n>t[Ug]},Yg=t=>{if(t[jg]>t[Lg])for(let e=t[Hg].tail;t[jg]>t[Lg]&&null!==e;){const n=e.prev;Vg(t,e),e=n}},Vg=(t,e)=>{if(e){const n=e.value;t[qg]&&t[qg](n.key,n.value),t[jg]-=n.length,t[Xg].delete(n.key),t[Hg].removeNode(e)}};class Kg{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const Qg=(t,e,n,i)=>{let r=n.value;Zg(t,r)&&(Vg(t,n),t[Ig]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};var tv=class{constructor(t){if("number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[Lg]=t.max||1/0;const e=t.length||Gg;if(this[Bg]="function"!==typeof e?Gg:e,this[Ig]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[Ug]=t.maxAge||0,this[qg]=t.dispose,this[Wg]=t.noDisposeOnSet||!1,this[Jg]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!==typeof t||t<0)throw new TypeError("max must be a non-negative number");this[Lg]=t||1/0,Yg(this)}get max(){return this[Lg]}set allowStale(t){this[Ig]=!!t}get allowStale(){return this[Ig]}set maxAge(t){if("number"!==typeof t)throw new TypeError("maxAge must be a non-negative number");this[Ug]=t,Yg(this)}get maxAge(){return this[Ug]}set lengthCalculator(t){"function"!==typeof t&&(t=Gg),t!==this[Bg]&&(this[Bg]=t,this[jg]=0,this[Hg].forEach((t=>{t.length=this[Bg](t.value,t.key),this[jg]+=t.length}))),Yg(this)}get lengthCalculator(){return this[Bg]}get length(){return this[jg]}get itemCount(){return this[Hg].length}rforEach(t,e){e=e||this;for(let n=this[Hg].tail;null!==n;){const i=n.prev;Qg(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[Hg].head;null!==n;){const i=n.next;Qg(this,t,n,e),n=i}}keys(){return this[Hg].toArray().map((t=>t.key))}values(){return this[Hg].toArray().map((t=>t.value))}reset(){this[qg]&&this[Hg]&&this[Hg].length&&this[Hg].forEach((t=>this[qg](t.key,t.value))),this[Xg]=new Map,this[Hg]=new Pg,this[jg]=0}dump(){return this[Hg].map((t=>!Zg(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[Hg]}set(t,e,n){if((n=n||this[Ug])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,r=this[Bg](e,t);if(this[Xg].has(t)){if(r>this[Lg])return Vg(this,this[Xg].get(t)),!1;const o=this[Xg].get(t).value;return this[qg]&&(this[Wg]||this[qg](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[jg]+=r-o.length,o.length=r,this.get(t),Yg(this),!0}const o=new Kg(t,e,r,i,n);return o.length>this[Lg]?(this[qg]&&this[qg](t,e),!1):(this[jg]+=o.length,this[Hg].unshift(o),this[Xg].set(t,this[Hg].head),Yg(this),!0)}has(t){if(!this[Xg].has(t))return!1;const e=this[Xg].get(t).value;return!Zg(this,e)}get(t){return $g(this,t,!0)}peek(t){return $g(this,t,!1)}pop(){const t=this[Hg].tail;return t?(Vg(this,t),t.value):null}del(t){Vg(this,this[Xg].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[Xg].forEach(((t,e)=>$g(this,e,!1)))}};const ev=Object.freeze({loose:!0}),nv=Object.freeze({});var iv=t=>t?"object"!==typeof t?ev:t:nv,rv={exports:{}};var ov={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var av="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG)?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error("SEMVER",...e)}:()=>{};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=ov,o=av,a=(e=t.exports={}).re=[],s=e.safeRe=[],c=e.src=[],l=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=(t,e,n)=>{const i=(t=>{for(const[e,n]of d)t=t.split("".concat(e,"*")).join("".concat(e,"{0,").concat(n,"}")).split("".concat(e,"+")).join("".concat(e,"{1,").concat(n,"}"));return t})(e),r=u++;o(t,r,e),l[t]=r,c[r]=e,a[r]=new RegExp(e,n?"g":void 0),s[r]=new RegExp(i,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(f,"*")),h("MAINVERSION","(".concat(c[l.NUMERICIDENTIFIER],")\\.")+"(".concat(c[l.NUMERICIDENTIFIER],")\\.")+"(".concat(c[l.NUMERICIDENTIFIER],")")),h("MAINVERSIONLOOSE","(".concat(c[l.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[l.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[l.NUMERICIDENTIFIERLOOSE],")")),h("PRERELEASEIDENTIFIER","(?:".concat(c[l.NUMERICIDENTIFIER],"|").concat(c[l.NONNUMERICIDENTIFIER],")")),h("PRERELEASEIDENTIFIERLOOSE","(?:".concat(c[l.NUMERICIDENTIFIERLOOSE],"|").concat(c[l.NONNUMERICIDENTIFIER],")")),h("PRERELEASE","(?:-(".concat(c[l.PRERELEASEIDENTIFIER],"(?:\\.").concat(c[l.PRERELEASEIDENTIFIER],")*))")),h("PRERELEASELOOSE","(?:-?(".concat(c[l.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(c[l.PRERELEASEIDENTIFIERLOOSE],")*))")),h("BUILDIDENTIFIER","".concat(f,"+")),h("BUILD","(?:\\+(".concat(c[l.BUILDIDENTIFIER],"(?:\\.").concat(c[l.BUILDIDENTIFIER],")*))")),h("FULLPLAIN","v?".concat(c[l.MAINVERSION]).concat(c[l.PRERELEASE],"?").concat(c[l.BUILD],"?")),h("FULL","^".concat(c[l.FULLPLAIN],"$")),h("LOOSEPLAIN","[v=\\s]*".concat(c[l.MAINVERSIONLOOSE]).concat(c[l.PRERELEASELOOSE],"?").concat(c[l.BUILD],"?")),h("LOOSE","^".concat(c[l.LOOSEPLAIN],"$")),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE","".concat(c[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),h("XRANGEIDENTIFIER","".concat(c[l.NUMERICIDENTIFIER],"|x|X|\\*")),h("XRANGEPLAIN","[v=\\s]*(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:".concat(c[l.PRERELEASE],")?").concat(c[l.BUILD],"?")+")?)?"),h("XRANGEPLAINLOOSE","[v=\\s]*(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(c[l.PRERELEASELOOSE],")?").concat(c[l.BUILD],"?")+")?)?"),h("XRANGE","^".concat(c[l.GTLT],"\\s*").concat(c[l.XRANGEPLAIN],"$")),h("XRANGELOOSE","^".concat(c[l.GTLT],"\\s*").concat(c[l.XRANGEPLAINLOOSE],"$")),h("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),h("COERCERTL",c[l.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM","(\\s*)".concat(c[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",h("TILDE","^".concat(c[l.LONETILDE]).concat(c[l.XRANGEPLAIN],"$")),h("TILDELOOSE","^".concat(c[l.LONETILDE]).concat(c[l.XRANGEPLAINLOOSE],"$")),h("LONECARET","(?:\\^)"),h("CARETTRIM","(\\s*)".concat(c[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",h("CARET","^".concat(c[l.LONECARET]).concat(c[l.XRANGEPLAIN],"$")),h("CARETLOOSE","^".concat(c[l.LONECARET]).concat(c[l.XRANGEPLAINLOOSE],"$")),h("COMPARATORLOOSE","^".concat(c[l.GTLT],"\\s*(").concat(c[l.LOOSEPLAIN],")$|^$")),h("COMPARATOR","^".concat(c[l.GTLT],"\\s*(").concat(c[l.FULLPLAIN],")$|^$")),h("COMPARATORTRIM","(\\s*)".concat(c[l.GTLT],"\\s*(").concat(c[l.LOOSEPLAIN],"|").concat(c[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE","^\\s*(".concat(c[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(c[l.XRANGEPLAIN],")")+"\\s*$"),h("HYPHENRANGELOOSE","^\\s*(".concat(c[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(c[l.XRANGEPLAINLOOSE],")")+"\\s*$"),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(rv,rv.exports);var sv=rv.exports;const cv=/^[0-9]+$/,lv=(t,e)=>{const n=cv.test(t),i=cv.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1};var uv={compareIdentifiers:lv,rcompareIdentifiers:(t,e)=>lv(e,t)};const fv=av,{MAX_LENGTH:dv,MAX_SAFE_INTEGER:hv}=ov,{safeRe:pv,t:mv}=sv,gv=iv,{compareIdentifiers:vv}=uv;var yv=class t{constructor(e,n){if(n=gv(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!==typeof e)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof e,'".'));if(e.length>dv)throw new TypeError("version is longer than ".concat(dv," characters"));fv("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=e.trim().match(n.loose?pv[mv.LOOSE]:pv[mv.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hv||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<hv)return e}return t})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}toString(){return this.version}compare(e){if(fv("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if("string"===typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),vv(this.major,e.major)||vv(this.minor,e.minor)||vv(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const t=this.prerelease[n],i=e.prerelease[n];if(fv("prerelease compare",n,t,i),void 0===t&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===t)return-1;if(t!==i)return vv(t,i)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{const t=this.build[n],i=e.build[n];if(fv("prerelease compare",n,t,i),void 0===t&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===t)return-1;if(t!==i)return vv(t,i)}while(++n)}inc(t,e,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,n),this.inc("pre",e,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e,n),this.inc("pre",e,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const t=Number(n)?1:0;if(!e&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[t];else{let i=this.prerelease.length;for(;--i>=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let i=[e,t];!1===n&&(i=[e]),0===vv(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}};const bv=yv;var xv=(t,e,n)=>new bv(t,n).compare(new bv(e,n));const _v=xv;const wv=xv;const kv=xv;const Ev=xv;const Dv=xv;const Av=xv;const Sv=(t,e,n)=>0===_v(t,e,n),Cv=(t,e,n)=>0!==wv(t,e,n),Fv=(t,e,n)=>kv(t,e,n)>0,Mv=(t,e,n)=>Ev(t,e,n)>=0,Ov=(t,e,n)=>Dv(t,e,n)<0,Tv=(t,e,n)=>Av(t,e,n)<=0;var Nv,zv,Rv,Pv,Lv=(t,e,n,i)=>{switch(e){case"===":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t===n;case"!==":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return Sv(t,n,i);case"!=":return Cv(t,n,i);case">":return Fv(t,n,i);case">=":return Mv(t,n,i);case"<":return Ov(t,n,i);case"<=":return Tv(t,n,i);default:throw new TypeError("Invalid operator: ".concat(e))}};function jv(){if(Pv)return Rv;Pv=1;class t{constructor(e,r){if(r=n(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!h(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+t,o=e.get(n);if(o)return o;const p=this.options.loose,m=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];t=t.replace(m,A(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(a[s.COMPARATORTRIM],c),r("comparator trim",t),t=t.replace(a[s.TILDETRIM],l),r("tilde trim",t),t=t.replace(a[s.CARETTRIM],u),r("caret trim",t);let v=t.split(" ").map((t=>g(t,this.options))).join(" ").split(/\s+/).map((t=>D(t,this.options)));p&&(v=v.filter((t=>(r("loose invalid filter",t,this.options),!!t.match(a[s.COMPARATORLOOSE]))))),r("range list",v);const y=new Map,b=v.map((t=>new i(t,this.options)));for(const e of b){if(h(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const x=[...y.values()];return e.set(n,x),x}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>m(t,n)&&e.set.some((e=>m(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(t){if(!t)return!1;if("string"===typeof t)try{t=new o(t,this.options)}catch(sy){return!1}for(let e=0;e<this.set.length;e++)if(S(this.set[e],t,this.options))return!0;return!1}}Rv=t;const e=new tv({max:1e3}),n=iv,i=function(){if(zv)return Nv;zv=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(i,r){if(r=n(r),i instanceof e){if(i.loose===!!r.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),a("comparator",i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(e){const n=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],o=e.match(n);if(!o)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=t}toString(){return this.value}test(e){if(a("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"===typeof e)try{e=new s(e,this.options)}catch(sy){return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,i){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(t.value,i).test(this.value):""===t.operator?""===t.value||new c(this.value,i).test(t.semver):(!(i=n(i)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&!(!i.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||!!(o(this.semver,"<",t.semver,i)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(o(this.semver,">",t.semver,i)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}Nv=e;const n=iv,{safeRe:i,t:r}=sv,o=Lv,a=av,s=yv,c=jv();return Nv}(),r=av,o=yv,{safeRe:a,t:s,comparatorTrimReplace:c,tildeTrimReplace:l,caretTrimReplace:u}=sv,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=ov,h=t=>"<0.0.0-0"===t.value,p=t=>""===t.value,m=(t,e)=>{let n=!0;const i=t.slice();let r=i.pop();for(;n&&i.length;)n=i.every((t=>r.intersects(t,e))),r=i.pop();return n},g=(t,e)=>(r("comp",t,e),t=x(t,e),r("caret",t),t=y(t,e),r("tildes",t),t=w(t,e),r("xrange",t),t=E(t,e),r("stars",t),t),v=t=>!t||"x"===t.toLowerCase()||"*"===t,y=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const n=e.loose?a[s.TILDELOOSE]:a[s.TILDE];return t.replace(n,((e,n,i,o,a)=>{let s;return r("tilde",t,e,n,i,o,a),v(n)?s="":v(i)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):v(o)?s=">=".concat(n,".").concat(i,".0 <").concat(n,".").concat(+i+1,".0-0"):a?(r("replaceTilde pr",a),s=">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(+i+1,".0-0")):s=">=".concat(n,".").concat(i,".").concat(o," <").concat(n,".").concat(+i+1,".0-0"),r("tilde return",s),s}))},x=(t,e)=>t.trim().split(/\s+/).map((t=>_(t,e))).join(" "),_=(t,e)=>{r("caret",t,e);const n=e.loose?a[s.CARETLOOSE]:a[s.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,((e,n,o,a,s)=>{let c;return r("caret",t,e,n,o,a,s),v(n)?c="":v(o)?c=">=".concat(n,".0.0").concat(i," <").concat(+n+1,".0.0-0"):v(a)?c="0"===n?">=".concat(n,".").concat(o,".0").concat(i," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(i," <").concat(+n+1,".0.0-0"):s?(r("replaceCaret pr",s),c="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(n,".").concat(o,".").concat(+a+1,"-0"):">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(+n+1,".0.0-0")):(r("no pr"),c="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(a).concat(i," <").concat(n,".").concat(o,".").concat(+a+1,"-0"):">=".concat(n,".").concat(o,".").concat(a).concat(i," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(a," <").concat(+n+1,".0.0-0")),r("caret return",c),c}))},w=(t,e)=>(r("replaceXRanges",t,e),t.split(/\s+/).map((t=>k(t,e))).join(" ")),k=(t,e)=>{t=t.trim();const n=e.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return t.replace(n,((n,i,o,a,s,c)=>{r("xRange",t,n,i,o,a,s,c);const l=v(o),u=l||v(a),f=u||v(s),d=f;return"="===i&&d&&(i=""),c=e.includePrerelease?"-0":"",l?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(u&&(a=0),s=0,">"===i?(i=">=",u?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",u?o=+o+1:a=+a+1),"<"===i&&(c="-0"),n="".concat(i+o,".").concat(a,".").concat(s).concat(c)):u?n=">=".concat(o,".0.0").concat(c," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(a,".0").concat(c," <").concat(o,".").concat(+a+1,".0-0")),r("xRange return",n),n}))},E=(t,e)=>(r("replaceStars",t,e),t.trim().replace(a[s.STAR],"")),D=(t,e)=>(r("replaceGTE0",t,e),t.trim().replace(a[e.includePrerelease?s.GTE0PRE:s.GTE0],"")),A=t=>(e,n,i,r,o,a,s,c,l,u,f,d,h)=>(n=v(i)?"":v(r)?">=".concat(i,".0.0").concat(t?"-0":""):v(o)?">=".concat(i,".").concat(r,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":""),c=v(l)?"":v(u)?"<".concat(+l+1,".0.0-0"):v(f)?"<".concat(l,".").concat(+u+1,".0-0"):d?"<=".concat(l,".").concat(u,".").concat(f,"-").concat(d):t?"<".concat(l,".").concat(u,".").concat(+f+1,"-0"):"<=".concat(c),"".concat(n," ").concat(c).trim()),S=(t,e,n)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let n=0;n<t.length;n++)if(r(t[n].semver),t[n].semver!==i.ANY&&t[n].semver.prerelease.length>0){const i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0};return Rv}const Bv=jv();var Iv=(t,e,n)=>{try{e=new Bv(e,n)}catch(sy){return!1}return e.test(t)},Uv=Fg(Iv);var qv='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function Wv(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(const r of n)Hv(t,r);return t}function Hv(t,e){for(const n of Object.keys(e))(0,B.writeConfig)(t,n,e[n],!0)}function Xv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Jv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xv(Object(n),!0).forEach((function(e){Cg(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const Gv=B;let $v=o;const Zv="undefined"!==typeof window?window:void 0;void 0===$v&&null!==Zv&&void 0!==Zv&&null!==(kg=Zv.vl)&&void 0!==kg&&kg.compile&&($v=Zv.vl);const Yv={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Vv={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Kv={vega:"Vega","vega-lite":"Vega-Lite"},Qv={vega:Gv.version,"vega-lite":$v?$v.version:"not available"},ty={vega:t=>t,"vega-lite":(t,e)=>$v.compile(t,{config:e}).spec},ey='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>',ny="chart-wrapper";function iy(t,e,n,i){const r="<html><head>".concat(e,'</head><body><pre><code class="json">'),o="</code></pre>".concat(n,"</body></html>"),a=window.open("");a.document.write(r+t+o),a.document.title="".concat(Kv[i]," JSON Source")}function ry(t){return(e=t)&&"load"in e?t:Gv.loader(t);var e}async function oy(t,e){var n,i;let r,o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,B.isString)(e)?(o=ry(s.loader),r=JSON.parse(await o.load(e))):r=e;const c=function(t){var e,n;const i=null!==(e=null===(n=t.usermeta)||void 0===n?void 0:n.embedOptions)&&void 0!==e?e:{};return(0,B.isString)(i.defaultStyle)&&(i.defaultStyle=!1),i}(r),l=c.loader;var u;o&&!l||(o=ry(null!==(u=s.loader)&&void 0!==u?u:l));const f=await ay(c,o),d=await ay(s,o),h=Jv(Jv({},Wv(d,f)),{},{config:(0,B.mergeConfig)(null!==(n=d.config)&&void 0!==n?n:{},null!==(i=f.config)&&void 0!==i?i:{})});return await async function(t,e){var n,i,r,o,s,c,l;let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=arguments.length>3?arguments[3]:void 0;const d=u.theme?(0,B.mergeConfig)(a[u.theme],null!==(n=u.config)&&void 0!==n?n:{}):u.config,h=(0,B.isBoolean)(u.actions)?u.actions:Wv({},Yv,null!==(i=u.actions)&&void 0!==i?i:{}),p=Jv(Jv({},Vv),u.i18n),m=null!==(r=u.renderer)&&void 0!==r?r:"canvas",g=null!==(o=u.logLevel)&&void 0!==o?o:Gv.Warn,v=null!==(s=u.downloadFileName)&&void 0!==s?s:"visualization",y="string"===typeof t?document.querySelector(t):t;if(!y)throw new Error("".concat(t," does not exist"));if(!1!==u.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:n}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(y);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerHTML=void 0===u.defaultStyle||!0===u.defaultStyle?qv.toString():u.defaultStyle,n.appendChild(e)}}const b=function(t,e){if(t.$schema){const i=gm(t.$schema);var n;e&&e!==i.library&&console.warn("The given visualization spec is written in ".concat(Kv[i.library],", but mode argument sets ").concat(null!==(n=Kv[e])&&void 0!==n?n:e,"."));const r=i.library;return Uv(Qv[r],"^".concat(i.version.slice(1)))||console.warn("The input spec uses ".concat(Kv[r]," ").concat(i.version,", but the current version of ").concat(Kv[r]," is v").concat(Qv[r],".")),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!==e&&void 0!==e?e:"vega"}(e,u.mode);let x=ty[b](e,d);if("vega-lite"===b&&x.$schema){const t=gm(x.$schema);Uv(Qv.vega,"^".concat(t.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(t.version,", but current version is v").concat(Qv.vega,"."))}y.classList.add("vega-embed"),h&&y.classList.add("has-actions");y.innerHTML="";let _=y;if(h){const t=document.createElement("div");t.classList.add(ny),y.appendChild(t),_=t}const w=u.patch;w&&(x=w instanceof Function?w(x):E(x,w,!0,!1).newDocument);u.formatLocale&&Gv.formatLocale(u.formatLocale);u.timeFormatLocale&&Gv.timeFormatLocale(u.timeFormatLocale);if(u.expressionFunctions)for(const a in u.expressionFunctions){const t=u.expressionFunctions[a];"fn"in t?Gv.expressionFunction(a,t.fn,t.visitor):t instanceof Function&&Gv.expressionFunction(a,t)}const{ast:k}=u,D=Gv.parse(x,"vega-lite"===b?{}:d,{ast:k}),A=new(u.viewClass||Gv.View)(D,Jv({loader:f,logLevel:g,renderer:m},k?{expr:null!==(c=null!==(l=Gv.expressionInterpreter)&&void 0!==l?l:u.expr)&&void 0!==c?c:I.N}:{}));if(A.addSignalListener("autosize",((t,e)=>{const{type:n}=e;"fit-x"==n?(_.classList.add("fit-x"),_.classList.remove("fit-y")):"fit-y"==n?(_.classList.remove("fit-x"),_.classList.add("fit-y")):"fit"==n?_.classList.add("fit-x","fit-y"):_.classList.remove("fit-x","fit-y")})),!1!==u.tooltip){const t="function"===typeof u.tooltip?u.tooltip:new wg(!0===u.tooltip?{}:u.tooltip).call;A.tooltip(t)}let S,{hover:C}=u;void 0===C&&(C="vega"===b);if(C){const{hoverSet:t,updateSet:e}="boolean"===typeof C?{}:C;A.hover(t,e)}u&&(null!=u.width&&A.width(u.width),null!=u.height&&A.height(u.height),null!=u.padding&&A.padding(u.padding));if(await A.initialize(_,u.bind).runAsync(),!1!==h){let t=y;if(!1!==u.defaultStyle||u.forceActionsMenu){const e=document.createElement("details");e.title=p.CLICK_TO_VIEW_ACTIONS,y.append(e),t=e;const n=document.createElement("summary");n.innerHTML=ey,e.append(n),S=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",S)}const n=document.createElement("div");if(t.append(n),n.classList.add("vega-actions"),!0===h||!1!==h.export)for(const e of["svg","png"])if(!0===h||!0===h.export||h.export[e]){const t=p["".concat(e.toUpperCase(),"_ACTION")],i=document.createElement("a"),r=(0,B.isObject)(u.scaleFactor)?u.scaleFactor[e]:u.scaleFactor;i.text=t,i.href="#",i.target="_blank",i.download="".concat(v,".").concat(e),i.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await A.toImageURL(e,r);this.href=n})),n.append(i)}if(!0===h||!1!==h.source){const t=document.createElement("a");t.text=p.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var n,i;iy(j()(e),null!==(n=u.sourceHeader)&&void 0!==n?n:"",null!==(i=u.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),n.append(t)}if("vega-lite"===b&&(!0===h||!1!==h.compiled)){const t=document.createElement("a");t.text=p.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,n;iy(j()(x),null!==(e=u.sourceHeader)&&void 0!==e?e:"",null!==(n=u.sourceFooter)&&void 0!==n?n:"","vega"),t.preventDefault()})),n.append(t)}if(!0===h||!1!==h.editor){var F;const t=null!==(F=u.editorUrl)&&void 0!==F?F:"https://vega.github.io/editor/",i=document.createElement("a");i.text=p.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const i=t.open(e),{origin:r}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===i&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(i.postMessage(n,r),setTimeout(t,250),o-=1)}),250)}(window,t,{config:d,mode:b,renderer:m,spec:j()(e)}),n.preventDefault()})),n.append(i)}}function M(){S&&document.removeEventListener("click",S),A.finalize()}return{view:A,spec:e,vgSpec:x,finalize:M,embedOptions:u}}(t,r,h,o)}async function ay(t,e){var n;const i=(0,B.isString)(t.config)?JSON.parse(await e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},r=(0,B.isString)(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return Jv(Jv(Jv({},t),r?{patch:r}:{}),i?{config:i}:{})}},77155:(t,e,n)=>{"use strict";n.d(e,{r:()=>g});const i="view",r="[",o="]",a="{",s="}",c=":",l=",",u="@",f=">",d=/[[\]{}]/,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};let p,m;function g(t,e,n){return p=e||i,m=n||h,y(t.trim()).map(b)}function v(t,e,n,i,r){const o=t.length;let a,s=0;for(;e<o;++e){if(a=t[e],!s&&a===n)return e;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return e}function y(t){const e=[],n=t.length;let i=0,c=0;for(;c<n;)c=v(t,c,l,r+a,o+s),e.push(t.substring(i,c).trim()),i=++c;if(0===e.length)throw"Empty event selector: "+t;return e}function b(t){return"["===t[0]?function(t){const e=t.length;let n,i=1;if(i=v(t,i,o,r,o),i===e)throw"Empty between selector: "+t;if(n=y(t.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+t;if(t=t.slice(i+1).trim(),t[0]!==f)throw"Expected '>' after between selector: "+t;n=n.map(b);const a=b(t.slice(1).trim());if(a.between)return{between:n,stream:a};a.between=n;return a}(t):function(t){const e={source:p},n=[];let i,f,h=[0,0],g=0,y=0,b=t.length,x=0;if(t[b-1]===s){if(x=t.lastIndexOf(a),!(x>=0))throw"Unmatched right brace: "+t;try{h=function(t){const e=t.split(l);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!==n)throw t;return n}))}(t.substring(x+1,b-1))}catch(w){throw"Invalid throttle specification: "+t}b=(t=t.slice(0,x).trim()).length,x=0}if(!b)throw t;t[0]===u&&(g=++x);i=v(t,x,c),i<b&&(n.push(t.substring(y,i).trim()),y=x=++i);if(x=v(t,x,r),x===b)n.push(t.substring(y,b).trim());else if(n.push(t.substring(y,x).trim()),f=[],y=++x,y===b)throw"Unmatched left bracket: "+t;for(;x<b;){if(x=v(t,x,o),x===b)throw"Unmatched left bracket: "+t;if(f.push(t.substring(y,x).trim()),x<b-1&&t[++x]!==r)throw"Expected left bracket: "+t;y=++x}if(!(b=n.length)||d.test(n[b-1]))throw"Invalid event selector: "+t;b>1?(e.type=n[1],g?e.markname=n[0].slice(1):(_=n[0],m[_]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var _;"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=f&&(e.filter=f);h[0]&&(e.throttle=h[0]);h[1]&&(e.debounce=h[1]);return e}(t)}},88120:(t,e,n)=>{"use strict";n.d(e,{BJ:()=>Ht,Lt:()=>c,YP:()=>Gt,_G:()=>Xt,t$:()=>r,wk:()=>Jt});var i=n(15721);const r="Literal",o="Property",a="ArrayExpression",s="BinaryExpression",c="CallExpression",l="ConditionalExpression",u="LogicalExpression",f="MemberExpression",d="ObjectExpression",h="UnaryExpression";function p(t){this.type=t}var m,g,v,y,b;p.prototype.visit=function(t){let e,n,i;if(t(this))return 1;for(e=function(t){switch(t.type){case a:return t.elements;case s:case u:return[t.left,t.right];case c:return[t.callee].concat(t.arguments);case l:return[t.test,t.consequent,t.alternate];case f:return[t.object,t.property];case d:return t.properties;case o:return[t.key,t.value];case h:return[t.argument];default:return[]}}(this),n=0,i=e.length;n<i;++n)if(e[n].visit(t))return 1};var x=1,_=2,w=3,k=4,E=5,D=6,A=7,S=8;(m={})[x]="Boolean",m[_]="<end>",m[w]="Identifier",m[k]="Keyword",m[E]="Null",m[D]="Numeric",m[A]="Punctuator",m[S]="String",m[9]="RegularExpression";var C="ArrayExpression",F="BinaryExpression",M="CallExpression",O="ConditionalExpression",T="Identifier",N="Literal",z="LogicalExpression",R="MemberExpression",P="ObjectExpression",L="Property",j="UnaryExpression",B="Unexpected token %0",I="Unexpected number",U="Unexpected string",q="Unexpected identifier",W="Unexpected reserved word",H="Unexpected end of input",X="Invalid regular expression",J="Invalid regular expression: missing /",G="Octal literals are not allowed in strict mode.",$="Duplicate data property in object literal not allowed in strict mode",Z="ILLEGAL",Y="Disabled.",V=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),K=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Q(t,e){if(!t)throw new Error("ASSERT: "+e)}function tt(t){return t>=48&&t<=57}function et(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function nt(t){return"01234567".indexOf(t)>=0}function it(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function rt(t){return 10===t||13===t||8232===t||8233===t}function ot(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&V.test(String.fromCharCode(t))}function at(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&K.test(String.fromCharCode(t))}const st={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function ct(){for(;v<y;){const t=g.charCodeAt(v);if(!it(t)&&!rt(t))break;++v}}function lt(t){var e,n,i,r=0;for(n="u"===t?4:2,e=0;e<n;++e)v<y&&et(g[v])?(i=g[v++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):Dt({},B,Z);return String.fromCharCode(r)}function ut(){var t,e,n,i;for(e=0,"}"===(t=g[v])&&Dt({},B,Z);v<y&&et(t=g[v++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&Dt({},B,Z),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),i=56320+(e-65536&1023),String.fromCharCode(n,i))}function ft(){var t,e;for(t=g.charCodeAt(v++),e=String.fromCharCode(t),92===t&&(117!==g.charCodeAt(v)&&Dt({},B,Z),++v,(t=lt("u"))&&"\\"!==t&&ot(t.charCodeAt(0))||Dt({},B,Z),e=t);v<y&&at(t=g.charCodeAt(v));)++v,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==g.charCodeAt(v)&&Dt({},B,Z),++v,(t=lt("u"))&&"\\"!==t&&at(t.charCodeAt(0))||Dt({},B,Z),e+=t);return e}function dt(){var t,e;return t=v,e=92===g.charCodeAt(v)?ft():function(){var t,e;for(t=v++;v<y;){if(92===(e=g.charCodeAt(v)))return v=t,ft();if(!at(e))break;++v}return g.slice(t,v)}(),{type:1===e.length?w:st.hasOwnProperty(e)?k:"null"===e?E:"true"===e||"false"===e?x:w,value:e,start:t,end:v}}function ht(){var t,e,n,i,r=v,o=g.charCodeAt(v),a=g[v];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++v,{type:A,value:String.fromCharCode(o),start:r,end:v};default:if(61===(t=g.charCodeAt(v+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return v+=2,{type:A,value:String.fromCharCode(o)+String.fromCharCode(t),start:r,end:v};case 33:case 61:return v+=2,61===g.charCodeAt(v)&&++v,{type:A,value:g.slice(r,v),start:r,end:v}}}return">>>="===(i=g.substr(v,4))?{type:A,value:i,start:r,end:v+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:A,value:n,start:r,end:v+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:A,value:e,start:r,end:v+=2}:("//"===e&&Dt({},B,Z),"<>=!+-*%&|^/".indexOf(a)>=0?(++v,{type:A,value:a,start:r,end:v}):void Dt({},B,Z))}function pt(){var t,e,n;if(Q(tt((n=g[v]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=v,t="","."!==n){if(t=g[v++],n=g[v],"0"===t){if("x"===n||"X"===n)return++v,function(t){let e="";for(;v<y&&et(g[v]);)e+=g[v++];return 0===e.length&&Dt({},B,Z),ot(g.charCodeAt(v))&&Dt({},B,Z),{type:D,value:parseInt("0x"+e,16),start:t,end:v}}(e);if(nt(n))return function(t){let e="0"+g[v++];for(;v<y&&nt(g[v]);)e+=g[v++];return(ot(g.charCodeAt(v))||tt(g.charCodeAt(v)))&&Dt({},B,Z),{type:D,value:parseInt(e,8),octal:!0,start:t,end:v}}(e);n&&tt(n.charCodeAt(0))&&Dt({},B,Z)}for(;tt(g.charCodeAt(v));)t+=g[v++];n=g[v]}if("."===n){for(t+=g[v++];tt(g.charCodeAt(v));)t+=g[v++];n=g[v]}if("e"===n||"E"===n)if(t+=g[v++],"+"!==(n=g[v])&&"-"!==n||(t+=g[v++]),tt(g.charCodeAt(v)))for(;tt(g.charCodeAt(v));)t+=g[v++];else Dt({},B,Z);return ot(g.charCodeAt(v))&&Dt({},B,Z),{type:D,value:parseFloat(t),start:e,end:v}}function mt(){var t,e,n,i;return b=null,ct(),t=v,e=function(){var t,e,n,i;for(Q("/"===(t=g[v]),"Regular expression literal must start with a slash"),e=g[v++],n=!1,i=!1;v<y;)if(e+=t=g[v++],"\\"===t)rt((t=g[v++]).charCodeAt(0))&&Dt({},J),e+=t;else if(rt(t.charCodeAt(0)))Dt({},J);else if(n)"]"===t&&(n=!1);else{if("/"===t){i=!0;break}"["===t&&(n=!0)}return i||Dt({},J),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";v<y&&at((t=g[v]).charCodeAt(0));)++v,"\\"===t&&v<y?Dt({},B,Z):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&Dt({},X,n),{value:n,literal:e}}(),i=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";Dt({},X)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(i){Dt({},X)}try{return new RegExp(t,e)}catch(r){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:i,regex:{pattern:e.value,flags:n.value},start:t,end:v}}function gt(){if(ct(),v>=y)return{type:_,start:v,end:v};const t=g.charCodeAt(v);return ot(t)?dt():40===t||41===t||59===t?ht():39===t||34===t?function(){var t,e,n,i,r="",o=!1;for(Q("'"===(t=g[v])||'"'===t,"String literal must starts with a quote"),e=v,++v;v<y;){if((n=g[v++])===t){t="";break}if("\\"===n)if((n=g[v++])&&rt(n.charCodeAt(0)))"\r"===n&&"\n"===g[v]&&++v;else switch(n){case"u":case"x":"{"===g[v]?(++v,r+=ut()):r+=lt(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:nt(n)?(0!==(i="01234567".indexOf(n))&&(o=!0),v<y&&nt(g[v])&&(o=!0,i=8*i+"01234567".indexOf(g[v++]),"0123".indexOf(n)>=0&&v<y&&nt(g[v])&&(i=8*i+"01234567".indexOf(g[v++]))),r+=String.fromCharCode(i)):r+=n}else{if(rt(n.charCodeAt(0)))break;r+=n}}return""!==t&&Dt({},B,Z),{type:S,value:r,octal:o,start:e,end:v}}():46===t?tt(g.charCodeAt(v+1))?pt():ht():tt(t)?pt():ht()}function vt(){const t=b;return v=t.end,b=gt(),v=t.end,t}function yt(){const t=v;b=gt(),v=t}function bt(t,e,n){const i=new p("||"===t||"&&"===t?z:F);return i.operator=t,i.left=e,i.right=n,i}function xt(t,e){const n=new p(M);return n.callee=t,n.arguments=e,n}function _t(t){const e=new p(T);return e.name=t,e}function wt(t){const e=new p(N);return e.value=t.value,e.raw=g.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function kt(t,e,n){const i=new p(R);return i.computed="["===t,i.object=e,i.property=n,i.computed||(n.member=!0),i}function Et(t,e,n){const i=new p(L);return i.key=e,i.value=n,i.kind=t,i}function Dt(t,e){var n,i=Array.prototype.slice.call(arguments,2),r=e.replace(/%(\d)/g,((t,e)=>(Q(e<i.length,"Message reference must be in range"),i[e])));throw(n=new Error(r)).index=v,n.description=r,n}function At(t){t.type===_&&Dt(t,H),t.type===D&&Dt(t,I),t.type===S&&Dt(t,U),t.type===w&&Dt(t,q),t.type===k&&Dt(t,W),Dt(t,B,t.value)}function St(t){const e=vt();e.type===A&&e.value===t||At(e)}function Ct(t){return b.type===A&&b.value===t}function Ft(t){return b.type===k&&b.value===t}function Mt(){const t=[];for(v=b.start,St("[");!Ct("]");)Ct(",")?(vt(),t.push(null)):(t.push(qt()),Ct("]")||St(","));return vt(),function(t){const e=new p(C);return e.elements=t,e}(t)}function Ot(){v=b.start;const t=vt();return t.type===S||t.type===D?(t.octal&&Dt(t,G),wt(t)):_t(t.value)}function Tt(){var t,e,n;return v=b.start,(t=b).type===w?(n=Ot(),St(":"),Et("init",n,qt())):t.type!==_&&t.type!==A?(e=Ot(),St(":"),Et("init",e,qt())):void At(t)}function Nt(){var t,e,n=[],i={},r=String;for(v=b.start,St("{");!Ct("}");)e="$"+((t=Tt()).key.type===T?t.key.name:r(t.key.value)),Object.prototype.hasOwnProperty.call(i,e)?Dt({},$):i[e]=!0,n.push(t),Ct("}")||St(",");return St("}"),function(t){const e=new p(P);return e.properties=t,e}(n)}const zt={if:1};function Rt(){var t,e,n;if(Ct("("))return function(){St("(");const t=Wt();return St(")"),t}();if(Ct("["))return Mt();if(Ct("{"))return Nt();if(t=b.type,v=b.start,t===w||zt[b.value])n=_t(vt().value);else if(t===S||t===D)b.octal&&Dt(b,G),n=wt(vt());else{if(t===k)throw new Error(Y);t===x?((e=vt()).value="true"===e.value,n=wt(e)):t===E?((e=vt()).value=null,n=wt(e)):Ct("/")||Ct("/=")?(n=wt(mt()),yt()):At(vt())}return n}function Pt(){const t=[];if(St("("),!Ct(")"))for(;v<y&&(t.push(qt()),!Ct(")"));)St(",");return St(")"),t}function Lt(){v=b.start;const t=vt();return function(t){return t.type===w||t.type===k||t.type===x||t.type===E}(t)||At(t),_t(t.value)}function jt(){St("[");const t=Wt();return St("]"),t}function Bt(){const t=function(){var t;for(t=Rt();;)if(Ct("."))St("."),t=kt(".",t,Lt());else if(Ct("("))t=xt(t,Pt());else{if(!Ct("["))break;t=kt("[",t,jt())}return t}();if(b.type===A&&(Ct("++")||Ct("--")))throw new Error(Y);return t}function It(){var t,e;if(b.type!==A&&b.type!==k)e=Bt();else{if(Ct("++")||Ct("--"))throw new Error(Y);if(Ct("+")||Ct("-")||Ct("~")||Ct("!"))t=vt(),e=It(),e=function(t,e){const n=new p(j);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(Ft("delete")||Ft("void")||Ft("typeof"))throw new Error(Y);e=Bt()}}return e}function Ut(t){let e=0;if(t.type!==A&&t.type!==k)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function qt(){var t,e;return t=function(){var t,e,n,i,r,o,a,s,c,l;if(t=b,c=It(),0===(r=Ut(i=b)))return c;for(i.prec=r,vt(),e=[t,b],o=[c,i,a=It()];(r=Ut(b))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,c=o.pop(),e.pop(),n=bt(s,c,a),o.push(n);(i=vt()).prec=r,o.push(i),e.push(b),n=It(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=bt(o[l-1].value,o[l-2],n),l-=2;return n}(),Ct("?")&&(vt(),e=qt(),St(":"),t=function(t,e,n){const i=new p(O);return i.test=t,i.consequent=e,i.alternate=n,i}(t,e,qt())),t}function Wt(){const t=qt();if(Ct(","))throw new Error(Y);return t}function Ht(t){v=0,y=(g=t).length,b=null,yt();const e=Wt();if(b.type!==_)throw new Error("Unexpect token after expression.");return e}var Xt={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function Jt(t){function e(e,n,i){return r=>function(e,n,i,r){let o=t(n[0]);return i&&(o=i+"("+o+")",0===i.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(r<0?"":0===r?"()":"("+n.slice(1).map(t).join(",")+")")}(e,r,n,i)}const n="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&(0,i.vU)("Missing arguments to clamp function."),e.length>3&&(0,i.vU)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),trim:e("trim",r,0),regexp:o,test:e("test",o),if:function(e){e.length<3&&(0,i.vU)("Missing arguments to if function."),e.length>3&&(0,i.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function Gt(t){const e=(t=t||{}).allowed?(0,i.Rg)(t.allowed):{},n=t.forbidden?(0,i.Rg)(t.forbidden):{},r=t.constants||Xt,o=(t.functions||Jt)(d),a=t.globalvar,s=t.fieldvar,c=(0,i.mf)(a)?a:t=>"".concat(a,'["').concat(t,'"]');let l={},u={},f=0;function d(t){if((0,i.HD)(t))return t;const e=h[t.type];return null==e&&(0,i.vU)("Unsupported type: "+t.type),e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const o=t.name;return f>0?o:(0,i.nr)(n,o)?(0,i.vU)("Illegal identifier: "+o):(0,i.nr)(r,o)?r[o]:(0,i.nr)(e,o)?o:(l[o]=1,c(o))},MemberExpression:t=>{const e=!t.computed,n=d(t.object);e&&(f+=1);const i=d(t.property);return n===s&&(u[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(i)]=1),e&&(f-=1),n+(e?"."+i:"["+i+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&(0,i.vU)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=(0,i.nr)(o,e)&&o[e];return r||(0,i.vU)("Unrecognized function: "+e),(0,i.mf)(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(d).join(",")+"]",BinaryExpression:t=>"("+d(t.left)+" "+t.operator+" "+d(t.right)+")",UnaryExpression:t=>"("+t.operator+d(t.argument)+")",ConditionalExpression:t=>"("+d(t.test)+"?"+d(t.consequent)+":"+d(t.alternate)+")",LogicalExpression:t=>"("+d(t.left)+t.operator+d(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(d).join(",")+"}",Property:t=>{f+=1;const e=d(t.key);return f-=1,e+":"+d(t.value)}};function p(t){const e={code:d(t),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},e}return p.functions=o,p.constants=r,p}},60784:(t,e,n)=>{"use strict";n.d(e,{N:()=>h});var i={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},r={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},o={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const a=Array.prototype.slice,s=(t,e,n)=>{const i=n?n(e[0]):e[0];return i[t].apply(i,a.call(e,1))};var c={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:(t,e,n,i,r,o,a)=>new Date(t,e||0,null!=n?n:1,i||0,r||0,o||0,a||0),date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const l=["view","item","group","xy","x","y"],u=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&u.add(setImmediate);const f={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:"datum"===n?t.datum:"event"===n?t.event:"item"===n?t.item:i[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,i=t(e.object);n&&(t.memberDepth+=1);const r=t(e.property);if(n&&(t.memberDepth-=1),!u.has(i[r]))return i[r];console.error('Prevented interpretation of member "'.concat(r,'" which could lead to insecure code execution'))},CallExpression:(t,e)=>{const n=e.arguments;let i=e.callee.name;return i.startsWith("_")&&(i=i.slice(1)),"if"===i?t(n[0])?t(n[1]):t(n[2]):(t.fn[i]||c[i]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>r[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>o[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>"&&"===e.operator?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce(((e,n)=>{t.memberDepth+=1;const i=t(n.key);return t.memberDepth-=1,u.has(t(n.value))?console.error('Prevented interpretation of property "'.concat(i,'" which could lead to insecure code execution')):e[i]=t(n.value),e}),{})};function d(t,e,n,i,r,o){const a=t=>f[t.type](a,t);return a.memberDepth=0,a.fn=Object.create(e),a.params=n,a.datum=i,a.event=r,a.item=o,l.forEach((t=>a.fn[t]=function(){return r.vega[t](...arguments)})),a(t)}var h={operator(t,e){const n=e.ast,i=t.functions;return t=>d(n,i,t)},parameter(t,e){const n=e.ast,i=t.functions;return(t,e)=>d(n,i,e,t)},event(t,e){const n=e.ast,i=t.functions;return t=>d(n,i,void 0,void 0,t)},handler(t,e){const n=e.ast,i=t.functions;return(t,e)=>{const r=e.item&&e.item.datum;return d(n,i,t,r,e)}},encode(t,e){const{marktype:n,channels:i}=e,r=t.functions,o="group"===n||"image"===n||"rect"===n;return(t,e)=>{const a=t.datum;let s,c=0;for(const n in i)s=d(i[n].ast,r,e,a,void 0,t),t[n]!==s&&(t[n]=s,c=1);return"rule"!==n&&function(t,e,n){let i;e.x2&&(e.x?(n&&t.x>t.x2&&(i=t.x,t.x=t.x2,t.x2=i),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(i=t.y,t.y=t.y2,t.y2=i),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}(t,i,o),c}}}},15721:(t,e,n)=>{"use strict";function i(t,e,n){return t.fields=e||[],t.fname=n,t}function r(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}function a(t){return 1===t.length?s(t[0]):c(t)}n.d(e,{$G:()=>Lt,$m:()=>At,BB:()=>Rt,Ds:()=>at,Dw:()=>B,EP:()=>f,FP:()=>jt,HD:()=>wt,He:()=>T,Hq:()=>b,IX:()=>Y,J_:()=>yt,Jy:()=>kt,Kj:()=>_t,Kn:()=>A,N3:()=>Z,Oj:()=>o,QA:()=>U,Rg:()=>Pt,TS:()=>St,TW:()=>bt,We:()=>ct,XW:()=>mt,Xr:()=>ht,ZE:()=>i,ZU:()=>zt,Zw:()=>q,_k:()=>u,a9:()=>ot,ay:()=>H,bM:()=>p,bV:()=>G,cG:()=>k,dH:()=>X,dI:()=>lt,el:()=>r,fE:()=>C,fj:()=>O,hj:()=>xt,iL:()=>F,id:()=>d,j2:()=>et,jj:()=>x,jn:()=>vt,k:()=>v,kI:()=>w,kJ:()=>D,kX:()=>m,kg:()=>E,l$:()=>V,l7:()=>st,m8:()=>Ot,mJ:()=>I,mK:()=>J,mS:()=>$,mf:()=>K,nr:()=>ft,qu:()=>tt,rx:()=>Ct,sw:()=>Tt,t7:()=>Et,u5:()=>gt,uU:()=>_,vU:()=>l,vk:()=>Ft,yP:()=>Mt,yR:()=>h,yb:()=>g,yl:()=>pt});const s=t=>function(e){return e[t]},c=t=>{const e=t.length;return function(n){for(let i=0;i<e;++i)n=n[t[i]];return n}};function l(t){throw Error(t)}function u(t){const e=[],n=t.length;let i,r,o,a=null,s=0,c="";function u(){e.push(c+t.substring(i,r)),c="",i=r+1}for(t+="",i=r=0;r<n;++r)if(o=t[r],"\\"===o)c+=t.substring(i,r++),i=r;else if(o===a)u(),a=null,s=-1;else{if(a)continue;i===s&&'"'===o||i===s&&"'"===o?(i=r+1,a=o):"."!==o||s?"["===o?(r>i&&u(),s=i=r+1):"]"===o&&(s||l("Access path missing open bracket: "+t),s>0&&u(),s=0,i=r+1):r>i?u():i=r+1}return s&&l("Access path missing closing bracket: "+t),a&&l("Access path missing closing quote: "+t),r>i&&(r++,u()),e}function f(t,e,n){const r=u(t);return t=1===r.length?r[0]:t,i((n&&n.get||a)(r),[t],e||t)}const d=f("id"),h=i((t=>t),[],"identity"),p=i((()=>0),[],"zero"),m=i((()=>1),[],"one"),g=i((()=>!0),[],"true"),v=i((()=>!1),[],"false");function y(t,e,n){const i=[e].concat([].slice.call(n));console[t].apply(console,i)}const b=0,x=1,_=2,w=3,k=4;function E(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y,i=t||b;return{level(t){return arguments.length?(i=+t,this):i},error(){return i>=x&&n(e||"error","ERROR",arguments),this},warn(){return i>=_&&n(e||"warn","WARN",arguments),this},info(){return i>=w&&n(e||"log","INFO",arguments),this},debug(){return i>=k&&n(e||"log","DEBUG",arguments),this}}}var D=Array.isArray;function A(t){return t===Object(t)}const S=t=>"__proto__"!==t;function C(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=M(t.signals,e.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;F(t,n,e[n],i)}return t}),{})}function F(t,e,n,i){if(!S(e))return;let r,o;if(A(n)&&!D(n))for(r in o=A(t[e])?t[e]:t[e]={},n)i&&(!0===i||i[r])?F(o,r,n[r]):S(r)&&(o[r]=n[r]);else t[e]=n}function M(t,e){if(null==t)return e;const n={},i=[];function r(t){n[t.name]||(n[t.name]=1,i.push(t))}return e.forEach(r),t.forEach(r),i}function O(t){return t[t.length-1]}function T(t){return null==t||""===t?null:+t}const N=t=>e=>t*Math.exp(e),z=t=>e=>Math.log(t*e),R=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),P=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,L=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function j(t,e,n,i){const r=n(t[0]),o=n(O(t)),a=(o-r)*e;return[i(r-a),i(o-a)]}function B(t,e){return j(t,e,T,h)}function I(t,e){var n=Math.sign(t[0]);return j(t,e,z(n),N(n))}function U(t,e,n){return j(t,e,L(n),L(1/n))}function q(t,e,n){return j(t,e,R(n),P(n))}function W(t,e,n,i,r){const o=i(t[0]),a=i(O(t)),s=null!=e?i(e):(o+a)/2;return[r(s+(o-s)*n),r(s+(a-s)*n)]}function H(t,e,n){return W(t,e,n,T,h)}function X(t,e,n){const i=Math.sign(t[0]);return W(t,e,n,z(i),N(i))}function J(t,e,n,i){return W(t,e,n,L(i),L(1/i))}function G(t,e,n,i){return W(t,e,n,R(i),P(i))}function $(t){return 1+~~(new Date(t).getMonth()/3)}function Z(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Y(t){return null!=t?D(t)?t:[t]:[]}function V(t,e,n){let i,r=t[0],o=t[1];return o<r&&(i=o,o=r,r=i),i=o-r,i>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-i),r+i]}function K(t){return"function"===typeof t}const Q="descending";function tt(t,e,n){n=n||{},e=Y(e)||[];const r=[],a=[],s={},c=n.comparator||nt;return Y(t).forEach(((t,i)=>{null!=t&&(r.push(e[i]===Q?-1:1),a.push(t=K(t)?t:f(t,null,n)),(o(t)||[]).forEach((t=>s[t]=1)))})),0===a.length?null:i(c(a,r),Object.keys(s))}const et=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),nt=(t,e)=>1===t.length?it(t[0],e[0]):rt(t,e,t.length),it=(t,e)=>function(n,i){return et(t(n),t(i))*e},rt=(t,e,n)=>(e.push(0),function(i,r){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=et(o(i),o(r));return a*e[s]});function ot(t){return K(t)?t:()=>t}function at(t,e){let n;return i=>{n&&clearTimeout(n),n=setTimeout((()=>(e(i),n=null)),t)}}function st(t){for(let e,n,i=1,r=arguments.length;i<r;++i)for(n in e=arguments[i],e)t[n]=e[n];return t}function ct(t,e){let n,i,r,o,a=0;if(t&&(n=t.length))if(null==e){for(i=t[a];a<n&&(null==i||i!==i);i=t[++a]);for(r=o=i;a<n;++a)i=t[a],null!=i&&(i<r&&(r=i),i>o&&(o=i))}else{for(i=e(t[a]);a<n&&(null==i||i!==i);i=e(t[++a]));for(r=o=i;a<n;++a)i=e(t[a]),null!=i&&(i<r&&(r=i),i>o&&(o=i))}return[r,o]}function lt(t,e){const n=t.length;let i,r,o,a,s,c=-1;if(null==e){for(;++c<n;)if(r=t[c],null!=r&&r>=r){i=o=r;break}if(c===n)return[-1,-1];for(a=s=c;++c<n;)r=t[c],null!=r&&(i>r&&(i=r,a=c),o<r&&(o=r,s=c))}else{for(;++c<n;)if(r=e(t[c],c,t),null!=r&&r>=r){i=o=r;break}if(c===n)return[-1,-1];for(a=s=c;++c<n;)r=e(t[c],c,t),null!=r&&(i>r&&(i=r,a=c),o<r&&(o=r,s=c))}return[a,s]}const ut=Object.prototype.hasOwnProperty;function ft(t,e){return ut.call(t,e)}const dt={};function ht(t){let e,n={};function i(t){return ft(n,t)&&n[t]!==dt}const r={size:0,empty:0,object:n,has:i,get:t=>i(t)?n[t]:void 0,set(t,e){return i(t)||(++r.size,n[t]===dt&&--r.empty),n[t]=e,this},delete(t){return i(t)&&(--r.size,++r.empty,n[t]=dt),this},clear(){r.size=r.empty=0,r.object=n={}},test(t){return arguments.length?(e=t,r):e},clean(){const t={};let i=0;for(const r in n){const o=n[r];o===dt||e&&e(o)||(t[r]=o,++i)}r.size=i,r.empty=0,r.object=n=t}};return t&&Object.keys(t).forEach((e=>{r.set(e,t[e])})),r}function pt(t,e,n,i,r,o){if(!n&&0!==n)return o;const a=+n;let s,c=t[0],l=O(t);l<c&&(s=c,c=l,l=s),s=Math.abs(e-c);const u=Math.abs(l-e);return s<u&&s<=a?i:u<=a?r:o}function mt(t,e,n){const i=t.prototype=Object.create(e.prototype);return Object.defineProperty(i,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),st(i,n)}function gt(t,e,n,i){let r,o=e[0],a=e[e.length-1];return o>a&&(r=o,o=a,a=r),i=void 0===i||i,((n=void 0===n||n)?o<=t:o<t)&&(i?t<=a:t<a)}function vt(t){return"boolean"===typeof t}function yt(t){return"[object Date]"===Object.prototype.toString.call(t)}function bt(t){return t&&K(t[Symbol.iterator])}function xt(t){return"number"===typeof t}function _t(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function wt(t){return"string"===typeof t}function kt(t,e,n){t&&(t=e?Y(t).map((t=>t.replace(/\\(.)/g,"$1"))):Y(t));const r=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:u(t));let c;if(r)if(1===r){const e=s(t[0]);c=function(t){return""+e(t)}}else{const e=t.map(s);c=function(t){let n=""+e[0](t),i=0;for(;++i<r;)n+="|"+e[i](t);return n}}else c=function(){return""};return i(c,t,"key")}function Et(t,e){const n=t[0],i=O(t),r=+e;return r?1===r?i:n+r*(i-n):n}const Dt=1e4;function At(t){let e,n,i;t=+t||Dt;const r=()=>{e={},n={},i=0},o=(r,o)=>(++i>t&&(n=e,e={},i=1),e[r]=o);return r(),{clear:r,has:t=>ft(e,t)||ft(n,t),get:t=>ft(e,t)?e[t]:ft(n,t)?o(t,n[t]):void 0,set:(t,n)=>ft(e,t)?e[t]=n:o(t,n)}}function St(t,e,n,i){const r=e.length,o=n.length;if(!o)return e;if(!r)return n;const a=i||new e.constructor(r+o);let s=0,c=0,l=0;for(;s<r&&c<o;++l)a[l]=t(e[s],n[c])>0?n[c++]:e[s++];for(;s<r;++s,++l)a[l]=e[s];for(;c<o;++c,++l)a[l]=n[c];return a}function Ct(t,e){let n="";for(;--e>=0;)n+=t;return n}function Ft(t,e,n,i){const r=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===i?Ct(r,a)+o:"center"===i?Ct(r,~~(a/2))+o+Ct(r,Math.ceil(a/2)):o+Ct(r,a)}function Mt(t){return t&&O(t)-t[0]||0}function Ot(t){return D(t)?"["+t.map(Ot)+"]":A(t)||wt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Tt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Nt=t=>xt(t)||yt(t)?t:Date.parse(t);function zt(t,e){return e=e||Nt,null==t||""===t?null:e(t)}function Rt(t){return null==t||""===t?null:t+""}function Pt(t){const e={},n=t.length;for(let i=0;i<n;++i)e[t[i]]=!0;return e}function Lt(t,e,n,i){const r=null!=i?i:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-r.length);return a<=e?o:"left"===n?r+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+r+o.slice(a-~~(s/2)):o.slice(0,s)+r}function jt(t,e,n){if(t)if(e){const i=t.length;for(let r=0;r<i;++r){const i=e(t[r]);i&&n(i,r,t)}}else t.forEach(n)}},91149:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Bounds:()=>$d,CanvasHandler:()=>Am,CanvasRenderer:()=>Om,DATE:()=>Mt,DAY:()=>Ot,DAYOFYEAR:()=>Tt,Dataflow:()=>Nr,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>yr,Gradient:()=>Kf,GroupItem:()=>Yd,HOURS:()=>Nt,Handler:()=>sm,Info:()=>m.kI,Item:()=>Zd,MILLISECONDS:()=>Pt,MINUTES:()=>zt,MONTH:()=>Ct,Marks:()=>Xp,MultiPulse:()=>Cr,None:()=>m.Hq,Operator:()=>mr,Parameters:()=>dr,Pulse:()=>Er,QUARTER:()=>St,RenderType:()=>wg,Renderer:()=>lm,ResourceLoader:()=>Vd,SECONDS:()=>Rt,SVGHandler:()=>Nm,SVGRenderer:()=>og,SVGStringRenderer:()=>bg,Scenegraph:()=>Qp,TIME_UNITS:()=>Lt,Transform:()=>Rr,View:()=>kF,WEEK:()=>Ft,Warn:()=>m.uU,YEAR:()=>At,accessor:()=>m.ZE,accessorFields:()=>m.Oj,accessorName:()=>m.el,array:()=>m.IX,ascending:()=>m.j2,bandwidthNRD:()=>Jr,bin:()=>Gr,bootstrapCI:()=>Yr,boundClip:()=>Mg,boundContext:()=>yh,boundItem:()=>Jp,boundMark:()=>$p,boundStroke:()=>th,changeset:()=>ur,clampRange:()=>m.l$,codegenExpression:()=>EA.YP,compare:()=>m.qu,constant:()=>m.a9,cumulativeLogNormal:()=>fo,cumulativeNormal:()=>oo,cumulativeUniform:()=>yo,dayofyear:()=>Ht,debounce:()=>m.Ds,defaultLocale:()=>wi,definition:()=>Lr,densityLogNormal:()=>uo,densityNormal:()=>ro,densityUniform:()=>vo,domChild:()=>im,domClear:()=>rm,domCreate:()=>em,domFind:()=>nm,dotbin:()=>Vr,error:()=>m.vU,expressionFunction:()=>bC,extend:()=>m.l7,extent:()=>m.We,extentIndex:()=>m.dI,falsy:()=>m.k,fastmap:()=>m.Xr,field:()=>m.EP,flush:()=>m.yl,font:()=>Lp,fontFamily:()=>Pp,fontSize:()=>Op,format:()=>Ji,formatLocale:()=>pi,formats:()=>Gi,hasOwnProperty:()=>m.nr,id:()=>m.id,identity:()=>m.yR,inferType:()=>Bi,inferTypes:()=>Ii,ingest:()=>rr,inherits:()=>m.XW,inrange:()=>m.u5,interpolate:()=>xf,interpolateColors:()=>vf,interpolateRange:()=>gf,intersect:()=>Dg,intersectBoxLine:()=>Fh,intersectPath:()=>Dh,intersectPoint:()=>Ah,intersectRule:()=>Ch,isArray:()=>m.kJ,isBoolean:()=>m.jn,isDate:()=>m.J_,isFunction:()=>m.mf,isIterable:()=>m.TW,isNumber:()=>m.hj,isObject:()=>m.Kn,isRegExp:()=>m.Kj,isString:()=>m.HD,isTuple:()=>er,key:()=>m.Jy,lerp:()=>m.t7,lineHeight:()=>Tp,loader:()=>Yi,locale:()=>_i,logger:()=>m.kg,lruCache:()=>m.$m,markup:()=>Vm,merge:()=>m.TS,mergeConfig:()=>m.fE,multiLineOffset:()=>zp,one:()=>m.kX,pad:()=>m.vk,panLinear:()=>m.Dw,panLog:()=>m.mJ,panPow:()=>m.QA,panSymlog:()=>m.Zw,parse:()=>XN,parseExpression:()=>EA.BJ,parseSelector:()=>CF.r,path:()=>Mc,pathCurves:()=>td,pathEqual:()=>Ng,pathParse:()=>ad,pathRectangle:()=>Md,pathRender:()=>vd,pathSymbols:()=>_d,pathTrail:()=>Od,peek:()=>m.fj,point:()=>am,projection:()=>J_,quantileLogNormal:()=>ho,quantileNormal:()=>ao,quantileUniform:()=>bo,quantiles:()=>Hr,quantizeInterpolator:()=>yf,quarter:()=>m.mS,quartiles:()=>Xr,random:()=>$r,randomInteger:()=>Qr,randomKDE:()=>co,randomLCG:()=>Kr,randomLogNormal:()=>po,randomMixture:()=>mo,randomNormal:()=>so,randomUniform:()=>xo,read:()=>Zi,regressionConstant:()=>_o,regressionExp:()=>Co,regressionLinear:()=>Ao,regressionLoess:()=>Ro,regressionLog:()=>So,regressionPoly:()=>Oo,regressionPow:()=>Fo,regressionQuad:()=>Mo,renderModule:()=>Eg,repeat:()=>m.rx,resetDefaultLocale:()=>ki,resetSVGClipId:()=>Jd,resetSVGDefIds:()=>zg,responseType:()=>$i,runtimeContext:()=>FC,sampleCurve:()=>Bo,sampleLogNormal:()=>lo,sampleNormal:()=>io,sampleUniform:()=>go,scale:()=>af,sceneEqual:()=>Tg,sceneFromJSON:()=>Vp,scenePickVisit:()=>Ih,sceneToJSON:()=>Yp,sceneVisit:()=>Bh,sceneZOrder:()=>jh,scheme:()=>Ef,serializeXML:()=>Km,setRandom:()=>Zr,span:()=>m.yP,splitAccessPath:()=>m._k,stringValue:()=>m.m8,textMetrics:()=>Dp,timeBin:()=>ze,timeFloor:()=>ae,timeFormatLocale:()=>bi,timeInterval:()=>de,timeOffset:()=>me,timeSequence:()=>ye,timeUnitSpecifier:()=>Ut,timeUnits:()=>Bt,toBoolean:()=>m.sw,toDate:()=>m.ZU,toNumber:()=>m.He,toSet:()=>m.Rg,toString:()=>m.BB,transform:()=>jr,transforms:()=>Pr,truncate:()=>m.$G,truthy:()=>m.yb,tupleid:()=>nr,typeParsers:()=>Pi,utcFloor:()=>le,utcInterval:()=>he,utcOffset:()=>ge,utcSequence:()=>be,utcdayofyear:()=>Yt,utcquarter:()=>m.N3,utcweek:()=>Vt,version:()=>JN,visitArray:()=>m.FP,week:()=>Xt,writeConfig:()=>m.iL,zero:()=>m.bM,zoomLinear:()=>m.ay,zoomLog:()=>m.dH,zoomPow:()=>m.mK,zoomSymlog:()=>m.bV});var i={};n.r(i),n.d(i,{aggregate:()=>oa,bin:()=>aa,collect:()=>ca,compare:()=>la,countpattern:()=>fa,cross:()=>da,density:()=>ga,dotbin:()=>_a,expression:()=>wa,extent:()=>Ea,facet:()=>Aa,field:()=>Sa,filter:()=>Fa,flatten:()=>Ma,fold:()=>Oa,formula:()=>Ta,generate:()=>Na,impute:()=>Pa,joinaggregate:()=>La,kde:()=>ja,key:()=>Ba,load:()=>Ua,lookup:()=>Wa,multiextent:()=>Ha,multivalues:()=>Ja,params:()=>$a,pivot:()=>Za,prefacet:()=>Ya,project:()=>Va,proxy:()=>Ka,quantile:()=>Qa,relay:()=>ts,sample:()=>es,sequence:()=>ns,sieve:()=>is,subflow:()=>Da,timeunit:()=>rs,tupleindex:()=>as,values:()=>ss,window:()=>ds});var r={};n.r(r),n.d(r,{interpolate:()=>dl.Z,interpolateArray:()=>Al.Z,interpolateBasis:()=>Sl.Z,interpolateBasisClosed:()=>Cl.Z,interpolateCubehelix:()=>Su,interpolateCubehelixLong:()=>Cu,interpolateDate:()=>Fl.Z,interpolateDiscrete:()=>Ml,interpolateHcl:()=>pu,interpolateHclLong:()=>mu,interpolateHsl:()=>Wl,interpolateHslLong:()=>Hl,interpolateHue:()=>Tl,interpolateLab:()=>du,interpolateNumber:()=>Nl.Z,interpolateNumberArray:()=>zl.Z,interpolateObject:()=>Rl.Z,interpolateRgb:()=>Il.ZP,interpolateRgbBasis:()=>Il.hD,interpolateRgbBasisClosed:()=>Il.YD,interpolateRound:()=>hl.Z,interpolateString:()=>Pl.Z,interpolateTransformCss:()=>Ll.Y,interpolateTransformSvg:()=>Ll.w,interpolateZoom:()=>Bl,piecewise:()=>yl,quantize:()=>Fu});var o={};n.r(o),n.d(o,{bound:()=>yv,identifier:()=>_v,mark:()=>wv,overlap:()=>kv,render:()=>Mv,viewlayout:()=>Kv});var a={};n.r(a),n.d(a,{axisticks:()=>ty,datajoin:()=>ey,encode:()=>iy,legendentries:()=>ry,linkpath:()=>ly,pie:()=>py,scale:()=>yy,sortitems:()=>wy,stack:()=>Sy});var s={};n.r(s),n.d(s,{contour:()=>mw,geojson:()=>yw,geopath:()=>bw,geopoint:()=>xw,geoshape:()=>_w,graticule:()=>ww,heatmap:()=>kw,isocontour:()=>ow,kde2d:()=>dw,projection:()=>Dw});var c={};n.r(c),n.d(c,{force:()=>sk});var l={};n.r(l),n.d(l,{nest:()=>pE,pack:()=>xE,partition:()=>wE,stratify:()=>kE,tree:()=>AE,treelinks:()=>SE,treemap:()=>ME});var u={};n.r(u),n.d(u,{label:()=>QE});var f={};n.r(f),n.d(f,{loess:()=>eD,regression:()=>iD});var d={};n.r(d),n.d(d,{voronoi:()=>PD});var h={};n.r(h),n.d(h,{wordcloud:()=>KD});var p={};n.r(p),n.d(p,{crossfilter:()=>aA,resolvefilter:()=>sA});var m=n(15721),g={},v={},y=34,b=10,x=13;function _(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function w(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function k(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function E(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+k(-e,6):e>9999?"+"+k(e,6):k(e,4))+"-"+k(t.getUTCMonth()+1,2)+"-"+k(t.getUTCDate(),2)+(o?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"."+k(o,3)+"Z":r?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"Z":i||n?"T"+k(n,2)+":"+k(i,2)+"Z":"")}function D(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return v;if(l)return l=!1,g;var e,i,r=a;if(t.charCodeAt(r)===y){for(;a++<o&&t.charCodeAt(a)!==y||t.charCodeAt(++a)===y;);return(e=a)>=o?c=!0:(i=t.charCodeAt(a++))===b?l=!0:i===x&&(l=!0,t.charCodeAt(a)===b&&++a),t.slice(r+1,e-1).replace(/""/g,'"')}for(;a<o;){if((i=t.charCodeAt(e=a++))===b)l=!0;else if(i===x)l=!0,t.charCodeAt(a)===b&&++a;else if(i!==n)continue;return t.slice(r,e)}return c=!0,t.slice(r,o)}for(t.charCodeAt(o-1)===b&&--o,t.charCodeAt(o-1)===x&&--o;(i=u())!==v;){for(var f=[];i!==g&&i!==v;)f.push(i),i=u();e&&null==(f=e(f,s++))||r.push(f)}return r}function r(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?E(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,o=i(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=_(t);return function(i,r){return e(n(i),r,t)}}(t,e):_(t)}));return o.columns=r||[],o},parseRows:i,format:function(e,n){return null==n&&(n=w(e)),[n.map(a).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=w(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function A(t){return t}function S(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return C(t,e)}))}:C(t,e)}function C(t,e){var n=e.id,i=e.bbox,r=null==e.properties?{}:e.properties,o=F(t,e);return null==n&&null==i?{type:"Feature",properties:r,geometry:o}:null==i?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function F(t,e){var n=function(t){if(null==t)return A;var e,n,i=t.scale[0],r=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var c=2,l=t.length,u=new Array(l);for(u[0]=(e+=t[0])*i+o,u[1]=(n+=t[1])*r+a;c<l;)u[c]=t[c],++c;return u}}(t.transform),i=t.arcs;function r(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],o=0,a=r.length;o<a;++o)e.push(n(r[o],o));t<0&&function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function c(t){return t.map(s)}return function t(e){var n,i=e.type;switch(i){case"GeometryCollection":return{type:i,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=c(e.arcs);break;case"MultiPolygon":n=e.arcs.map(c);break;default:return null}return{type:i,coordinates:n}}(e)}function M(t,e){var n={},i={},r={},o=[],a=-1;function s(t,e){for(var i in t){var r=t[i];delete e[r.start],delete r.start,delete r.end,r.forEach((function(t){n[t<0?~t:t]=1})),o.push(r)}}return e.forEach((function(n,i){var r,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=e[++a],e[a]=n,e[i]=r)})),e.forEach((function(e){var n,o,a=function(e){var n,i=t.arcs[e<0?~e:e],r=i[0];t.transform?(n=[0,0],i.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=i[i.length-1];return e<0?[n,r]:[r,n]}(e),s=a[0],c=a[1];if(n=r[s])if(delete r[n.end],n.push(e),n.end=c,o=i[c]){delete i[o.start];var l=o===n?n:n.concat(o);i[l.start=n.start]=r[l.end=o.end]=l}else i[n.start]=r[n.end]=n;else if(n=i[c])if(delete i[n.start],n.unshift(e),n.start=s,o=r[s]){delete r[o.end];var u=o===n?n:o.concat(n);i[u.start=o.start]=r[u.end=n.end]=u}else i[n.start]=r[n.end]=n;else i[(n=[e]).start=s]=r[n.end=c]=n})),s(r,i),s(i,r),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function O(t){return F(t,T.apply(this,arguments))}function T(t,e,n){var i,r,o;if(arguments.length>1)i=function(t,e,n){var i,r=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:i})}function s(t){t.forEach(a)}function c(t){t.forEach(s)}function l(t){t.forEach(c)}function u(t){switch(i=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":c(t.arcs);break;case"MultiPolygon":l(t.arcs)}}return u(e),o.forEach(null==n?function(t){r.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&r.push(t[0].i)}),r}(0,e,n);else for(r=0,i=new Array(o=t.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:M(t,i)}}var N=n(88747),z=n(14547),R=n(37012),P=n(29641),L=n(86790),j=n(86425),B=n(28159);const I=new Date,U=new Date;function q(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=n=>q((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(I.setTime(+e),U.setTime(+i),t(I),t(U),Math.floor(n(I,U))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const W=1e3,H=6e4,X=36e5,J=864e5,G=6048e5,$=2592e6,Z=31536e6,Y=q((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*H)/J),(t=>t.getDate()-1)),V=(Y.range,q((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/J),(t=>t.getUTCDate()-1))),K=(V.range,q((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/J),(t=>Math.floor(t/J))));K.range;function Q(t){return q((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*H)/G))}const tt=Q(0),et=Q(1),nt=Q(2),it=Q(3),rt=Q(4),ot=Q(5),at=Q(6);tt.range,et.range,nt.range,it.range,rt.range,ot.range,at.range;function st(t){return q((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/G))}const ct=st(0),lt=st(1),ut=st(2),ft=st(3),dt=st(4),ht=st(5),pt=st(6),mt=(ct.range,lt.range,ut.range,ft.range,dt.range,ht.range,pt.range,q((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));mt.every=t=>isFinite(t=Math.floor(t))&&t>0?q((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;mt.range;const gt=q((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));gt.every=t=>isFinite(t=Math.floor(t))&&t>0?q((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;gt.range;const vt=q((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),yt=(vt.range,q((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),bt=(yt.range,q((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*W-t.getMinutes()*H)}),((t,e)=>{t.setTime(+t+e*X)}),((t,e)=>(e-t)/X),(t=>t.getHours()))),xt=(bt.range,q((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*X)}),((t,e)=>(e-t)/X),(t=>t.getUTCHours()))),_t=(xt.range,q((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*W)}),((t,e)=>{t.setTime(+t+e*H)}),((t,e)=>(e-t)/H),(t=>t.getMinutes()))),wt=(_t.range,q((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*H)}),((t,e)=>(e-t)/H),(t=>t.getUTCMinutes()))),kt=(wt.range,q((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*W)}),((t,e)=>(e-t)/W),(t=>t.getUTCSeconds()))),Et=(kt.range,q((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t)));Et.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?q((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Et:null);Et.range;var Dt=n(53619);const At="year",St="quarter",Ct="month",Ft="week",Mt="date",Ot="day",Tt="dayofyear",Nt="hours",zt="minutes",Rt="seconds",Pt="milliseconds",Lt=[At,St,Ct,Ft,Mt,Ot,Tt,Nt,zt,Rt,Pt],jt=Lt.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function Bt(t){const e=(0,m.IX)(t).slice(),n={};e.length||(0,m.vU)("Missing time unit."),e.forEach((t=>{(0,m.nr)(jt,t)?n[t]=1:(0,m.vU)("Invalid time unit: ".concat(t,"."))}));return(n[Ft]||n[Ot]?1:0)+(n[St]||n[Ct]||n[Mt]?1:0)+(n[Tt]?1:0)>1&&(0,m.vU)("Incompatible time units: ".concat(t)),e.sort(((t,e)=>jt[t]-jt[e])),e}const It={[At]:"%Y ",[St]:"Q%q ",[Ct]:"%b ",[Mt]:"%d ",[Ft]:"W%U ",[Ot]:"%a ",[Tt]:"%j ",[Nt]:"%H:00",[zt]:"00:%M",[Rt]:":%S",[Pt]:".%L",["".concat(At,"-").concat(Ct)]:"%Y-%m ",["".concat(At,"-").concat(Ct,"-").concat(Mt)]:"%Y-%m-%d ",["".concat(Nt,"-").concat(zt)]:"%H:%M"};function Ut(t,e){const n=(0,m.l7)({},It,e),i=Bt(t),r=i.length;let o,a,s="",c=0;for(c=0;c<r;)for(o=i.length;o>c;--o)if(a=i.slice(c,o).join("-"),null!=n[a]){s+=n[a],c=o;break}return s.trim()}const qt=new Date;function Wt(t){return qt.setFullYear(t),qt.setMonth(0),qt.setDate(1),qt.setHours(0,0,0,0),qt}function Ht(t){return Jt(new Date(t))}function Xt(t){return Gt(new Date(t))}function Jt(t){return Y.count(Wt(t.getFullYear())-1,t)}function Gt(t){return tt.count(Wt(t.getFullYear())-1,t)}function $t(t){return Wt(t).getDay()}function Zt(t,e,n,i,r,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,i,r,o,a);return s.setFullYear(t),s}return new Date(t,e,n,i,r,o,a)}function Yt(t){return Kt(new Date(t))}function Vt(t){return Qt(new Date(t))}function Kt(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return V.count(e-1,t)}function Qt(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return ct.count(e-1,t)}function te(t){return qt.setTime(Date.UTC(t,0,1)),qt.getUTCDay()}function ee(t,e,n,i,r,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,i,r,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,i,r,o,a))}function ne(t,e,n,i,r){const o=e||1,a=(0,m.fj)(t),s=(t,e,r)=>function(t,e,n,i){const r=n<=1?t:i?(e,r)=>i+n*Math.floor((t(e,r)-i)/n):(e,i)=>n*Math.floor(t(e,i)/n);return e?(t,n)=>e(r(t,n),n):r}(n[r=r||t],i[r],t===a&&o,e),c=new Date,l=(0,m.Rg)(t),u=l[At]?s(At):(0,m.a9)(2012),f=l[Ct]?s(Ct):l[St]?s(St):m.bM,d=l[Ft]&&l[Ot]?s(Ot,1,Ft+Ot):l[Ft]?s(Ft,1):l[Ot]?s(Ot,1):l[Mt]?s(Mt,1):l[Tt]?s(Tt,1):m.kX,h=l[Nt]?s(Nt):m.bM,p=l[zt]?s(zt):m.bM,g=l[Rt]?s(Rt):m.bM,v=l[Pt]?s(Pt):m.bM;return function(t){c.setTime(+t);const e=u(c);return r(e,f(c),d(c,e),h(c),p(c),g(c),v(c))}}function ie(t,e,n){return e+7*t-(n+6)%7}const re={[At]:t=>t.getFullYear(),[St]:t=>Math.floor(t.getMonth()/3),[Ct]:t=>t.getMonth(),[Mt]:t=>t.getDate(),[Nt]:t=>t.getHours(),[zt]:t=>t.getMinutes(),[Rt]:t=>t.getSeconds(),[Pt]:t=>t.getMilliseconds(),[Tt]:t=>Jt(t),[Ft]:t=>Gt(t),[Ft+Ot]:(t,e)=>ie(Gt(t),t.getDay(),$t(e)),[Ot]:(t,e)=>ie(1,t.getDay(),$t(e))},oe={[St]:t=>3*t,[Ft]:(t,e)=>ie(t,0,$t(e))};function ae(t,e){return ne(t,e||1,re,oe,Zt)}const se={[At]:t=>t.getUTCFullYear(),[St]:t=>Math.floor(t.getUTCMonth()/3),[Ct]:t=>t.getUTCMonth(),[Mt]:t=>t.getUTCDate(),[Nt]:t=>t.getUTCHours(),[zt]:t=>t.getUTCMinutes(),[Rt]:t=>t.getUTCSeconds(),[Pt]:t=>t.getUTCMilliseconds(),[Tt]:t=>Kt(t),[Ft]:t=>Qt(t),[Ot]:(t,e)=>ie(1,t.getUTCDay(),te(e)),[Ft+Ot]:(t,e)=>ie(Qt(t),t.getUTCDay(),te(e))},ce={[St]:t=>3*t,[Ft]:(t,e)=>ie(t,0,te(e))};function le(t,e){return ne(t,e||1,se,ce,ee)}const ue={[At]:mt,[St]:vt.every(3),[Ct]:vt,[Ft]:tt,[Mt]:Y,[Ot]:Y,[Tt]:Y,[Nt]:bt,[zt]:_t,[Rt]:kt,[Pt]:Et},fe={[At]:gt,[St]:yt.every(3),[Ct]:yt,[Ft]:ct,[Mt]:V,[Ot]:V,[Tt]:V,[Nt]:xt,[zt]:wt,[Rt]:kt,[Pt]:Et};function de(t){return ue[t]}function he(t){return fe[t]}function pe(t,e,n){return t?t.offset(e,n):void 0}function me(t,e,n){return pe(de(t),e,n)}function ge(t,e,n){return pe(he(t),e,n)}function ve(t,e,n,i){return t?t.range(e,n,i):void 0}function ye(t,e,n,i){return ve(de(t),e,n,i)}function be(t,e,n,i){return ve(he(t),e,n,i)}const xe=1e3,_e=6e4,we=36e5,ke=864e5,Ee=2592e6,De=31536e6,Ae=[At,Ct,Mt,Nt,zt,Rt,Pt],Se=Ae.slice(0,-1),Ce=Se.slice(0,-1),Fe=Ce.slice(0,-1),Me=Fe.slice(0,-1),Oe=[At,Ct],Te=[At],Ne=[[Se,1,xe],[Se,5,5e3],[Se,15,15e3],[Se,30,3e4],[Ce,1,_e],[Ce,5,3e5],[Ce,15,9e5],[Ce,30,18e5],[Fe,1,we],[Fe,3,108e5],[Fe,6,216e5],[Fe,12,432e5],[Me,1,ke],[[At,Ft],1,6048e5],[Oe,1,Ee],[Oe,3,7776e6],[Te,1,De]];function ze(t){const e=t.extent,n=t.maxbins||40,i=Math.abs((0,m.yP)(e))/n;let r,o,a=(0,Dt.Z)((t=>t[2])).right(Ne,i);return a===Ne.length?(r=Te,o=(0,N.ly)(e[0]/De,e[1]/De,n)):a?(a=Ne[i/Ne[a-1][2]<Ne[a][2]/i?a-1:a],r=a[0],o=a[1]):(r=Ae,o=Math.max((0,N.ly)(e[0],e[1],n),1)),{units:r,step:o}}function Re(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Pe(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Le(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function je(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,l=Ye(r),u=Ve(r),f=Ye(o),d=Ve(o),h=Ye(a),p=Ve(a),m=Ye(s),g=Ve(s),v=Ye(c),y=Ve(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:bn,e:bn,f:En,g:Rn,G:Ln,H:xn,I:_n,j:wn,L:kn,m:Dn,M:An,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ai,s:si,S:Sn,u:Cn,U:Fn,V:On,w:Tn,W:Nn,x:null,X:null,y:zn,Y:Pn,Z:jn,"%":oi},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Bn,e:Bn,f:Hn,g:ei,G:ii,H:In,I:Un,j:qn,L:Wn,m:Xn,M:Jn,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ai,s:si,S:Gn,u:$n,U:Zn,V:Vn,w:Kn,W:Qn,x:null,X:null,y:ti,Y:ni,Z:ri,"%":oi},_={a:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return E(t,e,n,i)},d:ln,e:ln,f:mn,g:on,G:rn,H:fn,I:fn,j:un,L:pn,m:cn,M:dn,p:function(t,e,n){var i=l.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:sn,Q:vn,s:yn,S:hn,u:Qe,U:tn,V:en,w:Ke,W:nn,x:function(t,e,i){return E(t,n,e,i)},X:function(t,e,n){return E(t,i,e,n)},y:on,Y:rn,Z:an,"%":gn};function w(t,e){return function(n){var i,r,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(c,s)),null!=(r=He[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),c=s+1);return a.push(t.slice(c,s)),a.join("")}}function k(t,e){return function(n){var i,r,o=Le(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Pe(Le(o.y,0,1))).getUTCDay(),i=r>4||0===r?lt.ceil(i):lt(i),i=V.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Re(Le(o.y,0,1))).getDay(),i=r>4||0===r?et.ceil(i):et(i),i=Y.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Pe(Le(o.y,0,1)).getUTCDay():Re(Le(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Pe(o)):Re(o)}}function E(t,e,n,i){for(var r,o,a=0,s=e.length,c=n.length;a<s;){if(i>=c)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=_[r in He?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),x.x=w(n,x),x.X=w(i,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Be,Ie,Ue,qe,We,He={"-":"",_:" ",0:"0"},Xe=/^\s*\d+/,Je=/^%/,Ge=/[\\^$*+?|[\]().{}]/g;function $e(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function Ze(t){return t.replace(Ge,"\\$&")}function Ye(t){return new RegExp("^(?:"+t.map(Ze).join("|")+")","i")}function Ve(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Ke(t,e,n){var i=Xe.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Qe(t,e,n){var i=Xe.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function tn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function en(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function nn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function rn(t,e,n){var i=Xe.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function on(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function an(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function sn(t,e,n){var i=Xe.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function cn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function ln(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function un(t,e,n){var i=Xe.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function fn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function dn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function hn(t,e,n){var i=Xe.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function pn(t,e,n){var i=Xe.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function mn(t,e,n){var i=Xe.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function gn(t,e,n){var i=Je.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function vn(t,e,n){var i=Xe.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yn(t,e,n){var i=Xe.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function bn(t,e){return $e(t.getDate(),e,2)}function xn(t,e){return $e(t.getHours(),e,2)}function _n(t,e){return $e(t.getHours()%12||12,e,2)}function wn(t,e){return $e(1+Y.count(mt(t),t),e,3)}function kn(t,e){return $e(t.getMilliseconds(),e,3)}function En(t,e){return kn(t,e)+"000"}function Dn(t,e){return $e(t.getMonth()+1,e,2)}function An(t,e){return $e(t.getMinutes(),e,2)}function Sn(t,e){return $e(t.getSeconds(),e,2)}function Cn(t){var e=t.getDay();return 0===e?7:e}function Fn(t,e){return $e(tt.count(mt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||0===e?rt(t):rt.ceil(t)}function On(t,e){return t=Mn(t),$e(rt.count(mt(t),t)+(4===mt(t).getDay()),e,2)}function Tn(t){return t.getDay()}function Nn(t,e){return $e(et.count(mt(t)-1,t),e,2)}function zn(t,e){return $e(t.getFullYear()%100,e,2)}function Rn(t,e){return $e((t=Mn(t)).getFullYear()%100,e,2)}function Pn(t,e){return $e(t.getFullYear()%1e4,e,4)}function Ln(t,e){var n=t.getDay();return $e((t=n>=4||0===n?rt(t):rt.ceil(t)).getFullYear()%1e4,e,4)}function jn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+$e(e/60|0,"0",2)+$e(e%60,"0",2)}function Bn(t,e){return $e(t.getUTCDate(),e,2)}function In(t,e){return $e(t.getUTCHours(),e,2)}function Un(t,e){return $e(t.getUTCHours()%12||12,e,2)}function qn(t,e){return $e(1+V.count(gt(t),t),e,3)}function Wn(t,e){return $e(t.getUTCMilliseconds(),e,3)}function Hn(t,e){return Wn(t,e)+"000"}function Xn(t,e){return $e(t.getUTCMonth()+1,e,2)}function Jn(t,e){return $e(t.getUTCMinutes(),e,2)}function Gn(t,e){return $e(t.getUTCSeconds(),e,2)}function $n(t){var e=t.getUTCDay();return 0===e?7:e}function Zn(t,e){return $e(ct.count(gt(t)-1,t),e,2)}function Yn(t){var e=t.getUTCDay();return e>=4||0===e?dt(t):dt.ceil(t)}function Vn(t,e){return t=Yn(t),$e(dt.count(gt(t),t)+(4===gt(t).getUTCDay()),e,2)}function Kn(t){return t.getUTCDay()}function Qn(t,e){return $e(lt.count(gt(t)-1,t),e,2)}function ti(t,e){return $e(t.getUTCFullYear()%100,e,2)}function ei(t,e){return $e((t=Yn(t)).getUTCFullYear()%100,e,2)}function ni(t,e){return $e(t.getUTCFullYear()%1e4,e,4)}function ii(t,e){var n=t.getUTCDay();return $e((t=n>=4||0===n?dt(t):dt.ceil(t)).getUTCFullYear()%1e4,e,4)}function ri(){return"+0000"}function oi(){return"%"}function ai(t){return+t}function si(t){return Math.floor(+t/1e3)}function ci(t){const e={};return n=>e[n]||(e[n]=t(n))}function li(t){const e=ci(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=(0,z.Z)(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return i=e(n),r=e(".1f")(1)[1],t=>{const e=i(t),n=e.indexOf(r);if(n<0)return e;let o=function(t,e){let n,i=t.lastIndexOf("e");if(i>0)return i;for(i=t.length;--i>e;)if(n=t.charCodeAt(i),n>=48&&n<=57)return i+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var i,r},formatSpan(t,i,r,o){o=(0,z.Z)(null==o?",f":o);const a=(0,N.ly)(t,i,r),s=Math.max(Math.abs(t),Math.abs(i));let c;if(null==o.precision)switch(o.type){case"s":return isNaN(c=(0,R.Z)(a,s))||(o.precision=c),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(c=(0,P.Z)(a,s))||(o.precision=c-("e"===o.type));break;case"f":case"%":isNaN(c=(0,L.Z)(a))||(o.precision=c-2*("%"===o.type))}return e(o)}}}let ui,fi;function di(){return ui=li({format:j.WU,formatPrefix:j.jH})}function hi(t){return li((0,B.Z)(t))}function pi(t){return arguments.length?ui=hi(t):ui}function mi(t,e,n){n=n||{},(0,m.Kn)(n)||(0,m.vU)("Invalid time multi-format specifier: ".concat(n));const i=e(Rt),r=e(zt),o=e(Nt),a=e(Mt),s=e(Ft),c=e(Ct),l=e(St),u=e(At),f=t(n[Pt]||".%L"),d=t(n[Rt]||":%S"),h=t(n[zt]||"%I:%M"),p=t(n[Nt]||"%I %p"),g=t(n[Mt]||n[Ot]||"%a %d"),v=t(n[Ft]||"%b %d"),y=t(n[Ct]||"%B"),b=t(n[St]||"%B"),x=t(n[At]||"%Y");return t=>(i(t)<t?f:r(t)<t?d:o(t)<t?h:a(t)<t?p:c(t)<t?s(t)<t?g:v:u(t)<t?l(t)<t?y:b:x)(t)}function gi(t){const e=ci(t.format),n=ci(t.utcFormat);return{timeFormat:t=>(0,m.HD)(t)?e(t):mi(e,de,t),utcFormat:t=>(0,m.HD)(t)?n(t):mi(n,he,t),timeParse:ci(t.parse),utcParse:ci(t.utcParse)}}function vi(){return fi=gi({format:Ie,parse:Ue,utcFormat:qe,utcParse:We})}function yi(t){return gi(je(t))}function bi(t){return arguments.length?fi=yi(t):fi}!function(t){Be=je(t),Ie=Be.format,Ue=Be.parse,qe=Be.utcFormat,We=Be.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),di(),vi();const xi=(t,e)=>(0,m.l7)({},t,e);function _i(t,e){const n=t?hi(t):pi(),i=e?yi(e):bi();return xi(n,i)}function wi(t,e){const n=arguments.length;return n&&2!==n&&(0,m.vU)("defaultLocale expects either zero or two arguments."),n?xi(pi(t),bi(e)):xi(pi(),bi())}function ki(){return di(),vi(),wi()}const Ei=/^(data:|([A-Za-z]+:)?\/\/)/,Di=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ai=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Si="file://";async function Ci(t,e){const n=await this.sanitize(t,e),i=n.href;return n.localFile?this.file(i):this.http(i,e)}async function Fi(t,e){e=(0,m.l7)({},this.options,e);const n=this.fileAccess,i={href:null};let r,o,a;const s=Di.test(t.replace(Ai,""));null!=t&&"string"===typeof t&&s||(0,m.vU)("Sanitize failure, invalid URI: "+(0,m.m8)(t));const c=Ei.test(t);return(a=e.baseURL)&&!c&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(r=t.startsWith(Si))||"file"===e.mode||"http"!==e.mode&&!c&&n,r?t=t.slice(Si.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(i,"localFile",{value:!!o}),i.href=t,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function Mi(t){return t?e=>new Promise(((n,i)=>{t.readFile(e,((t,e)=>{t?i(t):n(e)}))})):Oi}async function Oi(){(0,m.vU)("No file system access.")}function Ti(t){return t?async function(e,n){const i=(0,m.l7)({},this.options.http,n),r=n&&n.response,o=await t(e,i);return o.ok?(0,m.mf)(o[r])?o[r]():o.text():(0,m.vU)(o.status+""+o.statusText)}:Ni}async function Ni(){(0,m.vU)("No HTTP fetch method available.")}const zi=t=>null!=t&&t===t,Ri=t=>!Number.isNaN(+t)&&!(t instanceof Date),Pi={boolean:m.sw,integer:m.He,number:m.He,date:m.ZU,string:m.BB,unknown:m.yR},Li=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>Ri(t)&&Number.isInteger(+t),Ri,t=>!Number.isNaN(Date.parse(t))],ji=["boolean","integer","number","date"];function Bi(t,e){if(!t||!t.length)return"unknown";const n=t.length,i=Li.length,r=Li.map(((t,e)=>e+1));for(let o,a,s=0,c=0;s<n;++s)for(a=e?t[s][e]:t[s],o=0;o<i;++o)if(r[o]&&zi(a)&&!Li[o](a)&&(r[o]=0,++c,c===Li.length))return"string";return ji[r.reduce(((t,e)=>0===t?e:t),0)-1]}function Ii(t,e){return e.reduce(((e,n)=>(e[n]=Bi(t,n),e)),{})}function Ui(t){const e=function(e,n){const i={delimiter:t};return qi(e,n?(0,m.l7)(n,i):i)};return e.responseType="text",e}function qi(t,e){return e.header&&(t=e.header.map(m.m8).join(e.delimiter)+"\n"+t),D(e.delimiter).parse(t+"")}function Wi(t,e){const n=e&&e.property?(0,m.EP)(e.property):m.yR;return!(0,m.Kn)(t)||(i=t,"function"===typeof Buffer&&(0,m.mf)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(t)):function(t,e){!(0,m.kJ)(t)&&(0,m.TW)(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var i}qi.responseType="text",Wi.responseType="json";const Hi={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function Xi(t,e){let n,i,r,o;return t=Wi(t,e),e&&e.feature?(n=S,r=e.feature):e&&e.mesh?(n=O,r=e.mesh,o=Hi[e.filter]):(0,m.vU)("Missing TopoJSON feature or mesh parameter."),i=(i=t.objects[r])?n(t,i,o):(0,m.vU)("Invalid TopoJSON object: "+r),i&&i.features||[i]}Xi.responseType="json";const Ji={dsv:qi,csv:Ui(","),tsv:Ui("\t"),json:Wi,topojson:Xi};function Gi(t,e){return arguments.length>1?(Ji[t]=e,this):(0,m.nr)(Ji,t)?Ji[t]:null}function $i(t){const e=Gi(t);return e&&e.responseType||"text"}function Zi(t,e,n,i){const r=Gi((e=e||{}).type||"json");return r||(0,m.vU)("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n,i){if(!t.length)return;const r=bi();n=n||r.timeParse,i=i||r.utcParse;let o,a,s,c,l,u,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=Ii(t,f));f=Object.keys(e);const d=f.map((t=>{const r=e[t];let o,a;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){o=r.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?i:n)(a)}if(!Pi[r])throw Error("Illegal format pattern: "+t+":"+r);return Pi[r]}));for(s=0,l=t.length,u=f.length;s<l;++s)for(o=t[s],c=0;c<u;++c)a=f[c],o[a]=d[c](o[a])}(t,e.parse,n,i),(0,m.nr)(t,"columns")&&delete t.columns,t}const Yi=function(t,e){return n=>({options:n||{},sanitize:Fi,load:Ci,fileAccess:!!e,file:Mi(e),http:Ti(t)})}("undefined"!==typeof fetch&&fetch,null);function Vi(t){const e=t||m.yR,n=[],i={};return n.add=t=>{const r=e(t);return i[r]||(i[r]=1,n.push(t)),n},n.remove=t=>{const r=e(t);if(i[r]){i[r]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function Ki(t,e){try{await e(t)}catch(n){t.error(n)}}const Qi=Symbol("vega_id");let tr=1;function er(t){return!(!t||!nr(t))}function nr(t){return t[Qi]}function ir(t,e){return t[Qi]=e,t}function rr(t){const e=t===Object(t)?t:{data:t};return nr(e)?e:ir(e,tr++)}function or(t){return ar(t,rr({}))}function ar(t,e){for(const n in t)e[n]=t[n];return e}function sr(t,e){return ir(e,nr(t))}function cr(t,e){return t?e?(n,i)=>t(n,i)||nr(e(n))-nr(e(i)):(e,n)=>t(e,n)||nr(e)-nr(n):null}function lr(t){return t&&t.constructor===ur}function ur(){const t=[],e=[],n=[],i=[],r=[];let o=null,a=!1;return{constructor:ur,insert(e){const n=(0,m.IX)(e),i=n.length;for(let r=0;r<i;++r)t.push(n[r]);return this},remove(t){const n=(0,m.mf)(t)?i:e,r=(0,m.IX)(t),o=r.length;for(let e=0;e<o;++e)n.push(r[e]);return this},modify(t,e,i){const o={field:e,value:(0,m.a9)(i)};return(0,m.mf)(t)?(o.filter=t,r.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return(0,m.mf)(t)?r.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(s,c){const l={},u={};let f,d,h,p,m,g;for(f=0,d=c.length;f<d;++f)l[nr(c[f])]=1;for(f=0,d=e.length;f<d;++f)m=e[f],l[nr(m)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],c.forEach((t=>{p(t)&&(l[nr(t)]=-1)}));for(f=0,d=t.length;f<d;++f)m=t[f],g=nr(m),l[g]?l[g]=1:s.add.push(rr(t[f]));for(f=0,d=c.length;f<d;++f)m=c[f],l[nr(m)]<0&&s.rem.push(m);function v(t,e,n){n?t[e]=n(t):s.encode=e,a||(u[nr(t)]=t)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=l[nr(m)],g>0&&(v(m,p,h.value),s.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,c.forEach((t=>{p(t)&&l[nr(t)]>0&&v(t,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=e.length||i.length?c.filter((t=>l[nr(t)]>0)):c.slice();else for(g in u)s.mod.push(u[g]);return(o||null==o&&(e.length||i.length))&&s.clean(!0),s}}}const fr="_:mod:_";function dr(){Object.defineProperty(this,fr,{writable:!0,value:{}})}dr.prototype={set(t,e,n,i){const r=this,o=r[t],a=r[fr];return null!=e&&e>=0?(o[e]!==n||i)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||i)&&(r[t]=n,a[t]=(0,m.kJ)(n)?1+n.length:-1),r},modified(t,e){const n=this[fr];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if((0,m.kJ)(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[fr]={},this}};let hr=0;const pr=new dr;function mr(t,e,n,i){this.id=++hr,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,i)}function gr(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}mr.prototype={targets(){return this._targets||(this._targets=Vi(m.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:gr(1),modified:gr(2),parameters(t,e,n){e=!1!==e;const i=this._argval=this._argval||new dr,r=this._argops=this._argops||[],o=[];let a,s,c,l;const u=(t,n,a)=>{a instanceof mr?(a!==this&&(e&&a.targets().add(this),o.push(a)),r.push({op:a,name:t,index:n})):i.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)(0,m.IX)(s).forEach((t=>{t instanceof mr?t!==this&&(t.targets().add(this),o.push(t)):(0,m.vU)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,m.kJ)(s))for(i.set(a,-1,Array(c=s.length)),l=0;l<c;++l)u(a,l,s[l]);else u(a,-1,s);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(t){const e=this._argval||pr,n=this._argops;let i,r,o,a;if(n){const s=n.length;for(r=0;r<s;++r)i=n[r],o=i.op,a=o.modified()&&o.stamp===t,e.set(i.name,i.index,o.value,a);if(n.initonly){for(r=0;r<s;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,i,r;if(t)for(e=0,n=t.length;e<n;++e)i=t[e],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),i=e.call(this,n,t);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let vr=0;function yr(t,e,n){this.id=++vr,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function br(t,e,n){return new yr(t,e,n)}yr.prototype={_filter:m.yb,_apply:m.yR,targets(){return this._targets||(this._targets=Vi(m.id))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,i=n?n.length:0;for(let t=0;t<i;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=br(t);return this.targets().add(e),e},apply(t){const e=br(null,t);return this.targets().add(e),e},merge(){const t=br();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=br();return this.targets().add(br(null,null,(0,m.Ds)(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(br(null,null,(()=>n=!0))),e.targets().add(br(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=m.yb,this._targets=null}};const xr={skip:!0};function _r(t,e,n,i,r,o){const a=(0,m.l7)({},o,xr);let s,c;(0,m.mf)(n)||(n=(0,m.a9)(n)),void 0===i?s=e=>t.touch(n(e)):(0,m.mf)(i)?(c=new mr(null,i,r,!1),s=e=>{c.evaluate(e);const i=n(e),r=c.value;lr(r)?t.pulse(i,r,o):t.update(i,r,a)}):s=e=>t.update(n(e),i,a),e.apply(s)}function wr(t,e,n,i,r,o){if(void 0===i)e.targets().add(n);else{const a=o||{},s=new mr(null,function(t,e){return e=(0,m.mf)(e)?e:(0,m.a9)(e),t?function(n,i){const r=e(n,i);return t.skip()||(t.skip(r!==this.value).value=r),r}:e}(n,i),r,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}const kr={};function Er(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Dr(t,e){const n=[];return(0,m.FP)(t,e,(t=>n.push(t))),n}function Ar(t,e){const n={};return t.visit(e,(t=>{n[nr(t)]=1})),t=>n[nr(t)]?null:t}function Sr(t,e){return t?(n,i)=>t(n,i)&&e(n,i):e}function Cr(t,e,n,i){const r=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===e){if(a.fields){const t=r.fields||(r.fields={});for(const e in a.fields)t[e]=1}a.changed(r.ADD)&&(o|=r.ADD),a.changed(r.REM)&&(o|=r.REM),a.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}function Fr(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}Er.prototype={StopPropagation:kr,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new Er(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new Er(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,Ar(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return(0,m.kJ)(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?(0,m.kJ)(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=Sr(n.addF,e)),2&t&&(n.remF=Sr(n.remF,e)),4&t&&(n.modF=Sr(n.modF,e)),16&t&&(n.srcF=Sr(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Dr(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Dr(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Dr(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,i=e;if(16&t)return(0,m.FP)(n.source,n.srcF,i),n;1&t&&(0,m.FP)(n.add,n.addF,i),2&t&&(0,m.FP)(n.rem,n.remF,i),4&t&&(0,m.FP)(n.mod,n.modF,i);const r=n.source;if(8&t&&r){const t=n.add.length+n.mod.length;t===r.length||(t?(0,m.FP)(r,Ar(n,5),i):(0,m.FP)(r,n.srcF,i))}return n}},(0,m.XW)(Cr,Er,{fork(t){const e=new Er(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?(0,m.kJ)(t)?t.some((t=>n[t])):n[t]:0},filter(){(0,m.vU)("MultiPulse does not support filtering.")},materialize(){(0,m.vU)("MultiPulse does not support materialization.")},visit(t,e){const n=this,i=n.pulses,r=i.length;let o=0;if(t&n.SOURCE)for(;o<r;++o)i[o].visit(t,e);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(t,e);return n}});const Mr={skip:!1,force:!1};function Or(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Tr(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let i;return e.length?(i=e[0],e[0]=n,function(t,e,n){const i=e,r=t.length,o=t[e];let a,s=1+(e<<1);for(;s<r;)a=s+1,a<r&&n(t[s],t[a])>=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,Tr(t,i,e,n)}(e,0,t)):i=n,i}}}function Tr(t,e,n,i){let r,o;const a=t[n];for(;n>e&&(o=n-1>>1,r=t[o],i(a,r)<0);)t[n]=r,n=o;return t[n]=a}function Nr(){this.logger((0,m.kg)()),this.logLevel(m.jj),this._clock=0,this._rank=0,this._locale=wi();try{this._loader=Yi()}catch(t){}this._touched=Vi(m.id),this._input={},this._pulse=null,this._heap=Or(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function zr(t){return function(){return this._log[t].apply(this,arguments)}}function Rr(t,e){mr.call(this,t,null,e)}Nr.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:zr("error"),warn:zr("warn"),info:zr("info"),debug:zr("debug"),logLevel:zr("level"),cleanThreshold:1e4,add:function(t,e,n,i){let r,o=1;return t instanceof mr?r=t:t&&t.prototype instanceof mr?r=new t:(0,m.mf)(t)?r=new mr(null,t):(o=0,r=new mr(t,e)),this.rank(r),o&&(i=n,n=e),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(t,e){const n=t.rank,i=e.length;for(let r=0;r<i;++r)if(n<e[r].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,i,r;for(;e.length;)if(this.rank(n=e.pop()),i=n._targets)for(r=i.length;--r>=0;)e.push(n=i[r]),n===t&&(0,m.vU)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||Mr);const i=new Er(this,this._clock+(this._pulse?0:1)),r=t.pulse&&t.pulse.source||[];return i.target=t,this._input[t.id]=e.pulse(i,r),this},touch:function(t,e){const n=e||Mr;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const i=n||Mr;return(t.set(e)||i.force)&&this.touch(t,i),this},changeset:ur,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Zi(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const i=this,r=i._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0===--n.requests&&(t._pending=null,e(t))},t._pending=n}(i);r.requests+=1;const o=await i.request(e,n);return i.pulse(t,i.changeset().remove(m.yb).insert(o.data||[])),r.done(),o},request:async function(t,e){const n=this;let i,r=0;try{i=await n.loader().load(t,{context:"dataflow",response:$i(e&&e.type)});try{i=n.parse(i,e)}catch(o){r=-2,n.warn("Data ingestion failed",t,o)}}catch(o){r=-1,n.warn("Loading failed",t,o)}return{data:i,status:r}},events:function(t,e,n,i){const r=this,o=br(n,i),a=function(t){t.dataflow=r;try{o.receive(t)}catch(e){r.error(e)}finally{r.run()}};let s;s="string"===typeof t&&"undefined"!==typeof document?document.querySelectorAll(t):(0,m.IX)(t);const c=s.length;for(let l=0;l<c;++l)s[l].addEventListener(e,a);return o},on:function(t,e,n,i,r){return(t instanceof mr?wr:_r)(this,t,e,n,i,r),this},evaluate:async function(t,e,n){const i=this,r=[];if(i._pulse)return Fr(i);if(i._pending&&await i._pending,e&&await Ki(i,e),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Er(i,o,t),i._touched.forEach((t=>i._enqueue(t,!0))),i._touched=Vi(m.id);let a,s,c,l=0;try{for(;i._heap.size()>0;)a=i._heap.pop(),a.rank===a.qrank?(s=a.run(i._getPulse(a,t)),s.then?s=await s:s.async&&(r.push(s.async),s=kr),s!==kr&&a._targets&&a._targets.forEach((t=>i._enqueue(t))),++l):i._enqueue(a,!0)}catch(u){i._heap.clear(),c=u}if(i._input={},i._pulse=null,i.debug("Pulse ".concat(o,": ").concat(l," operators")),c&&(i._postrun=[],i.error(c)),i._postrun.length){const t=i._postrun.sort(((t,e)=>e.priority-t.priority));i._postrun=[];for(let e=0;e<t.length;++e)await Ki(i,t[e].callback)}return n&&await Ki(i,n),r.length&&Promise.all(r).then((t=>i.runAsync(null,(()=>{t.forEach((t=>{try{t(i)}catch(u){i.error(u)}}))})))),i},run:function(t,e,n){return this._pulse?Fr(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(i,i),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(i){this.error(i)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,e){const n=t.source,i=this._clock;return n&&(0,m.kJ)(n)?new Cr(this,i,n.map((t=>t.pulse)),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==kr&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},(0,m.XW)(Rr,mr,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const Pr={};function Lr(t){const e=jr(t);return e&&e.Definition||null}function jr(t){return t=t&&t.toLowerCase(),(0,m.nr)(Pr,t)?Pr[t]:null}var Br=n(94319),Ir=n(88643),Ur=n(26379),qr=n(88048);function*Wr(t,e){if(null==e)for(let n of t)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of t)i=e(i,++n,t),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function Hr(t,e,n){const i=Float64Array.from(Wr(t,n));return i.sort(Br.Z),e.map((t=>(0,Ir.s7)(i,t)))}function Xr(t,e){return Hr(t,[.25,.5,.75],e)}function Jr(t,e){const n=t.length,i=(0,Ur.Z)(t,e),r=Xr(t,e),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function Gr(t){const e=t.maxbins||20,n=t.base||10,i=Math.log(n),r=t.divide||[5,2];let o,a,s,c,l,u,f=t.extent[0],d=t.extent[1];const h=t.span||d-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(c=h/e,l=0,u=t.steps.length;l<u&&t.steps[l]<c;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/i),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/i)-a));Math.ceil(h/o)>e;)o*=n;for(l=0,u=r.length;l<u;++l)c=o/r[l],c>=s&&h/c<=e&&(o=c)}c=Math.log(o);const p=c>=0?0:1+~~(-c/i),m=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(c=Math.floor(f/o+m)*o,f=f<c?c-o:c,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var $r=Math.random;function Zr(t){$r=t}function Yr(t,e,n,i){if(!t.length)return[void 0,void 0];const r=Float64Array.from(Wr(t,i)),o=r.length,a=e;let s,c,l,u;for(l=0,u=Array(a);l<a;++l){for(s=0,c=0;c<o;++c)s+=r[~~($r()*o)];u[l]=s/o}return u.sort(Br.Z),[(0,Ir.ZP)(u,n/2),(0,Ir.ZP)(u,1-n/2)]}function Vr(t,e,n,i){i=i||(t=>t);const r=t.length,o=new Float64Array(r);let a,s=0,c=1,l=i(t[0]),u=l,f=l+e;for(;c<r;++c){if(a=i(t[c]),a>=f){for(u=(l+u)/2;s<c;++s)o[s]=u;f=a+e,l=a}u=a}for(u=(l+u)/2;s<c;++s)o[s]=u;return n?function(t,e){const n=t.length;let i,r,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(i=a+1;t[a]===t[i];)++i;if(t[a]-t[a-1]<e){for(r=a+(o+i-a-a>>1);r<a;)t[r++]=t[a];for(;r>a;)t[r--]=t[o]}o=a,a=i}return t}(o,e+e/4):o}function Kr(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function Qr(t,e){let n,i,r;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,r=i-n,o):n},max(t){return arguments.length?(i=t||0,r=i-n,o):i},sample:()=>n+Math.floor(r*$r()),pdf:t=>t===Math.floor(t)&&t>=n&&t<i?1/r:0,cdf(t){const e=Math.floor(t);return e<n?0:e>=i?1:(e-n+1)/r},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*r):NaN};return o.min(t).max(e)}const to=Math.sqrt(2*Math.PI),eo=Math.SQRT2;let no=NaN;function io(t,e){t=t||0,e=null==e?1:e;let n,i,r=0,o=0;if(no===no)r=no,no=NaN;else{do{r=2*$r()-1,o=2*$r()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,no=o*i}return t+r*e}function ro(t,e,n){const i=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*to)}function oo(t,e,n){const i=(t-(e=e||0))/(n=null==n?1:n),r=Math.abs(i);let o;if(r>37)o=0;else{const t=Math.exp(-r*r/2);let e;r<7.07106781186547?(e=.0352624965998911*r+.700383064443688,e=e*r+6.37396220353165,e=e*r+33.912866078383,e=e*r+112.079291497871,e=e*r+221.213596169931,e=e*r+220.206867912376,o=t*e,e=.0883883476483184*r+1.75566716318264,e=e*r+16.064177579207,e=e*r+86.7807322029461,e=e*r+296.564248779674,e=e*r+637.333633378831,e=e*r+793.826512519948,e=e*r+440.413735824752,o/=e):(e=r+.65,e=r+4/e,e=r+3/e,e=r+2/e,e=r+1/e,o=t/e/2.506628274631)}return i>0?1-o:o}function ao(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*eo*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function so(t,e){let n,i;const r={mean(t){return arguments.length?(n=t||0,r):n},stdev(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>io(n,i),pdf:t=>ro(t,n,i),cdf:t=>oo(t,n,i),icdf:t=>ao(t,n,i)};return r.mean(t).stdev(e)}function co(t,e){const n=so();let i=0;const r={data(n){return arguments.length?(t=n,i=n?n.length:0,r.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=Jr(t)),r):e},sample:()=>t[~~($r()*i)]+e*n.sample(),pdf(r){let o=0,a=0;for(;a<i;++a)o+=n.pdf((r-t[a])/e);return o/e/i},cdf(r){let o=0,a=0;for(;a<i;++a)o+=n.cdf((r-t[a])/e);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(t)}function lo(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+io()*e)}function uo(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const i=(Math.log(t)-e)/n;return Math.exp(-.5*i*i)/(n*to*t)}function fo(t,e,n){return oo(Math.log(t),e,n)}function ho(t,e,n){return Math.exp(ao(t,e,n))}function po(t,e){let n,i;const r={mean(t){return arguments.length?(n=t||0,r):n},stdev(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>lo(n,i),pdf:t=>uo(t,n,i),cdf:t=>fo(t,n,i),icdf:t=>ho(t,n,i)};return r.mean(t).stdev(e)}function mo(t,e){let n,i=0;const r={weights(t){return arguments.length?(n=function(t){const e=[];let n,r=0;for(n=0;n<i;++n)r+=e[n]=null==t[n]?1:+t[n];for(n=0;n<i;++n)e[n]/=r;return e}(e=t||[]),r):e},distributions(n){return arguments.length?(n?(i=n.length,t=n):(i=0,t=[]),r.weights(e)):t},sample(){const e=$r();let r=t[i-1],o=n[0],a=0;for(;a<i-1;o+=n[++a])if(e<o){r=t[a];break}return r.sample()},pdf(e){let r=0,o=0;for(;o<i;++o)r+=n[o]*t[o].pdf(e);return r},cdf(e){let r=0,o=0;for(;o<i;++o)r+=n[o]*t[o].cdf(e);return r},icdf(){throw Error("Mixture icdf not supported.")}};return r.distributions(t).weights(e)}function go(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*$r()}function vo(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function yo(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function bo(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function xo(t,e){let n,i;const r={min(t){return arguments.length?(n=t||0,r):n},max(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>go(n,i),pdf:t=>vo(t,n,i),cdf:t=>yo(t,n,i),icdf:t=>bo(t,n,i)};return null==e&&(e=null==t?1:t,t=0),r.min(t).max(e)}function _o(t,e,n){let i=0,r=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(i+=(t-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function wo(t,e,n,i){const r=i-t*t,o=Math.abs(r)<1e-24?0:(n-t*e)/r;return[e-o*t,o]}function ko(t,e,n,i){t=t.filter((t=>{let i=e(t),r=n(t);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r})),i&&t.sort(((t,n)=>e(t)-e(n)));const r=t.length,o=new Float64Array(r),a=new Float64Array(r);let s,c,l,u=0,f=0,d=0;for(l of t)o[u]=s=+e(l),a[u]=c=+n(l),++u,f+=(s-f)/u,d+=(c-d)/u;for(u=0;u<r;++u)o[u]-=f,a[u]-=d;return[o,a,f,d]}function Eo(t,e,n,i){let r,o,a=-1;for(const s of t)r=e(s),o=n(s),null!=r&&(r=+r)>=r&&null!=o&&(o=+o)>=o&&i(r,o,++a)}function Do(t,e,n,i,r){let o=0,a=0;return Eo(t,e,n,((t,e)=>{const n=e-r(t),s=e-i;o+=n*n,a+=s*s})),1-o/a}function Ao(t,e,n){let i=0,r=0,o=0,a=0,s=0;Eo(t,e,n,((t,e)=>{++s,i+=(t-i)/s,r+=(e-r)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const c=wo(i,r,o,a),l=t=>c[0]+c[1]*t;return{coef:c,predict:l,rSquared:Do(t,e,n,r,l)}}function So(t,e,n){let i=0,r=0,o=0,a=0,s=0;Eo(t,e,n,((t,e)=>{++s,t=Math.log(t),i+=(t-i)/s,r+=(e-r)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const c=wo(i,r,o,a),l=t=>c[0]+c[1]*Math.log(t);return{coef:c,predict:l,rSquared:Do(t,e,n,r,l)}}function Co(t,e,n){const[i,r,o,a]=ko(t,e,n);let s,c,l,u=0,f=0,d=0,h=0,p=0;Eo(t,e,n,((t,e)=>{s=i[p++],c=Math.log(e),l=s*e,u+=(e*c-u)/p,f+=(l-f)/p,d+=(l*c-d)/p,h+=(s*l-h)/p}));const[m,g]=wo(f/a,u/a,d/a,h/a),v=t=>Math.exp(m+g*(t-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:Do(t,e,n,a,v)}}function Fo(t,e,n){let i=0,r=0,o=0,a=0,s=0,c=0;Eo(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++c,i+=(n-i)/c,r+=(l-r)/c,o+=(n*l-o)/c,a+=(n*n-a)/c,s+=(e-s)/c}));const l=wo(i,r,o,a),u=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:u,rSquared:Do(t,e,n,s,u)}}function Mo(t,e,n){const[i,r,o,a]=ko(t,e,n),s=i.length;let c,l,u,f,d=0,h=0,p=0,m=0,g=0;for(c=0;c<s;)l=i[c],u=r[c++],f=l*l,d+=(f-d)/c,h+=(f*l-h)/c,p+=(f*f-p)/c,m+=(l*u-m)/c,g+=(f*u-g)/c;const v=p-d*d,y=d*v-h*h,b=(g*d-m*h)/y,x=(m*v-g*h)/y,_=-b*d,w=t=>b*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:Do(t,e,n,a,w)}}function Oo(t,e,n,i){if(0===i)return _o(t,e,n);if(1===i)return Ao(t,e,n);if(2===i)return Mo(t,e,n);const[r,o,a,s]=ko(t,e,n),c=r.length,l=[],u=[],f=i+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<c;++p)m+=Math.pow(r[p],d)*o[p];for(l.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<c;++p)m+=Math.pow(r[p],d+h);g[h]=m}u.push(g)}u.push(l);const v=function(t){const e=t.length-1,n=[];let i,r,o,a,s;for(i=0;i<e;++i){for(a=i,r=i+1;r<e;++r)Math.abs(t[i][r])>Math.abs(t[i][a])&&(a=r);for(o=i;o<e+1;++o)s=t[o][i],t[o][i]=t[o][a],t[o][a]=s;for(r=i+1;r<e;++r)for(o=e;o>=i;o--)t[o][r]-=t[o][i]*t[i][r]/t[i][i]}for(r=e-1;r>=0;--r){for(s=0,o=r+1;o<e;++o)s+=t[o][r]*n[o];n[r]=(t[e][r]-s)/t[r][r]}return n}(u),y=t=>{t-=a;let e=s+v[0]+v[1]*t+v[2]*t*t;for(d=3;d<f;++d)e+=v[d]*Math.pow(t,d);return e};return{coef:To(f,v,-a,s),predict:y,rSquared:Do(t,e,n,s,y)}}function To(t,e,n,i){const r=Array(t);let o,a,s,c;for(o=0;o<t;++o)r[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],c=1,r[o]+=s,a=1;a<=o;++a)c*=(o+1-a)/a,r[o-a]+=s*Math.pow(n,a)*c;return r[0]+=i,r}const No=2,zo=1e-12;function Ro(t,e,n,i){const[r,o,a,s]=ko(t,e,n,!0),c=r.length,l=Math.max(2,~~(i*c)),u=new Float64Array(c),f=new Float64Array(c),d=new Float64Array(c).fill(1);for(let h=-1;++h<=No;){const t=[0,l-1];for(let n=0;n<c;++n){const e=r[n],i=t[0],a=t[1],s=e-r[i]>r[a]-e?i:a;let c=0,l=0,h=0,p=0,m=0;const g=1/Math.abs(r[s]-e||1);for(let t=i;t<=a;++t){const n=r[t],i=o[t],a=Po(Math.abs(e-n)*g)*d[t],s=n*a;c+=a,l+=s,h+=i*a,p+=i*s,m+=n*s}const[v,y]=wo(l/c,h/c,p/c,m/c);u[n]=v+y*e,f[n]=Math.abs(o[n]-u[n]),Lo(r,n+1,t)}if(h===No)break;const e=(0,qr.Z)(f);if(Math.abs(e)<zo)break;for(let n,i,r=0;r<c;++r)n=f[r]/(6*e),d[r]=n>=1?zo:(i=1-n*n)*i}return function(t,e,n,i){const r=t.length,o=[];let a,s=0,c=0,l=[];for(;s<r;++s)a=t[s]+n,l[0]===a?l[1]+=(e[s]-l[1])/++c:(c=0,l[1]+=i,l=[a,e[s]],o.push(l));return l[1]+=i,o}(r,u,a,s)}function Po(t){return(t=1-t*t*t)*t*t}function Lo(t,e,n){const i=t[e];let r=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>r&&t[o]-i<=i-t[r];)n[0]=++r,n[1]=o,++o}const jo=.5*Math.PI/180;function Bo(t,e,n,i){n=n||25,i=Math.max(n,i||200);const r=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,c=s/i,l=[r(o)],u=[];if(n===i){for(let t=1;t<i;++t)l.push(r(o+t/n*s));return l.push(r(a)),l}u.push(r(a));for(let m=n;--m>0;)u.push(r(o+m/n*s));let f=l[0],d=u[u.length-1];const h=1/s,p=function(t,e){let n=t,i=t;const r=e.length;for(let o=0;o<r;++o){const t=e[o][1];t<n&&(n=t),t>i&&(i=t)}return 1/(i-n)}(f[1],u);for(;d;){const t=r((f[0]+d[0])/2);t[0]-f[0]>=c&&Io(f,t,d,h,p)>jo?u.push(t):(f=d,l.push(d),u.pop()),d=u[u.length-1]}return l}function Io(t,e,n,i,r){const o=Math.atan2(r*(n[1]-t[1]),i*(n[0]-t[0])),a=Math.atan2(r*(e[1]-t[1]),i*(e[0]-t[0]));return Math.abs(o-a)}var Uo=n(36397),qo=n(84128),Wo=n(82601);function Ho(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}):function(){return""};var e}function Xo(t,e,n){return n||t+(e?"_"+e:"")}const Jo=()=>{},Go={init:Jo,add:Jo,rem:Jo,idx:0},$o={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e<t.min||void 0===t.min)&&(t.min=e)},rem:(t,e)=>{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e<t.min&&(t.argmin=n)},rem:(t,e)=>{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Zo=Object.keys($o).filter((t=>"__count__"!==t));function Yo(t,e){return $o[t](e)}function Vo(t,e){return t.idx-e.idx}function Ko(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function Qo(t,e){null!=t&&""!==t?t===t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function ta(t,e){null!=t&&""!==t?t===t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function ea(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function na(t,e){const n=e||m.yR,i=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=$o[t]())}))};return t.forEach(n),Object.values(e).sort(Vo)}(t),r=t.slice().sort(Vo);function o(t){this._ops=i,this._out=r,this.cell=t,this.init()}return o.prototype.init=Ko,o.prototype.add=Qo,o.prototype.rem=ta,o.prototype.set=ea,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function ia(t){this._key=t?(0,m.EP)(t):nr,this.reset()}[...Zo,"__count__"].forEach((t=>{$o[t]=function(t,e){return n=>(0,m.l7)({name:t,out:n||t},Go,e)}(t,$o[t])}));const ra=ia.prototype;function oa(t){Rr.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ra.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ra.add=function(t){this._add.push(t)},ra.rem=function(t){this._rem.push(t)},ra.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,i=t.length,r=e.length,o=Array(i-r),a={};let s,c,l;for(s=0;s<r;++s)a[n(e[s])]=1;for(s=0,c=0;s<i;++s)a[n(l=t[s])]?a[n(l)]=0:o[c++]=l;return this._rem=[],this._add=o},ra.distinct=function(t){const e=this.values(),n={};let i,r=e.length,o=0;for(;--r>=0;)i=t(e[r])+"",(0,m.nr)(n,i)||(n[i]=1,++o);return o},ra.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=(0,m.dI)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},ra.argmin=function(t){return this.extent(t)[0]||{}},ra.argmax=function(t){return this.extent(t)[1]||{}},ra.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},ra.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},ra.quartile=function(t){return this._get===t&&this._q||(this._q=Xr(this.values(),t),this._get=t),this._q},ra.q1=function(t){return this.quartile(t)[0]},ra.q2=function(t){return this.quartile(t)[1]},ra.q3=function(t){return this.quartile(t)[2]},ra.ci=function(t){return this._get===t&&this._ci||(this._ci=Yr(this.values(),1e3,.05,t),this._get=t),this._ci},ra.ci0=function(t){return this.ci(t)[0]},ra.ci1=function(t){return this.ci(t)[1]},oa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Zo},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},(0,m.XW)(oa,Rr,{transform(t,e){const n=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.modified();return n.stamp=i.stamp,n.value&&(r||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(t):Object.create(null),e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),i.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&i.clean(!0).runAfter((()=>this.clean())),n.changes(i)},cross(){const t=this,e=t.value,n=t._dnames,i=n.map((()=>({}))),r=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<r;++o)i[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,c){const l=n[c],u=i[c++];for(const n in u){const i=a?a+"|"+n:n;s[l]=u[n],c<r?o(i,s,c):e[i]||t.cell(i,s)}}("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],i={};function r(t){const n=(0,m.IX)((0,m.Oj)(t)),r=n.length;let o,a=0;for(;a<r;++a)i[o=n[a]]||(i[o]=1,e.push(o))}this._dims=(0,m.IX)(t.groupby),this._dnames=this._dims.map((t=>{const e=(0,m.el)(t);return r(t),n.push(e),e})),this.cellkey=t.key?t.key:Ho(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],c=o.length,l={};let u,f,d,h,p,g;for(c!==a.length&&(0,m.vU)("Unmatched number of fields and aggregate ops."),g=0;g<c;++g)u=o[g],f=a[g],null==u&&"count"!==f&&(0,m.vU)("Null aggregate field specified."),h=(0,m.el)(u),p=Xo(f,h,s[g]),n.push(p),"count"!==f?(d=l[h],d||(r(u),d=l[h]=[],d.field=u,this._measures.push(d)),"count"!==f&&(this._countOnly=!1),d.push(Yo(f,p))):this._counts.push(p);return this._measures=this._measures.map((t=>na(t,t.field))),Object.create(null)},cellkey:Ho(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let i=0;i<e;++i)n.agg[i]=new t[i](n)}return n.store&&(n.data=new ia),n},newtuple(t,e){const n=this._dnames,i=this._dims,r=i.length,o={};for(let a=0;a<r;++a)o[n[a]]=i[a](t);return e?sr(e.tuple,o):rr(o)},clean(){const t=this.value;for(const e in t)0===t[e].num&&delete t[e]},add(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(t);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(t),t)},rem(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(t);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let i=0,r=n.length;i<r;++i)e[n[i]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,i=n.length;t<i;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,i=this._prev,r=this._drop,o=t.add,a=t.rem,s=t.mod;let c,l,u,f;if(i)for(l in i)c=i[l],r&&!c.num||a.push(c.tuple);for(u=0,f=this._alen;u<f;++u)o.push(this.celltuple(e[u])),e[u]=null;for(u=0,f=this._mlen;u<f;++u)c=n[u],(0===c.num&&r?a:s).push(this.celltuple(c)),n[u]=null;return this._alen=this._mlen=0,this._prev=null,t}});function aa(t){Rr.call(this,null,t)}function sa(t,e,n){const i=t;let r=e||[],o=n||[],a={},s=0;return{add:t=>o.push(t),remove:t=>a[i(t)]=++s,size:()=>r.length,data:(t,e)=>(s&&(r=r.filter((t=>!a[i(t)])),a={},s=0),e&&t&&r.sort(t),o.length&&(r=t?(0,m.TS)(t,r,o.sort(t)):r.concat(o),o=[]),r)}}function ca(t){Rr.call(this,[],t)}function la(t){mr.call(this,null,ua,t)}function ua(t){return this.value&&!t.modified()?this.value:(0,m.qu)(t.fields,t.orders)}function fa(t){Rr.call(this,null,t)}function da(t){Rr.call(this,null,t)}aa.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},(0,m.XW)(aa,Rr,{transform(t,e){const n=!1!==t.interval,i=this._bins(t),r=i.start,o=i.step,a=t.as||["bin0","bin1"],s=a[0],c=a[1];let l;return l=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified((0,m.Oj)(t.field))?e.ADD_MOD:e.ADD,e.visit(l,n?t=>{const e=i(t);t[s]=e,t[c]=null==e?null:r+o*(1+(e-r)/o)}:t=>t[s]=i(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=Gr(t),i=n.step;let r,o,a=n.start,s=a+Math.ceil((n.stop-a)/i)*i;null!=(r=t.anchor)&&(o=r-(a+i*Math.floor((r-a)/i)),a+=o,s+=o);const c=function(t){let n=(0,m.He)(e(t));return null==n?null:n<a?-1/0:n>s?1/0:(n=Math.max(a,Math.min(n,s-i)),a+i*Math.floor(1e-14+(n-a)/i))};return c.start=a,c.stop=n.stop,c.step=i,this.value=(0,m.ZE)(c,(0,m.Oj)(e),t.name||"bin_"+(0,m.el)(e))}}),ca.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,m.XW)(ca,Rr,{transform(t,e){const n=e.fork(e.ALL),i=sa(nr,this.value,n.materialize(n.ADD).add),r=t.sort,o=e.changed()||r&&(t.modified("sort")||e.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(cr(r),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),(0,m.XW)(la,mr),fa.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},(0,m.XW)(fa,Rr,{transform(t,e){const n=e=>n=>{for(var i,r=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],c=0,l=r.length;c<l;++c)a.test(i=r[c])||e(i)},i=this._parameterCheck(t,e),r=this._counts,o=this._match,a=this._stop,s=t.field,c=t.as||["text","count"],l=n((t=>r[t]=1+(r[t]||0))),u=n((t=>r[t]-=1));return i?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,u)),this._finish(e,c)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,i=this._tuples||(this._tuples={}),r=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,c,l;for(s in n)c=i[s],l=n[s]||0,!c&&l?(i[s]=c=rr({}),c[r]=s,c[o]=l,a.add.push(c)):0===l?(c&&a.rem.push(c),n[s]=null,i[s]=null):c[o]!==l&&(c[o]=l,a.mod.push(c));return a.modifies(e)}}),da.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,m.XW)(da,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.as||["a","b"],r=i[0],o=i[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,i){for(var r,o,a=[],s={},c=t.length,l=0;l<c;++l)for(s[e]=o=t[l],r=0;r<c;++r)s[n]=t[r],i(s)&&(a.push(rr(s)),(s={})[e]=o);return a}(s,r,o,t.filter||m.yb)):n.mod=s,n.source=this.value,n.modifies(i)}});const ha={kde:co,mixture:mo,normal:so,lognormal:po,uniform:xo},pa="function";function ma(t,e){const n=t[pa];(0,m.nr)(ha,n)||(0,m.vU)("Unknown distribution function: "+n);const i=ha[n]();for(const r in t)"field"===r?i.data((t.from||e()).map(t[r])):"distributions"===r?i[r](t[r].map((t=>ma(t,e)))):typeof i[r]===pa&&i[r](t[r]);return i}function ga(t){Rr.call(this,null,t)}const va=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],ya={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:va},{name:"weights",type:"number",array:!0}]};function ba(t,e){return t?t.map(((t,n)=>e[n]||(0,m.el)(t))):null}function xa(t,e,n){const i=[],r=t=>t(c);let o,a,s,c,l,u;if(null==e)i.push(t.map(n));else for(o={},a=0,s=t.length;a<s;++a)c=t[a],l=e.map(r),u=o[l],u||(o[l]=u=[],u.dims=l,i.push(u)),u.push(n(c));return i}ga.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:va.concat(ya)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(ga,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=ma(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),r=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&(0,m.vU)("Invalid density method: "+a),t.extent||i.data||(0,m.vU)("Missing density extent parameter."),a=i[a];const s=t.as||["value","density"],c=Bo(a,t.extent||(0,m.We)(i.data()),r,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],rr(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function _a(t){Rr.call(this,null,t)}_a.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function wa(t){mr.call(this,null,ka,t),this.modified(!0)}function ka(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:(0,m.ZE)((n=>e(n,t)),(0,m.Oj)(e),(0,m.el)(e))}function Ea(t){Rr.call(this,[void 0,void 0],t)}function Da(t,e){mr.call(this,t),this.parent=e,this.count=0}function Aa(t){Rr.call(this,{},t),this._keys=(0,m.Xr)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,i=e.active;n<i;++n)t(e[n],n,e)}}function Sa(t){mr.call(this,null,Ca,t)}function Ca(t){return this.value&&!t.modified()?this.value:(0,m.kJ)(t.name)?(0,m.IX)(t.name).map((t=>(0,m.EP)(t))):(0,m.EP)(t.name,t.as)}function Fa(t){Rr.call(this,(0,m.Xr)(),t)}function Ma(t){Rr.call(this,[],t)}function Oa(t){Rr.call(this,[],t)}function Ta(t){Rr.call(this,null,t)}function Na(t){Rr.call(this,[],t)}(0,m.XW)(_a,Rr,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,i=xa(e.source,t.groupby,m.yR),r=t.smooth||!1,o=t.field,a=t.step||((t,e)=>(0,m.yP)((0,m.We)(t,e))/30)(n,o),s=cr(((t,e)=>o(t)-o(e))),c=t.as||"bin",l=i.length;let u,f=1/0,d=-1/0,h=0;for(;h<l;++h){const t=i[h].sort(s);u=-1;for(const e of Vr(t,a,r,o))e<f&&(f=e),e>d&&(d=e),t[++u][c]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(c)}}),(0,m.XW)(wa,mr),Ea.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,m.XW)(Ea,Rr,{transform(t,e){const n=this.value,i=t.field,r=e.changed()||e.modified(i.fields)||t.modified("field");let o=n[0],a=n[1];if((r||null==o)&&(o=1/0,a=-1/0),e.visit(r?e.SOURCE:e.ADD,(t=>{const e=(0,m.He)(i(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){let t=(0,m.el)(i);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]}}),(0,m.XW)(Da,mr,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),(0,m.XW)(Aa,Rr,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,i){const r=this.value;let o,a,s=(0,m.nr)(r,t)&&r[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[t])&&a.tuple,o=n.dataflow,s=new Da(n.fork(n.NO_SOURCE),this),o.add(s).connect(e(o,t,a)),r[t]=s,this.activate(s)),s},clean(){const t=this.value;let e=0;for(const n in t)if(0===t[n].count){const i=t[n].detachSubflow;i&&i(),delete t[n],++e}if(e){const t=this._targets.filter((t=>t&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,i=t?t.length:0;let r=0;for(;r<i;++r)e[r]=t[r];for(;r<n&&null!=e[r];++r)e[r]=null;e.active=i},transform(t,e){const n=e.dataflow,i=t.key,r=t.subflow,o=this._keys,a=t.modified("key"),s=t=>this.subflow(t,r,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=nr(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))})),e.visit(e.ADD,(t=>{const e=i(t);o.set(nr(t),e),s(e).add(t)})),a||e.modified(i.fields)?e.visit(e.MOD,(t=>{const e=nr(t),n=o.get(e),r=i(t);n===r?s(r).mod(t):(o.set(e,r),s(n).rem(t),s(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{s(o.get(nr(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=nr(t),n=o.get(e),r=i(t);n!==r&&(o.set(e,r),s(n).rem(t),s(r).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),(0,m.XW)(Sa,mr),Fa.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,m.XW)(Fa,Rr,{transform(t,e){const n=e.dataflow,i=this.value,r=e.fork(),o=r.add,a=r.rem,s=r.mod,c=t.expr;let l=!0;function u(e){const n=nr(e),r=c(e,t),u=i.get(n);r&&u?(i.delete(n),o.push(e)):r||u?l&&r&&!u&&s.push(e):(i.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=nr(t);i.has(e)?i.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{c(e,t)?o.push(e):i.set(nr(e),1)})),e.visit(e.MOD,u),t.modified()&&(l=!1,e.visit(e.REFLOW,u)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),Ma.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},(0,m.XW)(Ma,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=ba(i,t.as||[]),o=t.index||null,a=r.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=i.map((e=>e(t))),s=e.reduce(((t,e)=>Math.max(t,e.length)),0);let c,l,u,f=0;for(;f<s;++f){for(l=or(t),c=0;c<a;++c)l[r[c]]=null==(u=e[c][f])?null:u;o&&(l[o]=f),n.add.push(l)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}}),Oa.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},(0,m.XW)(Oa,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=i.map(m.el),o=t.as||["key","value"],a=o[0],s=o[1],c=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{for(let e,o=0;o<c;++o)e=or(t),e[a]=r[o],e[s]=i[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)}}),Ta.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},(0,m.XW)(Ta,Rr,{transform(t,e){const n=t.expr,i=t.as,r=t.modified(),o=t.initonly?e.ADD:r?e.SOURCE:e.modified(n.fields)||e.modified(i)?e.ADD_MOD:e.ADD;return r&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(i),e.visit(o,(e=>e[i]=n(e,t)))}}),(0,m.XW)(Na,Rr,{transform(t,e){const n=e.fork(e.ALL),i=t.generator;let r,o,a,s=this.value,c=t.size-s.length;if(c>0){for(r=[];--c>=0;)r.push(a=rr(i(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else o=s.slice(0,-c),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-c);return n.source=this.value=s,n}});const za={value:"value",median:qr.Z,mean:function(t,e){let n=0,i=0;if(void 0===e)for(let r of t)null!=r&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n},min:Uo.Z,max:qo.Z},Ra=[];function Pa(t){Rr.call(this,[],t)}function La(t){oa.call(this,t)}function ja(t){Rr.call(this,null,t)}function Ba(t){mr.call(this,null,Ia,t)}function Ia(t){return this.value&&!t.modified()?this.value:(0,m.Jy)(t.fields,t.flat)}function Ua(t){Rr.call(this,[],t),this._pending=null}function qa(t,e,n){n.forEach(rr);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);return i.rem=t.value,t.value=i.source=i.add=n,t._pending=null,i.rem.length&&i.clean(!0),i}function Wa(t){Rr.call(this,{},t)}function Ha(t){mr.call(this,null,Xa,t)}function Xa(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let i,r,o=1/0,a=-1/0;for(i=0;i<n;++i)r=e[i],r[0]<o&&(o=r[0]),r[1]>a&&(a=r[1]);return[o,a]}function Ja(t){mr.call(this,null,Ga,t)}function Ga(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function $a(t){Rr.call(this,null,t)}function Za(t){oa.call(this,t)}function Ya(t){Aa.call(this,t)}function Va(t){Rr.call(this,null,t)}function Ka(t){Rr.call(this,null,t)}function Qa(t){Rr.call(this,null,t)}Pa.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},(0,m.XW)(Pa,Rr,{transform(t,e){var n,i,r,o,a,s,c,l,u,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||za.value;if(null!=za[n])return n===za.value?(e=void 0!==t.value?t.value:0,()=>e):za[n];(0,m.vU)("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=(0,m.el)(t.field),v=(0,m.el)(t.key),y=(t.groupby||[]).map(m.el),b=function(t,e,n,i){var r,o,a,s,c,l,u,f,d=t=>t(f),h=[],p=i?i.slice():[],m={},g={};for(p.forEach(((t,e)=>m[t]=e+1)),s=0,u=t.length;s<u;++s)l=n(f=t[s]),c=m[l]||(m[l]=p.push(l)),(a=g[o=(r=e?e.map(d):Ra)+""])||(a=g[o]=[],h.push(a),a.values=r),a[c-1]=f;return h.domain=p,h}(e.source,t.groupby,t.key,t.keyvals),x=[],_=this.value,w=b.domain.length;for(a=0,l=b.length;a<l;++a)for(r=(n=b[a]).values,i=NaN,c=0;c<w;++c)if(null==n[c]){for(o=b.domain[c],f={_impute:!0},s=0,u=r.length;s<u;++s)f[y[s]]=r[s];f[v]=o,f[g]=Number.isNaN(i)?i=h(n,p):i,x.push(rr(f))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),_.length&&(d.rem=d.materialize(d.REM).rem.concat(_)),this.value=x,d}}),La.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Zo},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,m.XW)(La,oa,{transform(t,e){const n=this,i=t.modified();let r;return n.value&&(i||e.modified(n._inputs,!0))?(r=n.value=i?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(r=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{(0,m.l7)(t,r[n.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(t[n]),t[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),ja.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(ja,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=xa(i,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",c=t.as||["value","density"],l=[];let u=t.extent,f=t.steps||t.minsteps||25,d=t.steps||t.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,m.vU)("Invalid density method: "+s),"shared"===t.resolve&&(u||(u=(0,m.We)(i,t.field)),f=d=t.steps||d),r.forEach((e=>{const n=co(e,a)[s],i=t.counts?e.length:1;Bo(n,u||(0,m.We)(e),f,d).forEach((t=>{const n={};for(let i=0;i<o.length;++i)n[o[i]]=e.dims[i];n[c[0]]=t[0],n[c[1]]=t[1]*i,l.push(rr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),(0,m.XW)(Ba,mr),(0,m.XW)(Ua,Rr,{transform(t,e){const n=e.dataflow;if(this._pending)return qa(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return qa(this,e,n.parse(t.values,t.format));if(t.async){const e=n.request(t.url,t.format).then((t=>(this._pending=(0,m.IX)(t.data),t=>t.touch(this))));return{async:e}}return n.request(t.url,t.format).then((t=>qa(this,e,(0,m.IX)(t.data))))}}),Wa.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},(0,m.XW)(Wa,Rr,{transform(t,e){const n=t.fields,i=t.index,r=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let c,l,u,f=a?e.SOURCE:e.ADD,d=e,h=t.as;return r?(l=r.length,s>1&&!h&&(0,m.vU)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&(0,m.vU)('The "as" parameter has too few output field names.'),h=h||r.map(m.el),c=function(t){for(var e,a,c=0,u=0;c<s;++c)if(null==(a=i.get(n[c](t))))for(e=0;e<l;++e,++u)t[h[u]]=o;else for(e=0;e<l;++e,++u)t[h[u]]=r[e](a)}):(h||(0,m.vU)("Missing output field names."),c=function(t){for(var e,r=0;r<s;++r)e=i.get(n[r](t)),t[h[r]]=null==e?o:e}),a?d=e.reflow(!0):(u=n.some((t=>e.modified(t.fields))),f|=u?e.MOD:0),e.visit(f,c),d.modifies(h)}}),(0,m.XW)(Ha,mr),(0,m.XW)(Ja,mr),(0,m.XW)($a,Rr,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Za.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Zo,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,m.XW)(Za,oa,{_transform:oa.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,i=t.value,r=("count"===t.op?"__count__":t.op)||"sum",o=(0,m.Oj)(n).concat((0,m.Oj)(i)),a=function(t,e,n){const i={},r=[];return n.visit(n.SOURCE,(e=>{const n=t(e);i[n]||(i[n]=1,r.push(n))})),r.sort(m.j2),e?r.slice(0,e):r}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((()=>r)),fields:a.map((t=>function(t,e,n,i){return(0,m.ZE)((i=>e(i)===t?n(i):NaN),i,t+"")}(t,n,i,o))),as:a.map((t=>t+"")),modified:t.modified.bind(t)}}(t,e),e)}}),(0,m.XW)(Ya,Aa,{transform(t,e){const n=t.subflow,i=t.field,r=t=>this.subflow(nr(t),n,e,t);return(t.modified("field")||i&&e.modified((0,m.Oj)(i)))&&(0,m.vU)("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(t=>{const e=r(t);i(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=r(t);i(t).forEach((t=>e.add(rr(t))))})),e.visit(e.REM,(t=>{const e=r(t);i(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>r(t).mod(t))),e.visit(e.ADD,(t=>r(t).add(t))),e.visit(e.REM,(t=>r(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),Va.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},(0,m.XW)(Va,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=ba(t.fields,t.as||[]),o=i?(t,e)=>function(t,e,n,i){for(let r=0,o=n.length;r<o;++r)e[i[r]]=n[r](t);return e}(t,e,i,r):ar;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,(t=>{const e=nr(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,rr({}));a[nr(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[nr(t)]))})),n}}),(0,m.XW)(Ka,Rr,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),Qa.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function ts(t){Rr.call(this,null,t)}function es(t){Rr.call(this,[],t),this.count=0}function ns(t){Rr.call(this,null,t)}function is(t){Rr.call(this,null,t),this.modified(!0)}function rs(t){Rr.call(this,null,t)}(0,m.XW)(Qa,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const r=xa(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=[],s=t.step||.01,c=t.probs||(0,Wo.Z)(s/2,1-1e-14,s),l=c.length;return r.forEach((t=>{const e=Hr(t,c);for(let n=0;n<l;++n){const r={};for(let e=0;e<o.length;++e)r[o[e]]=t.dims[e];r[i[0]]=c[n],r[i[1]]=e[n],a.push(rr(r))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,m.XW)(ts,Rr,{transform(t,e){let n,i;return this.value?i=this.value:(n=e=e.addAll(),i=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(t=>{const e=nr(t);n.rem.push(i[e]),i[e]=null})),e.visit(e.ADD,(t=>{const e=or(t);i[nr(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=i[nr(t)];for(const i in t)e[i]=t[i],n.modifies(i);n.mod.push(e)}))),n}}),es.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,m.XW)(es,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.modified("size"),r=t.size,o=this.value.reduce(((t,e)=>(t[nr(e)]=1,t)),{});let a=this.value,s=this.count,c=0;function l(t){let e,i;a.length<r?a.push(t):(i=~~((s+1)*$r()),i<a.length&&i>=c&&(e=a[i],o[nr(e)]&&n.rem.push(e),a[i]=t)),++s}if(e.rem.length&&(e.visit(e.REM,(t=>{const e=nr(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s})),a=a.filter((t=>-1!==o[nr(t)]))),(e.rem.length||i)&&a.length<r&&e.source&&(c=s=a.length,e.visit(e.SOURCE,(t=>{o[nr(t)]||l(t)})),c=-1),i&&a.length>r){const t=a.length-r;for(let e=0;e<t;++e)o[nr(a[e])]=-1,n.rem.push(a[e]);a=a.slice(t)}return e.mod.length&&e.visit(e.MOD,(t=>{o[nr(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,l),(e.add.length||c<0)&&(n.add=a.filter((t=>!o[nr(t)]))),this.count=s,this.value=n.source=a,n}}),ns.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},(0,m.XW)(ns,Rr,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),i=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=(0,Wo.Z)(t.start,t.stop,t.step||1).map((t=>{const e={};return e[i]=t,rr(e)})),n.add=e.add.concat(this.value),n}}),(0,m.XW)(is,Rr,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const os=["unit0","unit1"];function as(t){Rr.call(this,(0,m.Xr)(),t)}function ss(t){Rr.call(this,null,t)}rs.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Lt,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:os}]},(0,m.XW)(rs,Rr,{transform(t,e){const n=t.field,i=!1!==t.interval,r="utc"===t.timezone,o=this._floor(t,e),a=(r?he:de)(o.unit).offset,s=t.as||os,c=s[0],l=s[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(n)))&&(h=(e=e.reflow(!0)).SOURCE,f=1/0,d=-1/0),e.visit(h,(t=>{const e=n(t);let r,s;null==e?(t[c]=null,i&&(t[l]=null)):(t[c]=r=s=o(e),i&&(t[l]=s=a(r,u)),r<f&&(f=r),s>d&&(d=s))})),o.start=f,o.stop=d,e.modifies(i?s:c)},_floor(t,e){const n="utc"===t.timezone,{units:i,step:r}=t.units?{units:t.units,step:t.step||1}:ze({extent:t.extent||(0,m.We)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Bt(i),a=this.value||{},s=(n?le:ae)(o,r);return s.unit=(0,m.fj)(o),s.units=o,s.step=r,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,m.XW)(as,Rr,{transform(t,e){const n=e.dataflow,i=t.field,r=this.value,o=t=>r.set(i(t),t);let a=!0;return t.modified("field")||e.modified(i.fields)?(r.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>r.delete(i(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),e.fork()}}),(0,m.XW)(ss,Rr,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(cr(t.sort)):e.source).map(t.field))}});const cs={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?++t:t}}},percent_rank:function(){const t=cs.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,i=e.compare;let r=e.index;if(t<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;t=r}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||(0,m.vU)("ntile num must be greater than zero.");const n=cs.cume_dist(),i=n.next;return{init:n.init,next:t=>Math.ceil(e*i(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const i=n.index-e;return i>=0?t(n.data[i]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const i=n.index+e,r=n.data;return i<r.length?t(r[i]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||(0,m.vU)("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(e-1);return i<n.i1?t(n.data[i]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const i=t(n.data[n.index]);return null!=i?e=i:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:i=>{const r=i.data;return i.index<=n?e:(n=function(t,e,n){for(let i=e.length;n<i;++n){if(null!=t(e[n]))return n}return-1}(t,r,i.index))<0?(n=r.length,e=null):e=t(r[n])}}}};const ls=Object.keys(cs);function us(t){const e=(0,m.IX)(t.ops),n=(0,m.IX)(t.fields),i=(0,m.IX)(t.params),r=(0,m.IX)(t.as),o=this.outputs=[],a=this.windows=[],s={},c={},l=[],u=[];let f=!0;function d(t){(0,m.IX)((0,m.Oj)(t)).forEach((t=>s[t]=1))}d(t.sort),e.forEach(((t,e)=>{const s=n[e],h=(0,m.el)(s),p=Xo(t,h,r[e]);if(d(s),o.push(p),(0,m.nr)(cs,t))a.push(function(t,e,n,i){const r=cs[t](e,n);return{init:r.init||m.bM,update:function(t,e){e[i]=r.next(t)}}}(t,n[e],i[e],p));else{if(null==s&&"count"!==t&&(0,m.vU)("Null aggregate field specified."),"count"===t)return void l.push(p);f=!1;let e=c[h];e||(e=c[h]=[],e.field=s,u.push(e)),e.push(Yo(t,p))}})),(l.length||u.length)&&(this.cell=function(t,e,n){t=t.map((t=>na(t,t.field)));const i={num:0,agg:null,store:!1,count:e};if(!n)for(var r=t.length,o=i.agg=Array(r),a=0;a<r;++a)o[a]=new t[a](i);if(i.store)var s=i.data=new ia;return i.add=function(t){if(i.num+=1,!n){s&&s.add(t);for(let e=0;e<r;++e)o[e].add(o[e].get(t),t)}},i.rem=function(t){if(i.num-=1,!n){s&&s.rem(t);for(let e=0;e<r;++e)o[e].rem(o[e].get(t),t)}},i.set=function(t){let r,a;for(s&&s.values(),r=0,a=e.length;r<a;++r)t[e[r]]=i.num;if(!n)for(r=0,a=o.length;r<a;++r)o[r].set(t)},i.init=function(){i.num=0,s&&s.reset();for(let t=0;t<r;++t)o[t].init()},i}(u,l,f)),this.inputs=Object.keys(s)}const fs=us.prototype;function ds(t){Rr.call(this,{},t),this._mlen=0,this._mods=[]}function hs(t,e,n,i){const r=i.sort,o=r&&!i.ignorePeers,a=i.frame||[null,0],s=t.data(n),c=s.length,l=o?(0,Dt.Z)(r):null,u={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,m.a9)(-1)};e.init();for(let f=0;f<c;++f)ps(u,a,f,c),o&&ms(u,l),e.update(u,s[f])}function ps(t,e,n,i){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?i:Math.min(i,n+Math.abs(e[1])+1),t.index=n}function ms(t,e){const n=t.i0,i=t.i1-1,r=t.compare,o=t.data,a=o.length-1;n>0&&!r(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),i<a&&!r(o[i],o[i+1])&&(t.i1=e.right(o,o[i]))}function gs(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function vs(t){this._context=t}function ys(){}function bs(t){this._context=t}function xs(t){this._context=t}function _s(t,e){this._basis=new vs(t),this._beta=e}fs.init=function(){this.windows.forEach((t=>t.init())),this.cell&&this.cell.init()},fs.update=function(t,e){const n=this.cell,i=this.windows,r=t.data,o=i&&i.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(r[a]);for(a=t.p1;a<t.i1;++a)n.add(r[a]);n.set(e)}for(a=0;a<o;++a)i[a].update(t,e)},ds.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ls.concat(Zo)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},(0,m.XW)(ds,Rr,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),i=cr(t.sort),r=Ho(t.groupby),o=t=>this.group(r(t));let a=this.state;a&&!n||(a=this.state=new us(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let s=0,c=this._mlen;s<c;++s)hs(this._mods[s],a,i,t);return this._mlen=0,this._mods=[],e.reflow(n).modifies(a.outputs)},group(t){let e=this.value[t];return e||(e=this.value[t]=sa(nr),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}}),vs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:gs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:gs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},bs.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:gs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},xs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:gs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},_s.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],a=t[n]-r,s=e[n]-o,c=-1;++c<=n;)i=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+i*a),this._beta*e[c]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const ws=function t(e){function n(t){return 1===e?new vs(t):new _s(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function ks(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Es(t,e){this._context=t,this._k=(1-e)/6}Es.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ks(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ks(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ds=function t(e){function n(t){return new Es(t,e)}return n.tension=function(e){return t(+e)},n}(0);function As(t,e){this._context=t,this._k=(1-e)/6}As.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ks(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ss=function t(e){function n(t){return new As(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Cs(t,e){this._context=t,this._k=(1-e)/6}Cs.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ks(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Fs=function t(e){function n(t){return new Cs(t,e)}return n.tension=function(e){return t(+e)},n}(0),Ms=Math.abs,Os=Math.atan2,Ts=Math.cos,Ns=Math.max,zs=Math.min,Rs=Math.sin,Ps=Math.sqrt,Ls=1e-12,js=Math.PI,Bs=js/2,Is=2*js;function Us(t){return t>=1?Bs:t<=-1?-Bs:Math.asin(t)}function qs(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Ls){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ls){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}function Ws(t,e){this._context=t,this._alpha=e}Ws.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:qs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Hs=function t(e){function n(t){return e?new Ws(t,e):new Es(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Xs(t,e){this._context=t,this._alpha=e}Xs.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:qs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Js=function t(e){function n(t){return e?new Xs(t,e):new Cs(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gs(t,e){this._context=t,this._alpha=e}Gs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:qs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $s=function t(e){function n(t){return e?new Gs(t,e):new As(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Zs(t){this._context=t}function Ys(t){return new Zs(t)}function Vs(t){this._context=t}function Ks(t){return t<0?-1:1}function Qs(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(Ks(o)+Ks(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function tc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ec(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function nc(t){this._context=t}function ic(t){this._context=new rc(t)}function rc(t){this._context=t}function oc(t){this._context=t}function ac(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function sc(t,e){this._context=t,this._t=e}function cc(t){return function(){return t}}Zs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},Vs.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},nc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ec(this,this._t0,tc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ec(this,tc(this,n=Qs(this,t,e)),n);break;default:ec(this,this._t0,n=Qs(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(ic.prototype=Object.create(nc.prototype)).point=function(t,e){nc.prototype.point.call(this,e,t)},rc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=ac(t),r=ac(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var lc,uc,fc,dc,hc,pc,mc,gc,vc,yc,bc,xc,_c,wc,kc=n(50669);const Ec=Math.PI,Dc=2*Ec,Ac=1e-6,Sc=Dc-Ac;function Cc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Fc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Cc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error("invalid digits: ".concat(t));if(e>15)return Cc;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append(lc||(lc=(0,kc.Z)(["M",",",""])),this._x0=this._x1=+t,this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append(uc||(uc=(0,kc.Z)(["Z"]))))}lineTo(t,e){this._append(fc||(fc=(0,kc.Z)(["L",",",""])),this._x1=+t,this._y1=+e)}quadraticCurveTo(t,e,n,i){this._append(dc||(dc=(0,kc.Z)(["Q",",",",",",",""])),+t,+e,this._x1=+n,this._y1=+i)}bezierCurveTo(t,e,n,i,r,o){this._append(hc||(hc=(0,kc.Z)(["C",",",",",",",",",",",""])),+t,+e,+n,+i,this._x1=+r,this._y1=+o)}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error("negative radius: ".concat(r));let o=this._x1,a=this._y1,s=n-t,c=i-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append(pc||(pc=(0,kc.Z)(["M",",",""])),this._x1=t,this._y1=e);else if(f>Ac)if(Math.abs(u*s-c*l)>Ac&&r){let d=n-o,h=i-a,p=s*s+c*c,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=r*Math.tan((Ec-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>Ac&&this._append(gc||(gc=(0,kc.Z)(["L",",",""])),t+b*l,e+b*u),this._append(vc||(vc=(0,kc.Z)(["A",",",",0,0,",",",",",""])),r,r,+(u*d>l*h),this._x1=t+x*s,this._y1=e+x*c)}else this._append(mc||(mc=(0,kc.Z)(["L",",",""])),this._x1=t,this._y1=e);else;}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error("negative radius: ".concat(n));let a=n*Math.cos(i),s=n*Math.sin(i),c=t+a,l=e+s,u=1^o,f=o?i-r:r-i;null===this._x1?this._append(yc||(yc=(0,kc.Z)(["M",",",""])),c,l):(Math.abs(this._x1-c)>Ac||Math.abs(this._y1-l)>Ac)&&this._append(bc||(bc=(0,kc.Z)(["L",",",""])),c,l),n&&(f<0&&(f=f%Dc+Dc),f>Sc?this._append(xc||(xc=(0,kc.Z)(["A",",",",0,1,",",",",","A",",",",0,1,",",",",",""])),n,n,u,t-a,e-s,n,n,u,this._x1=c,this._y1=l):f>Ac&&this._append(_c||(_c=(0,kc.Z)(["A",",",",0,",",",",",",",""])),n,n,+(f>=Ec),u,this._x1=t+n*Math.cos(r),this._y1=e+n*Math.sin(r)))}rect(t,e,n,i){this._append(wc||(wc=(0,kc.Z)(["M",",","h","v","h","Z"])),this._x0=this._x1=+t,this._y0=this._y1=+e,n=+n,+i,-n)}toString(){return this._}}function Mc(){return new Fc}function Oc(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError("invalid digits: ".concat(n));e=t}return t},()=>new Fc(e)}function Tc(t){return t.innerRadius}function Nc(t){return t.outerRadius}function zc(t){return t.startAngle}function Rc(t){return t.endAngle}function Pc(t){return t&&t.padAngle}function Lc(t,e,n,i,r,o,a){var s=t-n,c=e-i,l=(a?o:-o)/Ps(s*s+c*c),u=l*c,f=-l*s,d=t+u,h=e+f,p=n+u,m=i+f,g=(d+p)/2,v=(h+m)/2,y=p-d,b=m-h,x=y*y+b*b,_=r-o,w=d*m-p*h,k=(b<0?-1:1)*Ps(Ns(0,_*_*x-w*w)),E=(w*b-y*k)/x,D=(-w*y-b*k)/x,A=(w*b+y*k)/x,S=(-w*y+b*k)/x,C=E-g,F=D-v,M=A-g,O=S-v;return C*C+F*F>M*M+O*O&&(E=A,D=S),{cx:E,cy:D,x01:-u,y01:-f,x11:E*(r/_-1),y11:D*(r/_-1)}}Mc.prototype=Fc.prototype;Array.prototype.slice;function jc(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function Bc(t){return t[0]}function Ic(t){return t[1]}function Uc(t,e){var n=cc(!0),i=null,r=Ys,o=null,a=Oc(s);function s(s){var c,l,u,f=(s=jc(s)).length,d=!1;for(null==i&&(o=r(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"===typeof t?t:void 0===t?Bc:cc(t),e="function"===typeof e?e:void 0===e?Ic:cc(e),s.x=function(e){return arguments.length?(t="function"===typeof e?e:cc(+e),s):t},s.y=function(t){return arguments.length?(e="function"===typeof t?t:cc(+t),s):e},s.defined=function(t){return arguments.length?(n="function"===typeof t?t:cc(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}function qc(t,e,n){var i=null,r=cc(!0),o=null,a=Ys,s=null,c=Oc(l);function l(l){var u,f,d,h,p,m=(l=jc(l)).length,g=!1,v=new Array(m),y=new Array(m);for(null==o&&(s=a(p=c())),u=0;u<=m;++u){if(!(u<m&&r(h=l[u],u,l))===g)if(g=!g)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=f;--d)s.point(v[d],y[d]);s.lineEnd(),s.areaEnd()}g&&(v[u]=+t(h,u,l),y[u]=+e(h,u,l),s.point(i?+i(h,u,l):v[u],n?+n(h,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return Uc().defined(r).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?Bc:cc(+t),e="function"===typeof e?e:cc(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?Ic:cc(+n),l.x=function(e){return arguments.length?(t="function"===typeof e?e:cc(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"===typeof e?e:cc(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"===typeof t?t:cc(+t),l):i},l.y=function(t){return arguments.length?(e="function"===typeof t?t:cc(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"===typeof t?t:cc(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:cc(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"===typeof t?t:cc(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}Ps(3);const Wc={draw(t,e){const n=Ps(e/js);t.moveTo(n,0),t.arc(0,0,n,0,Is)}},Hc=(Ps(1/3),Rs(js/10)/Rs(7*js/10));Rs(Is/10),Ts(Is/10),Ps(3),Ps(3),Ps(3),Ps(12);function Xc(t,e){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const Jc=()=>"undefined"!==typeof Image?Image:null;var Gc=n(94712),$c=n(13629),Zc=n(94923);var Yc=n(95658),Vc=n(66042),Kc=n(1885),Qc=n(8896);function tl(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function el(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nl(t){var e=1,n=t(tl(e),el(e));return n.constant=function(n){return arguments.length?t(tl(e=+n),el(e)):e},(0,$c.Q)(n)}function il(t,e,n,i,r,o){const a=[[kt,1,W],[kt,5,5e3],[kt,15,15e3],[kt,30,3e4],[o,1,H],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,X],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,J],[i,2,1728e5],[n,1,G],[e,1,$],[e,3,7776e6],[t,1,Z]];function s(e,n,i){const r=Math.abs(n-e)/i,o=(0,Dt.Z)((t=>{let[,,e]=t;return e})).right(a,r);if(o===a.length)return t.every((0,N.ly)(e/Z,n/Z,i));if(0===o)return Et.every(Math.max((0,N.ly)(e,n,i),1));const[s,c]=a[r/a[o-1][2]<a[o][2]/r?o-1:o];return s.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"===typeof n.range?n:s(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},s]}const[rl,ol]=il(gt,yt,ct,K,xt,wt),[al,sl]=il(mt,vt,tt,Y,bt,_t);var cl=n(48033);function ll(t){return new Date(t)}function ul(t){return t instanceof Date?+t:+new Date(+t)}function fl(t,e,n,i,r,o,a,s,c,l){var u=(0,Kc.ZP)(),f=u.invert,d=u.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),y=l("%b %d"),b=l("%B"),x=l("%Y");function _(t){return(c(t)<t?h:s(t)<t?p:a(t)<t?m:o(t)<t?g:i(t)<t?r(t)<t?v:y:n(t)<t?b:x)(t)}return u.invert=function(t){return new Date(f(t))},u.domain=function(t){return arguments.length?d(Array.from(t,ul)):d().map(ll)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?_:l(e)},u.nice=function(t){var n=d();return t&&"function"===typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d((0,cl.Z)(n,t)):u},u.copy=function(){return(0,Kc.JG)(u,fl(t,e,n,i,r,o,a,s,c,l))},u}var dl=n(34588),hl=n(40602);function pl(){var t,e,n,i,r,o=0,a=1,s=Kc.yR,c=!1;function l(e){return null==e||isNaN(e=+e)?r:s(0===n?.5:(e=(i(e)-t)*n,c?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,i;return arguments.length?([n,i]=e,s=t(n,i),l):[s(0),s(1)]}}return l.domain=function(r){return arguments.length?([o,a]=r,t=i(o=+o),e=i(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(c=!!t,l):c},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=u(dl.Z),l.rangeRound=u(hl.Z),l.unknown=function(t){return arguments.length?(r=t,l):r},function(r){return i=r,t=r(o),e=r(a),n=t===e?0:1/(e-t),l}}function ml(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function gl(){var t=(0,$c.Q)(pl()(Kc.yR));return t.copy=function(){return ml(t,gl())},Qc.O.apply(t,arguments)}function vl(){var t=(0,Vc.Hh)(pl());return t.copy=function(){return ml(t,vl()).exponent(t.exponent())},Qc.O.apply(t,arguments)}function yl(t,e){void 0===e&&(e=t,t=dl.Z);for(var n=0,i=e.length-1,r=e[0],o=new Array(i<0?0:i);n<i;)o[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return o[e](t-e)}}function bl(){var t,e,n,i,r,o,a,s=0,c=.5,l=1,u=1,f=Kc.yR,d=!1;function h(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(u*t<u*e?i:r),f(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,f=yl(t,[n,i,r]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,c,l]=a,t=o(s=+s),e=o(c=+c),n=o(l=+l),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,h):[s,c,l]},h.clamp=function(t){return arguments.length?(d=!!t,h):d},h.interpolator=function(t){return arguments.length?(f=t,h):f},h.range=p(dl.Z),h.rangeRound=p(hl.Z),h.unknown=function(t){return arguments.length?(a=t,h):a},function(a){return o=a,t=a(s),e=a(c),n=a(l),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,h}}function xl(){var t=(0,Vc.Hh)(bl());return t.copy=function(){return ml(t,xl()).exponent(t.exponent())},Qc.O.apply(t,arguments)}var _l=n(79978),wl=n(90983),kl=n(87758),El=n(58458),Dl=n(73113),Al=n(15507),Sl=n(5535),Cl=n(20943),Fl=n(30155);function Ml(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Ol=n(97017);function Tl(t,e){var n=(0,Ol.wx)(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var Nl=n(74552),zl=n(29232),Rl=n(88246),Pl=n(71413),Ll=n(18959);function jl(t){return((t=Math.exp(t))+1/t)/2}const Bl=function t(e,n,i){function r(t,r){var o,a,s=t[0],c=t[1],l=t[2],u=r[0],f=r[1],d=r[2],h=u-s,p=f-c,m=h*h+p*p;if(m<1e-12)a=Math.log(d/l)/e,o=function(t){return[s+t*h,c+t*p,l*Math.exp(e*t*a)]};else{var g=Math.sqrt(m),v=(d*d-l*l+i*m)/(2*l*n*g),y=(d*d-l*l-i*m)/(2*d*n*g),b=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(y*y+1)-y);a=(x-b)/e,o=function(t){var i=t*a,r=jl(b),o=l/(n*g)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*i+b)-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+o*h,c+o*p,l*r/jl(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return r.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},r}(Math.SQRT2,2,4);var Il=n(30975),Ul=n(52017);function ql(t){return function(e,n){var i=t((e=(0,Ul.Ym)(e)).h,(n=(0,Ul.Ym)(n)).h),r=(0,Ol.ZP)(e.s,n.s),o=(0,Ol.ZP)(e.l,n.l),a=(0,Ol.ZP)(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=r(t),e.l=o(t),e.opacity=a(t),e+""}}}const Wl=ql(Ol.wx);var Hl=ql(Ol.ZP),Xl=n(20322);const Jl=Math.PI/180,Gl=180/Math.PI,$l=.96422,Zl=1,Yl=.82521,Vl=4/29,Kl=6/29,Ql=3*Kl*Kl,tu=.008856451679035631;function eu(t){if(t instanceof iu)return new iu(t.l,t.a,t.b,t.opacity);if(t instanceof uu)return fu(t);t instanceof Ul.Ss||(t=(0,Ul.SU)(t));var e,n,i=su(t.r),r=su(t.g),o=su(t.b),a=ru((.2225045*i+.7168786*r+.0606169*o)/Zl);return i===r&&r===o?e=n=a:(e=ru((.4360747*i+.3850649*r+.1430804*o)/$l),n=ru((.0139322*i+.0971045*r+.7141733*o)/Yl)),new iu(116*a-16,500*(e-a),200*(a-n),t.opacity)}function nu(t,e,n,i){return 1===arguments.length?eu(t):new iu(t,e,n,null==i?1:i)}function iu(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function ru(t){return t>tu?Math.pow(t,1/3):t/Ql+Vl}function ou(t){return t>Kl?t*t*t:Ql*(t-Vl)}function au(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function su(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cu(t){if(t instanceof uu)return new uu(t.h,t.c,t.l,t.opacity);if(t instanceof iu||(t=eu(t)),0===t.a&&0===t.b)return new uu(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Gl;return new uu(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function lu(t,e,n,i){return 1===arguments.length?cu(t):new uu(t,e,n,null==i?1:i)}function uu(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function fu(t){if(isNaN(t.h))return new iu(t.l,0,0,t.opacity);var e=t.h*Jl;return new iu(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function du(t,e){var n=(0,Ol.ZP)((t=nu(t)).l,(e=nu(e)).l),i=(0,Ol.ZP)(t.a,e.a),r=(0,Ol.ZP)(t.b,e.b),o=(0,Ol.ZP)(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=o(e),t+""}}function hu(t){return function(e,n){var i=t((e=lu(e)).h,(n=lu(n)).h),r=(0,Ol.ZP)(e.c,n.c),o=(0,Ol.ZP)(e.l,n.l),a=(0,Ol.ZP)(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=o(t),e.opacity=a(t),e+""}}}(0,Xl.Z)(iu,nu,(0,Xl.l)(Ul.Il,{brighter(t){return new iu(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new iu(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=$l*ou(e),t=Zl*ou(t),n=Yl*ou(n),new Ul.Ss(au(3.1338561*e-1.6168667*t-.4906146*n),au(-.9787684*e+1.9161415*t+.033454*n),au(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),(0,Xl.Z)(uu,lu,(0,Xl.l)(Ul.Il,{brighter(t){return new uu(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new uu(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return fu(this).rgb()}}));const pu=hu(Ol.wx);var mu=hu(Ol.ZP),gu=-.14861,vu=1.78277,yu=-.29227,bu=-.90649,xu=1.97294,_u=xu*bu,wu=xu*vu,ku=vu*yu-bu*gu;function Eu(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof Du)return new Du(t.h,t.s,t.l,t.opacity);t instanceof Ul.Ss||(t=(0,Ul.SU)(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(ku*i+_u*e-wu*n)/(ku+_u-wu),o=i-r,a=(xu*(n-r)-yu*o)/bu,s=Math.sqrt(a*a+o*o)/(xu*r*(1-r)),c=s?Math.atan2(a,o)*Gl-120:NaN;return new Du(c<0?c+360:c,s,r,t.opacity)}(t):new Du(t,e,n,null==i?1:i)}function Du(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Au(t){return function e(n){function i(e,i){var r=t((e=Eu(e)).h,(i=Eu(i)).h),o=(0,Ol.ZP)(e.s,i.s),a=(0,Ol.ZP)(e.l,i.l),s=(0,Ol.ZP)(e.opacity,i.opacity);return function(t){return e.h=r(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,i.gamma=e,i}(1)}(0,Xl.Z)(Du,Eu,(0,Xl.l)(Ul.Il,{brighter(t){return t=null==t?Ul.J5:Math.pow(Ul.J5,t),new Du(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ul.xV:Math.pow(Ul.xV,t),new Du(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Jl,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new Ul.Ss(255*(e+n*(gu*i+vu*r)),255*(e+n*(yu*i+bu*r)),255*(e+n*(xu*i)),this.opacity)}}));const Su=Au(Ol.wx);var Cu=Au(Ol.ZP);function Fu(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n}function Mu(t,e,n){const i=t-e+2*n;return t?i>0?i:1:0}const Ou="linear",Tu="log",Nu="pow",zu="sqrt",Ru="symlog",Pu="time",Lu="utc",ju="sequential",Bu="diverging",Iu="quantile",Uu="quantize",qu="threshold",Wu="ordinal",Hu="point",Xu="band",Ju="bin-ordinal",Gu="continuous",$u="discrete",Zu="discretizing",Yu="interpolating",Vu="temporal";function Ku(){const t=(0,El.Z)().unknown(void 0),e=t.domain,n=t.range;let i,r,o=[0,1],a=!1,s=0,c=0,l=.5;function u(){const t=e().length,u=o[1]<o[0],f=o[1-u],d=Mu(t,s,c);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(t-s))*l,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=(0,Wo.Z)(t).map((t=>h+i*t));return n(u?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),u()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],u()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,u()},t.bandwidth=function(){return r},t.step=function(){return i},t.round=function(t){return arguments.length?(a=!!t,u()):a},t.padding=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),s=c,u()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u()):s},t.paddingOuter=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),u()):c},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const i=o[1]<o[0],a=i?n().reverse():n(),s=a.length-1;let c,l,u,f=+t[0],d=+t[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(c=Math.max(0,(0,Gc.ml)(a,f)-1),l=f===d?c:(0,Gc.ml)(a,d)-1,f-a[c]>r+1e-10&&++c,i&&(u=c,c=s-l,l=s-u),c>l?void 0:e().slice(c,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return Ku().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(c).align(l)},u()}function Qu(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return Qu(e())},t}var tf=Array.prototype.map;const ef=Array.prototype.slice;const nf=new Map,rf=Symbol("vega_scale");function of(t){return t[rf]=!0,t}function af(t,e,n){return arguments.length>1?(nf.set(t,function(t,e,n){const i=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,i=e[0],r=e[1];return r<i&&(n=i,i=r,r=n),[t.invert(i),t.invert(r)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let i,r,o,a,s=e[0],c=e[1],l=-1;for(c<s&&(r=s,s=c,c=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=c&&(l<0&&(l=o),i=o);if(!(l<0))return s=t.invertExtent(n[l]),c=t.invertExtent(n[i]),[void 0===s[0]?s[1]:s[0],void 0===c[1]?c[0]:c[1]]}}(n):void 0),n.type=t,of(n)};return i.metadata=(0,m.Rg)((0,m.IX)(n)),i}(t,e,n)),this):sf(t)?nf.get(t):void 0}function sf(t){return nf.has(t)}function cf(t,e){const n=nf.get(t);return n&&n.metadata[e]}function lf(t){return cf(t,Gu)}function uf(t){return cf(t,$u)}function ff(t){return cf(t,Zu)}function df(t){return cf(t,Tu)}function hf(t){return cf(t,Yu)}function pf(t){return cf(t,Iu)}af("identity",(function t(e){var n;function i(t){return null==t||isNaN(t=+t)?n:t}return i.invert=i,i.domain=i.range=function(t){return arguments.length?(e=Array.from(t,Zc.Z),i):e.slice()},i.unknown=function(t){return arguments.length?(n=t,i):n},i.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Zc.Z):[0,1],(0,$c.Q)(i)})),af(Ou,$c.Z,Gu),af(Tu,Yc.Z,[Gu,Tu]),af(Nu,Vc.ZP,Gu),af(zu,Vc._b,Gu),af(Ru,(function t(){var e=nl((0,Kc.l4)());return e.copy=function(){return(0,Kc.JG)(e,t()).constant(e.constant())},Qc.o.apply(e,arguments)}),Gu),af(Pu,(function(){return Qc.o.apply(fl(al,sl,mt,vt,tt,Y,bt,_t,kt,Ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Gu,Vu]),af(Lu,(function(){return Qc.o.apply(fl(rl,ol,gt,yt,ct,V,xt,wt,kt,qe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Gu,Vu]),af(ju,gl,[Gu,Yu]),af("".concat(ju,"-").concat(Ou),gl,[Gu,Yu]),af("".concat(ju,"-").concat(Tu),(function t(){var e=(0,Yc.Q)(pl()).domain([1,10]);return e.copy=function(){return ml(e,t()).base(e.base())},Qc.O.apply(e,arguments)}),[Gu,Yu,Tu]),af("".concat(ju,"-").concat(Nu),vl,[Gu,Yu]),af("".concat(ju,"-").concat(zu),(function(){return vl.apply(null,arguments).exponent(.5)}),[Gu,Yu]),af("".concat(ju,"-").concat(Ru),(function t(){var e=nl(pl());return e.copy=function(){return ml(e,t()).constant(e.constant())},Qc.O.apply(e,arguments)}),[Gu,Yu]),af("".concat(Bu,"-").concat(Ou),(function t(){var e=(0,$c.Q)(bl()(Kc.yR));return e.copy=function(){return ml(e,t())},Qc.O.apply(e,arguments)}),[Gu,Yu]),af("".concat(Bu,"-").concat(Tu),(function t(){var e=(0,Yc.Q)(bl()).domain([.1,1,10]);return e.copy=function(){return ml(e,t()).base(e.base())},Qc.O.apply(e,arguments)}),[Gu,Yu,Tu]),af("".concat(Bu,"-").concat(Nu),xl,[Gu,Yu]),af("".concat(Bu,"-").concat(zu),(function(){return xl.apply(null,arguments).exponent(.5)}),[Gu,Yu]),af("".concat(Bu,"-").concat(Ru),(function t(){var e=nl(bl());return e.copy=function(){return ml(e,t()).constant(e.constant())},Qc.O.apply(e,arguments)}),[Gu,Yu]),af(Iu,_l.Z,[Zu,Iu]),af(Uu,wl.Z,Zu),af(qu,kl.Z,Zu),af(Ju,(function t(){let e=[],n=[];function i(t){return null==t||t!==t?void 0:n[((0,Gc.ZP)(e,t)-1)%n.length]}return i.domain=function(t){return arguments.length?(e=function(t){return tf.call(t,m.He)}(t),i):e.slice()},i.range=function(t){return arguments.length?(n=ef.call(t),i):n.slice()},i.tickFormat=function(t,n){return(0,Dl.Z)(e[0],(0,m.fj)(e),null==t?10:t,n)},i.copy=function(){return t().domain(i.domain()).range(i.range())},i}),[$u,Zu]),af(Wu,El.Z,$u),af(Xu,Ku,$u),af(Hu,(function(){return Qu(Ku().paddingInner(1))}),$u);const mf=["clamp","base","constant","exponent"];function gf(t,e){const n=e[0],i=(0,m.fj)(e)-n;return function(e){return t(n+e*i)}}function vf(t,e,n){return yl(xf(e||"rgb",n),t)}function yf(t,e){const n=new Array(e),i=e+1;for(let r=0;r<e;)n[r]=t(++r/i);return n}function bf(t,e,n){const i=n-e;let r,o,a;return i&&Number.isFinite(i)?(r=(o=t.type).indexOf("-"),o=r<0?o:o.slice(r+1),a=af(o)().domain([e,n]).range([0,1]),mf.forEach((e=>t[e]?a[e](t[e]()):0)),a):(0,m.a9)(.5)}function xf(t,e){const n=r[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function _f(t){const e=t.length/6|0,n=new Array(e);for(let i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}function wf(t,e){for(const n in t)Ef(n,e(t[n]))}const kf={};function Ef(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(kf[t]=e,this):kf[t]}wf({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},_f),wf({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(t=>vf(_f(t))));const Df="symbol",Af="discrete",Sf=t=>(0,m.kJ)(t)?t.map((t=>String(t))):String(t),Cf=(t,e)=>t[1]-e[1],Ff=(t,e)=>e[1]-t[1];function Mf(t,e,n){let i;return(0,m.hj)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor((0,m.yP)(t.domain())/n||1)))),(0,m.Kn)(e)&&(i=e.step,e=e.interval),(0,m.HD)(e)&&(e=t.type===Pu?de(e):t.type==Lu?he(e):(0,m.vU)("Only time and utc scales accept interval strings."),i&&(e=e.every(i))),e}function Of(t,e,n){let i=t.range(),r=i[0],o=(0,m.fj)(i),a=Cf;if(r>o&&(i=o,o=r,r=i,a=Ff),r=Math.floor(r),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>r<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],(0,m.fj)(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function Tf(t,e){return t.bins?Of(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Nf(t,e,n,i,r,o){const a=e.type;let s=Sf;if(a===Pu||r===Pu)s=t.timeFormat(i);else if(a===Lu||r===Lu)s=t.utcFormat(i);else if(df(a)){const r=t.formatFloat(i);if(o||e.bins)s=r;else{const t=zf(e,n,!1);s=e=>t(e)?r(e):""}}else if(e.tickFormat){const r=e.domain();s=t.formatSpan(r[0],r[r.length-1],n,i)}else i&&(s=t.format(i));return s}function zf(t,e,n){const i=Tf(t,e),r=t.base(),o=Math.log(r),a=Math.max(1,r*e/i.length),s=t=>{let e=t/Math.pow(r,Math.round(Math.log(t)/o));return e*r<r-.5&&(e*=r),e<=a};return n?i.filter(s):s}const Rf={[Iu]:"quantiles",[Uu]:"thresholds",[qu]:"domain"},Pf={[Iu]:"quantiles",[Uu]:"domain"};function Lf(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=(0,m.fj)(t),e}(t.bins):t.type===Tu?zf(t,e,!0):Rf[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[Rf[t.type]]()):Tf(t,e)}const jf=t=>Rf[t.type]||t.bins;function Bf(t,e,n,i,r,o,a){const s=Pf[e.type]&&o!==Pu&&o!==Lu?function(t,e,n){const i=e[Pf[e.type]](),r=i.length;let o,a=r>1?i[1]-i[0]:i[0];for(o=1;o<r;++o)a=Math.min(a,i[o]-i[o-1]);return t.formatSpan(0,a,30,n)}(t,e,r):Nf(t,e,n,r,o,a);return i===Df&&jf(e)?If(s):i===Af?qf(s):Wf(s)}const If=t=>(e,n,i)=>{const r=Uf(i[n+1],Uf(i.max,1/0)),o=Hf(e,t),a=Hf(r,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},Uf=(t,e)=>null!=t?t:e,qf=t=>(e,n)=>n?t(e):null,Wf=t=>e=>t(e),Hf=(t,e)=>Number.isFinite(t)?e(t):null;function Xf(t,e,n,i){const r=i||e.type;return(0,m.HD)(n)&&cf(r,Vu)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==Pu?n||r!==Lu?Bf(t,e,5,null,n,i,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Jf(t,e,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Xf(t,e,n.format,n.formatType);if(ff(e.type)){const t=Lf(e).slice(1).map(r),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(uf(e.type)){const t=e.domain(),n=t.length,o=n>i?t.slice(0,i-2).map(r).join(", ")+", ending with "+t.slice(-1).map(r):t.map(r).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(r(t[0])," to ").concat(r((0,m.fj)(t)))}}let Gf=0;const $f="p_";function Zf(t){return t&&t.gradient}function Yf(t,e,n){const i=t.gradient;let r=t.id,o="radial"===i?$f:"";return r||(r=t.id="gradient_"+Gf++,"radial"===i?(t.x1=Vf(t.x1,.5),t.y1=Vf(t.y1,.5),t.r1=Vf(t.r1,0),t.x2=Vf(t.x2,.5),t.y2=Vf(t.y2,.5),t.r2=Vf(t.r2,.5),o=$f):(t.x1=Vf(t.x1,0),t.y1=Vf(t.y1,0),t.x2=Vf(t.x2,1),t.y2=Vf(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function Vf(t,e){return null!=t?t:e}function Kf(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}}const Qf={basis:{curve:function(t){return new vs(t)}},"basis-closed":{curve:function(t){return new bs(t)}},"basis-open":{curve:function(t){return new xs(t)}},bundle:{curve:ws,tension:"beta",value:.85},cardinal:{curve:Ds,tension:"tension",value:0},"cardinal-open":{curve:Ss,tension:"tension",value:0},"cardinal-closed":{curve:Fs,tension:"tension",value:0},"catmull-rom":{curve:Hs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Js,tension:"alpha",value:.5},"catmull-rom-open":{curve:$s,tension:"alpha",value:.5},linear:{curve:Ys},"linear-closed":{curve:function(t){return new Vs(t)}},monotone:{horizontal:function(t){return new ic(t)},vertical:function(t){return new nc(t)}},natural:{curve:function(t){return new oc(t)}},step:{curve:function(t){return new sc(t,.5)}},"step-after":{curve:function(t){return new sc(t,1)}},"step-before":{curve:function(t){return new sc(t,0)}}};function td(t,e,n){var i=(0,m.nr)(Qf,t)&&Qf[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const ed={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},nd=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,id=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,rd=/^((\s+,?\s*)|(,\s*))/,od=/^[01]/;function ad(t){const e=[];return(t.match(nd)||[]).forEach((t=>{let n=t[0];const i=n.toLowerCase(),r=ed[i],o=function(t,e,n){const i=[];for(let r=0;e&&r<n.length;)for(let o=0;o<e;++o){const e="a"!==t||3!==o&&4!==o?id:od,a=n.slice(r).match(e);if(null===a)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const s=n.slice(r).match(rd);null!==s&&(r+=s[0].length)}return i}(i,r,t.slice(1).trim()),a=o.length;if(a<r||a&&a%r!==0)throw Error("Invalid SVG path, incorrect parameter count");if(e.push([n,...o.slice(0,r)]),a!==r){"m"===i&&(n="M"===n?"L":"l");for(let t=r;t<a;t+=r)e.push([n,...o.slice(t,t+r)])}})),e}const sd=Math.PI/180,cd=Math.PI/2,ld=2*Math.PI,ud=Math.sqrt(3)/2;var fd={},dd={},hd=[].join;function pd(t){const e=hd.call(t);if(dd[e])return dd[e];var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7];const u=l*a,f=-c*s,d=c*a,h=l*s,p=Math.cos(r),m=Math.sin(r),g=Math.cos(o),v=Math.sin(o),y=.5*(o-r),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),_=n+p-x*m,w=i+m+x*p,k=n+g,E=i+v,D=k+x*v,A=E-x*g;return dd[e]=[u*_+f*w,d*_+h*w,u*D+f*A,d*D+h*A,u*k+f*E,d*k+h*E]}const md=["l",0,0,0,0,0,0,0];function gd(t,e,n){const i=md[0]=t[0];if("a"===i||"A"===i)md[1]=e*t[1],md[2]=n*t[2],md[3]=t[3],md[4]=t[4],md[5]=t[5],md[6]=e*t[6],md[7]=n*t[7];else if("h"===i||"H"===i)md[1]=e*t[1];else if("v"===i||"V"===i)md[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)md[r]=(r%2==1?e:n)*t[r];return md}function vd(t,e,n,i,r,o){var a,s,c,l,u,f=null,d=0,h=0,p=0,m=0,g=0,v=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var y=0,b=e.length;y<b;++y){switch(a=e[y],1===r&&1===o||(a=gd(a,r,o)),a[0]){case"l":d+=a[1],h+=a[2],t.lineTo(d+n,h+i);break;case"L":d=a[1],h=a[2],t.lineTo(d+n,h+i);break;case"h":d+=a[1],t.lineTo(d+n,h+i);break;case"H":d=a[1],t.lineTo(d+n,h+i);break;case"v":h+=a[1],t.lineTo(d+n,h+i);break;case"V":h=a[1],t.lineTo(d+n,h+i);break;case"m":g=d+=a[1],v=h+=a[2],t.moveTo(d+n,h+i);break;case"M":g=d=a[1],v=h=a[2],t.moveTo(d+n,h+i);break;case"c":s=d+a[5],c=h+a[6],p=d+a[3],m=h+a[4],t.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,m+i,s+n,c+i),d=s,h=c;break;case"C":d=a[5],h=a[6],p=a[3],m=a[4],t.bezierCurveTo(a[1]+n,a[2]+i,p+n,m+i,d+n,h+i);break;case"s":s=d+a[3],c=h+a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+i,d+a[1]+n,h+a[2]+i,s+n,c+i),p=d+a[1],m=h+a[2],d=s,h=c;break;case"S":s=a[3],c=a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+i,a[1]+n,a[2]+i,s+n,c+i),d=s,h=c,p=a[1],m=a[2];break;case"q":s=d+a[3],c=h+a[4],p=d+a[1],m=h+a[2],t.quadraticCurveTo(p+n,m+i,s+n,c+i),d=s,h=c;break;case"Q":s=a[3],c=a[4],t.quadraticCurveTo(a[1]+n,a[2]+i,s+n,c+i),d=s,h=c,p=a[1],m=a[2];break;case"t":s=d+a[1],c=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,m=h):"t"===f[0]?(p=2*d-l,m=2*h-u):"q"===f[0]&&(p=2*d-p,m=2*h-m),l=p,u=m,t.quadraticCurveTo(p+n,m+i,s+n,c+i),h=c,p=(d=s)+a[1],m=h+a[2];break;case"T":s=a[1],c=a[2],p=2*d-p,m=2*h-m,t.quadraticCurveTo(p+n,m+i,s+n,c+i),d=s,h=c;break;case"a":yd(t,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+i]),d+=a[6],h+=a[7];break;case"A":yd(t,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+i]),d=a[6],h=a[7];break;case"z":case"Z":d=g,h=v,t.closePath()}f=a}}function yd(t,e,n,i){const r=function(t,e,n,i,r,o,a,s,c){const l=hd.call(arguments);if(fd[l])return fd[l];const u=a*sd,f=Math.sin(u),d=Math.cos(u),h=d*(s-t)*.5+f*(c-e)*.5,p=d*(c-e)*.5-f*(s-t)*.5;let m=h*h/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);const g=d/n,v=f/n,y=-f/i,b=d/i,x=g*s+v*c,_=y*s+b*c,w=g*t+v*e,k=y*t+b*e;let E=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;E<0&&(E=0);let D=Math.sqrt(E);o==r&&(D=-D);const A=.5*(x+w)-D*(k-_),S=.5*(_+k)+D*(w-x),C=Math.atan2(_-S,x-A);let F=Math.atan2(k-S,w-A)-C;F<0&&1===o?F+=ld:F>0&&0===o&&(F-=ld);const M=Math.ceil(Math.abs(F/(cd+.001))),O=[];for(let T=0;T<M;++T){const t=C+T*F/M,e=C+(T+1)*F/M;O[T]=[A,S,t,e,n,i,f,d]}return fd[l]=O}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let o=0;o<r.length;++o){const e=pd(r[o]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const bd=.5773502691896257,xd={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,ld)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n,r=i-n*bd,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n,r=i-n*bd;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=ud*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function _d(t){return(0,m.nr)(xd,t)?xd[t]:function(t){if(!(0,m.nr)(wd,t)){const e=ad(t);wd[t]={draw:function(t,n){vd(t,e,0,0,Math.sqrt(n)/2)}}}return wd[t]}(t)}var wd={};const kd=.448084975506;function Ed(t){return t.x}function Dd(t){return t.y}function Ad(t){return t.width}function Sd(t){return t.height}function Cd(t){return"function"===typeof t?t:()=>+t}function Fd(t,e,n){return Math.max(e,Math.min(t,n))}function Md(){var t=Ed,e=Dd,n=Ad,i=Sd,r=Cd(0),o=r,a=r,s=r,c=null;function l(l,u,f){var d,h=null!=u?u:+t.call(this,l),p=null!=f?f:+e.call(this,l),m=+n.call(this,l),g=+i.call(this,l),v=Math.min(m,g)/2,y=Fd(+r.call(this,l),0,v),b=Fd(+o.call(this,l),0,v),x=Fd(+a.call(this,l),0,v),_=Fd(+s.call(this,l),0,v);if(c||(c=d=Mc()),y<=0&&b<=0&&x<=0&&_<=0)c.rect(h,p,m,g);else{var w=h+m,k=p+g;c.moveTo(h+y,p),c.lineTo(w-b,p),c.bezierCurveTo(w-kd*b,p,w,p+kd*b,w,p+b),c.lineTo(w,k-_),c.bezierCurveTo(w,k-kd*_,w-kd*_,k,w-_,k),c.lineTo(h+x,k),c.bezierCurveTo(h+kd*x,k,h,k-kd*x,h,k-x),c.lineTo(h,p+y),c.bezierCurveTo(h,p+kd*y,h+kd*y,p,h+y,p),c.closePath()}if(d)return c=null,d+""||null}return l.x=function(e){return arguments.length?(t=Cd(e),l):t},l.y=function(t){return arguments.length?(e=Cd(t),l):e},l.width=function(t){return arguments.length?(n=Cd(t),l):n},l.height=function(t){return arguments.length?(i=Cd(t),l):i},l.cornerRadius=function(t,e,n,i){return arguments.length?(r=Cd(t),o=null!=e?Cd(e):r,s=null!=n?Cd(n):r,a=null!=i?Cd(i):o,l):r},l.context=function(t){return arguments.length?(c=null==t?null:t,l):c},l}function Od(){var t,e,n,i,r,o,a,s,c=null;function l(t,e,n){const i=n/2;if(r){var l=a-e,u=t-o;if(l||u){var f=Math.sqrt(l*l+u*u),d=(l/=f)*s,h=(u/=f)*s,p=Math.atan2(u,l);c.moveTo(o-d,a-h),c.lineTo(t-l*i,e-u*i),c.arc(t,e,i,p-Math.PI,p),c.lineTo(o+d,a+h),c.arc(o,a,s,p,p+Math.PI)}else c.arc(t,e,i,0,ld);c.closePath()}else r=1;o=t,a=e,s=i}function u(o){var a,s,u,f=o.length,d=!1;for(null==c&&(c=u=Mc()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&l(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(u)return c=null,u+""||null}return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(t){return arguments.length?(e=t,u):e},u.size=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(i=t,u):i},u.context=function(t){return arguments.length?(c=null==t?null:t,u):c},u}function Td(t,e){return null!=t?t:e}const Nd=t=>t.x||0,zd=t=>t.y||0,Rd=t=>!(!1===t.defined),Pd=function(){var t=Tc,e=Nc,n=cc(0),i=null,r=zc,o=Rc,a=Pc,s=null,c=Oc(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=r.apply(this,arguments)-Bs,p=o.apply(this,arguments)-Bs,m=Ms(p-h),g=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>Ls)if(m>Is-Ls)s.moveTo(d*Ts(h),d*Rs(h)),s.arc(0,0,d,h,p,!g),f>Ls&&(s.moveTo(f*Ts(p),f*Rs(p)),s.arc(0,0,f,p,h,g));else{var v,y,b=h,x=p,_=h,w=p,k=m,E=m,D=a.apply(this,arguments)/2,A=D>Ls&&(i?+i.apply(this,arguments):Ps(f*f+d*d)),S=zs(Ms(d-f)/2,+n.apply(this,arguments)),C=S,F=S;if(A>Ls){var M=Us(A/f*Rs(D)),O=Us(A/d*Rs(D));(k-=2*M)>Ls?(_+=M*=g?1:-1,w-=M):(k=0,_=w=(h+p)/2),(E-=2*O)>Ls?(b+=O*=g?1:-1,x-=O):(E=0,b=x=(h+p)/2)}var T=d*Ts(b),N=d*Rs(b),z=f*Ts(w),R=f*Rs(w);if(S>Ls){var P,L=d*Ts(x),j=d*Rs(x),B=f*Ts(_),I=f*Rs(_);if(m<js)if(P=function(t,e,n,i,r,o,a,s){var c=n-t,l=i-e,u=a-r,f=s-o,d=f*c-u*l;if(!(d*d<Ls))return[t+(d=(u*(e-o)-f*(t-r))/d)*c,e+d*l]}(T,N,B,I,L,j,z,R)){var U=T-P[0],q=N-P[1],W=L-P[0],H=j-P[1],X=1/Rs(function(t){return t>1?0:t<-1?js:Math.acos(t)}((U*W+q*H)/(Ps(U*U+q*q)*Ps(W*W+H*H)))/2),J=Ps(P[0]*P[0]+P[1]*P[1]);C=zs(S,(f-J)/(X-1)),F=zs(S,(d-J)/(X+1))}else C=F=0}E>Ls?F>Ls?(v=Lc(B,I,T,N,d,F,g),y=Lc(L,j,z,R,d,F,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),F<S?s.arc(v.cx,v.cy,F,Os(v.y01,v.x01),Os(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,F,Os(v.y01,v.x01),Os(v.y11,v.x11),!g),s.arc(0,0,d,Os(v.cy+v.y11,v.cx+v.x11),Os(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,F,Os(y.y11,y.x11),Os(y.y01,y.x01),!g))):(s.moveTo(T,N),s.arc(0,0,d,b,x,!g)):s.moveTo(T,N),f>Ls&&k>Ls?C>Ls?(v=Lc(z,R,L,j,f,-C,g),y=Lc(T,N,B,I,f,-C,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),C<S?s.arc(v.cx,v.cy,C,Os(v.y01,v.x01),Os(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,C,Os(v.y01,v.x01),Os(v.y11,v.x11),!g),s.arc(0,0,f,Os(v.cy+v.y11,v.cx+v.x11),Os(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,C,Os(y.y11,y.x11),Os(y.y01,y.x01),!g))):s.arc(0,0,f,w,_,g):s.lineTo(z,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-js/2;return[Ts(i)*n,Rs(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:cc(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:cc(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:cc(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"===typeof t?t:cc(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"===typeof t?t:cc(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:cc(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:cc(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().startAngle((t=>t.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),Ld=qc().x(Nd).y1(zd).y0((t=>(t.y||0)+(t.height||0))).defined(Rd),jd=qc().y(zd).x1(Nd).x0((t=>(t.x||0)+(t.width||0))).defined(Rd),Bd=Uc().x(Nd).y(zd).defined(Rd),Id=Md().x(Nd).y(zd).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>Td(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>Td(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>Td(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>Td(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),Ud=function(t,e){let n=null,i=Oc(r);function r(){let r;if(n||(n=r=i()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"===typeof t?t:cc(t||Wc),e="function"===typeof e?e:cc(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"===typeof e?e:cc(e),r):t},r.size=function(t){return arguments.length?(e="function"===typeof t?t:cc(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>_d(t.shape||"circle"))).size((t=>Td(t.size,64))),qd=Od().x(Nd).y(zd).defined(Rd).size((t=>t.size||1));function Wd(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Hd(t,e,n,i){return Id.context(t)(e,n,i)}var Xd=1;function Jd(){Xd=1}function Gd(t,e,n){var i=e.clip,r=t._defs,o=e.clip_id||(e.clip_id="clip"+Xd++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,m.mf)(i)?a.path=i(null):Wd(n)?a.path=Hd(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function $d(t){this.clear(),t&&this.union(t)}function Zd(t){this.mark=t,this.bounds=this.bounds||new $d}function Yd(t){Zd.call(this,t),this.items=this.items||[]}function Vd(t){this._pending=0,this._loader=t||Yi()}function Kd(t){t._pending+=1}function Qd(t){t._pending-=1}function th(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}$d.prototype={clone(){return new $d(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(t,e,n){var{x1:i,y1:r,x2:o,y2:a}=this,s=Math.cos(t),c=Math.sin(t),l=e-e*s+n*c,u=n-e*c-n*s;return[s*i-c*r+l,c*i+s*r+u,s*i-c*a+l,c*i+s*a+u,s*o-c*r+l,c*o+s*r+u,s*o-c*a+l,c*o+s*a+u]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,m.XW)(Yd,Zd),Vd.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return Kd(e),e._loader.sanitize(t,{context:"href"}).then((t=>(Qd(e),t))).catch((()=>(Qd(e),null)))},loadImage(t){const e=this,n=Jc();return Kd(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const i=t.href;if(!i||!n)throw{url:i};const r=new n,o=(0,m.nr)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>Qd(e),r.onerror=()=>Qd(e),r.src=i,r})).catch((t=>(Qd(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(i){t.pending()?setTimeout((()=>{n(!0)}),10):e(i)}(!1)}))}};const eh=ld-1e-8;let nh,ih,rh,oh,ah,sh,ch,lh;const uh=(t,e)=>nh.add(t,e),fh=(t,e)=>uh(ih=t,rh=e),dh=t=>uh(t,nh.y1),hh=t=>uh(nh.x1,t),ph=(t,e)=>ah*t+ch*e,mh=(t,e)=>sh*t+lh*e,gh=(t,e)=>uh(ph(t,e),mh(t,e)),vh=(t,e)=>fh(ph(t,e),mh(t,e));function yh(t,e){return nh=t,e?(oh=e*sd,ah=lh=Math.cos(oh),sh=Math.sin(oh),ch=-sh):(ah=lh=1,oh=sh=ch=0),bh}const bh={beginPath(){},closePath(){},moveTo:vh,lineTo:vh,rect(t,e,n,i){oh?(gh(t+n,e),gh(t+n,e+i),gh(t,e+i),vh(t,e)):(uh(t+n,e+i),fh(t,e))},quadraticCurveTo(t,e,n,i){const r=ph(t,e),o=mh(t,e),a=ph(n,i),s=mh(n,i);xh(ih,r,a,dh),xh(rh,o,s,hh),fh(a,s)},bezierCurveTo(t,e,n,i,r,o){const a=ph(t,e),s=mh(t,e),c=ph(n,i),l=mh(n,i),u=ph(r,o),f=mh(r,o);_h(ih,a,c,u,dh),_h(rh,s,l,f,hh),fh(u,f)},arc(t,e,n,i,r,o){if(i+=oh,r+=oh,ih=n*Math.cos(r)+t,rh=n*Math.sin(r)+e,Math.abs(r-i)>eh)uh(t-n,e-n),uh(t+n,e+n);else{const a=i=>uh(n*Math.cos(i)+t,n*Math.sin(i)+e);let s,c;if(a(i),a(r),r!==i)if((i%=ld)<0&&(i+=ld),(r%=ld)<0&&(r+=ld),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=ld,s=i-i%cd,c=0;c<4&&s>r;++c,s-=cd)a(s);else for(s=i-i%cd+cd,c=0;c<4&&s<r;++c,s+=cd)a(s)}}};function xh(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function _h(t,e,n,i,r){const o=i-t+3*e-3*n,a=t+n-2*e,s=t-e;let c,l=0,u=0;Math.abs(o)>1e-14?(c=a*a+s*o,c>=0&&(c=Math.sqrt(c),l=(-a+c)/o,u=(-a-c)/o)):l=.5*s/a,0<l&&l<1&&r(wh(l,t,e,n,i)),0<u&&u<1&&r(wh(u,t,e,n,i))}function wh(t,e,n,i,r){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*i+s*t*r}var kh=(kh=Xc(1,1))?kh.getContext("2d"):null;const Eh=new $d;function Dh(t){return function(e,n){if(!kh)return!0;t(kh,e),Eh.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=Eh;for(let t=r;t<=a;++t)for(let e=i;e<=o;++e)if(kh.isPointInPath(e,t))return!0;return!1}}function Ah(t,e){return e.contains(t.x||0,t.y||0)}function Sh(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(Eh.set(n,i,n+r,i+o))}function Ch(t,e){const n=t.x||0,i=t.y||0;return Fh(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Fh(t,e,n,i,r){const{x1:o,y1:a,x2:s,y2:c}=t,l=i-e,u=r-n;let f,d,h,p,m=0,g=1;for(p=0;p<4;++p){if(0===p&&(f=-l,d=-(o-e)),1===p&&(f=l,d=s-e),2===p&&(f=-u,d=-(a-n)),3===p&&(f=u,d=c-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>g)return!1;h>m&&(m=h)}else if(f>0){if(h<m)return!1;h<g&&(g=h)}}return!0}function Mh(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Oh(t,e){return null==t?e:t}function Th(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Nh(t,e,n){return Zf(n)?function(t,e,n){const i=n.width(),r=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+Oh(e.x1,.5)*i,n.y1+Oh(e.y1,.5)*r,Math.max(i,r)*Oh(e.r1,0),n.x1+Oh(e.x2,.5)*i,n.y1+Oh(e.y2,.5)*r,Math.max(i,r)*Oh(e.r2,.5));else{const a=Oh(e.x1,0),s=Oh(e.y1,0),c=Oh(e.x2,1),l=Oh(e.y2,0);if(a!==c&&s!==l&&i!==r){const n=Xc(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=Th(o.createLinearGradient(a,s,c,l),e.stops),o.fillRect(0,0,i,r),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*i,n.y1+s*r,n.x1+c*i,n.y1+l*r)}return Th(o,e.stops)}(t,n,e.bounds):n}function zh(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Nh(t,e,e.fill),!0)}var Rh=[];function Ph(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Nh(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Rh),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Lh(t,e){return t.zindex-e.zindex||t.index-e.index}function jh(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Lh)}function Bh(t,e){var n,i,r=t.items;if(!r||!r.length)return;const o=jh(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}function Ih(t,e){var n,i,r=t.items;if(!r||!r.length)return null;const o=jh(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Uh(t){return function(e,n,i){Bh(n,(n=>{i&&!i.intersects(n.bounds)||Wh(t,e,n,n)}))}}function qh(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Wh(t,e,n.items[0],n.items)}}function Wh(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Mh(e,n),n.fill&&zh(e,n,r)&&e.fill(),n.stroke&&Ph(e,n,r)&&e.stroke()))}function Hh(t){return t=t||m.yb,function(e,n,i,r,o,a){return i*=e.pixelRatio,r*=e.pixelRatio,Ih(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,i,r,o,a)?n:void 0}))}}function Xh(t,e){return function(n,i,r,o){var a,s,c=Array.isArray(i)?i[0]:i,l=null==e?c.fill:e,u=c.stroke&&n.isPointInStroke;return u&&(a=c.strokeWidth,s=c.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,i)&&(l&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o))}}function Jh(t){return Hh(Xh(t))}function Gh(t,e){return"translate("+t+","+e+")"}function $h(t){return"rotate("+t+")"}function Zh(t){return Gh(t.x||0,t.y||0)}function Yh(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=sd),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return Gh(t.x||0,t.y||0)+(t.angle?" "+$h(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(yh(t,n.angle),n),th(t,n).translate(n.x||0,n.y||0)},draw:Uh(i),pick:Jh(i),isect:n||Dh(i)}}var Vh=Yh("arc",(function(t,e){return Pd.context(t)(e)}));function Kh(t,e,n){function i(t,n){t.beginPath(),e(t,n)}const r=Xh(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(yh(t),i),th(t,i[0]))},draw:qh(i),pick:function(t,e,n,i,o,a){var s=e.items,c=e.bounds;return!s||!s.length||c&&!c.contains(o,a)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,s,n,i)?s[0]:null)},isect:Ah,tip:n}}var Qh=Kh("area",(function(t,e){const n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?jd:Ld).curve(td(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(i=Math.abs(t[a][o]-r))<s&&(s=i,n=t[a]);return n}));function tp(t,e){t.beginPath(),Wd(e)?Hd(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function ep(t){const e=Oh(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function np(t,e){const n=ep(e);t("d",Hd(null,e,n,n))}function ip(t,e,n,i){const r=ep(e);t.beginPath(),Hd(t,e,(n||0)+r,(i||0)+r)}const rp=Xh(ip),op=Xh(ip,!1),ap=Xh(ip,!0);var sp={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Zh(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e<i;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),th(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){Bh(e,(e=>{const i=e.x||0,r=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(ip(t,e,i,r),Mh(t,e),e.fill&&zh(t,e,a)&&t.fill(),e.stroke&&!o&&Ph(t,e,a)&&t.stroke()),t.save(),t.translate(i,r),e.clip&&tp(t,e),n&&n.translate(-i,-r),Bh(e,(e=>{this.draw(t,e,n)})),n&&n.translate(i,r),t.restore(),o&&e.stroke&&a&&(ip(t,e,i,r),Mh(t,e),Ph(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;const a=n*t.pixelRatio,s=i*t.pixelRatio;return Ih(e,(c=>{let l,u,f;const d=c.bounds;if(d&&!d.contains(r,o))return;u=c.x||0,f=c.y||0;const h=u+(c.width||0),p=f+(c.height||0),m=c.clip;if(m&&(r<u||r>h||o<f||o>p))return;if(t.save(),t.translate(u,f),u=r-u,f=o-f,m&&Wd(c)&&!ap(t,c,a,s))return t.restore(),null;const g=c.strokeForeground,v=!1!==e.interactive;return v&&g&&c.stroke&&op(t,c,a,s)?(t.restore(),c):(l=Ih(c,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,u,f)?this.pick(t,n,i,u,f):null)),!l&&v&&(c.fill||!g&&c.stroke)&&rp(t,c,a,s)&&(l=c),t.restore(),l||null)}))},isect:Sh,content:function(t,e,n){t("clip-path",e.clip?Gd(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),np(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?np(t,e):t("d","")}},cp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function lp(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function up(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function fp(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function dp(t,e){return"center"===t?e/2:"right"===t?e:0}function hp(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var pp={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=lp(e,n),r=up(e,i),o=fp(e,i),a=(e.x||0)-dp(e.align,r),s=(e.y||0)-hp(e.baseline,o);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",cp["xmlns:xlink"],"xlink:href"),t("transform",Gh(a,s)),t("width",r),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=up(e,n),r=fp(e,n),o=(e.x||0)-dp(e.align,i),a=(e.y||0)-hp(e.baseline,r);return t.set(o,a,o+i,a+r)},draw:function(t,e,n){Bh(e,(e=>{if(n&&!n.intersects(e.bounds))return;const i=lp(e,this);let r=up(e,i),o=fp(e,i);if(0===r||0===o)return;let a,s,c,l,u=(e.x||0)-dp(e.align,r),f=(e.y||0)-hp(e.baseline,o);!1!==e.aspect&&(s=i.width/i.height,c=e.width/e.height,s===s&&c===c&&s!==c&&(c<s?(l=r/s,f+=(o-l)/2,o=l):(l=o*s,u+=(r-l)/2,r=l))),(i.complete||i.toDataURL)&&(Mh(t,e),t.globalAlpha=null!=(a=e.opacity)?a:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(i,u,f,r,o))}))},pick:Hh(),isect:m.yb,get:lp,xOffset:dp,yOffset:hp},mp=Kh("line",(function(t,e){const n=e[0],i=n.interpolate||"linear";return Bd.curve(td(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function gp(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*sd,c=e.pathCache;c&&c.path===n||((e.pathCache=c=ad(n)).path=n),s&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(s),vd(t,c,0,0,o,a),t.rotate(-s),t.translate(-i,-r)):vd(t,c,i,r,o,a)}var vp={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return Gh(t.x||0,t.y||0)+(t.angle?" "+$h(t.angle):"")+(t.scaleX||t.scaleY?" "+function(t,e){return"scale("+t+","+e+")"}(t.scaleX||1,t.scaleY||1):"")}(e)),t("d",e.path)},bound:function(t,e){return gp(yh(t,e.angle),e)?t.set(0,0,0,0):th(t,e,!0)},draw:Uh(gp),pick:Jh(gp),isect:Dh(gp)};function yp(t,e){t.beginPath(),Hd(t,e)}var bp={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Hd(null,e))},bound:function(t,e){var n,i;return th(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Uh(yp),pick:Jh(yp),isect:Sh};function xp(t,e,n){var i,r,o,a;return!(!e.stroke||!Ph(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,a=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,a),!0)}var _p={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Zh(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return th(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){Bh(e,(e=>{if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&xp(t,e,i)&&(Mh(t,e),t.stroke())}}))},pick:Hh((function(t,e,n,i){return!!t.isPointInStroke&&(xp(t,e,1)&&t.isPointInStroke(n,i))})),isect:Ch},wp=Yh("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),kp=Yh("symbol",(function(t,e){return Ud.context(t)(e)}),Ah);const Ep=(0,m.$m)();var Dp={height:Op,measureWidth:Fp,estimateWidth:Sp,width:Sp,canvas:Ap};function Ap(t){Dp.width=t&&kh?Fp:Sp}function Sp(t,e){return Cp(Rp(t,e),Op(t))}function Cp(t,e){return~~(.8*t.length*e)}function Fp(t,e){return Op(t)<=0||!(e=Rp(t,e))?0:Mp(e,Lp(t))}function Mp(t,e){const n="(".concat(e,") ").concat(t);let i=Ep.get(n);return void 0===i&&(kh.font=e,i=kh.measureText(t).width,Ep.set(n,i)),i}function Op(t){return null!=t.fontSize?+t.fontSize||0:11}function Tp(t){return null!=t.lineHeight?t.lineHeight:Op(t)+2}function Np(t){return e=t.lineBreak&&t.text&&!(0,m.kJ)(t.text)?t.text.split(t.lineBreak):t.text,(0,m.kJ)(e)?e.length>1?e:e[0]:e;var e}function zp(t){const e=Np(t);return((0,m.kJ)(e)?e.length-1:0)*Tp(t)}function Rp(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Dp.width===Fp){const e=Lp(t);return t=>Mp(t,e)}{const e=Op(t);return t=>Cp(t,e)}}(t);if(i(e)<n)return e;var r,o=t.ellipsis||"\u2026",a="rtl"===t.dir,s=0,c=e.length;if(n-=i(o),a){for(;s<c;)r=s+c>>>1,i(e.slice(r))>n?s=r+1:c=r;return o+e.slice(s)}for(;s<c;)r=1+(s+c>>>1),i(e.slice(0,r))<n?s=r:c=r-1;return e.slice(0,s)+o}(t,n):n}function Pp(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Lp(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Op(t)+"px "+Pp(t,e)}function jp(t){var e=t.baseline,n=Op(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Tp(t):"line-bottom"===e?.29*n-.5*Tp(t):0)}Ap(!0);const Bp={left:"start",center:"middle",right:"end"},Ip=new $d;function Up(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-cd,n+=r*Math.cos(e),i+=r*Math.sin(e)),Ip.x1=n,Ip.y1=i,Ip}function qp(t,e,n){var i,r=Dp.height(e),o=e.align,a=Up(e),s=a.x1,c=a.y1,l=e.dx||0,u=(e.dy||0)+jp(e)-Math.round(.8*r),f=Np(e);if((0,m.kJ)(f)?(r+=Tp(e)*(f.length-1),i=f.reduce(((t,n)=>Math.max(t,Dp.width(e,n))),0)):i=Dp.width(e,f),"center"===o?l-=i/2:"right"===o&&(l-=i),t.set(l+=s,u+=c,l+i,u+r),e.angle&&!n)t.rotate(e.angle*sd,s,c);else if(2===n)return t.rotatedPoints(e.angle*sd,s,c);return t}var Wp={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+jp(e),o=Up(e),a=o.x1,s=o.y1,c=e.angle||0;t("text-anchor",Bp[e.align]||"start"),c?(n=Gh(a,s)+" "+$h(c),(i||r)&&(n+=" "+Gh(i,r))):n=Gh(a+i,s+r),t("transform",n)},bound:qp,draw:function(t,e,n){Bh(e,(e=>{var i,r,o,a,s,c,l,u=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===u||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Lp(e),t.textAlign=e.align||"left",r=(i=Up(e)).x1,o=i.y1,e.angle&&(t.save(),t.translate(r,o),t.rotate(e.angle*sd),r=o=0),r+=e.dx||0,o+=(e.dy||0)+jp(e),c=Np(e),Mh(t,e),(0,m.kJ)(c))for(s=Tp(e),a=0;a<c.length;++a)l=Rp(e,c[a]),e.fill&&zh(t,e,u)&&t.fillText(l,r,o),e.stroke&&Ph(t,e,u)&&t.strokeText(l,r,o),o+=s;else l=Rp(e,c),e.fill&&zh(t,e,u)&&t.fillText(l,r,o),e.stroke&&Ph(t,e,u)&&t.strokeText(l,r,o);e.angle&&t.restore()}}))},pick:Hh((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=Up(e),s=a.x1,c=a.y1,l=qp(Ip,e,1),u=-e.angle*sd,f=Math.cos(u),d=Math.sin(u),h=f*r-d*o+(s-f*s+d*c),p=d*r+f*o+(c-d*s-f*c);return l.contains(h,p)})),isect:function(t,e){const n=qp(Ip,t,2);return Fh(e,n[0],n[1],n[2],n[3])||Fh(e,n[0],n[1],n[4],n[5])||Fh(e,n[4],n[5],n[6],n[7])||Fh(e,n[2],n[3],n[6],n[7])}},Hp=Kh("trail",(function(t,e){return qd.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null})),Xp={arc:Vh,area:Qh,group:sp,image:pp,line:mp,path:vp,rect:bp,rule:_p,shape:wp,symbol:kp,text:Wp,trail:Hp};function Jp(t,e,n){var i=Xp[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new $d),t,n)}var Gp={mark:null};function $p(t,e,n){var i,r,o,a,s=Xp[t.marktype],c=s.bound,l=t.items,u=l&&l.length;if(s.nested)return u?o=l[0]:(Gp.mark=t,o=Gp),a=Jp(o,c,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new $d,u)for(i=0,r=l.length;i<r;++i)e.union(Jp(l[i],c,n));return t.bounds=e}const Zp=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Yp(t,e){return JSON.stringify(t,Zp,e)}function Vp(t){return Kp("string"===typeof t?JSON.parse(t):t)}function Kp(t){var e,n,i,r=t.marktype,o=t.items;if(o)for(n=0,i=o.length;n<i;++n)e=r?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(r||e)&&Kp(o[n]);return r&&$p(t),t}function Qp(t){arguments.length?this.root=Vp(t):(this.root=tm({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Yd(this.root)])}function tm(t,e){const n={bounds:new $d,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function em(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function nm(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function im(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=em(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function rm(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function om(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function am(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function sm(t,e){this._active=null,this._handlers={},this._loader=t||Yi(),this._tooltip=e||cm}function cm(t,e,n,i){t.element().setAttribute("title",i||"")}function lm(t){this._el=null,this._bgcolor=null,this._loader=new Vd(t)}Qp.prototype={toJSON(t){return Yp(this.root,t||0)},mark(t,e,n){const i=tm(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},sm.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const i in e)n.push(...e[i]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),i=em(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,a=t&&t.mark;if(a&&(r=Xp[a.marktype]).tip){for((o=am(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.width(),a=r.height();let s=r.x1+i[0]+n.left,c=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,c+=t.y||0;return{x:s,y:c,width:o,height:a,left:s,top:c,right:s+o,bottom:c+a}}},lm.prototype={initialize(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const um="dragenter",fm="dragleave",dm="dragover",hm="mousedown",pm="mousemove",mm="mouseout",gm="mouseover",vm="click",ym="mousewheel",bm="touchstart",xm="touchmove",_m="touchend",wm=["keydown","keypress","keyup",um,fm,dm,hm,"mouseup",pm,mm,gm,vm,"dblclick","wheel",ym,bm,xm,_m],km=pm,Em=mm,Dm=vm;function Am(t,e){sm.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Sm(t,e){(t=>t===bm||t===xm||t===_m?[bm,xm,_m]:[t])(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function Cm(t,e,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function Fm(t){return function(e){this.fire(t,e),this._active=null}}(0,m.XW)(Am,sm,{initialize(t,e,n){return this._canvas=t&&nm(t,"canvas"),[vm,hm,pm,mm,fm].forEach((t=>Sm(this,t))),sm.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:wm,DOMMouseScroll(t){this.fire(ym,t)},mousemove:Cm(pm,gm,mm),dragover:Cm(dm,um,fm),mouseout:Fm(mm),dragleave:Fm(fm),mousedown(t){this._down=this._active,this.fire(hm,t)},click(t){this._down===this._active&&(this.fire(vm,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(bm,t,!0)},touchmove(t){this.fire(xm,t,!0)},touchend(t){this.fire(_m,t,!0),this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===Dm&&i&&i.href?this.handleHref(e,i,i.href):t!==km&&t!==Em||this.handleTooltip(e,i,t!==Em),r)for(let o=0,a=r.length;o<a;++o)r[o].handler.call(this._obj,e,i)},on(t,e){const n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(Sm(this,t),(i[n]||(i[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},pickEvent(t){const e=am(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const o=this.context();return Xp[t.marktype].pick.call(this,o,t,e,n,i,r)}});var Mm="undefined"!==typeof window&&window.devicePixelRatio||1;function Om(t){lm.call(this,t),this._options={},this._redraw=!1,this._dirty=new $d,this._tempb=new $d}const Tm=lm.prototype;function Nm(t,e){sm.call(this,t,e);const n=this;n._hrefHandler=zm(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=zm(n,((t,e)=>{n.handleTooltip(t,e,t.type!==Em)}))}(0,m.XW)(Om,lm,{initialize(t,e,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Xc(1,1,this._options.type),t&&this._canvas&&(rm(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Tm.initialize.call(this,t,e,n,i,r)},resize(t,e,n,i){if(Tm.resize.call(this,t,e,n,i),this._canvas)!function(t,e,n,i,r,o){const a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),c=a?Mm:r;t.width=e*c,t.height=n*c;for(const l in o)s[l]=o[l];a&&1!==c&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=c,s.setTransform(c,0,0,c,c*i[0],c*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||(0,m.vU)("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty,a=((t,e,n)=>(new $d).set(0,0,e,n).translate(-t[0],-t[1]))(n,i,r);e.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],i,r),this.draw(e,t,s),e.restore(),o.clear(),this},draw(t,e,n){const i=Xp[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),(0,m.mf)(n)?(t.beginPath(),n(t),t.clip()):tp(t,e.group)}(t,e),i.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(t,e,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,i))}});const zm=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};(0,m.XW)(Nm,sm,{initialize(t,e,n){let i=this._svg;return i&&(i.removeEventListener(Dm,this._hrefHandler),i.removeEventListener(km,this._tooltipHandler),i.removeEventListener(Em,this._tooltipHandler)),this._svg=i=t&&nm(t,"svg"),i&&(i.addEventListener(Dm,this._hrefHandler),i.addEventListener(km,this._tooltipHandler),i.addEventListener(Em,this._tooltipHandler)),sm.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:zm(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const Rm="aria-hidden",Pm="aria-label",Lm="role",jm="aria-roledescription",Bm="graphics-object",Im="graphics-symbol",Um=(t,e,n)=>({[Lm]:t,[jm]:e,[Pm]:n||void 0}),qm=(0,m.Rg)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Wm={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?$m(t):null,r=t.context,o=r.scales[e.scale].value,a=r.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(i?" titled '".concat(i,"'"):"")+" for a ".concat(uf(s)?"discrete":s," scale")+" with ".concat(Jf(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?$m(t):null,i="".concat(e.type||""," legend").trim(),r=e.scales,o=Object.keys(r),a=t.context,s=a.scales[r[o[0]]].value,c=a.dataflow.locale();return function(t){return t.length?t[0].toUpperCase()+t.slice(1):t}(i)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return t=t.map((t=>t+("fill"===t||"stroke"===t?" color":""))),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+(0,m.fj)(t)}(o))+" with ".concat(Jf(c,s,t))}},"title-text":{desc:"title",caption:t=>"Title text '".concat(Gm(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(Gm(t),"'")}},Hm={ariaRole:Lm,ariaRoleDescription:jm,description:Pm};function Xm(t,e){const n=!1===e.aria;if(t(Rm,n||void 0),n||null==e.description)for(const i in Hm)t(Hm[i],void 0);else{const n=e.mark.marktype;t(Pm,e.description),t(Lm,e.ariaRole||("group"===n?Bm:Im)),t(jm,e.ariaRoleDescription||"".concat(n," mark"))}}function Jm(t){return!1===t.aria?{[Rm]:!0}:qm[t.role]?null:Wm[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return Um(e.role||Im,e.desc,n.description||i(n))}catch(n){return null}}(t,Wm[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return Um(n?Bm:Im,"".concat(e," mark container"),t.description)}(t)}function Gm(t){return(0,m.IX)(t.text).join(" ")}function $m(t){try{return(0,m.IX)((0,m.fj)(t.items).items[0].text).join(" ")}catch(e){return null}}const Zm=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Ym=t=>Zm(t).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function Vm(){let t="",e="",n="";const i=[],r=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(Ym(n),'"')),a),a={open(s){(o=>{e&&(t+="".concat(e,">").concat(n),r()),i.push(o)})(s),e="<"+s;for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];for(const t of l)for(const e in t)o(e,t[e]);return a},close(){const o=i.pop();return t+=e?e+(n?">".concat(n,"</").concat(o,">"):"/>"):"</".concat(o,">"),r(),a},attr:o,text:t=>(n+=Zm(t),a),toString:()=>t};return a}const Km=t=>Qm(Vm(),t)+"";function Qm(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,i=n.length;for(let e=0;e<i;++e)t.attr(n[e].name,n[e].value)}if(e.hasChildNodes()){const n=e.childNodes;for(const e of n)3===e.nodeType?t.text(e.nodeValue):Qm(t,e)}return t.close()}const tg={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},eg={blend:"mix-blend-mode"},ng={fill:"none","stroke-miterlimit":10},ig="http://www.w3.org/2000/xmlns/",rg=cp.xmlns;function og(t){lm.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const ag=lm.prototype;function sg(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function cg(t,e,n){let i,r,o;if("radial"===e.gradient){let i=im(t,n++,"pattern",rg);gg(i,{id:$f+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=im(i,0,"rect",rg),gg(i,{width:1,height:1,fill:"url(".concat(yg(),"#").concat(e.id,")")}),gg(t=im(t,n++,"radialGradient",rg),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else gg(t=im(t,n++,"linearGradient",rg),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,r=e.stops.length;i<r;++i)o=im(t,i,"stop",rg),o.setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return rm(t,i),n}function lg(t,e,n){let i;return(t=im(t,n,"clipPath",rg)).setAttribute("id",e.id),e.path?(i=im(t,0,"path",rg),i.setAttribute("d",e.path)):(i=im(t,0,"rect",rg),gg(i,{x:0,y:0,width:e.width,height:e.height})),rm(t,1),n+1}function ug(t,e,n,i,r){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=em(o,i,rg),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===i))){const e=em(o,"path",rg);a.appendChild(e),e.__data__=t;const n=em(o,"g",rg);a.appendChild(n),n.__data__=t;const i=em(o,"path",rg);a.appendChild(i),i.__data__=t,i.__values__={fill:"default"}}return(a.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}(0,m.XW)(og,lm,{initialize(t,e,n,i,r){return this._defs={},this._clearDefs(),t&&(this._svg=im(t,0,"svg",rg),this._svg.setAttributeNS(ig,"xmlns",rg),this._svg.setAttributeNS(ig,"xmlns:xlink",cp["xmlns:xlink"]),this._svg.setAttribute("version",cp.version),this._svg.setAttribute("class","marks"),rm(t,1),this._root=im(this._svg,0,"g",rg),gg(this._root,ng),rm(this._svg,1)),this.background(this._bgcolor),ag.initialize.call(this,t,e,n,i,r)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ag.background.apply(this,arguments)},resize(t,e,n,i){return ag.resize.call(this,t,e,n,i),this._svg&&(gg(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=im(t,0,"rect",rg),gg(n,{width:this._width,height:this._height,fill:e}));const i=Km(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),i},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),rm(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,i,r,o,a,s,c;for(a=0,s=t.length;a<s;++a)n=t[a],i=n.mark,i.marktype!==r&&(r=i.marktype,o=Xp[r]),i.zdirty&&i.dirty!==e&&(this._dirtyAll=!1,sg(n,e),i.items.forEach((t=>{t.dirty=e}))),i.zdirty||(n.exit?(o.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(o,c._svg,c)):n._svg&&(c=n._svg.parentNode,c&&c.removeChild(n._svg)),n._svg=null):(n=o.nested?i.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,sg(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const i=this._svg,r=Xp[e.marktype],o=!1===e.interactive?"none":null,a="g"===r.tag,s=ug(e,t,n,"g",i);s.setAttribute("class",om(e));const c=Jm(e);for(const d in c)vg(s,d,c[d]);a||vg(s,"pointer-events",o),vg(s,"clip-path",e.clip?Gd(this,e,e.group):null);let l=null,u=0;const f=t=>{const e=this.isDirty(t),n=ug(t,s,l,r.tag,i);e&&(this._update(r,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let i,r=0;Bh(n,(n=>{i=t.mark(e,n,i),++r})),rm(e,1+r)}(this,n,t)),l=n,++u};return r.nested?e.items.length&&f(e.items[0]):Bh(e,f),rm(s,u),s},_update(t,e,n){fg=e,dg=e.__values__,Xm(pg,n),t.attr(pg,n,this);const i=hg[t.type];i&&i.call(this,t,e,n),fg&&this.style(fg,n)},style(t,e){if(null!=e){for(const n in tg){let i="font"===n?Pp(e):e[n];if(i===dg[n])continue;const r=tg[n];null==i?t.removeAttribute(r):(Zf(i)&&(i=Yf(i,this._defs.gradient,yg())),t.setAttribute(r,i+"")),dg[n]=i}for(const n in eg)mg(t,eg[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=im(t,1,"defs",rg)),i=cg(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=im(t,1,"defs",rg)),i=lg(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):rm(n,i))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let fg=null,dg=null;const hg={group(t,e,n){const i=fg=e.childNodes[2];dg=i.__values__,t.foreground(pg,n,this),dg=e.__values__,fg=e.childNodes[1],t.content(pg,n,this);const r=fg=e.childNodes[0];t.background(pg,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==dg.events&&(vg(i,"pointer-events",o),vg(r,"pointer-events",o),dg.events=o),n.strokeForeground&&n.stroke){const t=n.fill;vg(i,"display",null),this.style(r,n),vg(r,"stroke",null),t&&(n.fill=null),dg=i.__values__,this.style(i,n),t&&(n.fill=t),fg=null}else vg(i,"display","none")},image(t,e,n){!1===n.smooth?(mg(e,"image-rendering","optimizeSpeed"),mg(e,"image-rendering","pixelated")):mg(e,"image-rendering",null)},text(t,e,n){const i=Np(n);let r,o,a,s;(0,m.kJ)(i)?(o=i.map((t=>Rp(n,t))),r=o.join("\n"),r!==dg.text&&(rm(e,0),a=e.ownerDocument,s=Tp(n),o.forEach(((t,i)=>{const r=em(a,"tspan",rg);r.__data__=n,r.textContent=t,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),e.appendChild(r)})),dg.text=r)):(o=Rp(n,i),o!==dg.text&&(e.textContent=o,dg.text=o)),vg(e,"font-family",Pp(n)),vg(e,"font-size",Op(n)+"px"),vg(e,"font-style",n.fontStyle),vg(e,"font-variant",n.fontVariant),vg(e,"font-weight",n.fontWeight)}};function pg(t,e,n){e!==dg[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(fg,t,e,n):vg(fg,t,e),dg[t]=e)}function mg(t,e,n){n!==dg[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),dg[e]=n)}function gg(t,e){for(const n in e)vg(t,n,e[n])}function vg(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function yg(){let t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function bg(t){lm.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}(0,m.XW)(bg,lm,{svg(){return this._text},_render(t){const e=Vm();e.open("svg",(0,m.l7)({},cp,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",ng,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Xp[e.marktype],i=n.tag,r=[Xm,n.attr];t.open("g",{class:om(e),"clip-path":e.clip?Gd(this,e,e.group):null},Jm(e),{"pointer-events":"g"!==i&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(i,this.attr(e,o,r,"g"!==i?i:null)),"text"===i){const e=Np(o);if((0,m.kJ)(e)){const n={x:0,dy:Tp(o)};for(let i=0;i<e.length;++i)t.open("tspan",i?n:null).text(Rp(o,e[i])).close()}else t.text(Rp(o,e))}else if("g"===i){const i=o.strokeForeground,r=o.fill,a=o.stroke;i&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),Bh(o,(e=>this.mark(t,e))),t.close(),i&&a?(r&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),r&&(o.fill=r)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):Bh(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,i){const r={},o=(t,e,n,i)=>{r[i||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),i&&function(t,e,n,i,r){let o;if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(t["font-family"]=Pp(e),t["font-size"]=Op(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const a in tg){let n=e[a];const i=tg[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&(Zf(n)&&(n=Yf(n,r.gradient,"")),t[i]=n)}for(const a in eg){const t=e[a];null!=t&&(o=o||[],o.push("".concat(eg[a],": ").concat(t,";")))}o&&(t.style=o.join(" "))}(r,e,t,i,this._defs),r},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const i=e[n],r=i.stops;"radial"===i.gradient?(t.open("pattern",{id:$f+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e<r.length;++e)t.open("stop",{offset:r[e].offset,"stop-color":r[e].color}).close();t.close()}for(const e in n){const i=n[e];t.open("clipPath",{id:e}),i.path?t.open("path",{d:i.path}).close():t.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),t.close()}t.close()}}});const xg="canvas",_g="none",wg={Canvas:xg,PNG:"png",SVG:"svg",None:_g},kg={};function Eg(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(kg[t]=e,this):kg[t]}function Dg(t,e,n){const i=[],r=(new $d).union(e),o=t.marktype;return o?Ag(t,r,n,i):"group"===o?Sg(t,r,n,i):(0,m.vU)("Intersect scene must be mark node or group item.")}function Ag(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,a=r.length;let s=0;if("group"===o)for(;s<a;++s)Sg(r[s],e,n,i);else for(const t=Xp[o].isect;s<a;++s){const n=r[s];Cg(n,e,t)&&i.push(n)}}return i}function Sg(t,e,n,i){n&&n(t.mark)&&Cg(t,e,Xp.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)Ag(r[t],e,n,i);e.translate(a,s)}return i}function Cg(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}kg[xg]=kg.png={renderer:Om,headless:Om,handler:Am},kg.svg={renderer:og,headless:bg,handler:Nm},kg[_g]={};const Fg=new $d;function Mg(t){const e=t.clip;if((0,m.mf)(e))e(yh(Fg.clear()));else{if(!e)return;Fg.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Fg)}const Og=1e-9;function Tg(t,e,n){return t===e||("path"===n?Ng(t,e):t instanceof Date&&e instanceof Date?+t===+e:(0,m.hj)(t)&&(0,m.hj)(e)?Math.abs(t-e)<=Og:t&&e&&((0,m.Kn)(t)||(0,m.Kn)(e))?function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(!Tg(t[n=r[i]],e[n],n))return!1;return typeof t===typeof e}(t,e):t==e)}function Ng(t,e){return Tg(ad(t),ad(e))}function zg(){Jd(),Gf=0}const Rg="top",Pg="left",Lg="right",jg="bottom",Bg="top-left",Ig="top-right",Ug="bottom-left",qg="bottom-right",Wg="start",Hg="middle",Xg="end",Jg="x",Gg="y",$g="group",Zg="axis",Yg="title",Vg="frame",Kg="scope",Qg="legend",tv="row-header",ev="row-footer",nv="row-title",iv="column-header",rv="column-footer",ov="column-title",av="padding",sv="symbol",cv="fit",lv="fit-x",uv="fit-y",fv="pad",dv="none",hv="all",pv="each",mv="flush",gv="column",vv="row";function yv(t){Rr.call(this,null,t)}function bv(t,e,n){return e(t.bounds.clear(),t,n)}(0,m.XW)(yv,Rr,{transform(t,e){const n=e.dataflow,i=t.mark,r=i.marktype,o=Xp[r],a=o.bound;let s,c=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),c=bv(i,a),i.items.forEach((t=>{t.bounds.clear().union(c)}));else if(r===$g||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),c.clear(),i.items.forEach((t=>c.union(bv(t,a)))),i.role){case Zg:case Qg:case Yg:e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,(t=>{c.union(bv(t,a))})),e.visit(e.MOD,(t=>{s=s||c.alignsWith(t.bounds),n.dirty(t),c.union(bv(t,a))})),s&&(c.clear(),i.items.forEach((t=>c.union(t.bounds))));return Mg(i),e.modifies("bounds")}});const xv=":vega_identifier:";function _v(t){Rr.call(this,0,t)}function wv(t){Rr.call(this,null,t)}function kv(t){Rr.call(this,null,t)}_v.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,m.XW)(_v,Rr,{transform(t,e){const n=(r=e.dataflow)._signals[xv]||(r._signals[xv]=r.add(0)),i=t.as;var r;let o=n.value;return e.visit(e.ADD,(t=>t[i]=t[i]||++o)),n.set(this.value=o),e}}),(0,m.XW)(wv,Rr,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const i=n.marktype===$g?Yd:Zd;return e.visit(e.ADD,(t=>i.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const Ev={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,i)=>i&&Dv(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},Dv=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),Av=(t,e)=>{for(var n,i=1,r=t.length,o=t[0].bounds;i<r;o=n,++i)if(Dv(o,n=t[i].bounds,e))return!0},Sv=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},Cv=t=>(t.forEach((t=>t.opacity=1)),t),Fv=(t,e)=>t.reflow(e.modified()).modifies("opacity");function Mv(t){Rr.call(this,null,t)}(0,m.XW)(kv,Rr,{transform(t,e){const n=Ev[t.method]||Ev.parity,i=t.separation||0;let r,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(Cv(a),e=Fv(e,t)),e;if(a=a.filter(Sv),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),r=Cv(a),e=Fv(e,t),r.length>=3&&Av(r,i)){do{r=n(r,i)}while(r.length>=3&&Av(r,i));r.length<3&&!(0,m.fj)(a).opacity&&(r.length>1&&((0,m.fj)(r).opacity=0),(0,m.fj)(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var i=t.range(),r=new $d;return e===Rg||e===jg?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),t=>r.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const s=r[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&s.union(t.bounds)})),e}}),(0,m.XW)(Mv,Rr,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const Ov=new $d;function Tv(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Nv(t){var e=t.items[0].orient;return e===Pg||e===Lg}function zv(t,e,n,i){var r,o,a=e.items[0],s=a.datum,c=null!=a.translate?a.translate:.5,l=a.orient,u=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=s.title&&a.items[u[2]].items[0],v=a.titlePadding,y=a.bounds,b=g&&zp(g),x=0,_=0;switch(Ov.clear().union(y),y.clear(),(r=u[0])>-1&&y.union(a.items[r].bounds),(r=u[1])>-1&&y.union(a.items[r].bounds),l){case Rg:x=h||0,_=-d,o=Math.max(p,Math.min(m,-y.y1)),y.add(0,-o).add(f,0),g&&Rv(t,g,o,v,b,0,-1,y);break;case Pg:x=-d,_=h||0,o=Math.max(p,Math.min(m,-y.x1)),y.add(-o,0).add(0,f),g&&Rv(t,g,o,v,b,1,-1,y);break;case Lg:x=n+d,_=h||0,o=Math.max(p,Math.min(m,y.x2)),y.add(0,0).add(o,f),g&&Rv(t,g,o,v,b,1,1,y);break;case jg:x=h||0,_=i+d,o=Math.max(p,Math.min(m,y.y2)),y.add(0,0).add(f,o),g&&Rv(t,g,o,v,0,0,1,y);break;default:x=a.x,_=a.y}return th(y.translate(x,_),a),Tv(a,"x",x+c)|Tv(a,"y",_+c)&&(a.bounds=Ov,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function Rv(t,e,n,i,r,o,a,s){const c=e.bounds;if(e.auto){const s=a*(n+r+i);let l=0,u=0;t.dirty(e),o?l=(e.x||0)-(e.x=s):u=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(c.translate(-l,-u)),t.dirty(e)}s.union(c)}const Pv=(t,e)=>Math.floor(Math.min(t,e)),Lv=(t,e)=>Math.ceil(Math.max(t,e));function jv(t){return(new $d).set(0,0,t.width||0,t.height||0)}function Bv(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function Iv(t,e,n){const i=(0,m.Kn)(t)?t[e]:t;return null!=i?i:void 0!==n?n:0}function Uv(t){return t<0?Math.ceil(-t):0}function qv(t,e,n){var i,r,o,a,s,c,l,u,f,d,h,p=!n.nodirty,m=n.bounds===mv?jv:Bv,g=Ov.set(0,0,0,0),v=Iv(n.align,gv),y=Iv(n.align,vv),b=Iv(n.padding,gv),x=Iv(n.padding,vv),_=n.columns||e.length,w=_<=0?1:Math.ceil(e.length/_),k=e.length,E=Array(k),D=Array(_),A=0,S=Array(k),C=Array(w),F=0,M=Array(k),O=Array(k),T=Array(k);for(r=0;r<_;++r)D[r]=0;for(r=0;r<w;++r)C[r]=0;for(r=0;r<k;++r)c=e[r],s=T[r]=m(c),c.x=c.x||0,M[r]=0,c.y=c.y||0,O[r]=0,o=r%_,a=~~(r/_),A=Math.max(A,l=Math.ceil(s.x2)),F=Math.max(F,u=Math.ceil(s.y2)),D[o]=Math.max(D[o],l),C[a]=Math.max(C[a],u),E[r]=b+Uv(s.x1),S[r]=x+Uv(s.y1),p&&t.dirty(e[r]);for(r=0;r<k;++r)r%_===0&&(E[r]=0),r<_&&(S[r]=0);if(v===pv)for(o=1;o<_;++o){for(h=0,r=o;r<k;r+=_)h<E[r]&&(h=E[r]);for(r=o;r<k;r+=_)E[r]=h+D[o-1]}else if(v===hv){for(h=0,r=0;r<k;++r)r%_&&h<E[r]&&(h=E[r]);for(r=0;r<k;++r)r%_&&(E[r]=h+A)}else for(v=!1,o=1;o<_;++o)for(r=o;r<k;r+=_)E[r]+=D[o-1];if(y===pv)for(a=1;a<w;++a){for(h=0,i=(r=a*_)+_;r<i;++r)h<S[r]&&(h=S[r]);for(r=a*_;r<i;++r)S[r]=h+C[a-1]}else if(y===hv){for(h=0,r=_;r<k;++r)h<S[r]&&(h=S[r]);for(r=_;r<k;++r)S[r]=h+F}else for(y=!1,a=1;a<w;++a)for(i=(r=a*_)+_;r<i;++r)S[r]+=C[a-1];for(f=0,r=0;r<k;++r)f=E[r]+(r%_?f:0),M[r]+=f-e[r].x;for(o=0;o<_;++o)for(d=0,r=o;r<k;r+=_)d+=S[r],O[r]+=d-e[r].y;if(v&&Iv(n.center,gv)&&w>1)for(r=0;r<k;++r)(f=(s=v===hv?A:D[r%_])-T[r].x2-e[r].x-M[r])>0&&(M[r]+=f/2);if(y&&Iv(n.center,vv)&&1!==_)for(r=0;r<k;++r)(d=(s=y===hv?F:C[~~(r/_)])-T[r].y2-e[r].y-O[r])>0&&(O[r]+=d/2);for(r=0;r<k;++r)g.union(T[r].translate(M[r],O[r]));switch(f=Iv(n.anchor,Jg),d=Iv(n.anchor,Gg),Iv(n.anchor,gv)){case Xg:f-=g.width();break;case Hg:f-=g.width()/2}switch(Iv(n.anchor,vv)){case Xg:d-=g.height();break;case Hg:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),r=0;r<k;++r)e[r].mark.bounds.clear();for(r=0;r<k;++r)(c=e[r]).x+=M[r]+=f,c.y+=O[r]+=d,g.union(c.mark.bounds.union(c.bounds.translate(M[r],O[r]))),p&&t.dirty(c);return g}function Wv(t,e,n){var i,r,o,a,s,c,l,u=function(t){var e,n,i=t.items,r=i.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<r;++o)if(n=(e=i[o]).items,e.marktype===$g)switch(e.role){case Zg:case Qg:case Yg:break;case tv:a.rowheaders.push(...n);break;case ev:a.rowfooters.push(...n);break;case iv:a.colheaders.push(...n);break;case rv:a.colfooters.push(...n);break;case nv:a.rowtitle=n[0];break;case ov:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=u.marks,d=n.bounds===mv?Hv:Xv,h=n.offset,p=n.columns||f.length,m=p<=0?1:Math.ceil(f.length/p),g=m*p;const v=qv(t,f,n);v.empty()&&v.set(0,0,0,0),u.rowheaders&&(c=Iv(n.headerBand,vv,null),i=Jv(t,u.rowheaders,f,p,m,-Iv(h,"rowHeader"),Pv,0,d,"x1",0,p,1,c)),u.colheaders&&(c=Iv(n.headerBand,gv,null),r=Jv(t,u.colheaders,f,p,p,-Iv(h,"columnHeader"),Pv,1,d,"y1",0,1,p,c)),u.rowfooters&&(c=Iv(n.footerBand,vv,null),o=Jv(t,u.rowfooters,f,p,m,Iv(h,"rowFooter"),Lv,0,d,"x2",p-1,p,1,c)),u.colfooters&&(c=Iv(n.footerBand,gv,null),a=Jv(t,u.colfooters,f,p,p,Iv(h,"columnFooter"),Lv,1,d,"y2",g-p,1,p,c)),u.rowtitle&&(s=Iv(n.titleAnchor,vv),l=Iv(h,"rowTitle"),l=s===Xg?o+l:i-l,c=Iv(n.titleBand,vv,.5),Gv(t,u.rowtitle,l,0,v,c)),u.coltitle&&(s=Iv(n.titleAnchor,gv),l=Iv(h,"columnTitle"),l=s===Xg?a+l:r-l,c=Iv(n.titleBand,gv,.5),Gv(t,u.coltitle,l,1,v,c))}function Hv(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function Xv(t,e){return t.bounds[e]}function Jv(t,e,n,i,r,o,a,s,c,l,u,f,d,h){var p,m,g,v,y,b,x,_,w,k=n.length,E=0,D=0;if(!k)return E;for(p=u;p<k;p+=f)n[p]&&(E=a(E,c(n[p],l)));if(!e.length)return E;for(e.length>r&&(t.warn("Grid headers exceed limit: "+r),e=e.slice(0,r)),E+=o,m=0,v=e.length;m<v;++m)t.dirty(e[m]),e[m].mark.bounds.clear();for(p=u,m=0,v=e.length;m<v;++m,p+=f){for(y=(b=e[m]).mark.bounds,g=p;g>=0&&null==(x=n[g]);g-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=E):(_=E,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,t.dirty(b),D=a(D,y[l])}return D}function Gv(t,e,n,i,r,o){if(e){t.dirty(e);var a=n,s=n;i?a=Math.round(r.x1+o*r.width()):s=Math.round(r.y1+o*r.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function $v(t,e,n,i,r,o,a){const s=function(t,e){const n=t[e]||{};return(e,i)=>null!=n[e]?n[e]:null!=t[e]?t[e]:i}(n,e),c=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,s("offset",0)),l=s("anchor",Wg),u=l===Xg?1:l===Hg?.5:0,f={align:pv,bounds:s("bounds",mv),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case Pg:f.anchor={x:Math.floor(i.x1)-c,column:Xg,y:u*(a||i.height()+2*i.y1),row:l};break;case Lg:f.anchor={x:Math.ceil(i.x2)+c,y:u*(a||i.height()+2*i.y1),row:l};break;case Rg:f.anchor={y:Math.floor(r.y1)-c,row:Xg,x:u*(o||r.width()+2*r.x1),column:l};break;case jg:f.anchor={y:Math.ceil(r.y2)+c,x:u*(o||r.width()+2*r.x1),column:l};break;case Bg:f.anchor={x:c,y:c};break;case Ig:f.anchor={x:o-c,y:c,column:Xg};break;case Ug:f.anchor={x:c,y:a-c,row:Xg};break;case qg:f.anchor={x:o-c,y:a-c,column:Xg,row:Xg}}return f}function Zv(t,e){var n,i,r=e.items[0],o=r.datum,a=r.orient,s=r.bounds,c=r.x,l=r.y;return r._bounds?r._bounds.clear().union(s):r._bounds=s.clone(),s.clear(),function(t,e,n){var i=e.padding,r=i-n.x,o=i-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,c=e.titlePadding||0,l=i-a.x,u=i-a.y;switch(a.orient){case Pg:r+=Math.ceil(a.bounds.width())+c;break;case Lg:case jg:break;default:o+=a.bounds.height()+c}switch((r||o)&&Vv(t,n,r,o),a.orient){case Pg:u+=Yv(e,n,a,s,1,1);break;case Lg:l+=Yv(e,n,a,Xg,0,0)+c,u+=Yv(e,n,a,s,1,1);break;case jg:l+=Yv(e,n,a,s,0,0),u+=Yv(e,n,a,Xg,-1,0,1)+c;break;default:l+=Yv(e,n,a,s,0,0)}(l||u)&&Vv(t,a,l,u),(l=Math.round(a.bounds.x1-i))<0&&(Vv(t,n,-l,0),Vv(t,a,-l,0))}else(r||o)&&Vv(t,n,r,o)}(t,r,r.items[0].items[0]),s=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(r,s),n=2*r.padding,i=2*r.padding,s.empty()||(n=Math.ceil(s.width()+n),i=Math.ceil(s.height()+i)),o.type===sv&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(r.items[0].items[0].items[0].items),a!==dv&&(r.x=c=0,r.y=l=0),r.width=n,r.height=i,th(s.set(c,l,c+n,l+i),r),r.mark.bounds.clear().union(s),r}function Yv(t,e,n,i,r,o,a){const s="symbol"!==t.datum.type,c=n.datum.vgrad,l=(!s||!o&&c||a?e:e.items[0]).bounds[r?"y2":"x2"]-t.padding,u=c&&o?l:0,f=c&&o?0:l,d=r<=0?0:zp(n);return Math.round(i===Wg?u:i===Xg?f-d:.5*(l-d))}function Vv(t,e,n,i){e.x+=n,e.y+=i,e.bounds.translate(n,i),e.mark.bounds.translate(n,i),t.dirty(e)}function Kv(t){Rr.call(this,null,t)}function Qv(t,e){let n=0;if(void 0===e)for(let i of t)(i=+i)&&(n+=i);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function ty(t){Rr.call(this,null,t)}function ey(t){Rr.call(this,null,t)}function ny(){return rr({})}function iy(t){Rr.call(this,null,t)}function ry(t){Rr.call(this,[],t)}(0,m.XW)(Kv,Rr,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&Wv(n,e,t.layout),function(t,e,n){var i,r,o,a,s,c=e.items,l=Math.max(0,e.width||0),u=Math.max(0,e.height||0),f=(new $d).set(0,0,l,u),d=f.clone(),h=f.clone(),p=[];for(a=0,s=c.length;a<s;++a)switch((r=c[a]).role){case Zg:(Nv(r)?d:h).union(zv(t,r,l,u));break;case Yg:i=r;break;case Qg:p.push(Zv(t,r));break;case Vg:case Kg:case tv:case ev:case nv:case iv:case rv:case ov:d.union(r.bounds),h.union(r.bounds);break;default:f.union(r.bounds)}if(p.length){const e={};p.forEach((t=>{(o=t.orient||Lg)!==dv&&(e[o]||(e[o]=[])).push(t)}));for(const i in e){const r=e[i];qv(t,r,$v(r,i,n.legends,d,h,l,u))}p.forEach((e=>{const i=e.bounds;if(i.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=i,t.dirty(e)),!n.autosize||n.autosize.type!==cv&&n.autosize.type!==lv&&n.autosize.type!==uv)f.union(i);else switch(e.orient){case Pg:case Lg:f.add(i.x1,0).add(i.x2,0);break;case Rg:case jg:f.add(0,i.y1).add(0,i.y2)}}))}f.union(d).union(h),i&&f.union(function(t,e,n,i,r){var o,a=e.items[0],s=a.frame,c=a.orient,l=a.anchor,u=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=c===Pg||c===Lg?i:n,m=0,g=0,v=0,y=0,b=0;if(s!==$g?c===Pg?(m=r.y2,p=r.y1):c===Lg?(m=r.y1,p=r.y2):(m=r.x1,p=r.x2):c===Pg&&(m=i,p=0),o=l===Wg?m:l===Xg?p:(m+p)/2,h&&h.text){switch(c){case Rg:case jg:b=d.bounds.height()+f;break;case Pg:y=d.bounds.width()+f;break;case Lg:y=-d.bounds.width()-f}Ov.clear().union(h.bounds),Ov.translate(y-(h.x||0),b-(h.y||0)),Tv(h,"x",y)|Tv(h,"y",b)&&(t.dirty(h),h.bounds.clear().union(Ov),h.mark.bounds.clear().union(Ov),t.dirty(h)),Ov.clear().union(h.bounds)}else Ov.clear();switch(Ov.union(d.bounds),c){case Rg:g=o,v=r.y1-Ov.height()-u;break;case Pg:g=r.x1-Ov.width()-u,v=o;break;case Lg:g=r.x2+Ov.width()+u,v=o;break;case jg:g=o,v=r.y2+u;break;default:g=a.x,v=a.y}return Tv(a,"x",g)|Tv(a,"y",v)&&(Ov.translate(g,v),t.dirty(a),a.bounds.clear().union(Ov),e.bounds.clear().union(Ov),t.dirty(a)),a.bounds}(t,i,l,u,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,i){const r=i.autosize||{},o=r.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,c=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-c)),h=Math.max(0,Math.ceil(n.y2-u));if(r.contains===av){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}o===dv?(l=0,f=0,c=a,u=s):o===cv?(c=Math.max(0,a-l-d),u=Math.max(0,s-f-h)):o===lv?(c=Math.max(0,a-l-d),s=u+f+h):o===uv?(a=c+l+d,u=Math.max(0,s-f-h)):o===fv&&(a=c+l+d,s=u+f+h);t._resizeView(a,s,c,u,[l,f],r.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}}),(0,m.XW)(ty,Rr,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,o=t.scale,a=Mf(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||Nf(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?Of(o,t.values,a):Tf(o,a);return r&&(i.rem=r),r=c.map(((t,e)=>rr({index:e/(c.length-1||1),value:t,label:s(t)}))),t.extra&&r.length&&r.push(rr({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}}),(0,m.XW)(ey,Rr,{transform(t,e){var n=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.item||ny,o=t.key||nr,a=this.value;return(0,m.kJ)(i.encode)&&(i.encode=null),a&&(t.modified("key")||e.modified(o))&&(0,m.vU)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=(0,m.Xr)().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,i.add.push(n)):i.mod.push(n):(n=r(t),a.set(e,n),i.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,i.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&i.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}}),(0,m.XW)(iy,Rr,{transform(t,e){var n=e.fork(e.ADD_REM),i=t.mod||!1,r=t.encoders,o=e.encode;if((0,m.kJ)(o)){if(!n.changed()&&!o.every((t=>r[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=r.update||m.k,c=r.enter||m.k,l=r.exit||m.k,u=(o&&!a?r[o]:s)||m.k;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{c(e,t),s(e,t)})),n.modifies(c.output),n.modifies(s.output),u!==m.k&&u!==s&&(e.visit(e.ADD,(e=>{u(e,t)})),n.modifies(u.output))),e.changed(e.REM)&&l!==m.k&&(e.visit(e.REM,(e=>{l(e,t)})),n.modifies(l.output)),a||u!==m.k){const r=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(r,(e=>{const r=c(e,t)||i;(u(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(c.output)):e.visit(r,(e=>{(u(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}}),(0,m.XW)(ry,Rr,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,i,r,o,a,s=e.dataflow.locale(),c=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,u=t.type||Df,f=t.scale,d=+t.limit,h=Mf(f,null==t.count?5:t.count,t.minstep),p=!!t.values||u===Df,g=t.format||Bf(s,f,h,u,t.formatSpecifier,t.formatType,p),v=t.values||Lf(f,h);return l&&(c.rem=l),u===Df?(d&&v.length>d?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=v.slice(0,d-1),a=!0):l=v,(0,m.mf)(r=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((e,n)=>Math.max(e,r(n,t))),0)):r=(0,m.a9)(o=r||8),l=l.map(((e,n)=>rr({index:n,label:g(e,n,l),value:e,offset:o,size:r(e,t)}))),a&&(a=v[l.length],l.push(rr({index:l.length,label:"\u2026".concat(v.length-l.length," entries"),value:a,offset:o,size:r(a,t)})))):"gradient"===u?(n=f.domain(),i=bf(f,n[0],(0,m.fj)(n)),v.length<3&&!t.values&&n[0]!==(0,m.fj)(n)&&(v=[n[0],(0,m.fj)(n)]),l=v.map(((t,e)=>rr({index:e,label:g(t,e,v),value:t,perc:i(t)})))):(r=v.length-1,i=function(t){const e=t.domain(),n=e.length-1;let i=+e[0],r=+(0,m.fj)(e),o=r-i;if(t.type===qu){const t=n?o/n:.1;i-=t,r+=t,o=r-i}return t=>(t-i)/o}(f),l=v.map(((t,e)=>rr({index:e,label:g(t,e,v),value:t,perc:e?i(t):0,perc2:e===r?1:i(v[e+1])})))),c.source=l,c.add=l,this.value=l,c}});const oy=t=>t.source.x,ay=t=>t.source.y,sy=t=>t.target.x,cy=t=>t.target.y;function ly(t){Rr.call(this,{},t)}ly.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},(0,m.XW)(ly,Rr,{transform(t,e){var n=t.sourceX||oy,i=t.sourceY||ay,r=t.targetX||sy,o=t.targetY||cy,a=t.as||"path",s=t.orient||"vertical",c=t.shape||"line",l=hy.get(c+"-"+s)||hy.get(c);return l||(0,m.vU)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=l(n(t),i(t),r(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const uy=(t,e,n,i)=>"M"+t+","+e+"L"+n+","+i,fy=(t,e,n,i)=>{var r=n-t,o=i-e,a=Math.hypot(r,o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,r)/Math.PI+" 0 1 "+n+","+i},dy=(t,e,n,i)=>{const r=n-t,o=i-e,a=.2*(r+o),s=.2*(o-r);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(i-a)+" "+n+","+i},hy=(0,m.Xr)({line:uy,"line-radial":(t,e,n,i)=>uy(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),arc:fy,"arc-radial":(t,e,n,i)=>fy(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),curve:dy,"curve-radial":(t,e,n,i)=>dy(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(t,e,n,i)=>"M"+t+","+e+"V"+i+"H"+n,"orthogonal-vertical":(t,e,n,i)=>"M"+t+","+e+"H"+n+"V"+i,"orthogonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*r+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+i*a+","+i*s},"diagonal-horizontal":(t,e,n,i)=>{const r=(t+n)/2;return"M"+t+","+e+"C"+r+","+e+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(t,e,n,i)=>{const r=(e+i)/2;return"M"+t+","+e+"C"+t+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),c=(e+i)/2;return"M"+e*r+","+e*o+"C"+c*r+","+c*o+" "+c*a+","+c*s+" "+i*a+","+i*s}});function py(t){Rr.call(this,null,t)}py.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},(0,m.XW)(py,Rr,{transform(t,e){var n,i,r,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],c=t.field||m.kX,l=t.startAngle||0,u=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(c),h=d.length,p=l,g=(u-l)/Qv(d),v=(0,Wo.Z)(h);for(t.sort&&v.sort(((t,e)=>d[t]-d[e])),n=0;n<h;++n)r=d[v[n]],(i=f[v[n]])[a]=p,i[s]=p+=r*g;return this.value=d,e.reflow(t.modified()).modifies(o)}});const my=5;function gy(t){return lf(t)&&t!==ju}const vy=(0,m.Rg)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function yy(t){Rr.call(this,null,t),this.modified(!0)}function by(t,e,n){if(df(t)){var i=Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0));i!==e.length&&n.warn("Log scale domain includes zero: "+(0,m.m8)(e))}return e}function xy(t,e,n){return(0,m.mf)(t)&&(e||n)?gf(t,_y(e||[0,1],n)):t}function _y(t,e){return e?t.slice().reverse():t}function wy(t){Rr.call(this,null,t)}(0,m.XW)(yy,Rr,{transform(t,e){var n=e.dataflow,i=this.value,r=function(t){var e,n=t.type,i="";if(n===ju)return ju+"-"+Ou;(function(t){const e=t.type;return lf(e)&&e!==Pu&&e!==Lu&&(t.scheme||t.range&&t.range.length&&t.range.every(m.HD))})(t)&&(i=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?ju+"-":3===e?Bu+"-":"");return(i+n||Ou).toLowerCase()}(t);for(r in i&&r===i.type||(this.value=i=af(r)()),t)if(!vy[r]){if("padding"===r&&gy(i.type))continue;(0,m.mf)(i[r])?i[r](t[r]):n.warn("Unsupported scale property: "+r)}return function(t,e,n){var i=t.type,r=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==Xu&&t!==Hu&&(0,m.vU)("Only band and point scales support rangeStep.");var i=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,r=t===Hu?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Mu(n,r,i)]}(i,e,n);else if(e.scheme&&(o=function(t,e,n){var i,r=e.schemeExtent;(0,m.kJ)(e.scheme)?i=vf(e.scheme,e.interpolate,e.interpolateGamma):(i=Ef(e.scheme.toLowerCase()))||(0,m.vU)("Unrecognized scheme name: ".concat(e.scheme));return n=t===qu?n+1:t===Ju?n-1:t===Iu||t===Uu?+e.schemeCount||my:n,hf(t)?xy(i,r,e.reverse):(0,m.mf)(i)?yf(xy(i,r),n):t===Wu?i:i.slice(0,n)}(i,e,n),(0,m.mf)(o))){if(t.interpolator)return t.interpolator(o);(0,m.vU)("Scale type ".concat(i," does not support interpolating color schemes."))}if(o&&hf(i))return t.interpolator(vf(_y(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(xf(e.interpolate,e.interpolateGamma)):(0,m.mf)(t.round)?t.round(r):(0,m.mf)(t.rangeRound)&&t.interpolate(r?hl.Z:dl.Z);o&&t.range(_y(o,e.reverse))}(i,t,function(t,e,n){let i=e.bins;if(i&&!(0,m.kJ)(i)){const e=t.domain(),n=e[0],r=(0,m.fj)(e),o=i.step;let a=null==i.start?n:i.start,s=null==i.stop?r:i.stop;o||(0,m.vU)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>r&&(s=o*Math.floor(r/o)),i=(0,Wo.Z)(a,s+o/2,o)}i?t.bins=i:t.bins&&delete t.bins;t.type===Ju&&(i?e.domain||e.domainRaw||(t.domain(i),n=i.length):t.bins=t.domain());return n}(i,t,function(t,e,n){const i=function(t,e,n){return e?(t.domain(by(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(i>-1)return i;var r,o,a=e.domain,s=t.type,c=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===Ou||e===Nu||e===zu)}(t);if(!a)return 0;gy(s)&&e.padding&&a[0]!==(0,m.fj)(a)&&(a=function(t,e,n,i,r,o){var a=Math.abs((0,m.fj)(n)-n[0]),s=a/(a-2*i),c=t===Tu?(0,m.dH)(e,null,s):t===zu?(0,m.mK)(e,null,s,.5):t===Nu?(0,m.mK)(e,null,s,r||1):t===Ru?(0,m.bV)(e,null,s,o||1):(0,m.ay)(e,null,s);return e=e.slice(),e[0]=c[0],e[e.length-1]=c[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((c||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(r=(a=a.slice()).length-1||1,c&&(a[0]>0&&(a[0]=0),a[r]<0&&(a[r]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[r]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[r]?r+1:o<a[0]?0:r;t!==r&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(by(s,a,n)),s===Wu&&t.unknown(e.domainImplicit?El.O:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Mf(t,e.nice)||null);return a.length}(i,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),(0,m.XW)(wy,Rr,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(cr(t.sort)),this.modified(n),e}});const ky="zero",Ey="center",Dy="normalize",Ay=["y0","y1"];function Sy(t){Rr.call(this,null,t)}function Cy(t,e,n,i,r){for(var o,a=(e-t.sum)/2,s=t.length,c=0;c<s;++c)(o=t[c])[i]=a,o[r]=a+=Math.abs(n(o))}function Fy(t,e,n,i,r){for(var o,a=1/t.sum,s=0,c=t.length,l=0,u=0;l<c;++l)(o=t[l])[i]=s,o[r]=s=a*(u+=Math.abs(n(o)))}function My(t,e,n,i,r){for(var o,a,s=0,c=0,l=t.length,u=0;u<l;++u)(o=+n(a=t[u]))<0?(a[i]=c,a[r]=c+=o):(a[i]=s,a[r]=s+=o)}Sy.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:ky,values:[ky,Ey,Dy]},{name:"as",type:"string",array:!0,length:2,default:Ay}]},(0,m.XW)(Sy,Rr,{transform(t,e){var n,i,r,o,a=t.as||Ay,s=a[0],c=a[1],l=cr(t.sort),u=t.field||m.kX,f=t.offset===Ey?Cy:t.offset===Dy?Fy:My;for(n=function(t,e,n,i){var r,o,a,s,c,l,u,f,d,h=[],p=t=>t(c);if(null==e)h.push(t.slice());else for(r={},o=0,a=t.length;o<a;++o)c=t[o],(u=r[l=e.map(p)])||(r[l]=u=[],h.push(u)),u.push(c);for(l=0,d=0,s=h.length;l<s;++l){for(o=0,f=0,a=(u=h[l]).length;o<a;++o)f+=Math.abs(i(u[o]));u.sum=f,f>d&&(d=f),n&&u.sort(n)}return h.max=d,h}(e.source,t.groupby,l,u),i=0,r=n.length,o=n.max;i<r;++i)f(n[i],o,u,s,c);return e.reflow(t.modified()).modifies(a)}});const Oy=t=>t;function Ty(t,e){t&&zy.hasOwnProperty(t.type)&&zy[t.type](t,e)}var Ny={Feature:function(t,e){Ty(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ty(n[i].geometry,e)}},zy={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ry(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Ry(n[i],e,0)},Polygon:function(t,e){Py(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Py(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ty(n[i],e)}};function Ry(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Py(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Ry(t[n],e,1);e.polygonEnd()}function Ly(t,e){t&&Ny.hasOwnProperty(t.type)?Ny[t.type](t,e):Ty(t,e)}class jy{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],o=t+r,a=Math.abs(t)<Math.abs(r)?t-(o-r):r-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,o=0;if(r>0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}var By=1e-6,Iy=1e-12,Uy=Math.PI,qy=Uy/2,Wy=Uy/4,Hy=2*Uy,Xy=180/Uy,Jy=Uy/180,Gy=Math.abs,$y=Math.atan,Zy=Math.atan2,Yy=Math.cos,Vy=Math.ceil,Ky=Math.exp,Qy=(Math.floor,Math.hypot),tb=Math.log,eb=Math.pow,nb=Math.sin,ib=Math.sign||function(t){return t>0?1:t<0?-1:0},rb=Math.sqrt,ob=Math.tan;function ab(t){return t>1?0:t<-1?Uy:Math.acos(t)}function sb(t){return t>1?qy:t<-1?-qy:Math.asin(t)}function cb(){}var lb,ub,fb,db,hb=new jy,pb=new jy,mb={point:cb,lineStart:cb,lineEnd:cb,polygonStart:function(){mb.lineStart=gb,mb.lineEnd=bb},polygonEnd:function(){mb.lineStart=mb.lineEnd=mb.point=cb,hb.add(Gy(pb)),pb=new jy},result:function(){var t=hb/2;return hb=new jy,t}};function gb(){mb.point=vb}function vb(t,e){mb.point=yb,lb=fb=t,ub=db=e}function yb(t,e){pb.add(db*t-fb*e),fb=t,db=e}function bb(){yb(lb,ub)}const xb=mb;var _b=1/0,wb=_b,kb=-_b,Eb=kb,Db={point:function(t,e){t<_b&&(_b=t);t>kb&&(kb=t);e<wb&&(wb=e);e>Eb&&(Eb=e)},lineStart:cb,lineEnd:cb,polygonStart:cb,polygonEnd:cb,result:function(){var t=[[_b,wb],[kb,Eb]];return kb=Eb=-(wb=_b=1/0),t}};const Ab=Db;var Sb,Cb,Fb,Mb,Ob=0,Tb=0,Nb=0,zb=0,Rb=0,Pb=0,Lb=0,jb=0,Bb=0,Ib={point:Ub,lineStart:qb,lineEnd:Xb,polygonStart:function(){Ib.lineStart=Jb,Ib.lineEnd=Gb},polygonEnd:function(){Ib.point=Ub,Ib.lineStart=qb,Ib.lineEnd=Xb},result:function(){var t=Bb?[Lb/Bb,jb/Bb]:Pb?[zb/Pb,Rb/Pb]:Nb?[Ob/Nb,Tb/Nb]:[NaN,NaN];return Ob=Tb=Nb=zb=Rb=Pb=Lb=jb=Bb=0,t}};function Ub(t,e){Ob+=t,Tb+=e,++Nb}function qb(){Ib.point=Wb}function Wb(t,e){Ib.point=Hb,Ub(Fb=t,Mb=e)}function Hb(t,e){var n=t-Fb,i=e-Mb,r=rb(n*n+i*i);zb+=r*(Fb+t)/2,Rb+=r*(Mb+e)/2,Pb+=r,Ub(Fb=t,Mb=e)}function Xb(){Ib.point=Ub}function Jb(){Ib.point=$b}function Gb(){Zb(Sb,Cb)}function $b(t,e){Ib.point=Zb,Ub(Sb=Fb=t,Cb=Mb=e)}function Zb(t,e){var n=t-Fb,i=e-Mb,r=rb(n*n+i*i);zb+=r*(Fb+t)/2,Rb+=r*(Mb+e)/2,Pb+=r,Lb+=(r=Mb*t-Fb*e)*(Fb+t),jb+=r*(Mb+e),Bb+=3*r,Ub(Fb=t,Mb=e)}const Yb=Ib;function Vb(t){this._context=t}Vb.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Hy)}},result:cb};var Kb,Qb,tx,ex,nx,ix=new jy,rx={point:cb,lineStart:function(){rx.point=ox},lineEnd:function(){Kb&&ax(Qb,tx),rx.point=cb},polygonStart:function(){Kb=!0},polygonEnd:function(){Kb=null},result:function(){var t=+ix;return ix=new jy,t}};function ox(t,e){rx.point=ax,Qb=ex=t,tx=nx=e}function ax(t,e){ex-=t,nx-=e,ix.add(rb(ex*ex+nx*nx)),ex=t,nx=e}const sx=rx;var cx,lx,ux,fx;let dx,hx,px,mx;class gx{constructor(t){this._append=null==t?vx:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));if(e>15)return vx;if(e!==dx){const t=10**e;dx=e,hx=function(e){let n=1;this._+=e[0];for(const i=e.length;n<i;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return hx}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append(cx||(cx=(0,kc.Z)(["M",",",""])),t,e),this._point=1;break;case 1:this._append(lx||(lx=(0,kc.Z)(["L",",",""])),t,e);break;default:if(this._append(ux||(ux=(0,kc.Z)(["M",",",""])),t,e),this._radius!==px||this._append!==hx){const t=this._radius,e=this._;this._="",this._append(fx||(fx=(0,kc.Z)(["m0,","a",","," 0 1,1 0,","a",","," 0 1,1 0,","z"])),t,t,t,-2*t,t,t,2*t),px=t,hx=this._append,mx=this._,this._=e}this._+=mx}}result(){const t=this._;return this._="",t.length?t:null}}function vx(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function yx(t,e){let n,i,r=3,o=4.5;function a(t){return t&&("function"===typeof o&&i.pointRadius(+o.apply(this,arguments)),Ly(t,n(i))),i.result()}return a.area=function(t){return Ly(t,n(xb)),xb.result()},a.measure=function(t){return Ly(t,n(sx)),sx.result()},a.bounds=function(t){return Ly(t,n(Ab)),Ab.result()},a.centroid=function(t){return Ly(t,n(Yb)),Yb.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Oy):(t=e).stream,a):t},a.context=function(t){return arguments.length?(i=null==t?(e=null,new gx(r)):new Vb(e=t),"function"!==typeof o&&i.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"===typeof t?t:(i.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));r=e}return null===e&&(i=new gx(r)),a},a.projection(t).digits(r).context(e)}function bx(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:cb,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function xx(t,e){return Gy(t[0]-e[0])<By&&Gy(t[1]-e[1])<By}function _x(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function wx(t,e,n,i,r){var o,a,s=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],a=t[e];if(xx(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);return void r.lineEnd()}a[0]+=2*By}s.push(n=new _x(i,t,null,!0)),c.push(n.o=new _x(i,null,n,!1)),s.push(n=new _x(a,t,null,!1)),c.push(n.o=new _x(a,null,n,!0))}})),s.length){for(c.sort(e),kx(s),kx(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;l=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=l.length;o<a;++o)r.point((u=l[o])[0],u[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(l=d.p.z,o=l.length-1;o>=0;--o)r.point((u=l[o])[0],u[1]);else i(d.x,d.p.x,-1,r);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);r.lineEnd()}}}function kx(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Ex(t){return[Zy(t[1],t[0]),sb(t[2])]}function Dx(t){var e=t[0],n=t[1],i=Yy(n);return[i*Yy(e),i*nb(e),nb(n)]}function Ax(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Sx(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Cx(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fx(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Mx(t){var e=rb(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Ox(t){return Gy(t[0])<=Uy?t[0]:ib(t[0])*((Gy(t[0])+Uy)%Hy-Uy)}function Tx(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Nx(t,e,n,i){return function(r){var o,a,s,c=e(r),l=bx(),u=e(l),f=!1,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,a=Tx(a);var t=function(t,e){var n=Ox(e),i=e[1],r=nb(i),o=[nb(n),-Yy(n),0],a=0,s=0,c=new jy;1===r?i=qy+By:-1===r&&(i=-qy-By);for(var l=0,u=t.length;l<u;++l)if(d=(f=t[l]).length)for(var f,d,h=f[d-1],p=Ox(h),m=h[1]/2+Wy,g=nb(m),v=Yy(m),y=0;y<d;++y,p=x,g=w,v=k,h=b){var b=f[y],x=Ox(b),_=b[1]/2+Wy,w=nb(_),k=Yy(_),E=x-p,D=E>=0?1:-1,A=D*E,S=A>Uy,C=g*w;if(c.add(Zy(C*D*nb(A),v*k+C*Yy(A))),a+=S?E+D*Hy:E,S^p>=n^x>=n){var F=Sx(Dx(h),Dx(b));Mx(F);var M=Sx(o,F);Mx(M);var O=(S^E>=0?-1:1)*sb(M[2]);(i>O||i===O&&(F[0]||F[1]))&&(s+=S^E>=0?1:-1)}}return(a<-By||a<By&&c<-Iy)^1&s}(o,i);a.length?(f||(r.polygonStart(),f=!0),wx(a,Rx,t,n,r)):t&&(f||(r.polygonStart(),f=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),f&&(r.polygonEnd(),f=!1),a=o=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(e,n){t(e,n)&&r.point(e,n)}function p(t,e){c.point(t,e)}function m(){d.point=p,c.lineStart()}function g(){d.point=h,c.lineEnd()}function v(t,e){s.push([t,e]),u.point(t,e)}function y(){u.lineStart(),s=[]}function b(){v(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,c=u.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&c){if((e=(n=d[0]).length-1)>0){for(f||(r.polygonStart(),f=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else h>1&&2&c&&d.push(d.pop().concat(d.shift())),a.push(d.filter(zx))}return d}}function zx(t){return t.length>1}function Rx(t,e){return((t=t.x)[0]<0?t[1]-qy-By:qy-t[1])-((e=e.x)[0]<0?e[1]-qy-By:qy-e[1])}const Px=Nx((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Uy:-Uy,c=Gy(o-n);Gy(c-Uy)<By?(t.point(n,i=(i+a)/2>0?qy:-qy),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(o,i),e=0):r!==s&&c>=Uy&&(Gy(n-r)<By&&(n-=r*By),Gy(o-s)<By&&(o-=s*By),i=function(t,e,n,i){var r,o,a=nb(t-n);return Gy(a)>By?$y((nb(e)*(o=Yy(i))*nb(n)-nb(i)*(r=Yy(e))*nb(t))/(r*o*a)):(e+i)/2}(n,i,o,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=o,i=a),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*qy,i.point(-Uy,r),i.point(0,r),i.point(Uy,r),i.point(Uy,0),i.point(Uy,-r),i.point(0,-r),i.point(-Uy,-r),i.point(-Uy,0),i.point(-Uy,r);else if(Gy(t[0]-e[0])>By){var o=t[0]<e[0]?Uy:-Uy;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])}),[-Uy,-qy]);function Lx(t,e,n,i,r,o){if(n){var a=Yy(e),s=nb(e),c=i*n;null==r?(r=e+i*Hy,o=e-c/2):(r=jx(a,r),o=jx(a,o),(i>0?r<o:r>o)&&(r+=i*Hy));for(var l,u=r;i>0?u>o:u<o;u-=c)l=Ex([a,-s*Yy(u),-s*nb(u)]),t.point(l[0],l[1])}}function jx(t,e){(e=Dx(e))[0]-=t,Mx(e);var n=ab(-e[1]);return((-e[2]<0?-n:n)+Hy-By)%Hy}var Bx=1e9,Ix=-Bx;function Ux(t,e,n,i){function r(r,o){return t<=r&&r<=n&&e<=o&&o<=i}function o(r,o,s,l){var u=0,f=0;if(null==r||(u=a(r,s))!==(f=a(o,s))||c(r,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(i,r){return Gy(i[0]-t)<By?r>0?0:3:Gy(i[0]-n)<By?r>0?2:1:Gy(i[1]-e)<By?r>0?1:0:r>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,d,h,p,m,g,v,y,b=a,x=bx(),_={point:w,lineStart:function(){_.point=k,l&&l.push(u=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){c&&(k(f,d),h&&g&&x.rejoin(),c.push(x.result()));_.point=w,g&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=l.length;n<r;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],d=f[0],h=f[1];c<u;++c)o=d,a=h,d=(f=s[c])[0],h=f[1],a<=i?h>i&&(d-o)*(i-a)>(h-a)*(t-o)&&++e:h<=i&&(d-o)*(i-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,r=(c=Tx(c)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&wx(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function w(t,e){r(t,e)&&b.point(t,e)}function k(o,a){var s=r(o,a);if(l&&u.push([o,a]),v)f=o,d=a,h=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&g)b.point(o,a);else{var c=[p=Math.max(Ix,Math.min(Bx,p)),m=Math.max(Ix,Math.min(Bx,m))],x=[o=Math.max(Ix,Math.min(Bx,o)),a=Math.max(Ix,Math.min(Bx,a))];!function(t,e,n,i,r,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,d=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=r-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=i-c,d||!(a>0)){if(a/=d,d<0){if(a<l)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>l&&(l=a)}else if(d>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*d),u<1&&(e[0]=s+u*f,e[1]=c+u*d),!0}}}}}(c,x,t,e,n,i)?s&&(b.lineStart(),b.point(o,a),y=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1)}p=o,m=a,g=s}return _}}function qx(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Wx(t,e){return Gy(t)>Uy&&(t-=Math.round(t/Hy)*Hy),[t,e]}function Hx(t,e,n){return(t%=Hy)?e||n?qx(Jx(t),Gx(e,n)):Jx(t):e||n?Gx(e,n):Wx}function Xx(t){return function(e,n){return Gy(e+=t)>Uy&&(e-=Math.round(e/Hy)*Hy),[e,n]}}function Jx(t){var e=Xx(t);return e.invert=Xx(-t),e}function Gx(t,e){var n=Yy(t),i=nb(t),r=Yy(e),o=nb(e);function a(t,e){var a=Yy(e),s=Yy(t)*a,c=nb(t)*a,l=nb(e),u=l*n+s*i;return[Zy(c*r-u*o,s*n-l*i),sb(u*r+c*o)]}return a.invert=function(t,e){var a=Yy(e),s=Yy(t)*a,c=nb(t)*a,l=nb(e),u=l*r-c*o;return[Zy(c*r+l*o,s*n+u*i),sb(u*n-s*i)]},a}function $x(t){return function(e){var n=new Zx;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Zx(){}function Yx(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),Ly(n,t.stream(Ab)),e(Ab.result()),null!=i&&t.clipExtent(i),t}function Vx(t,e,n){return Yx(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function Kx(t,e,n){return Vx(t,[[0,0],e],n)}function Qx(t,e,n){return Yx(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([o,a])}),n)}function t_(t,e,n){return Yx(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,a])}),n)}Wx.invert=Wx,Zx.prototype={constructor:Zx,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var e_=16,n_=Yy(30*Jy);function i_(t,e){return+e?function(t,e){function n(i,r,o,a,s,c,l,u,f,d,h,p,m,g){var v=l-i,y=u-r,b=v*v+y*y;if(b>4*e&&m--){var x=a+d,_=s+h,w=c+p,k=rb(x*x+_*_+w*w),E=sb(w/=k),D=Gy(Gy(w)-1)<By||Gy(o-f)<By?(o+f)/2:Zy(_,x),A=t(D,E),S=A[0],C=A[1],F=S-i,M=C-r,O=y*F-v*M;(O*O/b>e||Gy((v*F+y*M)/b-.5)>.3||a*d+s*h+c*p<n_)&&(n(i,r,o,a,s,c,S,C,D,x/=k,_/=k,w,m,g),g.point(S,C),n(S,C,D,x,_,w,l,u,f,d,h,p,m,g))}}return function(e){var i,r,o,a,s,c,l,u,f,d,h,p,m={point:g,lineStart:v,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=x},polygonEnd:function(){e.polygonEnd(),m.lineStart=v}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function v(){u=NaN,m.point=y,e.lineStart()}function y(i,r){var o=Dx([i,r]),a=t(i,r);n(u,f,l,d,h,p,u=a[0],f=a[1],l=i,d=o[0],h=o[1],p=o[2],e_,e),e.point(u,f)}function b(){m.point=g,e.lineEnd()}function x(){v(),m.point=_,m.lineEnd=w}function _(t,e){y(i=t,e),r=u,o=f,a=d,s=h,c=p,m.point=y}function w(){n(u,f,l,d,h,p,r,o,i,a,s,c,e_,e),m.lineEnd=b,b()}return m}}(t,e):function(t){return $x({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var r_=$x({point:function(t,e){this.stream.point(t*Jy,e*Jy)}});function o_(t,e,n,i,r,o){if(!o)return function(t,e,n,i,r){function o(o,a){return[e+t*(o*=i),n-t*(a*=r)]}return o.invert=function(o,a){return[(o-e)/t*i,(n-a)/t*r]},o}(t,e,n,i,r);var a=Yy(o),s=nb(o),c=a*t,l=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(t,o){return[c*(t*=i)-l*(o*=r)+e,n-l*t-c*o]}return p.invert=function(t,e){return[i*(u*t-f*e+d),r*(h-f*t-u*e)]},p}function a_(t){return s_((function(){return t}))()}function s_(t){var e,n,i,r,o,a,s,c,l,u,f=150,d=480,h=250,p=0,m=0,g=0,v=0,y=0,b=0,x=1,_=1,w=null,k=Px,E=null,D=Oy,A=.5;function S(t){return c(t[0]*Jy,t[1]*Jy)}function C(t){return(t=c.invert(t[0],t[1]))&&[t[0]*Xy,t[1]*Xy]}function F(){var t=o_(f,0,0,x,_,b).apply(null,e(p,m)),i=o_(f,d-t[0],h-t[1],x,_,b);return n=Hx(g,v,y),s=qx(e,i),c=qx(n,s),a=i_(s,A),M()}function M(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=r_(function(t){return $x({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(k(a(D(u=t)))))},S.preclip=function(t){return arguments.length?(k=t,w=void 0,M()):k},S.postclip=function(t){return arguments.length?(D=t,E=i=r=o=null,M()):D},S.clipAngle=function(t){return arguments.length?(k=+t?function(t){var e=Yy(t),n=6*Jy,i=e>0,r=Gy(e)>By;function o(t,n){return Yy(t)*Yy(n)>e}function a(t,n,i){var r=[1,0,0],o=Sx(Dx(t),Dx(n)),a=Ax(o,o),s=o[0],c=a-s*s;if(!c)return!i&&t;var l=e*a/c,u=-e*s/c,f=Sx(r,o),d=Fx(r,l);Cx(d,Fx(o,u));var h=f,p=Ax(d,h),m=Ax(h,h),g=p*p-m*(Ax(d,d)-1);if(!(g<0)){var v=rb(g),y=Fx(h,(-p-v)/m);if(Cx(y,d),y=Ex(y),!i)return y;var b,x=t[0],_=n[0],w=t[1],k=n[1];_<x&&(b=x,x=_,_=b);var E=_-x,D=Gy(E-Uy)<By;if(!D&&k<w&&(b=w,w=k,k=b),D||E<By?D?w+k>0^y[1]<(Gy(y[0]-x)<By?w:k):w<=y[1]&&y[1]<=k:E>Uy^(x<=y[0]&&y[0]<=_)){var A=Fx(h,(-p+v)/m);return Cx(A,d),[y,Ex(A)]}}}function s(e,n){var r=i?t:Uy-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return Nx(o,(function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=i?m?0:s(f,d):m?s(f+(f<0?Uy:-Uy),d):0;if(!e&&(l=c=m)&&t.lineStart(),m!==c&&(!(h=a(e,p))||xx(e,h)||xx(p,h))&&(p[2]=1),m!==c)u=0,m?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(r&&e&&i^m){var v;g&n||!(v=a(p,e,!0))||(u=0,i?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&xx(e,p)||t.point(p[0],p[1]),e=p,c=m,n=g},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}}),(function(e,i,r,o){Lx(o,t,n,r,e,i)}),i?[0,-t]:[-Uy,t-Uy])}(w=t*Jy):(w=null,Px),M()):w*Xy},S.clipExtent=function(t){return arguments.length?(D=null==t?(E=i=r=o=null,Oy):Ux(E=+t[0][0],i=+t[0][1],r=+t[1][0],o=+t[1][1]),M()):null==E?null:[[E,i],[r,o]]},S.scale=function(t){return arguments.length?(f=+t,F()):f},S.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],F()):[d,h]},S.center=function(t){return arguments.length?(p=t[0]%360*Jy,m=t[1]%360*Jy,F()):[p*Xy,m*Xy]},S.rotate=function(t){return arguments.length?(g=t[0]%360*Jy,v=t[1]%360*Jy,y=t.length>2?t[2]%360*Jy:0,F()):[g*Xy,v*Xy,y*Xy]},S.angle=function(t){return arguments.length?(b=t%360*Jy,F()):b*Xy},S.reflectX=function(t){return arguments.length?(x=t?-1:1,F()):x<0},S.reflectY=function(t){return arguments.length?(_=t?-1:1,F()):_<0},S.precision=function(t){return arguments.length?(a=i_(s,A=t*t),M()):rb(A)},S.fitExtent=function(t,e){return Vx(S,t,e)},S.fitSize=function(t,e){return Kx(S,t,e)},S.fitWidth=function(t,e){return Qx(S,t,e)},S.fitHeight=function(t,e){return t_(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&C,F()}}function c_(t){var e=0,n=Uy/3,i=s_(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Jy,n=t[1]*Jy):[e*Xy,n*Xy]},r}function l_(t,e){var n=nb(t),i=(n+nb(e))/2;if(Gy(i)<By)return function(t){var e=Yy(t);function n(t,n){return[t*e,nb(n)/e]}return n.invert=function(t,n){return[t/e,sb(n*e)]},n}(t);var r=1+n*(2*i-n),o=rb(r)/i;function a(t,e){var n=rb(r-2*i*nb(e))/i;return[n*nb(t*=i),o-n*Yy(t)]}return a.invert=function(t,e){var n=o-e,a=Zy(t,Gy(n))*ib(n);return n*i<0&&(a-=Uy*ib(t)*ib(n)),[a/i,sb((r-(t*t+n*n)*i*i)/(2*i))]},a}function u_(){return c_(l_).scale(155.424).center([0,33.6442])}function f_(){return u_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function d_(t){return function(e,n){var i=Yy(e),r=Yy(n),o=t(i*r);return o===1/0?[2,0]:[o*r*nb(e),o*nb(n)]}}function h_(t){return function(e,n){var i=rb(e*e+n*n),r=t(i),o=nb(r),a=Yy(r);return[Zy(e*o,i*a),sb(i&&n*o/i)]}}var p_=d_((function(t){return rb(2/(1+t))}));p_.invert=h_((function(t){return 2*sb(t/2)}));var m_=d_((function(t){return(t=ab(t))&&t/nb(t)}));function g_(t,e){return[t,tb(ob((qy+e)/2))]}function v_(t){var e,n,i,r=a_(t),o=r.center,a=r.scale,s=r.translate,c=r.clipExtent,l=null;function u(){var o=Uy*a(),s=r(function(t){function e(e){return(e=t(e[0]*Jy,e[1]*Jy))[0]*=Xy,e[1]*=Xy,e}return t=Hx(t[0]*Jy,t[1]*Jy,t.length>2?t[2]*Jy:0),e.invert=function(e){return(e=t.invert(e[0]*Jy,e[1]*Jy))[0]*=Xy,e[1]*=Xy,e},e}(r.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===g_?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),i]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(t){return arguments.length?(a(t),u()):a()},r.translate=function(t){return arguments.length?(s(t),u()):s()},r.center=function(t){return arguments.length?(o(t),u()):o()},r.clipExtent=function(t){return arguments.length?(null==t?l=e=n=i=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==l?null:[[l,e],[n,i]]},u()}function y_(t){return ob((qy+t)/2)}function b_(t,e){var n=Yy(t),i=t===e?nb(t):tb(n/Yy(e))/tb(y_(e)/y_(t)),r=n*eb(y_(t),i)/i;if(!i)return g_;function o(t,e){r>0?e<-qy+By&&(e=-qy+By):e>qy-By&&(e=qy-By);var n=r/eb(y_(e),i);return[n*nb(i*t),r-n*Yy(i*t)]}return o.invert=function(t,e){var n=r-e,o=ib(i)*rb(t*t+n*n),a=Zy(t,Gy(n))*ib(n);return n*i<0&&(a-=Uy*ib(t)*ib(n)),[a/i,2*$y(eb(r/o,1/i))-qy]},o}function x_(t,e){return[t,e]}function __(t,e){var n=Yy(t),i=t===e?nb(t):(n-Yy(e))/(e-t),r=n/i+t;if(Gy(i)<By)return x_;function o(t,e){var n=r-e,o=i*t;return[n*nb(o),r-n*Yy(o)]}return o.invert=function(t,e){var n=r-e,o=Zy(t,Gy(n))*ib(n);return n*i<0&&(o-=Uy*ib(t)*ib(n)),[o/i,r-ib(i)*rb(t*t+n*n)]},o}m_.invert=h_((function(t){return t})),g_.invert=function(t,e){return[t,2*$y(Ky(e))-qy]},x_.invert=x_;var w_=1.340264,k_=-.081106,E_=893e-6,D_=.003796,A_=rb(3)/2;function S_(t,e){var n=sb(A_*nb(e)),i=n*n,r=i*i*i;return[t*Yy(n)/(A_*(w_+3*k_*i+r*(7*E_+9*D_*i))),n*(w_+k_*i+r*(E_+D_*i))]}function C_(t,e){var n=Yy(e),i=Yy(t)*n;return[n*nb(t)/i,nb(e)/i]}function F_(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function M_(t,e){return[Yy(e)*nb(t),nb(e)]}function O_(t,e){var n=Yy(e),i=1+Yy(t)*n;return[n*nb(t)/i,nb(e)/i]}function T_(t,e){return[tb(ob((qy+e)/2)),-t]}S_.invert=function(t,e){for(var n,i=e,r=i*i,o=r*r*r,a=0;a<12&&(o=(r=(i-=n=(i*(w_+k_*r+o*(E_+D_*r))-e)/(w_+3*k_*r+o*(7*E_+9*D_*r)))*i)*r*r,!(Gy(n)<Iy));++a);return[A_*t*(w_+3*k_*r+o*(7*E_+9*D_*r))/Yy(i),sb(nb(i)/A_)]},C_.invert=h_($y),F_.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Gy(n)>By&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},M_.invert=h_(sb),O_.invert=h_((function(t){return 2*$y(t)})),T_.invert=function(t,e){return[-e,2*$y(Ky(t))-qy]};var N_=Math.abs,z_=(Math.atan,Math.atan2,Math.ceil,Math.cos),R_=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),P_=(Math.tan,1e-6),L_=Math.PI,j_=L_/2,B_=(Math.SQRT1_2,U_(2));U_(L_);function I_(t){return t>1?j_:t<-1?-j_:Math.asin(t)}function U_(t){return t>0?Math.sqrt(t):0}function q_(t,e){var n,i=t*R_(e),r=30;do{e-=n=(e+R_(e)-i)/(1+z_(e))}while(N_(n)>P_&&--r>0);return e/2}var W_=function(t,e,n){function i(i,r){return[t*i*z_(r=q_(n,r)),e*R_(r)]}return i.invert=function(i,r){return r=I_(r/e),[i/(t*z_(r)),I_((2*r+R_(2*r))/n)]},i}(B_/j_,B_,L_);const H_=yx(),X_=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function J_(t,e){if(!t||"string"!==typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?($_[t]=function(t,e){return function n(){const i=e();return i.type=t,i.path=yx().projection(i),i.copy=i.copy||function(){const t=n();return X_.forEach((e=>{i[e]&&t[e](i[e]())})),t.path.pointRadius(i.path.pointRadius()),t},of(i)}}(t,e),this):$_[t]||null}function G_(t){return t&&t.path||H_}const $_={albers:f_,albersusa:function(){var t,e,n,i,r,o,a=f_(),s=u_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=u_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(i.point(e,a),o)||(r.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,i){for(var r=-1;++r<e;)t[r].point(n,i)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),i=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+By,u+.12*e+By],[o-.214*e-By,u+.234*e-By]]).stream(l),r=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+By,u+.166*e+By],[o-.115*e-By,u+.234*e-By]]).stream(l),f()},u.fitExtent=function(t,e){return Vx(u,t,e)},u.fitSize=function(t,e){return Kx(u,t,e)},u.fitWidth=function(t,e){return Qx(u,t,e)},u.fitHeight=function(t,e){return t_(u,t,e)},u.scale(1070)},azimuthalequalarea:function(){return a_(p_).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return a_(m_).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return c_(b_).scale(109.5).parallels([30,30])},conicequalarea:u_,conicequidistant:function(){return c_(__).scale(131.154).center([0,13.9389])},equalEarth:function(){return a_(S_).scale(177.158)},equirectangular:function(){return a_(x_).scale(152.63)},gnomonic:function(){return a_(C_).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,i,r,o,a,s=1,c=0,l=0,u=1,f=1,d=0,h=null,p=1,m=1,g=$x({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),v=Oy;function y(){return p=s*u,m=s*f,o=a=null,b}function b(n){var i=n[0]*p,r=n[1]*m;if(d){var o=r*t-i*e;i=i*t+r*e,r=o}return[i+c,r+l]}return b.invert=function(n){var i=n[0]-c,r=n[1]-l;if(d){var o=r*t+i*e;i=i*t-r*e,r=o}return[i/p,r/m]},b.stream=function(t){return o&&a===t?o:o=g(v(a=t))},b.postclip=function(t){return arguments.length?(v=t,h=n=i=r=null,y()):v},b.clipExtent=function(t){return arguments.length?(v=null==t?(h=n=i=r=null,Oy):Ux(h=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),y()):null==h?null:[[h,n],[i,r]]},b.scale=function(t){return arguments.length?(s=+t,y()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],y()):[c,l]},b.angle=function(n){return arguments.length?(e=nb(d=n%360*Jy),t=Yy(d),y()):d*Xy},b.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},b.fitExtent=function(t,e){return Vx(b,t,e)},b.fitSize=function(t,e){return Kx(b,t,e)},b.fitWidth=function(t,e){return Qx(b,t,e)},b.fitHeight=function(t,e){return t_(b,t,e)},b},mercator:function(){return v_(g_).scale(961/Hy)},mollweide:function(){return a_(W_).scale(169.529)},naturalEarth1:function(){return a_(F_).scale(175.295)},orthographic:function(){return a_(M_).scale(249.5).clipAngle(90+By)},stereographic:function(){return a_(O_).scale(250).clipAngle(142)},transversemercator:function(){var t=v_(T_),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const GN in $_)J_(GN,$_[GN]);function Z_(t,e,n){var i=(0,Wo.Z)(t,e-By,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function Y_(t,e,n){var i=(0,Wo.Z)(t,e-By,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function V_(){var t,e,n,i,r,o,a,s,c,l,u,f,d=10,h=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return(0,Wo.Z)(Vy(i/p)*p,n,p).map(u).concat((0,Wo.Z)(Vy(s/m)*m,a,m).map(f)).concat((0,Wo.Z)(Vy(e/d)*d,t,d).filter((function(t){return Gy(t%p)>By})).map(c)).concat((0,Wo.Z)(Vy(o/h)*h,r,h).filter((function(t){return Gy(t%m)>By})).map(l))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],i>n&&(t=i,i=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(g)):[[i,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),v.precision(g)):[[e,o],[t,r]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],m=+t[1],v):[p,m]},v.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],v):[d,h]},v.precision=function(d){return arguments.length?(g=+d,c=Z_(o,r,90),l=Y_(e,t,g),u=Z_(s,a,90),f=Y_(i,n,g),v):g},v.extentMajor([[-180,-90+By],[180,90-By]]).extentMinor([[-180,-80-By],[180,80+By]])}function K_(){}const Q_=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function tw(){var t=1,e=1,n=a;function i(t,e){return e.map((e=>r(t,e)))}function r(i,r){var a=[],s=[];return function(n,i,r){var a,s,c,l,u,f,d=new Array,h=new Array;a=s=-1,l=n[0]>=i,Q_[l<<1].forEach(p);for(;++a<t-1;)c=l,l=n[a+1]>=i,Q_[c|l<<1].forEach(p);Q_[l|0].forEach(p);for(;++s<e-1;){for(a=-1,l=n[s*t+t]>=i,u=n[s*t]>=i,Q_[l<<1|u<<2].forEach(p);++a<t-1;)c=l,l=n[s*t+t+a+1]>=i,f=u,u=n[s*t+a+1]>=i,Q_[c|l<<1|u<<2|f<<3].forEach(p);Q_[l|u<<3].forEach(p)}a=-1,u=n[s*t]>=i,Q_[u<<2].forEach(p);for(;++a<t-1;)f=u,u=n[s*t+a+1]>=i,Q_[u<<2|f<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+a,t[0][1]+s],c=[t[1][0]+a,t[1][1]+s],l=o(i),u=o(c);(e=h[l])?(n=d[u])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(c),r(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(c),h[e.end=u]=e):(e=d[u])?(n=h[l])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(c),r(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(i),d[e.start=l]=e):d[l]=h[u]={start:l,end:u,ring:[i,c]}}Q_[u<<3].forEach(p)}(i,r,(t=>{n(t,i,r),function(t){var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}(t)>0?a.push([t]):s.push(t)})),s.forEach((t=>{for(var e,n=0,i=a.length;n<i;++n)if(-1!==ew((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:r,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,i,r){n.forEach((n=>{var o,a=n[0],s=n[1],c=0|a,l=0|s,u=i[l*t+c];a>0&&a<t&&c===a&&(o=i[l*t+c-1],n[0]=a+(r-o)/(u-o)-.5),s>0&&s<e&&l===s&&(o=i[(l-1)*t+c],n[1]=s+(r-o)/(u-o)-.5)}))}return i.contour=r,i.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),o=Math.floor(n[1]);return r>=0&&o>=0||(0,m.vU)("invalid size"),t=r,e=o,i},i.smooth=function(t){return arguments.length?(n=t?a:K_,i):n===a},i}function ew(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=nw(t,e[i]))return n;return 0}function nw(t,e){for(var n=e[0],i=e[1],r=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var c=t[o],l=c[0],u=c[1],f=t[s],d=f[0],h=f[1];if(iw(c,f,e))return 0;u>i!==h>i&&n<(d-l)*(i-u)/(h-u)+l&&(r=-r)}return r}function iw(t,e,n){var i,r,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],o=n[i],a=e[i],r<=o&&o<=a||a<=o&&o<=r)}function rw(t,e,n){return function(i){var r=(0,m.We)(i),o=n?Math.min(r[0],0):r[0],a=r[1],s=a-o,c=e?(0,N.ly)(o,a,t):s/(t+1);return(0,Wo.Z)(o+c,a,c)}}function ow(t){Rr.call(this,null,t)}function aw(t,e,n,i,r){const o=t.x1||0,a=t.y1||0,s=e*n<0;function c(t){t.forEach(l)}function l(t){s&&t.reverse(),t.forEach(u)}function u(t){t[0]=(t[0]-o)*e+i,t[1]=(t[1]-a)*n+r}return function(t){return t.coordinates.forEach(c),t}}function sw(t,e,n){const i=t>=0?t:Jr(e,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function cw(t){return(0,m.mf)(t)?t:(0,m.a9)(+t)}function lw(){var t=t=>t[0],e=t=>t[1],n=m.kX,i=[-1,-1],r=960,o=500,a=2;function s(s,c){const l=sw(i[0],s,t)>>a,u=sw(i[1],s,e)>>a,f=l?l+2:0,d=u?u+2:0,h=2*f+(r>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let v=m;s.forEach((i=>{const r=f+(+t(i)>>a),o=d+(+e(i)>>a);r>=0&&r<h&&o>=0&&o<p&&(m[r+o*h]+=+n(i))})),l>0&&u>0?(uw(h,p,m,g,l),fw(h,p,g,m,u),uw(h,p,m,g,l),fw(h,p,g,m,u),uw(h,p,m,g,l),fw(h,p,g,m,u)):l>0?(uw(h,p,m,g,l),uw(h,p,g,m,l),uw(h,p,m,g,l),v=g):u>0&&(fw(h,p,m,g,u),fw(h,p,g,m,u),fw(h,p,m,g,u),v=g);const y=c?Math.pow(2,-2*a):1/Qv(v);for(let t=0,e=h*p;t<e;++t)v[t]*=y;return{values:v,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(r>>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=cw(e),s):t},s.y=function(t){return arguments.length?(e=cw(t),s):e},s.weight=function(t){return arguments.length?(n=cw(t),s):n},s.size=function(t){if(!arguments.length)return[r,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||(0,m.vU)("invalid size"),r=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||(0,m.vU)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=(0,m.IX)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&(0,m.vU)("invalid bandwidth"),i=t,s):i},s}function uw(t,e,n,i,r){const o=1+(r<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+r;++e)e<t&&(s+=n[e+a*t]),e>=r&&(e>=o&&(s-=n[e-o+a*t]),i[e-r+a*t]=s/Math.min(e+1,t-1+o-e,o))}function fw(t,e,n,i,r){const o=1+(r<<1);for(let a=0;a<t;++a)for(let s=0,c=0;s<e+r;++s)s<e&&(c+=n[a+s*t]),s>=r&&(s>=o&&(c-=n[a+(s-o)*t]),i[a+(s-r)*t]=c/Math.min(s+1,e-1+o-s,o))}function dw(t){Rr.call(this,null,t)}ow.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},(0,m.XW)(ow,Rr,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=t.field||m.yR,o=tw().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const i=rw(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(t.map((t=>(0,qo.Z)(e(t).values))))}(i,r,t),s=null===t.as?null:t.as||"contour",c=[];return i.forEach((e=>{const n=r(e),i=o.size([n.width,n.height])(n.values,(0,m.kJ)(a)?a:a(n.values));!function(t,e,n,i){let r=i.scale||e.scale,o=i.translate||e.translate;(0,m.mf)(r)&&(r=r(n,i));(0,m.mf)(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const a=((0,m.hj)(r)?r:r[0])||1,s=((0,m.hj)(r)?r:r[1])||1,c=o&&o[0]||0,l=o&&o[1]||0;t.forEach(aw(e,a,s,c,l))}(i,n,e,t),i.forEach((t=>{c.push(ar(e,rr(null!=s?{[s]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),dw.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const hw=["x","y","weight","size","cellSize","bandwidth"];function pw(t,e){return hw.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function mw(t){Rr.call(this,null,t)}(0,m.XW)(dw,Rr,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=function(t,e){var n,i,r,o,a,s,c=[],l=t=>t(o);if(null==e)c.push(t);else for(n={},i=0,r=t.length;i<r;++i)o=t[i],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,c.push(s)),s.push(o);return c}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(m.el),a=pw(lw(),t),s=t.as||"grid";return n=r.map((e=>rr(function(t,e){for(let n=0;n<o.length;++n)t[o[n]]=e[n];return t}({[s]:a(e,t.counts)},e.dims)))),this.value&&(i.rem=this.value),this.value=i.source=i.add=n,i}}),mw.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},(0,m.XW)(mw,Rr,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,i,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=tw().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||rw(t.count||10,t.nice,!!a),c=t.size;return a||(a=e.materialize(e.SOURCE).source,i=aw(n=pw(lw(),t)(a,!0),n.scale||1,n.scale||1,0,0),c=[n.width,n.height],a=n.values),s=(0,m.kJ)(s)?s:s(a),a=o.size(c)(a,s),i&&a.forEach(i),this.value&&(r.rem=this.value),this.value=r.source=r.add=(a||[]).map(rr),r}});const gw="Feature",vw="FeatureCollection";function yw(t){Rr.call(this,null,t)}function bw(t){Rr.call(this,null,t)}function xw(t){Rr.call(this,null,t)}function _w(t){Rr.call(this,null,t)}function ww(t){Rr.call(this,[],t),this.generator=V_()}function kw(t){Rr.call(this,null,t)}function Ew(t){if(!(0,m.mf)(t))return!1;const e=(0,m.Rg)((0,m.Oj)(t));return e.$x||e.$y||e.$value||e.$max}function Dw(t){Rr.call(this,null,t),this.modified(!0)}function Aw(t,e,n){(0,m.mf)(t[e])&&t[e](n)}function Sw(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o,a,s,c,l,u,f,d,h=t._root,p={data:i},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((l=e>=(o=(m+v)/2))?m=o:v=o,(u=n>=(a=(g+y)/2))?g=a:y=a,r=h,!(h=h[f=u<<1|l]))return r[f]=p,t;if(s=+t._x.call(null,h.data),c=+t._y.call(null,h.data),e===s&&n===c)return p.next=h,r?r[f]=p:t._root=p,t;do{r=r?r[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(m+v)/2))?m=o:v=o,(u=n>=(a=(g+y)/2))?g=a:y=a}while((f=u<<1|l)===(d=(c>=a)<<1|s>=o));return r[d]=h,r[f]=p,t}function Cw(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Fw(t){return t[0]}function Mw(t){return t[1]}function Ow(t,e,n){var i=new Tw(null==e?Fw:e,null==n?Mw:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Tw(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function Nw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}yw.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,m.XW)(yw,Rr,{transform(t,e){var n,i=this._features,r=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],c=t.geojson||!o&&m.yR,l=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(c))||a&&e.modified((0,m.Oj)(a))||s&&e.modified((0,m.Oj)(s)),this.value&&!n||(l=e.SOURCE,this._features=i=[],this._points=r=[]),c&&e.visit(l,(t=>i.push(c(t)))),a&&s&&(e.visit(l,(t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&r.push([e,n])})),i=i.concat({type:gw,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:vw,features:i}}}),bw.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},(0,m.XW)(bw,Rr,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.field||m.yR,o=t.as||"path",a=n.SOURCE;!i||t.modified()?(this.value=i=G_(t.projection),n.materialize().reflow()):a=r===m.yR||e.modified(r.fields)?n.ADD_MOD:n.ADD;const s=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(i,t.pointRadius);return n.visit(a,(t=>t[o]=i(r(t)))),i.pointRadius(s),n.modifies(o)}}),xw.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},(0,m.XW)(xw,Rr,{transform(t,e){var n,i=t.projection,r=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],c=a[1];function l(t){const e=i([r(t),o(t)]);e?(t[s]=e[0],t[c]=e[1]):(t[s]=void 0,t[c]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(r.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),_w.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},(0,m.XW)(_w,Rr,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.as||"shape",o=n.ADD;return i&&!t.modified()||(this.value=i=function(t,e,n){const i=null==n?n=>t(e(n)):i=>{var r=t.pointRadius(),o=t.pointRadius(n)(e(i));return t.pointRadius(r),o};return i.context=e=>(t.context(e),i),i}(G_(t.projection),t.field||(0,m.EP)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[r]=i)),n.modifies(r)}}),ww.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},(0,m.XW)(ww,Rr,{transform(t,e){var n,i=this.value,r=this.generator;if(!i.length||t.modified())for(const o in t)(0,m.mf)(r[o])&&r[o](t[o]);return n=r(),i.length?e.mod.push(sr(i[0],n)):e.add.push(rr(n)),i[0]=n,e}}),kw.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},(0,m.XW)(kw,Rr,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,i="shared"===t.resolve,r=t.field||m.yR,o=function(t,e){let n;(0,m.mf)(t)?(n=n=>t(n,e),n.dep=Ew(t)):t?n=(0,m.a9)(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;(0,m.mf)(t)?(n=n=>(0,Ul.B8)(t(n,e)),n.dep=Ew(t)):n=(0,m.a9)((0,Ul.B8)(t||"#888"));return n}(t.color,t),s=t.as||"image",c={$x:0,$y:0,$value:0,$max:i?(0,qo.Z)(n.map((t=>(0,qo.Z)(r(t).values)))):0};return n.forEach((t=>{const e=r(t),n=(0,m.l7)({},t,c);i||(n.$max=(0,qo.Z)(e.values||[])),t[s]=function(t,e,n,i){const r=t.width,o=t.height,a=t.x1||0,s=t.y1||0,c=t.x2||r,l=t.y2||o,u=t.values,f=u?t=>u[t]:m.bM,d=Xc(c-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,c-a,l-s),g=p.data;for(let m=s,v=0;m<l;++m){e.$y=m-s;for(let t=a,o=m*r;t<c;++t,v+=4){e.$x=t-a,e.$value=f(t+o);const r=n(e);g[v+0]=r.r,g[v+1]=r.g,g[v+2]=r.b,g[v+3]=~~(255*i(e))}}return h.putImageData(p,0,0),d}(e,n,a.dep?a:(0,m.a9)(a(n)),o.dep?o:(0,m.a9)(o(n)))})),e.reflow(!0).modifies(s)}}),(0,m.XW)(Dw,Rr,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=J_((t||"mercator").toLowerCase());e||(0,m.vU)("Unrecognized projection type: "+t);return e()}(t.type),X_.forEach((e=>{null!=t[e]&&Aw(n,e,t[e])}))):X_.forEach((e=>{t.modified(e)&&Aw(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return t=(0,m.IX)(t),1===t.length?t[0]:{type:vw,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===vw?t.features:(0,m.IX)(t).filter((t=>null!=t)).map((t=>t.type===gw?t:{type:gw,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var zw=Ow.prototype=Tw.prototype;function Rw(t){return function(){return t}}function Pw(t){return 1e-6*(t()-.5)}function Lw(t){return t.x+t.vx}function jw(t){return t.y+t.vy}zw.copy=function(){var t,e,n=new Tw(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Nw(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Nw(e));return n},zw.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Sw(this.cover(e,n),e,n,t)},zw.addAll=function(t){var e,n,i,r,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(a[n]=i,s[n]=r,i<c&&(c=i),i>u&&(u=i),r<l&&(l=r),r>f&&(f=r));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)Sw(this,a[n],s[n],t[n]);return this},zw.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,o=(i=Math.floor(e))+1;else{for(var a,s,c=r-n||1,l=this._root;n>t||t>=r||i>e||e>=o;)switch(s=(e<i)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:r=n+c,o=i+c;break;case 1:n=r-c,o=i+c;break;case 2:r=n+c,i=o-c;break;case 3:n=r-c,i=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},zw.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},zw.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},zw.find=function(t,e,n){var i,r,o,a,s,c,l,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],m=this._root;for(m&&p.push(new Cw(m,u,f,d,h)),null==n?n=1/0:(u=t-n,f=e-n,d=t+n,h=e+n,n*=n);c=p.pop();)if(!(!(m=c.node)||(r=c.x0)>d||(o=c.y0)>h||(a=c.x1)<u||(s=c.y1)<f))if(m.length){var g=(r+a)/2,v=(o+s)/2;p.push(new Cw(m[3],g,v,a,s),new Cw(m[2],r,v,g,s),new Cw(m[1],g,o,a,v),new Cw(m[0],r,o,g,v)),(l=(e>=v)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var y=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),x=y*y+b*b;if(x<n){var _=Math.sqrt(n=x);u=t-_,f=e-_,d=t+_,h=e+_,i=m.data}}return i},zw.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,i,r,o,a,s,c,l,u,f,d,h=this._root,p=this._x0,m=this._y0,g=this._x1,v=this._y1;if(!h)return this;if(h.length)for(;;){if((l=o>=(s=(p+g)/2))?p=s:g=s,(u=a>=(c=(m+v)/2))?m=c:v=c,e=h,!(h=h[f=u<<1|l]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(i=h,!(h=h.next))return this;return(r=h.next)&&delete h.next,i?(r?i.next=r:delete i.next,this):e?(r?e[f]=r:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=r,this)},zw.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},zw.root=function(){return this._root},zw.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},zw.visit=function(t){var e,n,i,r,o,a,s=[],c=this._root;for(c&&s.push(new Cw(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,i=e.x0,r=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(i+o)/2,u=(r+a)/2;(n=c[3])&&s.push(new Cw(n,l,u,o,a)),(n=c[2])&&s.push(new Cw(n,i,u,l,a)),(n=c[1])&&s.push(new Cw(n,l,r,o,u)),(n=c[0])&&s.push(new Cw(n,i,r,l,u))}return this},zw.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new Cw(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=r[0])&&n.push(new Cw(o,a,s,u,f)),(o=r[1])&&n.push(new Cw(o,u,s,c,f)),(o=r[2])&&n.push(new Cw(o,a,f,u,l)),(o=r[3])&&n.push(new Cw(o,u,f,c,l))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},zw.x=function(t){return arguments.length?(this._x=t,this):this._x},zw.y=function(t){return arguments.length?(this._y=t,this):this._y};var Bw={value:()=>{}};function Iw(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Uw(i)}function Uw(t){this._=t}function qw(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Ww(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Bw,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Uw.prototype=Iw.prototype={constructor:Uw,on:function(t,e){var n,i,r=this._,o=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)r[n]=Ww(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Ww(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=qw(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Uw(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const Hw=Iw;var Xw=n(89121);const Jw=1664525,Gw=1013904223,$w=4294967296;function Zw(t){return t.x}function Yw(t){return t.y}var Vw=10,Kw=Math.PI*(3-Math.sqrt(5));function Qw(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=new Map,c=(0,Xw.HT)(f),l=Hw("tick","end"),u=function(){let t=1;return()=>(t=(Jw*t+Gw)%$w)/$w}();function f(){d(),l.call("tick",e),n<i&&(c.stop(),l.call("end",e))}function d(i){var c,l,u=t.length;void 0===i&&(i=1);for(var f=0;f<i;++f)for(n+=(o-n)*r,s.forEach((function(t){t(n)})),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function h(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=Vw*Math.sqrt(.5+n),o=n*Kw;e.x=r*Math.cos(o),e.y=r*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,i){var r,o,a,s,c,l=0,u=t.length;for(null==i?i=1/0:i*=i,l=0;l<u;++l)(a=(r=e-(s=t[l]).x)*r+(o=n-s.y)*o)<i&&(c=s,i=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}function tk(t){return t.index}function ek(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const nk={center:function(t,e){var n,i=1;function r(){var r,o,a=n.length,s=0,c=0;for(r=0;r<a;++r)s+=(o=n[r]).x,c+=o.y;for(s=(s/a-t)*i,c=(c/a-e)*i,r=0;r<a;++r)(o=n[r]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.strength=function(t){return arguments.length?(i=+t,r):i},r},collide:function(t){var e,n,i,r=1,o=1;function a(){for(var t,a,c,l,u,f,d,h=e.length,p=0;p<o;++p)for(a=Ow(e,Lw,jw).visitAfter(s),t=0;t<h;++t)c=e[t],f=n[c.index],d=f*f,l=c.x+c.vx,u=c.y+c.vy,a.visit(m);function m(t,e,n,o,a){var s=t.data,h=t.r,p=f+h;if(!s)return e>l+p||o<l-p||n>u+p||a<u-p;if(s.index>c.index){var m=l-s.x-s.vx,g=u-s.y-s.vy,v=m*m+g*g;v<p*p&&(0===m&&(v+=(m=Pw(i))*m),0===g&&(v+=(g=Pw(i))*g),v=(p-(v=Math.sqrt(v)))/v*r,c.vx+=(m*=v)*(p=(h*=h)/(d+h)),c.vy+=(g*=v)*p,s.vx-=m*(p=1-p),s.vy-=g*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function c(){if(e){var i,r,o=e.length;for(n=new Array(o),i=0;i<o;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!==typeof t&&(t=Rw(null==t?1:+t)),a.initialize=function(t,n){e=t,i=n,c()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(r=+t,a):r},a.radius=function(e){return arguments.length?(t="function"===typeof e?e:Rw(+e),c(),a):t},a},nbody:function(){var t,e,n,i,r,o=Rw(-30),a=1,s=1/0,c=.81;function l(n){var r,o=t.length,a=Ow(t,Zw,Yw).visitAfter(f);for(i=n,r=0;r<o;++r)e=t[r],a.visit(d)}function u(){if(t){var e,n,i=t.length;for(r=new Array(i),e=0;e<i;++e)n=t[e],r[n.index]=+o(n,e,t)}}function f(t){var e,n,i,o,a,s=0,c=0;if(t.length){for(i=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,i+=n*e.x,o+=n*e.y);t.x=i/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=r[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,d=t.y-e.y,h=u-o,p=f*f+d*d;if(h*h/c<p)return p<s&&(0===f&&(p+=(f=Pw(n))*f),0===d&&(p+=(d=Pw(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*i/p,e.vy+=d*t.value*i/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=Pw(n))*f),0===d&&(p+=(d=Pw(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=r[t.data.index]*i/p,e.vx+=f*h,e.vy+=d*h)}while(t=t.next)}}return l.initialize=function(e,i){t=e,n=i,u()},l.strength=function(t){return arguments.length?(o="function"===typeof t?t:Rw(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l},link:function(t){var e,n,i,r,o,a,s=tk,c=function(t){return 1/Math.min(r[t.source.index],r[t.target.index])},l=Rw(30),u=1;function f(i){for(var r=0,s=t.length;r<u;++r)for(var c,l,f,d,h,p,m,g=0;g<s;++g)l=(c=t[g]).source,d=(f=c.target).x+f.vx-l.x-l.vx||Pw(a),h=f.y+f.vy-l.y-l.vy||Pw(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*i*e[g],h*=p,f.vx-=d*(m=o[g]),f.vy-=h*m,l.vx+=d*(m=1-m),l.vy+=h*m}function d(){if(i){var a,c,l=i.length,u=t.length,f=new Map(i.map(((t,e)=>[s(t,e,i),t])));for(a=0,r=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!==typeof c.source&&(c.source=ek(f,c.source)),"object"!==typeof c.target&&(c.target=ek(f,c.target)),r[c.source.index]=(r[c.source.index]||0)+1,r[c.target.index]=(r[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=r[c.source.index]/(r[c.source.index]+r[c.target.index]);e=new Array(u),h(),n=new Array(u),p()}}function h(){if(i)for(var n=0,r=t.length;n<r;++n)e[n]=+c(t[n],n,t)}function p(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){i=t,a=e,d()},f.links=function(e){return arguments.length?(t=e,d(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"===typeof t?t:Rw(+t),h(),f):c},f.distance=function(t){return arguments.length?(l="function"===typeof t?t:Rw(+t),p(),f):l},f},x:function(t){var e,n,i,r=Rw(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vx+=(i[o]-r.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!==typeof t&&(t=Rw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"===typeof t?t:Rw(+t),a(),o):r},o.x=function(e){return arguments.length?(t="function"===typeof e?e:Rw(+e),a(),o):t},o},y:function(t){var e,n,i,r=Rw(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vy+=(i[o]-r.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!==typeof t&&(t=Rw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"===typeof t?t:Rw(+t),a(),o):r},o.y=function(e){return arguments.length?(t="function"===typeof e?e:Rw(+e),a(),o):t},o}},ik="forces",rk=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],ok=["static","iterations"],ak=["x","y","vx","vy"];function sk(t){Rr.call(this,null,t)}function ck(t,e,n,i){var r,o,a,s,c=(0,m.IX)(e.forces);for(r=0,o=rk.length;r<o;++r)(a=rk[r])!==ik&&e.modified(a)&&t[a](e[a]);for(r=0,o=c.length;r<o;++r)s=ik+r,(a=n||e.modified(ik,r)?uk(c[r]):i&&lk(c[r],i)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;r<o;++r)t.force(ik+r,null);return t.numForces=c.length,t}function lk(t,e){var n,i;for(n in t)if((0,m.mf)(i=t[n])&&e.modified((0,m.Oj)(i)))return 1;return 0}function uk(t){var e,n;for(n in(0,m.nr)(nk,t.force)||(0,m.vU)("Unrecognized force: "+t.force),e=nk[t.force](),t)(0,m.mf)(e[n])&&fk(e[n],t[n],t);return e}function fk(t,e,n){t((0,m.mf)(e)?t=>e(t,n):e)}function dk(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hk(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=mk)):void 0===e&&(e=pk);for(var n,i,r,o,a,s=new yk(t),c=[s];n=c.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)c.push(i=r[o]=new yk(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(vk)}function pk(t){return t.children}function mk(t){return Array.isArray(t)?t[1]:null}function gk(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function vk(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function yk(t){this.data=t,this.depth=this.height=0,this.parent=null}function bk(t){return null==t?null:xk(t)}function xk(t){if("function"!==typeof t)throw new Error;return t}function _k(){return 0}function wk(t){return function(){return t}}sk.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:ak}]},(0,m.XW)(sk,Rr,{transform(t,e){var n,i,r=this.value,o=e.changed(e.ADD_REM),a=t.modified(rk),s=t.iterations||300;if(r?(o&&(e.modifies("index"),r.nodes(e.source)),(a||e.changed(e.MOD))&&ck(r,t,0,e)):(this.value=r=function(t,e){const n=Qw(t),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),ck(n,e,!0).on("end",(()=>o=!0))}(e.source,t),r.on("tick",(n=e.dataflow,i=this,()=>n.touch(i).run())),t.static||(o=!0,r.tick()),e.modifies("index")),a||o||t.modified(ok)||e.changed()&&t.restart)if(r.alpha(Math.max(r.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/s)),t.static)for(r.stop();--s>=0;)r.tick();else if(r.stopped()&&r.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let s,c=this._argops,l=0,u=c.length;l<u;++l)if(s=c[l],s.name===ik&&"link"===s.op._argval.force)for(var i,r=s.op._argops,o=0,a=r.length;o<a;++o)if("links"===r[o].name&&(i=r[o].op.source)){n.pulse(i,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(ak)}}),yk.prototype=hk.prototype={constructor:yk,count:function(){return this.eachAfter(dk)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return hk(this).eachBefore(gk)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};const kk=1664525,Ek=1013904223,Dk=4294967296;function Ak(t,e){for(var n,i,r=0,o=(t=function(t,e){let n,i,r=t.length;for(;r;)i=e()*r--|0,n=t[r],t[r]=t[i],t[i]=n;return t}(Array.from(t),e)).length,a=[];r<o;)n=t[r],i&&Fk(i,n)?++r:(i=Ok(a=Sk(a,n)),r=0);return i}function Sk(t,e){var n,i;if(Mk(e,t))return[e];for(n=0;n<t.length;++n)if(Ck(e,t[n])&&Mk(Tk(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(i=n+1;i<t.length;++i)if(Ck(Tk(t[n],t[i]),e)&&Ck(Tk(t[n],e),t[i])&&Ck(Tk(t[i],e),t[n])&&Mk(Nk(t[n],t[i],e),t))return[t[n],t[i],e];throw new Error}function Ck(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function Fk(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Mk(t,e){for(var n=0;n<e.length;++n)if(!Fk(t,e[n]))return!1;return!0}function Ok(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Tk(t[0],t[1]);case 3:return Nk(t[0],t[1],t[2])}}function Tk(t,e){var n=t.x,i=t.y,r=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-i,u=s-r,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(i+a+l/f*u)/2,r:(f+r+s)/2}}function Nk(t,e,n){var i=t.x,r=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,d=i-a,h=i-l,p=r-s,m=r-u,g=c-o,v=f-o,y=i*i+r*r-o*o,b=y-a*a-s*s+c*c,x=y-l*l-u*u+f*f,_=h*p-d*m,w=(p*x-m*b)/(2*_)-i,k=(m*g-p*v)/_,E=(h*b-d*x)/(2*_)-r,D=(d*v-h*g)/_,A=k*k+D*D-1,S=2*(o+w*k+E*D),C=w*w+E*E-o*o,F=-(Math.abs(A)>1e-6?(S+Math.sqrt(S*S-4*A*C))/(2*A):C/S);return{x:i+w+k*F,y:r+E+D*F,r:F}}function zk(t,e,n){var i,r,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(r=e.r+n.r,r*=r,a=t.r+n.r,r>(a*=a)?(i=(l+a-r)/(2*l),o=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x-i*s-o*c,n.y=t.y-i*c+o*s):(i=(l+r-a)/(2*l),o=Math.sqrt(Math.max(0,r/l-i*i)),n.x=e.x+i*s-o*c,n.y=e.y+i*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Rk(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Pk(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function Lk(t){this._=t,this.next=null,this.previous=null}function jk(t,e){if(!(o=(t=function(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,i,r,o,a,s,c,l,u,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;zk(i,n,r=t[2]),n=new Lk(n),i=new Lk(i),r=new Lk(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(c=3;c<o;++c){zk(n._,i._,r=t[c]),r=new Lk(r),l=i.next,u=n.previous,f=i._.r,d=n._.r;do{if(f<=d){if(Rk(l._,r._)){i=l,n.next=i,i.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(Rk(u._,r._)){(n=u).next=i,i.previous=n,--c;continue t}d+=u._.r,u=u.previous}}while(l!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=Pk(n);(r=r.next)!==i;)(s=Pk(r))<a&&(n=r,a=s);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Ak(n,e),c=0;c<o;++c)(n=t[c]).x-=r.x,n.y-=r.y;return r.r}function Bk(t){return Math.sqrt(t.value)}function Ik(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Uk(t,e,n){return function(i){if(r=i.children){var r,o,a,s=r.length,c=t(i)*e||0;if(c)for(o=0;o<s;++o)r[o].r+=c;if(a=jk(r,n),c)for(o=0;o<s;++o)r[o].r-=c;i.r=a+c}}}function qk(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function Wk(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Hk(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*l}var Xk={depth:-1},Jk={},Gk={};function $k(t){return t.id}function Zk(t){return t.parentId}function Yk(){var t,e=$k,n=Zk;function i(i){var r,o,a,s,c,l,u,f,d=Array.from(i),h=e,p=n,m=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t="".concat(t);let e=t.length;Kk(t,e-1)&&!Kk(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:"/".concat(t)}(t(e,n,i)))),n=e.map(Vk),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(Vk(t)),d.push(Gk));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],l=d[a]=new yk(o),null!=(u=h(o,a,i))&&(u+="")&&(f=l.id=u,m.set(f,m.has(f)?Jk:l)),null!=(u=p(o,a,i))&&(u+="")&&(l.parent=u);for(a=0;a<r;++a)if(u=(l=d[a]).parent){if(!(c=m.get(u)))throw new Error("missing: "+u);if(c===Jk)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===Gk&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(l=d[t]).data===Gk;--t)l.data=null}if(s.parent=Xk,s.eachBefore((function(t){t.depth=t.parent.depth+1,--r})).eachBefore(vk),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=bk(t),i):e},i.parentId=function(t){return arguments.length?(n=bk(t),i):n},i.path=function(e){return arguments.length?(t=bk(e),i):t},i}function Vk(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Kk(t,e););return t.slice(0,e)}function Kk(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0===(1&n))return!0}return!1}function Qk(t,e){return t.parent===e.parent?1:2}function tE(t){var e=t.children;return e?e[0]:t.t}function eE(t){var e=t.children;return e?e[e.length-1]:t.t}function nE(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function iE(t,e,n){return t.a.parent===e.parent?t.a:n}function rE(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function oE(t,e){return t.parent===e.parent?1:2}function aE(t,e){return t+e.x}function sE(t,e){return Math.max(t,e.y)}function cE(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*l}rE.prototype=Object.create(yk.prototype);var lE=(1+Math.sqrt(5))/2;function uE(t,e,n,i,r,o){for(var a,s,c,l,u,f,d,h,p,m,g,v=[],y=e.children,b=0,x=0,_=y.length,w=e.value;b<_;){c=r-n,l=o-i;do{u=y[x++].value}while(!u&&x<_);for(f=d=u,g=u*u*(m=Math.max(l/c,c/l)/(w*t)),p=Math.max(d/g,g/f);x<_;++x){if(u+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),g=u*u*m,(h=Math.max(d/g,g/f))>p){u-=s;break}p=h}v.push(a={value:u,dice:c<l,children:y.slice(b,x)}),a.dice?Hk(a,n,i,r,w?i+=l*u/w:o):cE(a,n,i,w?n+=c*u/w:r,o),w-=u,b=x}return v}const fE=function t(e){function n(t,n,i,r,o){uE(e,t,n,i,r,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(lE),dE=function t(e){function n(t,n,i,r,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,d=a.length,h=t.value;++f<d;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?Hk(s,n,i,r,h?i+=(o-i)*s.value/h:o):cE(s,n,i,h?n+=(r-n)*s.value/h:r,o),h-=s.value}else t._squarify=a=uE(e,t,n,i,r,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(lE);function hE(t,e,n){const i={};return t.each((t=>{const r=t.data;n(r)&&(i[e(r)]=t)})),t.lookup=i,t}function pE(t){Rr.call(this,null,t)}pE.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const mE=t=>t.values;function gE(){const t=[],e={entries:t=>i(n(t,0),0),key:n=>(t.push(n),e)};function n(e,i){if(i>=t.length)return e;const r=e.length,o=t[i++],a={},s={};let c,l,u,f=-1;for(;++f<r;)c=o(l=e[f])+"",(u=a[c])?u.push(l):a[c]=[l];for(c in a)s[c]=n(a[c],i);return s}function i(e,n){if(++n>t.length)return e;const r=[];for(const t in e)r.push({key:t,values:i(e[t],n)});return r}return e}function vE(t){Rr.call(this,null,t)}(0,m.XW)(pE,Rr,{transform(t,e){e.source||(0,m.vU)("Nest transform requires an upstream data source.");var n=t.generate,i=t.modified(),r=e.clone(),o=this.value;return(!o||i||e.changed())&&(o&&o.each((t=>{t.children&&er(t.data)&&r.rem.push(t.data)})),this.value=o=hk({values:(0,m.IX)(t.keys).reduce(((t,e)=>(t.key(e),t)),gE()).entries(r.source)},mE),n&&o.each((t=>{t.children&&(t=rr(t.data),r.add.push(t),r.source.push(t))})),hE(o,nr,nr)),r.source.root=o,r}});const yE=(t,e)=>t.parent===e.parent?1:2;(0,m.XW)(vE,Rr,{transform(t,e){e.source&&e.source.root||(0,m.vU)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),i=this.fields,r=e.source.root,o=t.as||i;t.field?r.sum(t.field):r.count(),t.sort&&r.sort(cr(t.sort,(t=>t.data))),function(t,e,n){for(let i,r=0,o=e.length;r<o;++r)i=e[r],i in n&&t[i](n[i])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?yE:m.kX);try{this.value=n(r)}catch(a){(0,m.vU)(a)}return r.each((t=>function(t,e,n){const i=t.data,r=e.length-1;for(let o=0;o<r;++o)i[n[o]]=t[e[o]];i[n[r]]=t.children?t.children.length:0}(t,i,o))),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const bE=["x","y","r","depth","children"];function xE(t){vE.call(this,t)}xE.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:bE.length,default:bE}]},(0,m.XW)(xE,vE,{layout:function(){var t=null,e=1,n=1,i=_k;function r(r){const o=function(){let t=1;return()=>(t=(kk*t+Ek)%Dk)/Dk}();return r.x=e/2,r.y=n/2,t?r.eachBefore(Ik(t)).eachAfter(Uk(i,.5,o)).eachBefore(qk(1)):r.eachBefore(Ik(Bk)).eachAfter(Uk(_k,1,o)).eachAfter(Uk(i,r.r/Math.min(e,n),o)).eachBefore(qk(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=bk(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"===typeof t?t:wk(+t),r):i},r},params:["radius","size","padding"],fields:bE});const _E=["x0","y0","x1","y1","depth","children"];function wE(t){vE.call(this,t)}function kE(t){Rr.call(this,null,t)}wE.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:_E.length,default:_E}]},(0,m.XW)(wE,vE,{layout:function(){var t=1,e=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/o,r.eachBefore(function(t,e){return function(i){i.children&&Hk(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,o=i.y0,a=i.x1-n,s=i.y1-n;a<r&&(r=a=(r+a)/2),s<o&&(o=s=(o+s)/2),i.x0=r,i.y0=o,i.x1=a,i.y1=s}}(e,o)),i&&r.eachBefore(Wk),r}return r.round=function(t){return arguments.length?(i=!!t,r):i},r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]},r.padding=function(t){return arguments.length?(n=+t,r):n},r},params:["size","round","padding"],fields:_E}),kE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,m.XW)(kE,Rr,{transform(t,e){e.source||(0,m.vU)("Stratify transform requires an upstream data source.");let n=this.value;const i=t.modified(),r=e.fork(e.ALL).materialize(e.SOURCE),o=!n||i||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?hE(Yk().id(t.key).parentId(t.parentKey)(r.source),t.key,m.yb):hE(Yk()([{}]),t.key,t.key)),r.source.root=this.value=n,r}});const EE={tidy:function(){var t=Qk,e=1,n=1,i=null;function r(r){var c=function(t){for(var e,n,i,r,o,a=new rE(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new rE(i[r],r)),n.parent=e;return(a.parent=new rE(null,0)).children=[a],a}(r);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),i)r.eachBefore(s);else{var l=r,u=r,f=r;r.eachBefore((function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)}));var d=l===u?1:t(l,u)/2,h=d-l.x,p=e/(u.x+d+h),m=n/(f.depth||1);r.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*m}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,d=c.m;s=eE(s),o=tE(o),s&&o;)c=tE(c),(a=eE(a)).a=e,(r=s.z+f-o.z-l+t(s._,o._))>0&&(nE(iE(s,e,i),e,r),l+=r,u+=r),f+=s.m,l+=o.m,d+=c.m,u+=a.m;s&&!eE(a)&&(a.t=s,a.m+=f-u),o&&!tE(c)&&(c.t=o,c.m+=l-d,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},cluster:function(){var t=oE,e=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(aE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(sE,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(r),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}},DE=["x","y","depth","children"];function AE(t){vE.call(this,t)}function SE(t){Rr.call(this,[],t)}AE.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:DE.length,default:DE}]},(0,m.XW)(AE,vE,{layout(t){const e=t||"tidy";if((0,m.nr)(EE,e))return EE[e]();(0,m.vU)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:DE}),SE.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,m.XW)(SE,Rr,{transform(t,e){const n=this.value,i=e.source&&e.source.root,r=e.fork(e.NO_SOURCE),o={};return i||(0,m.vU)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(r.rem=n,e.visit(e.SOURCE,(t=>o[nr(t)]=1)),i.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[nr(e)]&&o[nr(n)]&&r.add.push(rr({source:n,target:e}))})),this.value=r.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[nr(t)]=1)),n.forEach((t=>{(o[nr(t.source)]||o[nr(t.target)])&&r.mod.push(t)}))),r}});const CE={binary:function(t,e,n,i,r){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,i,r,o,a,c){if(e>=n-1){var u=s[e];return u.x0=r,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],d=i/2+f,h=e+1,p=n-1;for(;h<p;){var m=h+p>>>1;l[m]<d?h=m+1:p=m}d-l[h-1]<l[h]-d&&e+1<h&&--h;var g=l[h]-f,v=i-g;if(a-r>c-o){var y=i?(r*v+a*g)/i:a;t(e,h,g,r,o,y,c),t(h,n,v,y,o,a,c)}else{var b=i?(o*v+c*g)/i:c;t(e,h,g,r,o,a,b),t(h,n,v,r,b,a,c)}}(0,c,t.value,e,n,i,r)},dice:Hk,slice:cE,slicedice:function(t,e,n,i,r){(1&t.depth?cE:Hk)(t,e,n,i,r)},squarify:fE,resquarify:dE},FE=["x0","y0","x1","y1","depth","children"];function ME(t){vE.call(this,t)}ME.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:FE.length,default:FE}]},(0,m.XW)(ME,vE,{layout(){const t=function(){var t=fE,e=!1,n=1,i=1,r=[0],o=_k,a=_k,s=_k,c=_k,l=_k;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(f),r=[0],e&&t.eachBefore(Wk),t}function f(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<i&&(i=f=(i+f)/2),d<u&&(u=d=(u+d)/2),e.x0=i,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=r[e.depth+1]=o(e)/2,i+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<i&&(i=f=(i+f)/2),(d-=c(e)-n)<u&&(u=d=(u+d)/2),t(e,i,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],i=+t[1],u):[n,i]},u.tile=function(e){return arguments.length?(t=xk(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"===typeof t?t:wk(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"===typeof t?t:wk(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"===typeof t?t:wk(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"===typeof t?t:wk(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"===typeof t?t:wk(+t),u):l},u}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{(0,m.nr)(CE,e)?t.tile(CE[e]):(0,m.vU)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:FE});const OE=4278190080;function TE(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function NE(t,e,n){if(!e.length)return;const i=e[0].mark.marktype;"group"===i?e.forEach((e=>{e.items.forEach((e=>NE(t,e.items,n)))})):Xp[i].draw(t,{items:n?e.map(zE):e})}function zE(t){const e=ar(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const RE=5,PE=31,LE=32,jE=new Uint32Array(LE+1),BE=new Uint32Array(LE+1);BE[0]=0,jE[0]=~BE[0];for(let GN=1;GN<=LE;++GN)BE[GN]=BE[GN-1]<<1|1,jE[GN]=~BE[GN];function IE(t,e,n){const i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),o=~~((e+2*n+i)/i),a=t=>~~((t+n)/i);return a.invert=t=>t*i-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+LE)/LE));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:(e,i)=>{const r=i*t+e;return n[r>>>RE]&1<<(r&PE)},set:(e,n)=>{const r=n*t+e;i(r>>>RE,1<<(r&PE))},clear:(e,n)=>{const i=n*t+e;r(i>>>RE,~(1<<(i&PE)))},getRange:(e,i,r,o)=>{let a,s,c,l,u=o;for(;u>=i;--u)if(a=u*t+e,s=u*t+r,c=a>>>RE,l=s>>>RE,c===l){if(n[c]&jE[a&PE]&BE[1+(s&PE)])return!0}else{if(n[c]&jE[a&PE])return!0;if(n[l]&BE[1+(s&PE)])return!0;for(let t=c+1;t<l;++t)if(n[t])return!0}return!1},setRange:(e,n,r,o)=>{let a,s,c,l,u;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,c=a>>>RE,l=s>>>RE,c===l)i(c,jE[a&PE]&BE[1+(s&PE)]);else for(i(c,jE[a&PE]),i(l,BE[1+(s&PE)]),u=c+1;u<l;++u)i(u,4294967295)},clearRange:(e,n,i,o)=>{let a,s,c,l,u;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,c=a>>>RE,l=s>>>RE,c===l)r(c,BE[a&PE]|jE[1+(s&PE)]);else for(r(c,BE[a&PE]),r(l,jE[1+(s&PE)]),u=c+1;u<l;++u)r(u,0)},outOfBounds:(n,i,r,o)=>n<0||i<0||o>=e||r>=t}}(r,o),a.ratio=i,a.padding=n,a.width=t,a.height=e,a}function UE(t,e,n,i,r,o){let a=n/2;return t-a<0||t+a>r||e-(a=i/2)<0||e+a>o}function qE(t,e,n,i,r,o,a,s){const c=r*o/(2*i),l=t(e-c),u=t(e+c),f=t(n-(o/=2)),d=t(n+o);return a.outOfBounds(l,f,u,d)||a.getRange(l,f,u,d)||s&&s.getRange(l,f,u,d)}const WE=[-1,-1,1,1],HE=[-1,1,-1,1];const XE=["right","center","left"],JE=["bottom","middle","top"];function GE(t,e,n,i,r,o,a,s,c,l,u,f){return!(r.outOfBounds(t,n,e,i)||(f&&o||r).getRange(t,n,e,i))}const $E={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},ZE={naive:function(t,e,n,i){const r=t.width,o=t.height;return function(t){const e=t.datum.datum.items[i].items,n=e.length,a=t.datum.fontSize,s=Dp.width(t.datum,t.datum.text);let c,l,u,f,d,h,p,m=0;for(let i=0;i<n;++i)c=e[i].x,u=e[i].y,l=void 0===e[i].x2?c:e[i].x2,f=void 0===e[i].y2?u:e[i].y2,d=(c+l)/2,h=(u+f)/2,p=Math.abs(l-c+f-u),p>=m&&(m=p,t.x=d,t.y=h);return d=s/2,h=a/2,c=t.x-d,l=t.x+d,u=t.y-h,f=t.y+h,t.align="center",c<0&&l<=r?t.align="left":0<=c&&r<l&&(t.align="right"),t.baseline="middle",u<0&&f<=o?t.baseline="top":0<=u&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1];function c(e,n,i,c,l){const u=t.invert(e),f=t.invert(n);let d,h=i,p=o;if(!UE(u,f,c,l,r,o)&&!qE(t,u,f,l,c,h,a,s)&&!qE(t,u,f,l,c,l,a,null)){for(;p-h>=1;)d=(h+p)/2,qE(t,u,f,l,c,d,a,s)?p=d:h=d;if(h>i)return[u,f,h,!0]}}return function(e){const s=e.datum.datum.items[i].items,l=s.length,u=e.datum.fontSize,f=Dp.width(e.datum,e.datum.text);let d,h,p,m,g,v,y,b,x,_,w,k,E,D,A,S,C,F=n?u:0,M=!1,O=!1,T=0;for(let i=0;i<l;++i){for(d=s[i].x,p=s[i].y,h=void 0===s[i].x2?d:s[i].x2,m=void 0===s[i].y2?p:s[i].y2,d>h&&(C=d,d=h,h=C),p>m&&(C=p,p=m,m=C),x=t(d),w=t(h),_=~~((x+w)/2),k=t(p),D=t(m),E=~~((k+D)/2),y=_;y>=x;--y)for(b=E;b>=k;--b)S=c(y,b,F,f,u),S&&([e.x,e.y,F,M]=S);for(y=_;y<=w;++y)for(b=E;b<=D;++b)S=c(y,b,F,f,u),S&&([e.x,e.y,F,M]=S);M||n||(A=Math.abs(h-d+m-p),g=(d+h)/2,v=(p+m)/2,A>=T&&!UE(g,v,f,u,r,o)&&!qE(t,g,v,u,f,u,a,null)&&(T=A,e.x=g,e.y=v,O=!0))}return!(!M&&!O)&&(g=f/2,v=u/2,a.setRange(t(e.x-g),t(e.y-v),t(e.x+g),t(e.y+v)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1],c=t.bitmap();return function(e){const l=e.datum.datum.items[i].items,u=l.length,f=e.datum.fontSize,d=Dp.width(e.datum,e.datum.text),h=[];let p,m,g,v,y,b,x,_,w,k,E,D,A=n?f:0,S=!1,C=!1,F=0;for(let i=0;i<u;++i){for(p=l[i].x,g=l[i].y,m=void 0===l[i].x2?p:l[i].x2,v=void 0===l[i].y2?g:l[i].y2,h.push([t((p+m)/2),t((g+v)/2)]);h.length;)if([x,_]=h.pop(),!(a.get(x,_)||s.get(x,_)||c.get(x,_))){c.set(x,_);for(let t=0;t<4;++t)y=x+WE[t],b=_+HE[t],c.outOfBounds(y,b,y,b)||h.push([y,b]);if(y=t.invert(x),b=t.invert(_),w=A,k=o,!UE(y,b,d,f,r,o)&&!qE(t,y,b,f,d,w,a,s)&&!qE(t,y,b,f,d,f,a,null)){for(;k-w>=1;)E=(w+k)/2,qE(t,y,b,f,d,E,a,s)?k=E:w=E;w>A&&(e.x=y,e.y=b,A=w,S=!0)}}S||n||(D=Math.abs(m-p+v-g),y=(p+m)/2,b=(g+v)/2,D>=F&&!UE(y,b,d,f,r,o)&&!qE(t,y,b,f,d,f,a,null)&&(F=D,e.x=y,e.y=b,C=!0))}return!(!S&&!C)&&(y=d/2,b=f/2,a.setRange(t(e.x-y),t(e.y-b),t(e.x+y),t(e.y+b)),e.align="center",e.baseline="middle",!0)}}};function YE(t,e,n,i,r,o,a,s,c,l,u){if(!t.length)return t;const f=Math.max(i.length,r.length),d=function(t,e){const n=new Float64Array(e),i=t.length;for(let r=0;r<i;++r)n[r]=t[r]||0;for(let r=i;r<e;++r)n[r]=n[i-1];return n}(i,f),h=function(t,e){const n=new Int8Array(e),i=t.length;for(let r=0;r<i;++r)n[r]|=$E[t[r]];for(let r=i;r<e;++r)n[r]=n[i-1];return n}(r,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,m="group"===p&&t[0].datum.items[c].marktype,g="area"===m,v=function(t,e,n,i){const r=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>r(t.datum):"line"===e?t=>{const e=t.datum.items[i].items;return r(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:r}(p,m,s,c),y=null===l||l===1/0,b=g&&"naive"===u;var x;let _=-1,w=-1;const k=t.map((t=>{const e=y?Dp.width(t,t.text):void 0;return _=Math.max(_,e),w=Math.max(w,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(t),textWidth:e}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...i):l;const E=IE(e[0],e[1],l);let D;if(!b){n&&k.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;t<h.length&&!e;++t)e=5===h[t]||d[t]<0;const i=(p&&a||g)&&t.map((t=>t.datum));D=o.length||i?function(t,e,n,i,r){const o=t.width,a=t.height,s=i||r,c=Xc(o,a).getContext("2d"),l=Xc(o,a).getContext("2d"),u=s&&Xc(o,a).getContext("2d");n.forEach((t=>NE(c,t,!1))),NE(l,e,!1),s&&NE(u,e,!0);const f=TE(c,o,a),d=TE(l,o,a),h=s&&TE(u,o,a),p=t.bitmap(),m=s&&t.bitmap();let g,v,y,b,x,_,w,k;for(v=0;v<a;++v)for(g=0;g<o;++g)x=v*o+g,_=f[x]&OE,k=d[x]&OE,w=s&&h[x]&OE,(_||w||k)&&(y=t(g),b=t(v),r||!_&&!k||p.set(y,b),s&&(_||w)&&m.set(y,b));return[p,m]}(E,i||[],o,e,g):function(t,e){const n=t.bitmap();return(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}(E,a&&k)}const A=g?ZE[u](E,D,a,c):function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1],c=i.length;return function(e){var l;const u=e.boundary,f=e.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>r||u[3]>o)return!1;let d,h,p,m,g,v,y,b,x,_,w,k,E,D,A,S=null!==(l=e.textWidth)&&void 0!==l?l:0;for(let r=0;r<c;++r){if(d=(3&n[r])-1,h=(n[r]>>>2&3)-1,p=0===d&&0===h||i[r]<0,m=d&&h?Math.SQRT1_2:1,g=i[r]<0?-1:1,v=u[1+d]+i[r]*d*m,w=u[4+h]+g*f*h/2+i[r]*h*m,b=w-f/2,x=w+f/2,k=t(v),D=t(b),A=t(x),!S){if(!GE(k,k,D,A,a,s,0,0,0,0,0,p))continue;S=Dp.width(e.datum,e.datum.text)}if(_=v+g*S*d/2,v=_-S/2,y=_+S/2,k=t(v),E=t(y),GE(k,E,D,A,a,s,0,0,0,0,0,p))return e.x=d?d*g<0?y:v:_,e.y=h?h*g<0?x:b:w,e.align=XE[d*g+1],e.baseline=JE[h*g+1],a.setRange(k,D,E,A),!0}return!1}}(E,D,h,d);return k.forEach((t=>t.opacity=+A(t))),k}const VE=["x","y","opacity","align","baseline"],KE=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function QE(t){Rr.call(this,null,t)}function tD(t,e){var n,i,r,o,a,s,c=[],l=function(t){return t(o)};if(null==e)c.push(t);else for(n={},i=0,r=t.length;i<r;++i)o=t[i],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,c.push(s)),s.push(o);return c}function eD(t){Rr.call(this,null,t)}QE.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:KE},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:VE.length,default:VE}]},(0,m.XW)(QE,Rr,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}("sort")))return;t.size&&2===t.size.length||(0,m.vU)("Size parameter should be specified as a [width, height] array.");const i=t.as||VE;return YE(e.materialize(e.SOURCE).source||[],t.size,t.sort,(0,m.IX)(null==t.offset?1:t.offset),(0,m.IX)(t.anchor||KE),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,void 0===t.padding?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[i[0]]=t.x,e[i[1]]=t.y,e[i[2]]=t.opacity,e[i[3]]=t.align,e[i[4]]=t.baseline})),e.reflow(n).modifies(i)}}),eD.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},(0,m.XW)(eD,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=tD(e.materialize(e.SOURCE).source,t.groupby),r=(t.groupby||[]).map(m.el),o=r.length,a=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],s=[];i.forEach((e=>{Ro(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let i=0;i<o;++i)n[r[i]]=e.dims[i];n[a[0]]=t[0],n[a[1]]=t[1],s.push(rr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const nD={constant:_o,linear:Ao,log:So,exp:Co,pow:Fo,quad:Mo,poly:Oo};function iD(t){Rr.call(this,null,t)}iD.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(nD)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},(0,m.XW)(iD,Rr,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=tD(e.materialize(e.SOURCE).source,t.groupby),r=(t.groupby||[]).map(m.el),o=t.method||"linear",a=null==t.order?3:t.order,s=((t,e)=>"poly"===t?e:"quad"===t?2:1)(o,a),c=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],l=nD[o],u=[];let f=t.extent;(0,m.nr)(nD,o)||(0,m.vU)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),i.forEach((n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const i=l(n,t.x,t.y,a);if(t.params)return void u.push(rr({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const d=f||(0,m.We)(n,t.x),h=t=>{const e={};for(let i=0;i<r.length;++i)e[r[i]]=n.dims[i];e[c[0]]=t[0],e[c[1]]=t[1],u.push(rr(e))};"linear"===o||"constant"===o?d.forEach((t=>h([t,i.predict(t)]))):Bo(i.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const rD=134217729,oD=33306690738754706e-32;function aD(t,e,n,i,r){let o,a,s,c,l=e[0],u=i[0],f=0,d=0;u>l===u>-l?(o=l,l=e[++f]):(o=u,u=i[++d]);let h=0;if(f<t&&d<n)for(u>l===u>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=u+o,s=o-(a-u),u=i[++d]),o=a,0!==s&&(r[h++]=s);f<t&&d<n;)u>l===u>-l?(a=o+l,c=a-o,s=o-(a-c)+(l-c),l=e[++f]):(a=o+u,c=a-o,s=o-(a-c)+(u-c),u=i[++d]),o=a,0!==s&&(r[h++]=s);for(;f<t;)a=o+l,c=a-o,s=o-(a-c)+(l-c),l=e[++f],o=a,0!==s&&(r[h++]=s);for(;d<n;)a=o+u,c=a-o,s=o-(a-c)+(u-c),u=i[++d],o=a,0!==s&&(r[h++]=s);return 0===o&&0!==h||(r[h++]=o),h}function sD(t){return new Float64Array(t)}const cD=22204460492503146e-32,lD=11093356479670487e-47,uD=sD(4),fD=sD(8),dD=sD(12),hD=sD(16),pD=sD(4);function mD(t,e,n,i,r,o){const a=(e-o)*(n-r),s=(t-r)*(i-o),c=a-s;if(0===a||0===s||a>0!==s>0)return c;const l=Math.abs(a+s);return Math.abs(c)>=33306690738754716e-32*l?c:-function(t,e,n,i,r,o,a){let s,c,l,u,f,d,h,p,m,g,v,y,b,x,_,w,k,E;const D=t-r,A=n-r,S=e-o,C=i-o;x=D*C,d=rD*D,h=d-(d-D),p=D-h,d=rD*C,m=d-(d-C),g=C-m,_=p*g-(x-h*m-p*m-h*g),w=S*A,d=rD*S,h=d-(d-S),p=S-h,d=rD*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,uD[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,uD[1]=b-(v+f)+(f-w),E=y+v,f=E-y,uD[2]=y-(E-f)+(v-f),uD[3]=E;let F=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,uD),M=cD*a;if(F>=M||-F>=M)return F;if(f=t-D,s=t-(D+f)+(f-r),f=n-A,l=n-(A+f)+(f-r),f=e-S,c=e-(S+f)+(f-o),f=i-C,u=i-(C+f)+(f-o),0===s&&0===c&&0===l&&0===u)return F;if(M=lD*a+oD*Math.abs(F),F+=D*u+C*s-(S*l+A*c),F>=M||-F>=M)return F;x=s*C,d=rD*s,h=d-(d-s),p=s-h,d=rD*C,m=d-(d-C),g=C-m,_=p*g-(x-h*m-p*m-h*g),w=c*A,d=rD*c,h=d-(d-c),p=c-h,d=rD*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,pD[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,pD[1]=b-(v+f)+(f-w),E=y+v,f=E-y,pD[2]=y-(E-f)+(v-f),pD[3]=E;const O=aD(4,uD,4,pD,fD);x=D*u,d=rD*D,h=d-(d-D),p=D-h,d=rD*u,m=d-(d-u),g=u-m,_=p*g-(x-h*m-p*m-h*g),w=S*l,d=rD*S,h=d-(d-S),p=S-h,d=rD*l,m=d-(d-l),g=l-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,pD[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,pD[1]=b-(v+f)+(f-w),E=y+v,f=E-y,pD[2]=y-(E-f)+(v-f),pD[3]=E;const T=aD(O,fD,4,pD,dD);x=s*u,d=rD*s,h=d-(d-s),p=s-h,d=rD*u,m=d-(d-u),g=u-m,_=p*g-(x-h*m-p*m-h*g),w=c*l,d=rD*c,h=d-(d-c),p=c-h,d=rD*l,m=d-(d-l),g=l-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,pD[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,pD[1]=b-(v+f)+(f-w),E=y+v,f=E-y,pD[2]=y-(E-f)+(v-f),pD[3]=E;const N=aD(T,dD,4,pD,hD);return hD[N-1]}(t,e,n,i,r,o,l)}sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(8),sD(8),sD(8),sD(4),sD(8),sD(8),sD(8),sD(12);sD(192),sD(192);sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(8),sD(8),sD(8),sD(8),sD(8),sD(8),sD(8),sD(8),sD(8),sD(4),sD(4),sD(4),sD(8),sD(16),sD(16),sD(16),sD(32),sD(32),sD(48),sD(64);sD(1152),sD(1152);sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(4),sD(24),sD(24),sD(24),sD(24),sD(24),sD(24),sD(24),sD(24),sD(24),sD(24),sD(1152),sD(1152),sD(1152),sD(1152),sD(1152),sD(2304),sD(2304),sD(3456),sD(5760),sD(8),sD(8),sD(8),sD(16),sD(24),sD(48),sD(48),sD(96),sD(192),sD(384),sD(384),sD(384),sD(768);sD(96),sD(96),sD(96),sD(1152);const gD=Math.pow(2,-52),vD=new Uint32Array(512);class yD{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:DD;const i=t.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=t[o];r[2*o]=e(i),r[2*o+1]=n(i)}return new yD(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!==typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let D=0;D<o;D++){const e=t[2*D],n=t[2*D+1];e<a&&(a=e),n<s&&(s=n),e>c&&(c=e),n>l&&(l=n),this._ids[D]=D}const u=(a+c)/2,f=(s+l)/2;let d,h,p,m=1/0;for(let D=0;D<o;D++){const e=bD(u,f,t[2*D],t[2*D+1]);e<m&&(d=D,m=e)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let D=0;D<o;D++){if(D===d)continue;const e=bD(g,v,t[2*D],t[2*D+1]);e<m&&e>0&&(h=D,m=e)}let y=t[2*h],b=t[2*h+1],x=1/0;for(let D=0;D<o;D++){if(D===d||D===h)continue;const e=_D(g,v,y,b,t[2*D],t[2*D+1]);e<x&&(p=D,x=e)}let _=t[2*p],w=t[2*p+1];if(x===1/0){for(let i=0;i<o;i++)this._dists[i]=t[2*i]-t[0]||t[2*i+1]-t[1];wD(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,i=-1/0;t<o;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(mD(g,v,y,b,_,w)<0){const t=h,e=y,n=b;h=p,y=_,b=w,p=t,_=e,w=n}const k=function(t,e,n,i,r,o){const a=n-t,s=i-e,c=r-t,l=o-e,u=a*a+s*s,f=c*c+l*l,d=.5/(a*l-s*c),h=t+(l*u-s*f)*d,p=e+(a*f-c*u)*d;return{x:h,y:p}}(g,v,y,b,_,w);this._cx=k.x,this._cy=k.y;for(let D=0;D<o;D++)this._dists[D]=bD(t[2*D],t[2*D+1],k.x,k.y);wD(this._ids,this._dists,0,o-1),this._hullStart=d;let E=3;n[d]=e[p]=h,n[h]=e[d]=p,n[p]=e[h]=d,i[d]=0,i[h]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,v)]=d,r[this._hashKey(y,b)]=h,r[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let D,A,S=0;S<this._ids.length;S++){const o=this._ids[S],a=t[2*o],s=t[2*o+1];if(S>0&&Math.abs(a-D)<=gD&&Math.abs(s-A)<=gD)continue;if(D=a,A=s,o===d||o===h||o===p)continue;let c=0;for(let t=0,e=this._hashKey(a,s);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let l,u=c;for(;l=n[u],mD(a,s,t[2*u],t[2*u+1],t[2*l],t[2*l+1])>=0;)if(u=l,u===c){u=-1;break}if(-1===u)continue;let f=this._addTriangle(u,o,n[u],-1,-1,i[u]);i[o]=this._legalize(f+2),i[u]=f,E++;let m=n[u];for(;l=n[m],mD(a,s,t[2*m],t[2*m+1],t[2*l],t[2*l+1])<0;)f=this._addTriangle(m,o,l,i[o],-1,i[m]),i[o]=this._legalize(f+2),n[m]=m,E--,m=l;if(u===c)for(;l=e[u],mD(a,s,t[2*l],t[2*l+1],t[2*u],t[2*u+1])<0;)f=this._addTriangle(l,o,u,-1,i[u],i[l]),this._legalize(f+2),i[l]=f,n[u]=u,E--,u=l;this._hullStart=e[o]=u,n[u]=e[m]=o,n[o]=m,r[this._hashKey(a,s)]=o,r[this._hashKey(t[2*u],t[2*u+1])]=u}this.hull=new Uint32Array(E);for(let D=0,A=this._hullStart;D<E;D++)this.hull[D]=A,A=n[A];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===r)break;t=vD[--r];continue}const c=a-a%3,l=s+(t+1)%3,u=c+(a+2)%3,f=e[o],d=e[t],h=e[l],p=e[u];if(xD(i[2*f],i[2*f+1],i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1])){e[t]=p,e[a]=f;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(a,n[o]),this._link(o,u);const s=c+(a+1)%3;r<vD.length&&(vD[r++]=s)}else{if(0===r)break;t=vD[--r]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,o),this.trianglesLen+=3,a}}function bD(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}function xD(t,e,n,i,r,o,a,s){const c=t-a,l=e-s,u=n-a,f=i-s,d=r-a,h=o-s,p=u*u+f*f,m=d*d+h*h;return c*(f*m-p*h)-l*(u*m-p*d)+(c*c+l*l)*(u*h-f*d)<0}function _D(t,e,n,i,r,o){const a=n-t,s=i-e,c=r-t,l=o-e,u=a*a+s*s,f=c*c+l*l,d=.5/(a*l-s*c),h=(l*u-s*f)*d,p=(a*f-c*u)*d;return h*h+p*p}function wD(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],o=e[i];let a=r-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=i}else{let r=n+1,o=i;kD(t,n+i>>1,r),e[t[n]]>e[t[i]]&&kD(t,n,i),e[t[r]]>e[t[i]]&&kD(t,r,i),e[t[n]]>e[t[r]]&&kD(t,n,r);const a=t[r],s=e[a];for(;;){do{r++}while(e[t[r]]<s);do{o--}while(e[t[o]]>s);if(o<r)break;kD(t,r,o)}t[n+1]=t[o],t[o]=a,i-r+1>=o-n?(wD(t,e,r,i),wD(t,e,n,o-1)):(wD(t,e,n,o-1),wD(t,e,r,i))}}function kD(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function ED(t){return t[0]}function DD(t){return t[1]}const AD=1e-6;class SD{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(i,",").concat(r):(Math.abs(this._x1-i)>AD||Math.abs(this._y1-r)>AD)&&(this._+="L"+i+","+r),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=i,",").concat(this._y1=r))}rect(t,e,n,i){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+i,"h").concat(-n,"Z")}value(){return this._||null}}class CD{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class FD{constructor(t){let[e,n,i,r]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500];if(!((i=+i)>=(e=+e))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let d,h,p=0,m=0,g=n.length;p<g;p+=3,m+=2){const e=2*n[p],i=2*n[p+1],o=2*n[p+2],a=t[e],s=t[e+1],c=t[i],l=t[i+1],u=t[o],f=t[o+1],g=c-a,v=l-s,y=u-a,b=f-s,x=2*(g*b-v*y);if(Math.abs(x)<1e-9){let e=1e9;const i=2*n[0];e*=Math.sign((t[i]-a)*b-(t[i+1]-s)*y),d=(a+u)/2-e*b,h=(s+f)/2+e*y}else{const t=1/x,e=g*g+v*v,n=y*y+b*b;d=a+(b*e-v*n)*t,h=s+(g*n-y*e)*t}r[m]=d,r[m+1]=h}let o,a,s,c=e[e.length-1],l=4*c,u=t[2*c],f=t[2*c+1];i.fill(0);for(let d=0;d<e.length;++d)c=e[d],o=l,a=u,s=f,l=4*c,u=t[2*c],f=t[2*c+1],i[o+2]=i[l]=s-f,i[o+3]=i[l+1]=u-a}render(t){const e=null==t?t=new SD:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:a}=this;if(r.length<=1)return null;for(let l=0,u=n.length;l<u;++l){const e=n[l];if(e<l)continue;const i=2*Math.floor(l/3),r=2*Math.floor(e/3),a=o[i],s=o[i+1],c=o[r],u=o[r+1];this._renderSegment(a,s,c,u,t)}let s,c=r[r.length-1];for(let l=0;l<r.length;++l){s=c,c=r[l];const e=2*Math.floor(i[c]/3),n=o[e],u=o[e+1],f=4*s,d=this._project(n,u,a[f+2],a[f+3]);d&&this._renderSegment(n,u,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new SD:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new SD:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let o=2;o<r;o+=2)i[o]===i[o-2]&&i[o+1]===i[o-1]||e.lineTo(i[o],i[o+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new CD;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let o;const a=this._regioncode(t,e),s=this._regioncode(n,i);0===a&&0===s?(r.moveTo(t,e),r.lineTo(n,i)):(o=this._clipSegment(t,e,n,i,a,s))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)===e&&(n=+n)===n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[i]==t[o]&&e[i+1]==t[o+1]&&e[(i+2)%r]==t[(o+a-2)%a]&&e[(i+3)%r]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[t];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(e[2*n],e[2*n+1]),s=s%3===2?s-2:s+1,r[s]!==t)break;s=i[s]}while(s!==o&&-1!==s);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let i,r,o,a,s=null,c=e[n-2],l=e[n-1],u=this._regioncode(c,l),f=0;for(let d=0;d<n;d+=2)if(i=c,r=l,c=e[d],l=e[d+1],o=u,u=this._regioncode(c,l),0===o&&0===u)a=f,f=0,s?s.push(c,l):s=[c,l];else{let e,n,d,h,p;if(0===o){if(null===(e=this._clipSegment(i,r,c,l,o,u)))continue;[n,d,h,p]=e}else{if(null===(e=this._clipSegment(c,l,i,r,u,o)))continue;[h,p,n,d]=e,a=f,f=this._edgecode(n,d),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(n,d):s=[n,d]}a=f,f=this._edgecode(h,p),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(h,p):s=[h,p]}if(s)a=f,f=this._edgecode(s[0],s[1]),a&&f&&this._edge(t,a,f,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,i,r,o){for(;;){if(0===r&&0===o)return[t,e,n,i];if(r&o)return null;let a,s,c=r||o;8&c?(a=t+(n-t)*(this.ymax-e)/(i-e),s=this.ymax):4&c?(a=t+(n-t)*(this.ymin-e)/(i-e),s=this.ymin):2&c?(s=e+(i-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(i-e)*(this.xmin-t)/(n-t),a=this.xmin),r?(t=a,e=s,r=this._regioncode(t,e)):(n=a,i=s,o=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,i))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],r,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let c,l=0,u=s.length,f=this._edgecode(s[u-2],s[u-1]);l<u;l+=2)c=f,f=this._edgecode(s[l],s[l+1]),c&&f&&(l=this._edge(t,c,f,s,l),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,i,r){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(t,n,o)||(i.splice(r,0,n,o),r+=2)}if(i.length>4)for(let o=0;o<i.length;o+=2){const t=(o+2)%i.length,e=(o+4)%i.length;(i[o]===i[t]&&i[t]===i[e]||i[o+1]===i[t+1]&&i[t+1]===i[e+1])&&(i.splice(t,2),o-=2)}return r}_project(t,e,n,i){let r,o,a,s=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<s&&(a=this.ymin,o=t+(s=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<s&&(a=this.ymax,o=t+(s=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=r)*i)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const MD=2*Math.PI,OD=Math.pow;function TD(t){return t[0]}function ND(t){return t[1]}function zD(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class RD{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:TD,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ND,i=arguments.length>3?arguments[3]:void 0;return new RD("length"in t?function(t,e,n,i){const r=t.length,o=new Float64Array(2*r);for(let a=0;a<r;++a){const r=t[a];o[2*a]=e.call(i,r,a,t),o[2*a+1]=n.call(i,r,a,t)}return o}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const o of t)yield e.call(i,o,r,t),yield n.call(i,o,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new yD(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let i=0;i<e.length;i+=3){const t=2*e[i],r=2*e[i+1],o=2*e[i+2];if((n[o]-n[t])*(n[r+1]-n[t+1])-(n[r]-n[t])*(n[o+1]-n[t+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,a=e.length/2;o<a;++o){const t=zD(e[2*o],e[2*o+1],r);e[2*o]=t[0],e[2*o+1]=t[1]}this._delaunator=new yD(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,c=n.length;s<c;++s){const t=r[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[t]||(o[t]=s)}for(let s=0,c=i.length;s<c;++s)a[i[s]]=s;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,2===i.length&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new FD(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const s=e[t];if(-1===s)return;let c=s,l=-1;do{if(yield l=o[c],c=c%3===2?c-2:c+1,o[c]!==t)return;if(c=r[c],-1===c){const e=n[(i[t]+1)%n.length];return void(e!==l&&(yield e))}}while(c!==s)}find(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((t=+t)!==t||(e=+e)!==e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:a,triangles:s,points:c}=this;if(-1===i[t]||!c.length)return(t+1)%(c.length>>1);let l=t,u=OD(e-c[2*t],2)+OD(n-c[2*t+1],2);const f=i[t];let d=f;do{let i=s[d];const f=OD(e-c[2*i],2)+OD(n-c[2*i+1],2);if(f<u&&(u=f,l=i),d=d%3===2?d-2:d+1,s[d]!==t)break;if(d=a[d],-1===d){if(d=r[(o[t]+1)%r.length],d!==i&&OD(e-c[2*d],2)+OD(n-c[2*d+1],2)<u)return d;break}}while(d!==f);return l}render(t){const e=null==t?t=new SD:void 0,{points:n,halfedges:i,triangles:r}=this;for(let o=0,a=i.length;o<a;++o){const e=i[o];if(e<o)continue;const a=2*r[o],s=2*r[e];t.moveTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"===typeof t.moveTo||(e=t,t=null),e=void 0==e?2:+e;const n=null==t?t=new SD:void 0,{points:i}=this;for(let r=0,o=i.length;r<o;r+=2){const n=i[r],o=i[r+1];t.moveTo(n+e,o),t.arc(n,o,e,0,MD)}return n&&n.value()}renderHull(t){const e=null==t?t=new SD:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;t.moveTo(i[r],i[r+1]);for(let a=1;a<o;++a){const e=2*n[a];t.lineTo(i[e],i[e+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new CD;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new SD:void 0,{points:i,triangles:r}=this,o=2*r[t*=3],a=2*r[t+1],s=2*r[t+2];return e.moveTo(i[o],i[o+1]),e.lineTo(i[a],i[a+1]),e.lineTo(i[s],i[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new CD;return this.renderTriangle(t,e),e.value()}}function PD(t){Rr.call(this,null,t)}PD.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const LD=[-1e5,-1e5,1e5,1e5];function jD(t){const e=t[0][0],n=t[0][1];let i=t.length-1;for(;t[i][0]===e&&t[i][1]===n;--i);return"M"+t.slice(0,i+1).join("L")+"Z"}(0,m.XW)(PD,Rr,{transform(t,e){const n=t.as||"path",i=e.source;if(!i||!i.length)return e;let r=t.size;r=r?[0,0,r[0],r[1]]:(r=t.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:LD;const o=this.value=RD.from(i,t.x,t.y).voronoi(r);for(let a=0,s=i.length;a<s;++a){const t=o.cellPolygon(a);i[a][n]=t?jD(t):null}return e.reflow(t.modified()).modifies(n)}});var BD=Math.PI/180,ID=64,UD=2048;function qD(){var t,e,n,i,r,o,a,s=[256,256],c=GD,l=[],u=Math.random,f={};function d(t,e,n){for(var i,r,o,a=e.x,l=e.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),d=c(s),h=u()<.5?1:-1,p=-h;(i=d(p+=h))&&(r=~~i[0],o=~~i[1],!(Math.min(Math.abs(r),Math.abs(o))>=f));)if(e.x=a+r,e.y=l+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1])&&(!n||!HD(e,t,s[0]))&&(!n||JD(e,n))){for(var m,g=e.sprite,v=e.width>>5,y=s[0]>>5,b=e.x-(v<<4),x=127&b,_=32-x,w=e.y1-e.y0,k=(e.y+e.y0)*y+(b>>5),E=0;E<w;E++){m=0;for(var D=0;D<=v;D++)t[k+D]|=m<<_|(D<v?(m=g[E*v+D])>>>x:0);k+=y}return e.sprite=null,!0}return!1}return f.layout=function(){for(var c=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(ID<<5)/e,t.height=UD/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Xc()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),h=null,p=l.length,m=-1,g=[],v=l.map((s=>({text:t(s),font:e(s),style:i(s),weight:r(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((t,e)=>e.size-t.size));++m<p;){var y=v[m];y.x=s[0]*(u()+.5)>>1,y.y=s[1]*(u()+.5)>>1,WD(c,y,v,m),y.hasText&&d(f,y,h)&&(g.push(y),h?XD(h,y):h=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=s[0]>>1,y.y-=s[1]>>1)}return g},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=$D(t),f):e},f.fontStyle=function(t){return arguments.length?(i=$D(t),f):i},f.fontWeight=function(t){return arguments.length?(r=$D(t),f):r},f.rotate=function(t){return arguments.length?(o=$D(t),f):o},f.text=function(e){return arguments.length?(t=$D(e),f):t},f.spiral=function(t){return arguments.length?(c=ZD[t]||t,f):c},f.fontSize=function(t){return arguments.length?(n=$D(t),f):n},f.padding=function(t){return arguments.length?(a=$D(t),f):a},f.random=function(t){return arguments.length?(u=t,f):u},f}function WD(t,e,n,i){if(!e.sprite){var r=t.context,o=t.ratio;r.clearRect(0,0,(ID<<5)/o,UD/o);var a,s,c,l,u,f=0,d=0,h=0,p=n.length;for(--i;++i<p;){if(e=n[i],r.save(),r.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=r.measureText(e.text+"m").width*o,c=e.size<<1,e.rotate){var m=Math.sin(e.rotate*BD),g=Math.cos(e.rotate*BD),v=a*g,y=a*m,b=c*g,x=c*m;a=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,c=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else a=a+31>>5<<5;if(c>h&&(h=c),f+a>=ID<<5&&(f=0,d+=h,h=0),d+c>=UD)break;r.translate((f+(a>>1))/o,(d+(c>>1))/o),e.rotate&&r.rotate(e.rotate*BD),r.fillText(e.text,0,0),e.padding&&(r.lineWidth=2*e.padding,r.strokeText(e.text,0,0)),r.restore(),e.width=a,e.height=c,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=r.getImageData(0,0,(ID<<5)/o,UD/o).data,w=[];--i>=0;)if((e=n[i]).hasText){for(s=(a=e.width)>>5,c=e.y1-e.y0,l=0;l<c*s;l++)w[l]=0;if(null==(f=e.xoff))return;d=e.yoff;var k=0,E=-1;for(u=0;u<c;u++){for(l=0;l<a;l++){var D=s*u+(l>>5),A=_[(d+u)*(ID<<5)+(f+l)<<2]?1<<31-l%32:0;w[D]|=A,k|=A}k?E=u:(e.y0++,c--,u--,d++)}e.y1=e.y0+E,e.sprite=w.slice(0,(e.y1-e.y0)*s)}}}function HD(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*n+(a>>5),f=0;f<l;f++){i=0;for(var d=0;d<=o;d++)if((i<<c|(d<o?(i=r[f*o+d])>>>s:0))&e[u+d])return!0;u+=n}return!1}function XD(t,e){var n=t[0],i=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function JD(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function GD(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function $D(t){return"function"===typeof t?t:function(){return t}}var ZD={archimedean:GD,rectangular:function(t){var e=4*t[0]/t[1],n=0,i=0;return function(t){var r=t<0?-1:1;switch(Math.sqrt(1+4*r*t)-r&3){case 0:n+=e;break;case 1:i+=4;break;case 2:n-=e;break;default:i-=4}return[n,i]}}};const YD=["x","y","font","fontSize","fontStyle","fontWeight","angle"],VD=["text","font","rotate","fontSize","fontStyle","fontWeight"];function KD(t){Rr.call(this,qD(),t)}KD.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:YD}]},(0,m.XW)(KD,Rr,{transform(t,e){!t.size||t.size[0]&&t.size[1]||(0,m.vU)("Wordcloud size dimensions must be non-zero.");const n=t.modified();if(!(n||e.changed(e.ADD_REM)||VD.some((function(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}))))return;const i=e.materialize(e.SOURCE).source,r=this.value,o=t.as||YD;let a,s=t.fontSize||14;if((0,m.mf)(s)?a=t.fontSizeRange:s=(0,m.a9)(s),a){const t=s,e=af("sqrt")().domain((0,m.We)(i,t)).range(a);s=n=>e(t(n))}i.forEach((t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0}));const c=r.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random($r).layout(),l=r.size(),u=l[0]>>1,f=l[1]>>1,d=c.length;for(let h,p,m=0;m<d;++m)h=c[m],p=h.datum,p[o[0]]=h.x+u,p[o[1]]=h.y+f,p[o[2]]=h.font,p[o[3]]=h.size,p[o[4]]=h.style,p[o[5]]=h.weight,p[o[6]]=h.rotate;return e.reflow(n).modifies(o)}});var QD=n(24120);const tA=t=>new Uint8Array(t),eA=t=>new Uint16Array(t),nA=t=>new Uint32Array(t);function iA(t,e,n){const i=(e<257?tA:e<65537?eA:nA)(t);return n&&i.set(n),i}function rA(t,e,n){const i=1<<e;return{one:i,zero:~i,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,r=n.bisect(n.range,t.value),o=t.index,a=r[0],s=r[1],c=o.length;let l;for(l=0;l<a;++l)e[o[l]]|=i;for(l=s;l<c;++l)e[o[l]]|=i;return n}}}function oA(){let t=nA(0),e=[],n=0;return{insert:function(i,r,o){if(!r.length)return[];const a=n,s=r.length,c=nA(s);let l,u,f,d=Array(s);for(f=0;f<s;++f)d[f]=i(r[f]),c[f]=f;if(d=function(t,e){return t.sort.call(e,((e,n)=>{const i=t[e],r=t[n];return i<r?-1:i>r?1:0})),(0,QD.Z)(t,e)}(d,c),a)l=e,u=t,e=Array(a+s),t=nA(a+s),function(t,e,n,i,r,o,a,s,c){let l,u=0,f=0;for(l=0;u<i&&f<a;++l)e[u]<r[f]?(s[l]=e[u],c[l]=n[u++]):(s[l]=r[f],c[l]=o[f++]+t);for(;u<i;++u,++l)s[l]=e[u],c[l]=n[u];for(;f<a;++f,++l)s[l]=r[f],c[l]=o[f]+t}(o,l,u,a,d,c,s,e,t);else{if(o>0)for(f=0;f<s;++f)c[f]+=o;e=d,t=c}return n=a+s,{index:c,value:d}},remove:function(i,r){const o=n;let a,s,c;for(s=0;!r[t[s]]&&s<o;++s);for(c=s;s<o;++s)r[a=t[s]]||(t[c]=a,e[c]=e[s],++c);n=o-i},bisect:function(t,i){let r;return i?r=i.length:(i=e,r=n),[(0,Gc.Nw)(i,t[0],0,r),(0,Gc.ml)(i,t[1],0,r)]},reindex:function(e){for(let i=0,r=n;i<r;++i)t[i]=e[t[i]]},index:()=>t,size:()=>n}}function aA(t){Rr.call(this,function(){let t=8,e=[],n=nA(0),i=iA(0,t),r=iA(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,i=0,r=e.length,o=t.length;i<o;++i)n=t[i],n._index=r++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),s=e;let c,l,u;for(l=0;!n[l]&&l<o;++l)a[l]=e[l],s[l]=l;for(u=l;l<o;++l)c=e[l],n[l]?s[l]=-1:(s[l]=u,i[u]=i[l],r[u]=r[l],a[u]=c,c._index=u++),i[l]=0;return e=a,s},size:()=>e.length,curr:()=>i,prev:()=>r,reset:t=>r[t]=i[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){i[t]|=e},clear(t,e){i[t]&=~e},resize(e,n){(e>i.length||n>t)&&(t=Math.max(n,t),i=iA(e,t,i),r=iA(e,t))}}}(),t),this._indices=null,this._dims=null}function sA(t){Rr.call(this,null,t)}aA.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},(0,m.XW)(aA,Rr,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,i=t.query,r=this._indices={},o=this._dims=[],a=i.length;let s,c,l=0;for(;l<a;++l)s=n[l].fname,c=r[s]||(r[s]=oA()),o.push(rA(c,l,i[l]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),i=t.fields,r=t.query,o=this._indices,a=this._dims,s=this.value,c=s.curr(),l=s.prev(),u=s.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let m,g,v,y,b,x,_,w,k;if(l.set(c),e.rem.length&&(b=this.remove(t,e,n)),e.add.length&&s.add(e.add),e.mod.length)for(x={},y=e.mod,_=0,w=y.length;_<w;++_)x[y[_]._index]=1;for(_=0;_<h;++_)k=i[_],(!a[_]||t.modified("fields",_)||e.modified(k.fields))&&(v=k.fname,(m=p[v])||(o[v]=g=oA(),p[v]=m=g.insert(k,e.source,0)),a[_]=rA(g,_,r[_]).onAdd(m,c));for(_=0,w=s.data().length;_<w;++_)b[_]||(l[_]!==c[_]?f.push(_):x[_]&&c[_]!==u&&d.push(_));return s.mask=(1<<h)-1,n},eval(t,e){const n=e.materialize().fork(),i=this._dims.length;let r=0;return e.rem.length&&(this.remove(t,e,n),r|=(1<<i)-1),t.modified("query")&&!t.modified("fields")&&(r|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),r|=(1<<i)-1),e.mod.length&&(this.modify(e,n),r|=(1<<i)-1),this.value.mask=r,n},insert(t,e,n){const i=e.add,r=this.value,o=this._dims,a=this._indices,s=t.fields,c={},l=n.add,u=r.size()+i.length,f=o.length;let d,h,p,m=r.size();r.resize(u,f),r.add(i);const g=r.curr(),v=r.prev(),y=r.all();for(d=0;d<f;++d)h=s[d].fname,p=c[h]||(c[h]=a[h].insert(s[d],i,m)),o[d].onAdd(p,g);for(;m<u;++m)v[m]=y,g[m]!==y&&l.push(m)},modify(t,e){const n=e.mod,i=this.value,r=i.curr(),o=i.all(),a=t.mod;let s,c,l;for(s=0,c=a.length;s<c;++s)l=a[s]._index,r[l]!==o&&n.push(l)},remove(t,e,n){const i=this._indices,r=this.value,o=r.curr(),a=r.prev(),s=r.all(),c={},l=n.rem,u=e.rem;let f,d,h,p;for(f=0,d=u.length;f<d;++f)h=u[f]._index,c[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&l.push(h);for(h in i)i[h].remove(d,c);return this.reindex(e,d,c),c},reindex(t,e,n){const i=this._indices,r=this.value;t.runAfter((()=>{const t=r.remove(e,n);for(const e in i)i[e].reindex(t)}))},update(t,e,n){const i=this._dims,r=t.query,o=e.stamp,a=i.length;let s,c,l=0;for(n.filters=0,c=0;c<a;++c)t.modified("query",c)&&(s=c,++l);if(1===l)l=i[s].one,this.incrementOne(i[s],r[s],n.add,n.rem);else for(c=0,l=0;c<a;++c)t.modified("query",c)&&(l|=i[c].one,this.incrementAll(i[c],r[c],o,n.add),n.rem=n.add);return l},incrementAll(t,e,n,i){const r=this.value,o=r.seen(),a=r.curr(),s=r.prev(),c=t.index(),l=t.bisect(t.range),u=t.bisect(e),f=u[0],d=u[1],h=l[0],p=l[1],m=t.one;let g,v,y;if(f<h)for(g=f,v=Math.min(h,d);g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;else if(f>h)for(g=h,v=Math.min(f,p);g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;if(d>p)for(g=Math.max(f,p),v=d;g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;else if(d<p)for(g=Math.max(h,d),v=p;g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;t.range=e.slice()},incrementOne(t,e,n,i){const r=this.value.curr(),o=t.index(),a=t.bisect(t.range),s=t.bisect(e),c=s[0],l=s[1],u=a[0],f=a[1],d=t.one;let h,p,m;if(c<u)for(h=c,p=Math.min(u,l);h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(c>u)for(h=u,p=Math.min(c,f);h<p;++h)m=o[h],r[m]^=d,i.push(m);if(l>f)for(h=Math.max(c,f),p=l;h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(l<f)for(h=Math.max(u,l),p=f;h<p;++h)m=o[h],r[m]^=d,i.push(m);t.range=e.slice()}}),sA.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},(0,m.XW)(sA,Rr,{transform(t,e){const n=~(t.ignore||0),i=t.filter,r=i.mask;if(0===(r&n))return e.StopPropagation;const o=e.fork(e.ALL),a=i.data(),s=i.curr(),c=i.prev(),l=t=>s[t]&n?null:a[t];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,(t=>{const e=s[t]&n;return!e&&e^c[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=s[t]&n;return e&&!(0^c[t]&n)?a[t]:null}))):(o.filter(o.ADD,l),o.filter(o.REM,(t=>(s[t]&n)===r?a[t]:null))),o.filter(o.SOURCE,(t=>l(t._index)))}});var cA,lA,uA,fA,dA,hA,pA,mA,gA,vA,yA,bA,xA,_A,wA,kA,EA=n(88120),DA=new jy,AA=new jy,SA={point:cb,lineStart:cb,lineEnd:cb,polygonStart:function(){DA=new jy,SA.lineStart=CA,SA.lineEnd=FA},polygonEnd:function(){var t=+DA;AA.add(t<0?Hy+t:t),this.lineStart=this.lineEnd=this.point=cb},sphere:function(){AA.add(Hy)}};function CA(){SA.point=MA}function FA(){OA(cA,lA)}function MA(t,e){SA.point=OA,cA=t,lA=e,uA=t*=Jy,fA=Yy(e=(e*=Jy)/2+Wy),dA=nb(e)}function OA(t,e){var n=(t*=Jy)-uA,i=n>=0?1:-1,r=i*n,o=Yy(e=(e*=Jy)/2+Wy),a=nb(e),s=dA*a,c=fA*o+s*Yy(r),l=s*i*nb(r);DA.add(Zy(l,c)),uA=t,fA=o,dA=a}var TA,NA,zA,RA,PA,LA,jA,BA,IA,UA,qA,WA,HA,XA,JA,GA,$A={point:ZA,lineStart:VA,lineEnd:KA,polygonStart:function(){$A.point=QA,$A.lineStart=tS,$A.lineEnd=eS,_A=new jy,SA.polygonStart()},polygonEnd:function(){SA.polygonEnd(),$A.point=ZA,$A.lineStart=VA,$A.lineEnd=KA,DA<0?(hA=-(mA=180),pA=-(gA=90)):_A>By?gA=90:_A<-By&&(pA=-90),kA[0]=hA,kA[1]=mA},sphere:function(){hA=-(mA=180),pA=-(gA=90)}};function ZA(t,e){wA.push(kA=[hA=t,mA=t]),e<pA&&(pA=e),e>gA&&(gA=e)}function YA(t,e){var n=Dx([t*Jy,e*Jy]);if(xA){var i=Sx(xA,n),r=Sx([i[1],-i[0],0],i);Mx(r),r=Ex(r);var o,a=t-vA,s=a>0?1:-1,c=r[0]*Xy*s,l=Gy(a)>180;l^(s*vA<c&&c<s*t)?(o=r[1]*Xy)>gA&&(gA=o):l^(s*vA<(c=(c+360)%360-180)&&c<s*t)?(o=-r[1]*Xy)<pA&&(pA=o):(e<pA&&(pA=e),e>gA&&(gA=e)),l?t<vA?nS(hA,t)>nS(hA,mA)&&(mA=t):nS(t,mA)>nS(hA,mA)&&(hA=t):mA>=hA?(t<hA&&(hA=t),t>mA&&(mA=t)):t>vA?nS(hA,t)>nS(hA,mA)&&(mA=t):nS(t,mA)>nS(hA,mA)&&(hA=t)}else wA.push(kA=[hA=t,mA=t]);e<pA&&(pA=e),e>gA&&(gA=e),xA=n,vA=t}function VA(){$A.point=YA}function KA(){kA[0]=hA,kA[1]=mA,$A.point=ZA,xA=null}function QA(t,e){if(xA){var n=t-vA;_A.add(Gy(n)>180?n+(n>0?360:-360):n)}else yA=t,bA=e;SA.point(t,e),YA(t,e)}function tS(){SA.lineStart()}function eS(){QA(yA,bA),SA.lineEnd(),Gy(_A)>By&&(hA=-(mA=180)),kA[0]=hA,kA[1]=mA,xA=null}function nS(t,e){return(e-=t)<0?e+360:e}function iS(t,e){return t[0]-e[0]}function rS(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var oS={sphere:cb,point:aS,lineStart:cS,lineEnd:fS,polygonStart:function(){oS.lineStart=dS,oS.lineEnd=hS},polygonEnd:function(){oS.lineStart=cS,oS.lineEnd=fS}};function aS(t,e){t*=Jy;var n=Yy(e*=Jy);sS(n*Yy(t),n*nb(t),nb(e))}function sS(t,e,n){++TA,zA+=(t-zA)/TA,RA+=(e-RA)/TA,PA+=(n-PA)/TA}function cS(){oS.point=lS}function lS(t,e){t*=Jy;var n=Yy(e*=Jy);XA=n*Yy(t),JA=n*nb(t),GA=nb(e),oS.point=uS,sS(XA,JA,GA)}function uS(t,e){t*=Jy;var n=Yy(e*=Jy),i=n*Yy(t),r=n*nb(t),o=nb(e),a=Zy(rb((a=JA*o-GA*r)*a+(a=GA*i-XA*o)*a+(a=XA*r-JA*i)*a),XA*i+JA*r+GA*o);NA+=a,LA+=a*(XA+(XA=i)),jA+=a*(JA+(JA=r)),BA+=a*(GA+(GA=o)),sS(XA,JA,GA)}function fS(){oS.point=aS}function dS(){oS.point=pS}function hS(){mS(WA,HA),oS.point=aS}function pS(t,e){WA=t,HA=e,t*=Jy,e*=Jy,oS.point=mS;var n=Yy(e);XA=n*Yy(t),JA=n*nb(t),GA=nb(e),sS(XA,JA,GA)}function mS(t,e){t*=Jy;var n=Yy(e*=Jy),i=n*Yy(t),r=n*nb(t),o=nb(e),a=JA*o-GA*r,s=GA*i-XA*o,c=XA*r-JA*i,l=Qy(a,s,c),u=sb(l),f=l&&-u/l;IA.add(f*a),UA.add(f*s),qA.add(f*c),NA+=u,LA+=u*(XA+(XA=i)),jA+=u*(JA+(JA=r)),BA+=u*(GA+(GA=o)),sS(XA,JA,GA)}var gS=n(20905);function vS(t){return t instanceof gS.H?t:new gS.H(t)}const yS="intersect",bS="union",xS="_vgsid_",_S=(0,m.EP)(xS),wS="E",kS="R",ES="R-E",DS="R-LE",AS="R-RE",SS="index:unit";function CS(t,e){for(var n,i,r=e.fields,o=e.values,a=r.length,s=0;s<a;++s)if((i=r[s]).getter=m.EP.getter||(0,m.EP)(i.field),n=i.getter(t),(0,m.J_)(n)&&(n=(0,m.He)(n)),(0,m.J_)(o[s])&&(o[s]=(0,m.He)(o[s])),(0,m.J_)(o[s][0])&&(o[s]=o[s].map(m.He)),i.type===wS){if((0,m.kJ)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===kS){if(!(0,m.u5)(n,o[s]))return!1}else if(i.type===AS){if(!(0,m.u5)(n,o[s],!0,!1))return!1}else if(i.type===ES){if(!(0,m.u5)(n,o[s],!1,!1))return!1}else if(i.type===DS&&!(0,m.u5)(n,o[s],!1,!0))return!1;return!0}const FS=(0,Dt.Z)(_S),MS=FS.left,OS=FS.right;var TS={["".concat(xS,"_union")]:function(){const t=new gS.H;for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];for(const r of n)for(const e of r)t.add(e);return t},["".concat(xS,"_intersect")]:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t=new gS.H(t),n=n.map(vS);t:for(const r of t)for(const e of n)if(!e.has(r)){t.delete(r);continue t}return t},E_union:function(t,e){if(!t.length)return e;for(var n=0,i=e.length;n<i;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((t=>e.indexOf(t)>=0)):e},R_union:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);return n>i&&(n=e[1],i=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<i&&(t[1]=i),t):[n,i]},R_intersect:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);return n>i&&(n=e[1],i=e[0]),t.length?i<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>i&&(t[1]=i),t):[n,i]}};function NS(t,e,n,i){e[0].type!==EA.t$&&(0,m.vU)("First argument to selection functions must be a string literal.");const r=e[0].value,o="unit",a="@"+o,s=":"+r;(e.length>=2&&(0,m.fj)(e).value)!==yS||(0,m.nr)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,m.nr)(i,s)||(i[s]=n.getData(r).tuplesRef())}function zS(t){const e=this.context.data[t];return e?e.values.value:[]}const RS=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},PS=RS("format"),LS=RS("timeFormat"),jS=RS("utcFormat"),BS=RS("timeParse"),IS=RS("utcParse"),US=new Date(2e3,0,1);function qS(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(US.setYear(2e3),US.setMonth(t),US.setDate(e),LS.call(this,US,n)):""}const WS="%",HS="$";function XS(t,e,n,i){e[0].type!==EA.t$&&(0,m.vU)("First argument to data functions must be a string literal.");const r=e[0].value,o=":"+r;if(!(0,m.nr)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function JS(t,e,n,i){if(e[0].type===EA.t$)GS(n,i,e[0].value);else for(t in n.scales)GS(n,i,t)}function GS(t,e,n){const i=WS+n;if(!(0,m.nr)(e,i))try{e[i]=t.scaleRef(n)}catch(r){}}function $S(t,e){if((0,m.mf)(t))return t;if((0,m.HD)(t)){const n=e.scales[t];return n&&function(t){return t&&!0===t[rf]}(n.value)?n.value:void 0}}function ZS(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=JS,n._range=JS,n._scale=JS;const i=e=>"_["+(e.type===EA.t$?(0,m.m8)(WS+e.value):(0,m.m8)(WS)+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(i(t[0]),")"),_range:t=>"".concat(i(t[0]),".range()"),_scale:e=>"".concat(i(e[0]),"(").concat(t(e[1]),")")}}function YS(t,e){return function(n,i,r){if(n){const e=$S(n,(r||this).context);return e&&e.path[t](i)}return e(i)}}const VS=YS("area",(function(t){return AA=new jy,Ly(t,SA),2*AA})),KS=YS("bounds",(function(t){var e,n,i,r,o,a,s;if(gA=mA=-(hA=pA=1/0),wA=[],Ly(t,$A),n=wA.length){for(wA.sort(iS),e=1,o=[i=wA[0]];e<n;++e)rS(i,(r=wA[e])[0])||rS(i,r[1])?(nS(i[0],r[1])>nS(i[0],i[1])&&(i[1]=r[1]),nS(r[0],i[1])>nS(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(s=nS(i[1],r[0]))>a&&(a=s,hA=r[0],mA=i[1])}return wA=kA=null,hA===1/0||pA===1/0?[[NaN,NaN],[NaN,NaN]]:[[hA,pA],[mA,gA]]})),QS=YS("centroid",(function(t){TA=NA=zA=RA=PA=LA=jA=BA=0,IA=new jy,UA=new jy,qA=new jy,Ly(t,oS);var e=+IA,n=+UA,i=+qA,r=Qy(e,n,i);return r<Iy&&(e=LA,n=jA,i=BA,NA<By&&(e=zA,n=RA,i=PA),(r=Qy(e,n,i))<Iy)?[NaN,NaN]:[Zy(n,e)*Xy,sb(i/r)*Xy]}));function tC(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(i){t.warn(i)}return n[n.length-1]}function eC(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nC(t){const e=(0,Ul.B8)(t);return.2126*eC(e.r)+.7152*eC(e.g)+.0722*eC(e.b)}function iC(t,e){return t===e||t!==t&&e!==e||((0,m.kJ)(t)?!(!(0,m.kJ)(e)||t.length!==e.length)&&function(t,e){for(let n=0,i=t.length;n<i;++n)if(!iC(t[n],e[n]))return!1;return!0}(t,e):!(!(0,m.Kn)(t)||!(0,m.Kn)(e))&&rC(t,e))}function rC(t,e){for(const n in t)if(!iC(t[n],e[n]))return!1;return!0}function oC(t){return e=>rC(t,e)}const aC={};function sC(t){return(0,m.kJ)(t)||ArrayBuffer.isView(t)?t:null}function cC(t){return sC(t)||((0,m.HD)(t)?t:null)}const lC=t=>t.data;function uC(t,e){const n=zS.call(e,t);return n.root&&n.root.lookup||{}}const fC=()=>"undefined"!==typeof window&&window||null;function dC(t,e,n){if(!t)return[];const[i,r]=t,o=(new $d).set(i[0],i[1],r[0],r[1]);return Dg(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=(0,m.IX)(t.marktype),i=(0,m.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!i.length||i.some((e=>t.name===e)))}return e}(e))}const hC={random:()=>$r(),cumulativeNormal:oo,cumulativeLogNormal:fo,cumulativeUniform:yo,densityNormal:ro,densityLogNormal:uo,densityUniform:vo,quantileNormal:ao,quantileLogNormal:ho,quantileUniform:bo,sampleNormal:io,sampleLogNormal:lo,sampleUniform:go,isArray:m.kJ,isBoolean:m.jn,isDate:m.J_,isDefined:t=>void 0!==t,isNumber:m.hj,isObject:m.Kn,isRegExp:m.Kj,isString:m.HD,isTuple:er,isValid:t=>null!=t&&t===t,toBoolean:m.sw,toDate:t=>(0,m.ZU)(t),toNumber:m.He,toString:m.BB,indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return cC(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return sC(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return cC(t).lastIndexOf(...n)},replace:function(t,e,n){return(0,m.mf)(n)&&(0,m.vU)("Function argument passed to replace."),String(t).replace(e,n)},reverse:function(t){return sC(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return cC(t).slice(...n)},flush:m.yl,lerp:m.t7,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),(0,m.l7)(...t)},pad:m.vk,peek:m.fj,pluck:function(t,e){const n=aC[e]||(aC[e]=(0,m.EP)(e));return(0,m.kJ)(t)?t.map(n):n(t)},span:m.yP,inrange:m.u5,truncate:m.$G,rgb:Ul.B8,lab:nu,hcl:lu,hsl:Ul.Ym,luminance:nC,contrast:function(t,e){const n=nC(t),i=nC(e);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:Wo.Z,format:PS,utcFormat:jS,utcParse:IS,utcOffset:ge,utcSequence:be,timeFormat:LS,timeParse:BS,timeOffset:me,timeSequence:ye,timeUnitSpecifier:Ut,monthFormat:function(t){return qS.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return qS.call(this,t,1,"%b")},dayFormat:function(t){return qS.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return qS.call(this,0,2+t,"%a")},quarter:m.mS,utcquarter:m.N3,week:Xt,utcweek:Vt,dayofyear:Ht,utcdayofyear:Yt,warn:function(){return tC(this.context.dataflow,"warn",arguments)},info:function(){return tC(this.context.dataflow,"info",arguments)},debug:function(){return tC(this.context.dataflow,"debug",arguments)},extent:t=>(0,m.We)(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:dC,clampRange:m.l$,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.hypot(n,i)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=fC();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=fC();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return Mu(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,i=this.context.data[t].input;return n.pulse(i,n.changeset().remove(m.yb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?vd(n,e=e||ad(t)):t}},panLinear:m.Dw,panLog:m.mJ,panPow:m.QA,panSymlog:m.Zw,zoomLinear:m.ay,zoomLog:m.dH,zoomPow:m.mK,zoomSymlog:m.bV,encode:function(t,e,n){if(t){const n=this.context.dataflow,i=t.mark.source;n.pulse(i,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,i,r,o){const a=this.context.dataflow,s=this.context.data[t],c=s.input,l=a.stamp();let u,f,d=s.changes;if(!1===a._trigger||!(c.value.length||e||i))return 0;if((!d||d.stamp<l)&&(s.changes=d=a.changeset(),d.stamp=l,a.runAfter((()=>{s.modified=!0,a.pulse(c,d).run()}),!0,1)),n&&(u=!0===n?m.yb:(0,m.kJ)(n)||er(n)?n:oC(n),d.remove(u)),e&&d.insert(e),i&&(u=oC(i),c.value.some(u)?d.remove(u):d.insert(i)),r)for(f in o)d.modify(r,f,o[f]);return 1},lassoAppend:function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const r=(t=(0,m.IX)(t))[t.length-1];return void 0===r||Math.hypot(r[0]-e,r[1]-n)>i?[...t,[e,n]]:t},lassoPath:function(t){return(0,m.IX)(t).reduce(((e,n,i)=>{let[r,o]=n;return e+(0==i?"M ".concat(r,",").concat(o," "):i===t.length-1?" Z":"L ".concat(r,",").concat(o," "))}),"")},intersectLasso:function(t,e,n){const{x:i,y:r,mark:o}=n,a=(new $d).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,c]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),c<a.y1&&(a.y1=c),c>a.y2&&(a.y2=c);return a.translate(i,r),dC([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[a,s]=n[o],[c,l]=n[r];l>e!=s>e&&t<(a-c)*(e-l)/(s-l)+c&&i++}return 1&i}(t.x,t.y,e)))}},pC=["view","item","group","xy","x","y"],mC="this.",gC={},vC={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat((0,m.m8)(HS+t),"]"),functions:function(t){const e=(0,EA.wk)(t);pC.forEach((t=>e[t]="event.vega."+t));for(const n in hC)e[n]=mC+n;return(0,m.l7)(e,ZS(t,hC,gC)),e},constants:EA._G,visitors:gC},yC=(0,EA.YP)(vC);function bC(t,e,n){return 1===arguments.length?hC[t]:(hC[t]=e,n&&(gC[t]=n),yC&&(yC.functions[t]=mC+t),this)}function xC(t,e){const n={};let i;try{t=(0,m.HD)(t)?t:(0,m.m8)(t)+"",i=(0,EA.BJ)(t)}catch(o){(0,m.vU)("Expression parse error: "+t)}i.visit((t=>{if(t.type!==EA.Lt)return;const i=t.callee.name,r=vC.visitors[i];r&&r(i,t.arguments,e,n)}));const r=yC(i);return r.globals.forEach((t=>{const i=HS+t;!(0,m.nr)(n,i)&&e.getSignal(t)&&(n[i]=e.signalRef(t))})),{$expr:(0,m.l7)({code:r.code},e.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}bC("bandwidth",(function(t,e){const n=$S(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),JS),bC("copy",(function(t,e){const n=$S(t,(e||this).context);return n?n.copy():void 0}),JS),bC("domain",(function(t,e){const n=$S(t,(e||this).context);return n?n.domain():[]}),JS),bC("range",(function(t,e){const n=$S(t,(e||this).context);return n&&n.range?n.range():[]}),JS),bC("invert",(function(t,e,n){const i=$S(t,(n||this).context);return i?(0,m.kJ)(e)?(i.invertRange||i.invert)(e):(i.invert||i.invertExtent)(e):void 0}),JS),bC("scale",(function(t,e,n){const i=$S(t,(n||this).context);return i?i(e):void 0}),JS),bC("gradient",(function(t,e,n,i,r){t=$S(t,(r||this).context);const o=Kf(e,n);let a=t.domain(),s=a[0],c=(0,m.fj)(a),l=m.yR;return c-s?l=bf(t,s,c):t=(t.interpolator?af("sequential")().interpolator(t.interpolator()):af("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,c=1]),t.ticks&&(a=t.ticks(+i||15),s!==a[0]&&a.unshift(s),c!==(0,m.fj)(a)&&a.push(c)),a.forEach((e=>o.stop(l(e),t(e)))),o}),JS),bC("geoArea",VS,JS),bC("geoBounds",KS,JS),bC("geoCentroid",QS,JS),bC("geoShape",(function(t,e,n){const i=$S(t,(n||this).context);return function(t){return i?i.path.context(t)(e):""}}),JS),bC("indata",(function(t,e,n){const i=this.context.data[t]["index:"+e],r=i?i.value.get(n):void 0;return r?r.count:r}),(function(t,e,n,i){e[0].type!==EA.t$&&(0,m.vU)("First argument to indata must be a string literal."),e[1].type!==EA.t$&&(0,m.vU)("Second argument to indata must be a string literal.");const r=e[0].value,o=e[1].value,a="@"+o;(0,m.nr)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),bC("data",zS,XS),bC("treePath",(function(t,e,n){const i=uC(t,this),r=i[e],o=i[n];return r&&o?r.path(o).map(lC):void 0}),XS),bC("treeAncestors",(function(t,e){const n=uC(t,this)[e];return n?n.ancestors().map(lC):void 0}),XS),bC("vlSelectionTest",(function(t,e,n){for(var i,r,o,a,s,c=this.context.data[t],l=c?c.values.value:[],u=c?c[SS]&&c[SS].value:void 0,f=n===yS,d=l.length,h=0;h<d;++h)if(i=l[h],u&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=CS(e,i),r[a]=s?-1:++o,s&&1===u.size)return!0;if(!s&&o===u.get(a).count)return!1}else if(f^(s=CS(e,i)))return s;return d&&f}),NS),bC("vlSelectionIdTest",(function(t,e,n){const i=this.context.data[t],r=i?i.values.value:[],o=i?i[SS]&&i[SS].value:void 0,a=n===yS,s=_S(e),c=MS(r,s);if(c===r.length)return!1;if(_S(r[c])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(OS(r,s)-c<o.size)return!1}return!0}),NS),bC("vlSelectionResolve",(function(t,e,n,i){for(var r,o,a,s,c,l,u,f,d,h,p,g,v=this.context.data[t],y=v?v.values.value:[],b={},x={},_={},w=y.length,k=0;k<w;++k)if(s=(r=y[k]).unit,o=r.fields,a=r.values,o&&a){for(p=0,g=o.length;p<g;++p)c=o[p],f=(u=b[c.field]||(b[c.field]={}))[s]||(u[s]=[]),_[c.field]=d=c.type.charAt(0),h=TS["".concat(d,"_union")],u[s]=h(f,(0,m.IX)(a[p]));n&&(f=x[s]||(x[s]=[])).push((0,m.IX)(a).reduce(((t,e,n)=>(t[o[n].field]=e,t)),{}))}else c=xS,l=_S(r),(f=(u=b[c]||(b[c]={}))[s]||(u[s]=[])).push(l),n&&(f=x[s]||(x[s]=[])).push({[xS]:l});if(e=e||bS,b[xS]?b[xS]=TS["".concat(xS,"_").concat(e)](...Object.values(b[xS])):Object.keys(b).forEach((t=>{b[t]=Object.keys(b[t]).map((e=>b[t][e])).reduce(((n,i)=>void 0===n?i:TS["".concat(_[t],"_").concat(e)](n,i)))})),y=Object.keys(x),n&&y.length){b[i?"vlPoint":"vlMulti"]=e===bS?{or:y.reduce(((t,e)=>(t.push(...x[e]),t)),[])}:{and:y.map((t=>({or:x[t]})))}}return b}),NS),bC("vlSelectionTuples",(function(t,e){return t.map((t=>(0,m.l7)(e.fields?{values:e.fields.map((e=>(e.getter||(e.getter=(0,m.EP)(e.field)))(t.datum)))}:{[xS]:_S(t.datum)},e)))}));const _C=(0,m.Rg)(["rule"]),wC=(0,m.Rg)(["group","image","rect"]);function kC(t){return(t+"").toLowerCase()}function EC(t,e,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...e.concat(n));return t&&t.functions?i.bind(t.functions):i}var DC={operator:(t,e)=>EC(t,["_"],e.code),parameter:(t,e)=>EC(t,["datum","_"],e.code),event:(t,e)=>EC(t,["event"],e.code),handler:(t,e)=>EC(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:i}=e;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const t="o["+(0,m.m8)(o)+"]";r+="$=".concat(i[o].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return r+=function(t,e){let n="";return _C[e]||(t.x2&&(t.x?(wC[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(wC[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",EC(t,["item","_"],r)},codegen:{get(t){const e="[".concat(t.map(m.m8).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const i=Function("a","b","var u, v; return "+t.map(((t,i)=>{const r=e[i];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+i]=t,o="this.f".concat(i,"(a)"),a="this.f".concat(i,"(b)")),function(t,e,n,i){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(i,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(i," : ")}(o,a,-r,r)})).join("")+"0;");return n?i.bind(n):i}}};function AC(t,e,n){if(!t||!(0,m.Kn)(t))return t;for(let i,r=0,o=SC.length;r<o;++r)if(i=SC[r],(0,m.nr)(t,i.key))return i.parse(t,e,n);return t}var SC=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||(0,m.vU)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=(0,m.Jy)(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,e,n){t.$params&&e.parseParameters(t.$params,n);const i="e:"+t.$expr.code;return e.fn[i]||(e.fn[i]=(0,m.ZE)(e.parameterExpression(t.$expr),t.$fields))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=(0,m.EP)(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,e){const n=t.$encode,i={};for(const r in n){const t=n[r];i[r]=(0,m.ZE)(e.encodeExpression(t.$expr),t.$fields),i[r].output=t.$output}return i}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,i=(0,m.IX)(t.$compare).map((t=>t&&t.$tupleid?nr:t));return e.fn[n]||(e.fn[n]=(0,m.qu)(i,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,i,r){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(r),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return nr}}];const CC={skip:!0};function FC(t,e,n,i){return new MC(t,e,n,i)}function MC(t,e,n,i){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=i||DC,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function OC(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function TC(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}MC.prototype=OC.prototype={fork(){const t=new OC(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,i=n.dataflow,r=t.value;if(n.set(t.id,e),function(t){return"collect"===kC(t)}(t.type)&&r&&(r.$ingest?i.ingest(e,r.$ingest,r.$format):r.$request?i.preload(e,r.$request,r.$format):i.pulse(e,i.changeset().insert(r))),t.root&&(n.root=e),t.parent){let r=n.get(t.parent.$ref);r?(i.connect(r,[e]),e.targets().add(r)):(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(t.parent.$ref),i.connect(r,[e]),e.targets().add(r)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const i=n.data[o]||(n.data[o]={});t.data[o].forEach((t=>i[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[kC(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,i,r){this.dataflow.on(e,n,i,r,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===kC(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||(0,m.vU)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const i in t){const r=t[i];e[i]=(0,m.kJ)(r)?r.map((t=>AC(t,n,e))):AC(r,n,e)}return e},parseStream:function(t){var e,n=this,i=null!=t.filter?n.eventExpression(t.filter):void 0,r=null!=t.stream?n.get(t.stream):void 0;t.source?r=n.events(t.source,t.type,i):t.merge&&(r=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),r=r.between(e[0],e[1])),t.filter&&(r=r.filter(i)),null!=t.throttle&&(r=r.throttle(+t.throttle)),null!=t.debounce&&(r=r.debounce(+t.debounce)),null==r&&(0,m.vU)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),n.stream(t,r)},parseUpdate:function(t){var e,n=this,i=(0,m.Kn)(i=t.source)?i.$ref:i,r=n.get(i),o=t.update,a=void 0;r||(0,m.vU)("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,r,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var i=n.signals={};Object.keys(e.signals).forEach((n=>{const r=e.signals[n];t.signals(n,r)&&(i[n]=r.value)}))}if(t.data){var r=n.data={};Object.keys(e.data).forEach((n=>{const i=e.data[n];t.data(n,i)&&(r[n]=i.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,i=t.data,r=t.signals;Object.keys(r||{}).forEach((t=>{n.update(e.signals[t],r[t],CC)})),Object.keys(i||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(m.yb).insert(i[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const i=e.subcontext[n];i&&i.setState(t)}))}};const NC="default";function zC(t,e){const n=t.globalCursor()?"undefined"!==typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function RC(t,e){var n=t._runtime.data;return(0,m.nr)(n,e)||(0,m.vU)("Unrecognized data set: "+e),n[e]}function PC(t,e){lr(e)||(0,m.vU)("Second argument to changes must be a changeset.");const n=RC(this,t);return n.modified=!0,this.pulse(n.input,e)}function LC(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function jC(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function BC(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function IC(t,e,n){var i,r,o=t._renderer,a=o&&o.canvas();return a&&(r=BC(t),(i=am(e.changedTouches?e.changedTouches[0]:e,a))[0]-=r[0],i[1]-=r[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const i=e?"group"===e.mark.marktype?e:e.mark.group:null;function r(t){var n,r=i;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function o(t){if(!t)return n;(0,m.HD)(t)&&(t=r(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:(0,m.a9)(t),item:(0,m.a9)(e||{}),group:r,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,i),e}const UC="view",qC={trap:!1};function WC(t,e,n,i){t._eventListeners.push({type:n,sources:(0,m.IX)(e),handler:i})}function HC(t,e,n){const i=t._eventConfig&&t._eventConfig[e];return!(!1===i||(0,m.Kn)(i)&&!i[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function XC(t){return t.item}function JC(t){return t.item.mark.source}function GC(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function $C(t,e,n){const i=document.createElement(t);for(const r in e)i.setAttribute(r,e[r]);return null!=n&&(i.textContent=n),i}const ZC="vega-bind",YC="vega-bind-name",VC="vega-bind-radio";function KC(t,e,n,i){const r=n.event||"input",o=()=>t.update(e.value);i.signal(n.signal,e.value),e.addEventListener(r,o),WC(i,e,r,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!==typeof Event?new Event(t):{type:t}}(r))}}function QC(t,e,n,i){const r=i.signal(n.signal),o=$C("div",{class:ZC}),a="radio"===n.input?o:o.appendChild($C("label"));a.appendChild($C("span",{class:YC},n.name||n.signal)),e.appendChild(o);let s=tF;switch(n.input){case"checkbox":s=eF;break;case"select":s=nF;break;case"radio":s=iF;break;case"range":s=rF}s(t,a,n,r)}function tF(t,e,n,i){const r=$C("input");for(const o in n)"signal"!==o&&"element"!==o&&r.setAttribute("input"===o?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,e.appendChild(r),r.addEventListener("input",(()=>t.update(r.value))),t.elements=[r],t.set=t=>r.value=t}function eF(t,e,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=$C("input",r);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function nF(t,e,n,i){const r=$C("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};oF(t,i)&&(n.selected=!0),r.appendChild($C("option",n,(o[e]||t)+""))})),e.appendChild(r),r.addEventListener("change",(()=>{t.update(n.options[r.selectedIndex])})),t.elements=[r],t.set=t=>{for(let e=0,i=n.options.length;e<i;++e)if(oF(n.options[e],t))return void(r.selectedIndex=e)}}function iF(t,e,n,i){const r=$C("span",{class:VC}),o=n.labels||[];e.appendChild(r),t.elements=n.options.map(((e,a)=>{const s={type:"radio",name:n.signal,value:e};oF(e,i)&&(s.checked=!0);const c=$C("input",s);c.addEventListener("change",(()=>t.update(e)));const l=$C("label",{},(o[a]||e)+"");return l.prepend(c),r.appendChild(l),c})),t.set=e=>{const n=t.elements,i=n.length;for(let t=0;t<i;++t)oF(n[t].value,e)&&(n[t].checked=!0)}}function rF(t,e,n,i){i=void 0!==i?i:(+n.max+ +n.min)/2;const r=null!=n.max?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,a=n.step||(0,N.ly)(o,r,100),s=$C("input",{type:"range",name:n.signal,min:o,max:r,step:a});s.value=i;const c=$C("span",{},+i);e.appendChild(s),e.appendChild(c);const l=()=>{c.textContent=s.value,t.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),t.elements=[s],t.set=t=>{s.value=t,c.textContent=t}}function oF(t,e){return t===e||t+""===e+""}function aF(t,e,n,i,r,o){return(e=e||new i(t.loader())).initialize(n,LC(t),jC(t),BC(t),r,o).background(t.background())}function sF(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function cF(t,e,n){if("string"===typeof e){if("undefined"===typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e&&n)try{e.textContent=""}catch(i){e=null,t.error(i)}return e}const lF=t=>+t||0;function uF(t){return(0,m.Kn)(t)?{top:lF(t.top),bottom:lF(t.bottom),left:lF(t.left),right:lF(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(lF(t))}async function fF(t,e,n,i){const r=Eg(e),o=r&&r.headless;return o||(0,m.vU)("Unrecognized renderer type: "+e),await t.runAsync(),aF(t,null,null,o,n,i).renderAsync(t._scenegraph.root)}var dF="width",hF="height",pF="padding",mF={skip:!0};function gF(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===pF?i.left+i.right:0)}function vF(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===pF?i.top+i.bottom:0)}function yF(t,e){return e.modified&&(0,m.kJ)(e.input.value)&&t.indexOf("_:vega:_")}function bF(t,e){return!("parent"===t||e instanceof Pr.proxy)}function xF(t,e,n,i){const r=t.element();r&&r.setAttribute("title",function(t){return null==t?"":(0,m.kJ)(t)?_F(t):(0,m.Kn)(t)&&!(0,m.J_)(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+((0,m.kJ)(n)?_F(n):wF(n))})).join("\n")):t+"";var e}(i))}function _F(t){return"["+t.map(wF).join(", ")+"]"}function wF(t){return(0,m.kJ)(t)?"[\u2026]":(0,m.Kn)(t)&&!(0,m.J_)(t)?"{\u2026}":t}function kF(t,e){const n=this;if(e=e||{},Nr.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const i=(0,m.l7)({},t.locale,e.locale);n.locale(_i(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||wg.Canvas,n._scenegraph=new Qp;const i=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||xF,n._redraw=!0,n._handler=(new Am).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=(0,m.l7)({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{(0,m.kJ)(t[e])&&(t[e]=(0,m.Rg)(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(t,e,n){return FC(t,Pr,hC,n).parse(e)}(n,t,e.expr);n._runtime=r,n._signals=r.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,m.l7)({},t)}))),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=gF(n,n._width),n._viewHeight=vF(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e[dF],i=e[hF],r=e[pF];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=gF(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=vF(t,e.size),o()}),{size:i});const a=t.add(null,o,{pad:r});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=i.rank+1,a.rank=r.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:NC,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const i=e.value,r=i?(0,m.HD)(i)?i:i.user:NC,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}})),t.add(null,(function(e){let n=e.cursor,i=this.value;return(0,m.HD)(n)||(i=n.item,n=n.user),zC(t,n&&n!==NC?n:i||n),i}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function EF(t,e){return(0,m.nr)(t._signals,e)?t._signals[e]:(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(e))}function DF(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function AF(t,e,n,i){let r=DF(n,i);return r||(r=sF(t,(()=>i(e,n.value))),r.handler=i,t.on(n,null,r)),t}function SF(t,e,n){const i=DF(e,n);return i&&e._targets.remove(i),t}(0,m.XW)(kF,Nr,{async evaluate(t,e,n){if(await Nr.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=BC(t),n=LC(t),i=jC(t);t._renderer.background(t.background()),t._renderer.resize(n,i,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,i)}catch(r){t.error(r)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Ki(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&TC(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const i=EF(this,t);return 1===arguments.length?i.value:this.update(i,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",uF(t)):uF(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(Eg(t)||(0,m.vU)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Nr.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(EF(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,i,r,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(dF,n,mF),a._resizeWidth.skip(!0)),a.height()!==i&&(s=1,a.signal(hF,i,mF),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===r[0]&&a._origin[1]===r[1]||(a._resize=1,a._origin=r),s&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let i=e;return n&&!1===n.trap||(i=sF(this,e),i.raw=e),this._handler.on(t,i),this},removeEventListener(t,e){for(var n,i,r=this._handler.handlers(t),o=r.length;--o>=0;)if(i=r[o].type,n=r[o].handler,t===i&&(e===n||e===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return AF(this,t,EF(this,t),e)},removeSignalListener(t,e){return SF(this,EF(this,t),e)},addDataListener(t,e){return AF(this,t,RC(this,t).values,e)},removeDataListener(t,e){return SF(this,RC(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=zC(this,null);this._globalCursor=!!t,e&&zC(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var i=new Xw.B7,r=e;return null==e?(i.restart(t,e,n),i):(i._restart=i.restart,i.restart=function(t,e,n){e=+e,n=null==n?(0,Xw.zO)():+n,i._restart((function o(a){a+=r,i._restart(o,r+=e,n),t(a)}),e,n)},i.restart(t,e,n),i)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var i,r=this,o=new yr(n),a=function(n,i){r.runAsync(null,(()=>{t===UC&&function(t,e){var n=t._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[e]:r?!r[e]:t.preventDefault()))}(r,e)&&n.preventDefault(),o.receive(IC(r,n,i))}))};if("timer"===t)HC(r,"timer",e)&&r.timer(a,e);else if(t===UC)HC(r,"view",e)&&r.addEventListener(e,a,qC);else if("window"===t?HC(r,"window",e)&&"undefined"!==typeof window&&(i=[window]):"undefined"!==typeof document&&HC(r,"selector",e)&&(i=Array.from(document.querySelectorAll(t))),i){for(var s=0,c=i.length;s<c;++s)i[s].addEventListener(e,a);WC(r,i,e,a)}else r.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,i=this._tooltip,r=this._timers,o=this._eventListeners;for(t=r.length;--t>=0;)r[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",XC),JC,GC(t)),this.on(this.events("view","mouseout",XC),JC,GC(e)),this},data:function(t,e){return arguments.length<2?RC(this,t).values.value:PC.call(this,t,ur().remove(m.yb).insert(e))},change:PC,insert:function(t,e){return PC.call(this,t,ur().insert(e))},remove:function(t,e){return PC.call(this,t,ur().remove(e))},scale:function(t){var e=this._runtime.scales;return(0,m.nr)(e,t)||(0,m.vU)("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Eg(i);t=n._el=t?cF(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),TC(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const a=o.handler||Am,s=t?o.renderer:o.headless;return n._renderer=s?aF(n,n._renderer,t,s):null,n._handler=function(t,e,n,i){const r=new i(t.loader(),sF(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,BC(t),t);return e&&e.handlers().forEach((t=>{r.on(t.type,t.handler)})),r}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==r&&(e=e?n._elBind=cF(n,e,!0):t.appendChild($C("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==r&&(t.element=cF(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(i.signal)&&t.runAsync(null,(()=>{r.source=!0,t.signal(i.signal,e)}))}},i.debounce&&(r.update=(0,m.Ds)(i.debounce,r.update))),(null==i.input&&i.element?KC:QC)(r,e,i,t),r.active||(t.on(t._signals[i.signal],null,(()=>{r.source?r.source=!1:r.set(t.signal(i.signal))})),r.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==wg.Canvas&&t!==wg.SVG&&t!==wg.PNG&&(0,m.vU)("Unrecognized image type: "+t);const n=await fF(this,t,e);return t===wg.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await fF(this,wg.Canvas,t,e)).canvas()},toSVG:async function(t){return(await fF(this,wg.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:yF,signals:bF,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});var CF=n(77155);function FF(t){return(0,m.Kn)(t)?t:{type:t||"pad"}}const MF=t=>+t||0,OF=t=>({top:t,bottom:t,left:t,right:t});function TF(t){return(0,m.Kn)(t)?t.signal?t:{top:MF(t.top),bottom:MF(t.bottom),left:MF(t.left),right:MF(t.right)}:OF(MF(t))}const NF=t=>(0,m.Kn)(t)&&!(0,m.kJ)(t)?(0,m.l7)({},t):{value:t};function zF(t,e,n,i){if(null!=n){return(0,m.Kn)(n)&&!(0,m.kJ)(n)||(0,m.kJ)(n)&&n.length&&(0,m.Kn)(n[0])?t.update[e]=n:t[i||"enter"][e]={value:n},1}return 0}function RF(t,e,n){for(const i in e)zF(t,i,e[i]);for(const i in n)zF(t,i,n[i],"update")}function PF(t,e,n){for(const i in e)n&&(0,m.nr)(n,i)||(t[i]=(0,m.l7)(t[i]||{},e[i]));return t}function LF(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const jF="mark",BF="frame",IF="scope",UF="axis",qF="axis-domain",WF="axis-grid",HF="axis-label",XF="axis-tick",JF="axis-title",GF="legend",$F="legend-band",ZF="legend-entry",YF="legend-gradient",VF="legend-label",KF="legend-symbol",QF="legend-title",tM="title",eM="title-text",nM="title-subtitle";function iM(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const rM=t=>(0,m.HD)(t)?(0,m.m8)(t):t.signal?"(".concat(t.signal,")"):cM(t);function oM(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:(0,m.m8)(t)));for(;e.length&&null==(0,m.fj)(e);)e.pop();return e.unshift(rM(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?aM("hcl",t.h,t.c,t.l):t.h||t.s?aM("hsl",t.h,t.s,t.l):t.l||t.a?aM("lab",t.l,t.a,t.b):t.r||t.g||t.b?aM("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?cM(t.field):void 0!==t.value?(0,m.m8)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=rM(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1===+t.band?"":"*"+sM(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(sM(t.exponent),")")),null!=t.mult&&(e+="*".concat(sM(t.mult))),null!=t.offset&&(e+="+".concat(sM(t.offset))),t.round&&(e="round(".concat(e,")")),e}const aM=(t,e,n,i)=>"(".concat(t,"(").concat([e,n,i].map(oM).join(","),")+'')");function sM(t){return(0,m.Kn)(t)?"("+oM(t)+")":t}function cM(t){return lM((0,m.Kn)(t)?t:{datum:t})}function lM(t){let e,n,i;if(t.signal)e="datum",i=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(i=t.parent,e+=".datum"):i=t.group}else t.datum?(e="datum",i=t.datum):(0,m.vU)("Invalid field reference: "+(0,m.m8)(t));return t.signal||(i=(0,m.HD)(i)?(0,m._k)(i).map(m.m8).join("]["):lM(i)),e+"["+i+"]"}function uM(t,e,n,i,r,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,i,r){const o={},a={};let s,c,l,u;for(c in c="lineBreak","text"!==e||null==r[c]||LF(c,t)||iM(o,c,r[c]),("legend"==n||String(n).startsWith("axis"))&&(n=null),u=n===BF?r.group:n===jF?(0,m.l7)({},r.mark,r[e]):null,u)l=LF(c,t)||("fill"===c||"stroke"===c)&&(LF("fill",t)||LF("stroke",t)),l||iM(o,c,u[c]);for(c in(0,m.IX)(i).forEach((e=>{const n=r.style&&r.style[e];for(const i in n)LF(i,t)||iM(o,i,n[i])})),t=(0,m.l7)({},t),o)u=o[c],u.signal?(s=s||{})[c]=u:a[c]=u;return t.enter=(0,m.l7)(a,t.enter),s&&(t.update=(0,m.l7)(s,t.update)),t}(t,e,n,i,r.config);for(const s in t)a[s]=fM(t[s],e,o,r);return o}function fM(t,e,n,i){const r={},o={};for(const s in t)null!=t[s]&&(r[s]=dM((a=t[s],(0,m.kJ)(a)?function(t){let e="";return t.forEach((t=>{const n=oM(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===(0,m.fj)(e)&&(e+="null"),e}(a):oM(a)),i,n,o));var a;return{$expr:{marktype:e,channels:r},$fields:Object.keys(o),$output:Object.keys(t)}}function dM(t,e,n,i){const r=xC(t,e);return r.$fields.forEach((t=>i[t]=1)),(0,m.l7)(n,r.$params),r.$expr}const hM="outer",pM=["value","update","init","react","bind"];function mM(t,e){(0,m.vU)(t+' for "outer" push: '+(0,m.m8)(e))}function gM(t,e){const n=t.name;if(t.push===hM)e.signals[n]||mM("No prior signal definition",n),pM.forEach((e=>{void 0!==t[e]&&mM("Invalid property ",e)}));else{const i=e.addSignal(n,t.value);!1===t.react&&(i.react=!1),t.bind&&e.addBinding(n,t.bind)}}function vM(t,e,n,i){this.id=-1,this.type=t,this.value=e,this.params=n,i&&(this.parent=i)}function yM(t,e,n,i){return new vM(t,e,n,i)}function bM(t,e){return yM("operator",t,e)}function xM(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function _M(t,e){return e?{$field:t,$name:e}:{$field:t}}const wM=_M("key");function kM(t,e){return{$compare:t,$order:e}}const EM="descending";function DM(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const AM="scope",SM="view";function CM(t){return t&&t.signal}function FM(t){if(CM(t))return!0;if((0,m.Kn)(t))for(const e in t)if(FM(t[e]))return!0;return!1}function MM(t,e){return null!=t?t:e}function OM(t){return t&&t.signal||t}const TM="timer";function NM(t,e){return(t.merge?zM:t.stream?RM:t.type?PM:(0,m.vU)("Invalid stream specification: "+(0,m.m8)(t)))(t,e)}function zM(t,e){const n=t.merge.map((t=>NM(t,e))),i=LM({merge:n},t,e);return e.addStream(i).id}function RM(t,e){const n=LM({stream:NM(t.stream,e)},t,e);return e.addStream(n).id}function PM(t,e){let n;t.type===TM?(n=e.event(TM,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===AM?SM:t||SM}(t.source),t.type);const i=LM({stream:n},t,e);return 1===Object.keys(i).length?n:e.addStream(i).id}function LM(t,e,n){let i=e.between;return i&&(2!==i.length&&(0,m.vU)('Stream "between" parameter must have 2 entries: '+(0,m.m8)(e)),t.between=[NM(i[0],n),NM(i[1],n)]),i=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&i.push(function(t,e,n){const i="event.item";return i+(t&&"*"!==t?"&&"+i+".mark.marktype==='"+t+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===AM&&i.push("inScope(event.item)"),i.length&&(t.filter=xC("("+i.join(")&&(")+")",n).$expr),null!=(i=e.throttle)&&(t.throttle=+i),null!=(i=e.debounce)&&(t.debounce=+i),e.consume&&(t.consume=!0),t}const jM={code:"_.$value",ast:{type:"Identifier",value:"value"}};function BM(t,e,n){const i=t.encode,r={target:n};let o=t.events,a=t.update,s=[];o||(0,m.vU)("Signal update missing events specification."),(0,m.HD)(o)&&(o=(0,CF.r)(o,e.isSubscope()?AM:SM)),o=(0,m.IX)(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[IM(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=i&&(a&&(0,m.vU)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,m.m8)(i)+")"),r.update=(0,m.HD)(a)?xC(a,e):null!=a.expr?xC(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:jM,$params:{$value:e.signalRef(a.signal)}}:(0,m.vU)("Invalid signal update specification."),t.force&&(r.options={force:!0}),s.forEach((t=>e.addUpdate((0,m.l7)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):NM(t,e)}}(t,e),r))))}function IM(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const UM=t=>(e,n,i)=>yM(t,n,e||void 0,i),qM=UM("aggregate"),WM=UM("axisticks"),HM=UM("bound"),XM=UM("collect"),JM=UM("compare"),GM=UM("datajoin"),$M=UM("encode"),ZM=UM("expression"),YM=UM("facet"),VM=UM("field"),KM=UM("key"),QM=UM("legendentries"),tO=UM("load"),eO=UM("mark"),nO=UM("multiextent"),iO=UM("multivalues"),rO=UM("overlap"),oO=UM("params"),aO=UM("prefacet"),sO=UM("projection"),cO=UM("proxy"),lO=UM("relay"),uO=UM("render"),fO=UM("scale"),dO=UM("sieve"),hO=UM("sortitems"),pO=UM("viewlayout"),mO=UM("values");let gO=0;const vO={min:"min",max:"max",count:"sum"};function yO(t,e){const n=e.getScale(t.name).params;let i;for(i in n.domain=wO(t.domain,t,e),null!=t.range&&(n.range=MO(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=bO(t.type||t),null!=t.gamma&&(e.interpolateGamma=bO(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return(0,m.Kn)(t)?{interval:bO(t.interval),step:bO(t.step)}:bO(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||(0,m.kJ)(t)?xO(t,e):e.objectProperty(t)}(t.bins,e)),t)(0,m.nr)(n,i)||"name"===i||(n[i]=bO(t[i],e))}function bO(t,e){return(0,m.Kn)(t)?t.signal?e.signalRef(t.signal):(0,m.vU)("Unsupported object: "+(0,m.m8)(t)):t}function xO(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>bO(t,e)))}function _O(t){(0,m.vU)("Can not find data set: "+(0,m.m8)(t))}function wO(t,e,n){if(t)return t.signal?n.signalRef(t.signal):((0,m.kJ)(t)?kO:t.fields?DO:EO)(t,e,n);null==e.domainMin&&null==e.domainMax||(0,m.vU)("No scale domain defined for domainMin/domainMax to override.")}function kO(t,e,n){return t.map((t=>bO(t,n)))}function EO(t,e,n){const i=n.getData(t.data);return i||_O(t.data),uf(e.type)?i.valuesRef(n,t.field,SO(t.sort,!1)):pf(e.type)?i.domainRef(n,t.field):i.extentRef(n,t.field)}function DO(t,e,n){const i=t.data,r=t.fields.reduce(((t,e)=>(e=(0,m.HD)(e)?{data:i,field:e}:(0,m.kJ)(e)||e.signal?function(t,e){const n="_:vega:_"+gO++,i=XM({});if((0,m.kJ)(t))i.value={$ingest:t};else if(t.signal){const r="setdata("+(0,m.m8)(n)+","+t.signal+")";i.params.input=e.signalRef(r)}return e.addDataPipeline(n,[i,dO({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(uf(e.type)?AO:pf(e.type)?CO:FO)(t,n,r)}function AO(t,e,n){const i=SO(t.sort,!0);let r,o;const a=n.map((t=>{const n=e.getData(t.data);return n||_O(t.data),n.countsRef(e,t.field,i)})),s={groupby:wM,pulse:a};i&&(r=i.op||"count",o=i.field?DM(r,i.field):"count",s.ops=[vO[r]],s.fields=[e.fieldRef(o)],s.as=[o]),r=e.add(qM(s));const c=e.add(XM({pulse:xM(r)}));return o=e.add(mO({field:wM,sort:e.sortRef(i),pulse:xM(c)})),xM(o)}function SO(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!vO[t.op]&&(0,m.vU)("Multiple domain scales can not be sorted using "+t.op):(0,m.vU)("No field provided for sort aggregate op: "+t.op):(0,m.Kn)(t)?t.field="key":t={field:"key"}),t}function CO(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||_O(t.data),n.domainRef(e,t.field)}));return xM(e.add(iO({values:i})))}function FO(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||_O(t.data),n.extentRef(e,t.field)}));return xM(e.add(nO({extents:i})))}function MO(t,e,n){const i=e.config.range;let r=t.range;if(r.signal)return e.signalRef(r.signal);if((0,m.HD)(r)){if(i&&(0,m.nr)(i,r))return MO(t=(0,m.l7)({},t,{range:i[r]}),e,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=uf(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,m.vU)("Unrecognized scale range value: "+(0,m.m8)(r))}else{if(r.scheme)return n.scheme=(0,m.kJ)(r.scheme)?xO(r.scheme,e):bO(r.scheme,e),r.extent&&(n.schemeExtent=xO(r.extent,e)),void(r.count&&(n.schemeCount=bO(r.count,e)));if(r.step)return void(n.rangeStep=bO(r.step,e));if(uf(t.type)&&!(0,m.kJ)(r))return wO(r,t,e);(0,m.kJ)(r)||(0,m.vU)("Unsupported range type: "+(0,m.m8)(r))}return r.map((t=>((0,m.kJ)(t)?xO:bO)(t,e)))}function OO(t,e,n){return(0,m.kJ)(t)?t.map((t=>OO(t,e,n))):(0,m.Kn)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:(0,m.vU)("Unsupported parameter object: "+(0,m.m8)(t)):t}const TO="top",NO="left",zO="right",RO="bottom",PO="center",LO="vertical",jO="start",BO="end",IO="index",UO="label",qO="offset",WO="perc",HO="perc2",XO="value",JO="guide-label",GO="guide-title",$O="group-title",ZO="group-subtitle",YO="symbol",VO="gradient",KO="discrete",QO="size",tT=[QO,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],eT={name:1,style:1,interactive:1},nT={value:0},iT={value:1},rT="group",oT="rect",aT="rule",sT="symbol",cT="text";function lT(t){return t.type=rT,t.interactive=t.interactive||!1,t}function uT(t,e){const n=(n,i)=>MM(t[n],MM(e[n],i));return n.isVertical=n=>LO===MM(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>MM(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>MM(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>MM(t.columns,MM(e.columns,+n.isVertical(!0))),n}function fT(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function dT(t,e,n){return"item.anchor === '".concat(jO,"' ? ").concat(t," : item.anchor === '").concat(BO,"' ? ").concat(e," : ").concat(n)}const hT=dT((0,m.m8)(NO),(0,m.m8)(zO),(0,m.m8)(PO));function pT(t,e){return e?t?(0,m.Kn)(t)?Object.assign({},t,{offset:pT(t.offset,e)}):{value:t,offset:e}:e:t}function mT(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=PF(t.encode,e,eT)):t.interactive=!1,t}function gT(t,e,n,i){const r=uT(t,n),o=r.isVertical(),a=r.gradientThickness(),s=r.gradientLength();let c,l,u,f,d;o?(l=[0,1],u=[0,0],f=a,d=s):(l=[0,0],u=[1,0],f=s,d=a);const h={enter:c={opacity:nT,x:nT,y:nT,width:NF(f),height:NF(d)},update:(0,m.l7)({},c,{opacity:iT,fill:{gradient:e,start:l,stop:u}}),exit:{opacity:nT}};return RF(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),mT({type:oT,role:YF,encode:h},i)}function vT(t,e,n,i,r){const o=uT(t,n),a=o.isVertical(),s=o.gradientThickness(),c=o.gradientLength();let l,u,f,d,h="";a?(l="y",f="y2",u="x",d="width",h="1-"):(l="x",f="x2",u="y",d="height");const p={opacity:nT,fill:{scale:e,field:XO}};p[l]={signal:h+"datum."+WO,mult:c},p[u]=nT,p[f]={signal:h+"datum."+HO,mult:c},p[d]=NF(s);const g={enter:p,update:(0,m.l7)({},p,{opacity:iT}),exit:{opacity:nT}};return RF(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),mT({type:oT,role:$F,key:XO,from:r,encode:g},i)}const yT="datum.".concat(WO,'<=0?"').concat(NO,'":datum.').concat(WO,'>=1?"').concat(zO,'":"').concat(PO,'"'),bT="datum.".concat(WO,'<=0?"').concat(RO,'":datum.').concat(WO,'>=1?"').concat(TO,'":"').concat("middle",'"');function xT(t,e,n,i){const r=uT(t,e),o=r.isVertical(),a=NF(r.gradientThickness()),s=r.gradientLength();let c,l,u,f,d=r("labelOverlap"),h="";const p={enter:c={opacity:nT},update:l={opacity:iT,text:{field:UO}},exit:{opacity:nT}};return RF(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:MM(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=l.baseline={signal:bT},u="y",f="x",h="1-"):(c.align=l.align={signal:yT},c.baseline={value:"top"},u="x",f="y"),c[u]=l[u]={signal:h+"datum."+WO,mult:s},c[f]=l[f]=a,a.offset=MM(t.labelOffset,e.gradientLabelOffset)||0,d=d?{separation:r("labelSeparation"),method:d,order:"datum."+IO}:void 0,mT({type:cT,role:VF,style:JO,key:XO,from:i,encode:p,overlap:d},n)}function _T(t,e,n,i,r){const o=uT(t,e),a=n.entries,s=!(!a||!a.interactive),c=a?a.name:void 0,l=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d="(".concat(r,") ? datum.").concat(qO," : datum.").concat(QO),h=l?NF(l):{field:QO},p="datum.".concat(IO),m="max(1, ".concat(r,")");let g,v,y,b,x;h.mult=.5,g={enter:v={opacity:nT,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:iT,x:v.x,y:v.y},exit:{opacity:nT}};let _=null,w=null;t.fill||(_=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),RF(g,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),tT.forEach((e=>{t[e]&&(y[e]=v[e]={scale:t[e],field:XO})}));const k=mT({type:sT,role:KF,key:XO,from:f,clip:!!l||void 0,encode:g},n.symbols),E=NF(u);E.offset=o("labelOffset"),g={enter:v={opacity:nT,x:{signal:d,offset:E},y:h},update:y={opacity:iT,text:{field:UO},x:v.x,y:v.y},exit:{opacity:nT}},RF(g,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const D=mT({type:cT,role:VF,style:JO,key:XO,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:nT,height:l?NF(l):nT,opacity:nT},exit:{opacity:nT},update:y={opacity:iT,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b="ceil(item.mark.items.length / ".concat(m,")"),y.row.signal="".concat(p,"%").concat(b),y.column.signal="floor(".concat(p," / ").concat(b,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(m,")"),y.column.signal="".concat(p," % ").concat(m),x={field:p}),y.column.signal="(".concat(r,")?").concat(y.column.signal,":").concat(p),lT({role:IF,from:i={facet:{data:i,name:"value",groupby:IO}},encode:PF(g,a,eT),marks:[k,D],name:c,interactive:s,sort:x})}const wT='item.orient === "left"',kT='item.orient === "right"',ET="(".concat(wT," || ").concat(kT,")"),DT="datum.vgrad && ".concat(ET),AT=dT('"top"','"bottom"','"middle"'),ST=dT('"right"','"left"','"center"'),CT="datum.vgrad && ".concat(kT," ? (").concat(ST,") : (").concat(ET," && !(datum.vgrad && ").concat(wT,')) ? "left" : ').concat(hT),FT="item._anchor || (".concat(ET,' ? "middle" : "start")'),MT="".concat(DT," ? (").concat(wT," ? -90 : 90) : 0"),OT="".concat(ET," ? (datum.vgrad ? (").concat(kT,' ? "bottom" : "top") : ').concat(AT,') : "top"');function TT(t,e){let n;return(0,m.Kn)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+NT(t.path)+")":t.sphere&&(n="geoShape("+NT(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function NT(t){return(0,m.Kn)(t)&&t.signal?t.signal:(0,m.m8)(t)}function zT(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===rT?IF:e||jF:e}function RT(t){return{marktype:t.type,name:t.name||void 0,role:t.role||zT(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function PT(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function LT(t,e){const n=Lr(t.type);n||(0,m.vU)("Unrecognized transform type: "+(0,m.m8)(t.type));const i=yM(n.type.toLowerCase(),null,jT(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(i)),i.metadata=n.metadata||{},i}function jT(t,e,n){const i={},r=t.params.length;for(let o=0;o<r;++o){const r=t.params[o];i[r.name]=BT(r,e,n)}return i}function BT(t,e,n){const i=t.type,r=e[t.name];return"index"===i?function(t,e,n){(0,m.HD)(e.from)||(0,m.vU)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==r?"param"===i?function(t,e,n){const i=e[t.name];return t.array?((0,m.kJ)(i)||(0,m.vU)("Expected an array of sub-parameters. Instead: "+(0,m.m8)(i)),i.map((e=>UT(t,e,n)))):UT(t,i,n)}(t,e,n):"projection"===i?n.projectionRef(e[t.name]):t.array&&!CM(r)?r.map((e=>IT(t,e,n))):IT(t,r,n):void(t.required&&(0,m.vU)("Missing required "+(0,m.m8)(e.type)+" parameter: "+(0,m.m8)(t.name)))}function IT(t,e,n){const i=t.type;if(CM(e))return XT(i)?(0,m.vU)("Expression references can not be signals."):JT(i)?n.fieldRef(e):GT(i)?n.compareRef(e):n.signalRef(e.signal);{const r=t.expr||JT(i);return r&&qT(e)?n.exprRef(e.expr,e.as):r&&WT(e)?_M(e.field,e.as):XT(i)?xC(e,n):HT(i)?xM(n.getData(e).values):JT(i)?_M(e):GT(i)?n.compareRef(e):e}}function UT(t,e,n){const i=t.params.length;let r;for(let a=0;a<i;++a){r=t.params[a];for(const t in r.key)if(r.key[t]!==e[t]){r=null;break}if(r)break}r||(0,m.vU)("Unsupported parameter: "+(0,m.m8)(e));const o=(0,m.l7)(jT(r,e,n),r.key);return xM(n.add(oO(o)))}const qT=t=>t&&t.expr,WT=t=>t&&t.field,HT=t=>"data"===t,XT=t=>"expr"===t,JT=t=>"field"===t,GT=t=>"compare"===t;function $T(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:xM(e.getData(t.data).output)}function ZT(t,e,n,i,r){this.scope=t,this.input=e,this.output=n,this.values=i,this.aggregate=r,this.index={}}function YT(t){return(0,m.HD)(t)?t:null}function VT(t,e,n){const i=DM(n.op,n.field);let r;if(e.ops){for(let o=0,a=e.as.length;o<a;++o)if(e.as[o]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((r=n.op.signal)?t.signalRef(r):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(i))}function KT(t,e,n,i,r,o,a){const s=e[n]||(e[n]={}),c=function(t){return(0,m.Kn)(t)?(t.order===EM?"-":"+")+DM(t.op,t.field):""}(o);let l,u,f=YT(r);if(null!=f&&(t=e.scope,f+=c?"|"+c:"",l=s[f]),!l){const n=o?{field:wM,pulse:e.countsRef(t,r,o)}:{field:t.fieldRef(r),pulse:xM(e.output)};c&&(n.sort=t.sortRef(o)),u=t.add(yM(i,void 0,n)),a&&(e.index[r]=u),l=xM(u),null!=f&&(s[f]=l)}return l}function QT(t,e,n){const i=t.remove,r=t.insert,o=t.toggle,a=t.modify,s=t.values,c=e.add(bM()),l=xC("if("+t.trigger+',modify("'+n+'",'+[r,i,o,a,s].map((t=>null==t?"null":t)).join(",")+"),0)",e);c.update=l.$expr,c.params=l.$params}function tN(t,e){const n=zT(t),i=t.type===rT,r=t.from&&t.from.facet,o=t.overlap;let a,s,c,l,u,f,d,h=t.layout||n===IF||n===BF;const p=n===jF||h||r,g=function(t,e,n){let i,r,o,a,s;return t?(i=t.facet)&&(e||(0,m.vU)("Only group marks can be faceted."),null!=i.field?a=s=$T(i,n):(t.data?s=xM(n.getData(t.data).aggregate):(o=LT((0,m.l7)({type:"aggregate",groupby:(0,m.IX)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=$T(i,n),a=s=xM(n.add(o))),r=n.keyRef(i.groupby,!0))):a=xM(n.add(XM(null,[{}]))),a||(a=$T(t,n)),{key:r,pulse:a,parent:s}}(t.from,i,e);s=e.add(GM({key:g.key||(t.key?_M(t.key):void 0),pulse:g.pulse,clean:!i}));const v=xM(s);s=c=e.add(XM({pulse:v})),s=e.add(eO({markdef:RT(t),interactive:PT(t.interactive,e),clip:TT(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:xM(s)}));const y=xM(s);s=l=e.add($M(uM(t.encode,t.type,n,t.style,e,{mod:!1,pulse:y}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=LT(t,e),i=n.metadata;(i.generates||i.changes)&&(0,m.vU)("Mark transforms should not generate new data."),i.nomod||(l.params.mod=!0),n.params.pulse=xM(s),e.add(s=n)})),t.sort&&(s=e.add(hO({sort:e.compareRef(t.sort),pulse:xM(s)})));const b=xM(s);(r||h)&&(h=e.add(pO({layout:e.objectProperty(t.layout),legends:e.legends,mark:y,pulse:b})),f=xM(h));const x=e.add(HM({mark:y,pulse:f||b}));d=xM(x),i&&(p&&(a=e.operators,a.pop(),h&&a.pop()),e.pushState(b,f||d,v),r?function(t,e,n){const i=t.from.facet,r=i.name,o=$T(i,e);let a;i.name||(0,m.vU)("Facet must have a name: "+(0,m.m8)(i)),i.data||(0,m.vU)("Facet must reference a data set: "+(0,m.m8)(i)),i.field?a=e.add(aO({field:e.fieldRef(i.field),pulse:o})):i.groupby?a=e.add(YM({key:e.keyRef(i.groupby),group:xM(e.proxy(n.parent)),pulse:o})):(0,m.vU)("Facet must specify groupby or field: "+(0,m.m8)(i));const s=e.fork(),c=s.add(XM()),l=s.add(dO({pulse:xM(c)}));s.addData(r,new ZT(s,c,c,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const i=e.add(aO({pulse:n.pulse})),r=e.fork();r.add(dO()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(h&&a.push(h),a.push(x))),o&&(d=function(t,e,n){const i=t.method,r=t.bound,o=t.separation,a={separation:CM(o)?n.signalRef(o.signal):o,method:CM(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(r){const t=r.tolerance;a.boundTolerance=CM(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return xM(n.add(rO(a)))}(o,d,e));const _=e.add(uO({pulse:d})),w=e.add(dO({pulse:xM(_)},void 0,e.parent()));null!=t.name&&(u=t.name,e.addData(u,new ZT(e,c,_,w)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&(0,m.vU)("Marks only support modify triggers."),QT(t,e,u)})))}function eN(t,e){const n=e.config.legend,i=t.encode||{},r=uT(t,n),o=i.legend||{},a=o.name||void 0,s=o.interactive,c=o.style,l={};let u,f,d,h=0;tT.forEach((e=>t[e]?(l[e]=t[e],h=h||t[e]):0)),h||(0,m.vU)("Missing valid scale for legend.");const p=function(t,e){let n=t.type||YO;t.type||1!==function(t){return tT.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=lf(e)?VO:ff(e)?KO:YO);return n!==VO?n:ff(e)?KO:VO}(t,e.scaleType(h)),g={title:null!=t.title,scales:l,type:p,vgrad:"symbol"!==p&&r.isVertical()},v=xM(e.add(XM(null,[g]))),y=xM(e.add(QM(f={type:p,scale:e.scaleRef(h),count:e.objectProperty(r("tickCount")),limit:e.property(r("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===VO?(d=[gT(t,h,n,i.gradient),xT(t,n,i.labels,y)],f.count=f.count||e.signalRef("max(2,2*floor((".concat(OM(r.gradientLength()),")/100))"))):p===KO?d=[vT(t,h,n,i.gradient,y),xT(t,n,i.labels,y)]:(u=function(t,e){const n=uT(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[_T(t,n,i,y,OM(u.columns))],f.size=function(t,e,n){const i=OM(iN("size",t,n)),r=OM(iN("strokeWidth",t,n)),o=OM(function(t,e,n){return fT("fontSize",t)||function(t,e,n){const i=e.config.style[n];return i&&i[t]}("fontSize",e,n)}(n[1].encode,e,JO));return xC("max(ceil(sqrt(".concat(i,")+").concat(r,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[lT({role:ZF,from:v,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:u,interactive:s})],g.title&&d.push(function(t,e,n,i){const r=uT(t,e),o={enter:{opacity:nT},update:{opacity:iT,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:nT}};return RF(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:FT},angle:{signal:MT},align:{signal:CT},baseline:{signal:OT},text:t.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),mT({type:cT,role:QF,style:GO,from:i,encode:o},n)}(t,n,i.title,v)),tN(lT({role:GF,from:v,encode:PF(nN(r,t,n),o,eT),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:s,style:c}),e)}function nN(t,e,n){const i={enter:{},update:{}};return RF(i,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),i}function iN(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):fT(t,n[0].encode)}ZT.fromEntries=function(t,e){const n=e.length,i=e[n-1],r=e[n-2];let o=e[0],a=null,s=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);s<n;++s)e[s].params.pulse=xM(e[s-1]),t.add(e[s]),"aggregate"===e[s].type&&(a=e[s]);return new ZT(t,o,r,i,a)},ZT.prototype={countsRef(t,e,n){const i=this,r=i.counts||(i.counts={}),o=YT(e);let a,s,c;return null!=o&&(t=i.scope,a=r[o]),a?n&&n.field&&VT(t,a.agg.params,n):(c={groupby:t.fieldRef(e,"key"),pulse:xM(i.output)},n&&n.field&&VT(t,c,n),s=t.add(qM(c)),a=t.add(XM({pulse:xM(s)})),a={agg:s,ref:xM(a)},null!=o&&(r[o]=a)),a.ref},tuplesRef(){return xM(this.values)},extentRef(t,e){return KT(t,this,"extent","extent",e,!1)},domainRef(t,e){return KT(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return KT(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return KT(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return KT(t,this,"indata","tupleindex",e,!0,!0)}};const rN='item.orient==="'.concat(NO,'"?-90:item.orient==="').concat(zO,'"?90:0');function oN(t,e){const n=uT(t=(0,m.HD)(t)?{text:t}:t,e.config.title),i=t.encode||{},r=i.group||{},o=r.name||void 0,a=r.interactive,s=r.style,c=[],l=xM(e.add(XM(null,[{}])));return c.push(function(t,e,n,i){const r={value:0},o=t.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return RF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),mT({type:cT,role:eM,style:$O,from:i,encode:a},n)}(t,n,function(t){const e=t.encode;return e&&e.title||(0,m.l7)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&c.push(function(t,e,n,i){const r={value:0},o=t.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return RF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),mT({type:cT,role:nM,style:ZO,from:i,encode:a},n)}(t,n,i.subtitle,l)),tN(lT({role:tM,from:l,encode:aN(n,r),marks:c,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),e)}function aN(t,e){const n={enter:{},update:{}};return RF(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:hT},angle:{signal:rN},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),PF(n,e,eT)}function sN(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(LT(t,e))})),t.on&&t.on.forEach((n=>{QT(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const i=[];let r,o,a,s,c,l=null,u=!1,f=!1;t.values?CM(t.values)||FM(t.format)?(i.push(lN(e,t)),i.push(l=cN())):i.push(l=cN({$ingest:t.values,$format:t.format})):t.url?FM(t.url)||FM(t.format)?(i.push(lN(e,t)),i.push(l=cN())):i.push(l=cN({$request:t.url,$format:t.format})):t.source&&(l=r=(0,m.IX)(t.source).map((t=>xM(e.getData(t).output))),i.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],c=s.metadata,l||c.source||i.push(l=cN()),i.push(s),c.generates&&(f=!0),c.modifies&&!f&&(u=!0),c.source?l=s:c.changes&&(l=null);r&&(a=r.length-1,i[0]=lO({derive:u,pulse:a?r:r[0]}),(u||a)&&i.splice(1,0,cN()));l||i.push(cN());return i.push(dO({})),i}(t,e,n))}function cN(t){const e=XM({},t);return e.metadata={source:!0},e}function lN(t,e){return tO({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}const uN=t=>t===RO||t===TO,fN=(t,e,n)=>CM(t)?yN(t.signal,e,n):t===NO||t===TO?e:n,dN=(t,e,n)=>CM(t)?gN(t.signal,e,n):uN(t)?e:n,hN=(t,e,n)=>CM(t)?vN(t.signal,e,n):uN(t)?n:e,pN=(t,e,n)=>CM(t)?bN(t.signal,e,n):t===TO?{value:e}:{value:n},mN=(t,e,n)=>CM(t)?xN(t.signal,e,n):t===zO?{value:e}:{value:n},gN=(t,e,n)=>_N("".concat(t," === '").concat(TO,"' || ").concat(t," === '").concat(RO,"'"),e,n),vN=(t,e,n)=>_N("".concat(t," !== '").concat(TO,"' && ").concat(t," !== '").concat(RO,"'"),e,n),yN=(t,e,n)=>kN("".concat(t," === '").concat(NO,"' || ").concat(t," === '").concat(TO,"'"),e,n),bN=(t,e,n)=>kN("".concat(t," === '").concat(TO,"'"),e,n),xN=(t,e,n)=>kN("".concat(t," === '").concat(zO,"'"),e,n),_N=(t,e,n)=>(e=null!=e?NF(e):e,n=null!=n?NF(n):n,wN(e)&&wN(n)?(e=e?e.signal||(0,m.m8)(e.value):null,n=n?n.signal||(0,m.m8)(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[(0,m.l7)({test:t},e)].concat(n||[])),wN=t=>null==t||1===Object.keys(t).length,kN=(t,e,n)=>({signal:"".concat(t," ? (").concat(DN(e),") : (").concat(DN(n),")")}),EN=(t,e,n,i,r)=>({signal:(null!=i?"".concat(t," === '").concat(NO,"' ? (").concat(DN(i),") : "):"")+(null!=n?"".concat(t," === '").concat(RO,"' ? (").concat(DN(n),") : "):"")+(null!=r?"".concat(t," === '").concat(zO,"' ? (").concat(DN(r),") : "):"")+(null!=e?"".concat(t," === '").concat(TO,"' ? (").concat(DN(e),") : "):"")+"(null)"}),DN=t=>CM(t)?t.signal:null==t?null:(0,m.m8)(t),AN=(t,e)=>0===e?0:CM(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e},SN=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function CN(t,e,n,i){let r;if(e&&(0,m.nr)(e,t))return e[t];if((0,m.nr)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=t[5].toLowerCase()+t.slice(6)}return i[GO][r]}if(t.startsWith("label")){switch(t){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=t[5].toLowerCase()+t.slice(6)}return i[JO][r]}return null}function FN(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function MN(t,e){return{scale:t.scale,range:e}}function ON(t,e,n,i,r){const o=uT(t,e),a=t.orient,s=t.gridScale,c=fN(a,1,-1),l=function(t,e){if(1===e);else if((0,m.Kn)(t)){let n=t=(0,m.l7)({},t);for(;null!=n.mult;){if(!(0,m.Kn)(n.mult))return n.mult=CM(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=(0,m.l7)({},n.mult)}n.mult=e}else t=CM(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,c);let u,f,d;const h={enter:u={opacity:nT},update:d={opacity:iT},exit:f={opacity:nT}};RF(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:XO,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=dN(a,{signal:"height"},{signal:"width"}),v=s?{scale:s,range:0,mult:c,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:c,offset:l}:(0,m.l7)(g,{mult:c,offset:l});return u.x=d.x=dN(a,p,v),u.y=d.y=hN(a,p,v),u.x2=d.x2=hN(a,y),u.y2=d.y2=dN(a,y),f.x=dN(a,p),f.y=hN(a,p),mT({type:aT,role:WF,key:XO,from:i,encode:h},n)}function TN(t,e,n,i,r){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+i+","+r+")"}}function NN(t,e,n,i){const r=uT(t,e),o=t.orient,a=fN(o,-1,1);let s,c;const l={enter:s={opacity:nT,anchor:NF(r("titleAnchor",null)),align:{signal:hT}},update:c=(0,m.l7)({},s,{opacity:iT,text:NF(t.title)}),exit:{opacity:nT}},u={signal:'lerp(range("'.concat(t.scale,'"), ').concat(dT(0,1,.5),")")};return c.x=dN(o,u),c.y=hN(o,u),s.angle=dN(o,nT,AN(a,90)),s.baseline=dN(o,pN(o,RO,TO),{value:RO}),c.angle=s.angle,c.baseline=s.baseline,RF(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),function(t,e,n,i){const r=(t,e)=>null!=t?(n.update[e]=SN(NF(t),n.update[e]),!1):!LF(e,i),o=r(t("titleX"),"x"),a=r(t("titleY"),"y");n.enter.auto=a===o?NF(a):dN(e,NF(a),NF(o))}(r,o,l,n),l.update.align=SN(l.update.align,s.align),l.update.angle=SN(l.update.angle,s.angle),l.update.baseline=SN(l.update.baseline,s.baseline),mT({type:cT,role:JF,style:GO,from:i,encode:l},n)}function zN(t,e){const n=function(t,e){var n,i,r,o=e.config,a=o.style,s=o.axis,c="band"===e.scaleType(t.scale)&&o.axisBand,l=t.orient;if(CM(l)){const t=FN([o.axisX,o.axisY]),e=FN([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},t))n[r]=dN(l,CN(r,o.axisX,s,a),CN(r,o.axisY,s,a));for(r of(i={},e))i[r]=EN(l.signal,CN(r,o.axisTop,s,a),CN(r,o.axisBottom,s,a),CN(r,o.axisLeft,s,a),CN(r,o.axisRight,s,a))}else n=l===TO||l===RO?o.axisX:o.axisY,i=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||i||c?(0,m.l7)({},s,n,i,c):s}(t,e),i=t.encode||{},r=i.axis||{},o=r.name||void 0,a=r.interactive,s=r.style,c=uT(t,n),l=function(t){const e=t("tickBand");let n,i,r=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},i={signal:"(".concat(e.signal,") === 'extent'")},(0,m.Kn)(r)||(r={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(r)})):"extent"===e?(n=1,i=!0,r=0):(n=.5,i=!1):(n=t("bandPosition"),i=t("tickExtra")),{extra:i,band:n,offset:r}}(c),u={scale:t.scale,ticks:!!c("ticks"),labels:!!c("labels"),grid:!!c("grid"),domain:!!c("domain"),title:null!=t.title},f=xM(e.add(XM({},[u]))),d=xM(e.add(WM({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(ON(t,n,i.grid,d,l)),u.ticks&&(p=c("tickSize"),h.push(function(t,e,n,i,r,o){const a=uT(t,e),s=t.orient,c=fN(s,-1,1);let l,u,f;const d={enter:l={opacity:nT},update:f={opacity:iT},exit:u={opacity:nT}};RF(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=NF(r);h.mult=c;const p={scale:t.scale,field:XO,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=dN(s,nT,p),f.y2=l.y2=dN(s,h),u.x=dN(s,p),f.x=l.x=hN(s,nT,p),f.x2=l.x2=hN(s,h),u.y=hN(s,p),mT({type:aT,role:XF,key:XO,from:i,encode:d},n)}(t,n,i.ticks,d,p,l))),u.labels&&(p=u.ticks?p:0,h.push(function(t,e,n,i,r,o){const a=uT(t,e),s=t.orient,c=t.scale,l=fN(s,-1,1),u=OM(a("labelFlush")),f=OM(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===u||!!u;const g=NF(r);g.mult=l,g.offset=NF(a("labelPadding")||0),g.offset.mult=l;const v={scale:c,field:XO,band:.5,offset:pT(o.offset,a("labelOffset"))},y=dN(s,m?TN(c,u,'"left"','"right"','"center"'):{value:"center"},mN(s,"left","right")),b=dN(s,pN(s,"bottom","top"),m?TN(c,u,'"top"','"bottom"','"middle"'):{value:"middle"}),x=TN(c,u,"-(".concat(f,")"),f,0);m=m&&f;const _={opacity:nT,x:dN(s,v,g),y:hN(s,v,g)},w={enter:_,update:p={opacity:iT,text:{field:UO},x:_.x,y:_.y,align:y,baseline:b},exit:{opacity:nT,x:_.x,y:_.y}};RF(w,{dx:!d&&m?dN(s,x):null,dy:!h&&m?hN(s,x):null}),RF(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let E=a("labelOverlap");return E=E||k?{separation:a("labelSeparation"),method:E,order:"datum.index",bound:k?{scale:c,orient:s,tolerance:k}:null}:void 0,p.align!==y&&(p.align=SN(p.align,y)),p.baseline!==b&&(p.baseline=SN(p.baseline,b)),mT({type:cT,role:HF,style:JO,key:XO,from:i,encode:w,overlap:E},n)}(t,n,i.labels,d,p,l))),u.domain&&h.push(function(t,e,n,i){const r=uT(t,e),o=t.orient;let a,s;const c={enter:a={opacity:nT},update:s={opacity:iT},exit:{opacity:nT}};RF(c,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=MN(t,0),u=MN(t,1);return a.x=s.x=dN(o,l,nT),a.x2=s.x2=dN(o,u),a.y=s.y=hN(o,l,nT),a.y2=s.y2=hN(o,u),mT({type:aT,role:qF,from:i,encode:c},n)}(t,n,i.domain,f)),u.title&&h.push(NN(t,n,i.title,f)),tN(lT({role:UF,from:f,encode:PF(RN(c,t),r,eT),marks:h,aria:c("aria"),description:c("description"),zindex:c("zindex"),name:o,interactive:a,style:s}),e)}function RN(t,e){const n={enter:{},update:{}};return RF(n,{orient:t("orient"),offset:t("offset")||0,position:MM(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function PN(t,e,n){const i=(0,m.IX)(t.signals),r=(0,m.IX)(t.scales);return n||i.forEach((t=>gM(t,e))),(0,m.IX)(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},i={};for(const r in t)"name"!==r&&(i[r]=OO(t[r],r,e));for(const r in n)null==i[r]&&(i[r]=OO(n[r],r,e));e.addProjection(t.name,i)}(t,e))),r.forEach((t=>function(t,e){const n=t.type||"linear";sf(n)||(0,m.vU)("Unrecognized scale type: "+(0,m.m8)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),(0,m.IX)(t.data).forEach((t=>sN(t,e))),r.forEach((t=>yO(t,e))),(n||i).forEach((t=>function(t,e){const n=e.getSignal(t.name);let i=t.update;t.init&&(i?(0,m.vU)("Signals can not include both init and update expressions."):(i=t.init,n.initonly=!0)),i&&(i=xC(i,e),n.update=i.$expr,n.params=i.$params),t.on&&t.on.forEach((t=>BM(t,e,n.id)))}(t,e))),(0,m.IX)(t.axes).forEach((t=>zN(t,e))),(0,m.IX)(t.marks).forEach((t=>tN(t,e))),(0,m.IX)(t.legends).forEach((t=>eN(t,e))),t.title&&oN(t.title,e),e.parseLambdas(),e}const LN=t=>PF({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function jN(t,e){const n=e.config,i=xM(e.root=e.add(bM())),r=function(t,e){const n=n=>MM(t[n],e[n]),i=[BN("background",n("background")),BN("autosize",FF(n("autosize"))),BN("padding",TF(n("padding"))),BN("width",n("width")||0),BN("height",n("height")||0)],r=i.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return(0,m.IX)(t.signals).forEach((t=>{(0,m.nr)(r,t.name)?t=(0,m.l7)(r[t.name],t):i.push(t),o[t.name]=t})),(0,m.IX)(e.signals).forEach((t=>{(0,m.nr)(o,t.name)||(0,m.nr)(r,t.name)||i.push(t)})),i}(t,n);r.forEach((t=>gM(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(XM()),a=e.add($M(uM(LN(t.encode),rT,BF,t.style,e,{pulse:xM(o)}))),s=e.add(pO({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:xM(a)}));e.operators.pop(),e.pushState(xM(a),xM(s),null),PN(t,e,r),e.operators.push(s);let c=e.add(HM({mark:i,pulse:xM(s)}));return c=e.add(uO({pulse:xM(c)})),c=e.add(dO({pulse:xM(c)})),e.addData("root",new ZT(e,o,o,c)),e}function BN(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function IN(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function UN(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function qN(t){return((0,m.kJ)(t)?WN:HN)(t)}function WN(t){const e=t.length;let n="[";for(let i=0;i<e;++i){const e=t[i];n+=(i>0?",":"")+((0,m.Kn)(e)?e.signal||qN(e):(0,m.m8)(e))}return n+"]"}function HN(t){let e,n,i="{",r=0;for(e in t)n=t[e],i+=(++r>1?",":"")+(0,m.m8)(e)+":"+((0,m.Kn)(n)?n.signal||qN(n):(0,m.m8)(n));return i+"}"}function XN(t,e,n){return(0,m.Kn)(t)||(0,m.vU)("Input Vega specification must be an object."),e=(0,m.fE)(function(){const t="sans-serif",e="#4c78a8",n="#000",i="#888",r="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:n},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:n,font:t,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:n,font:t,fontSize:10},"guide-title":{fill:n,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:r},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:i,grid:!1,gridWidth:1,gridColor:r,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:i,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:r,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:i,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),e,t.config),jN(t,new IN(e,n)).toRuntime()}IN.prototype=UN.prototype={parse(t){return PN(t,this)},fork(){return new UN(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof vM?xM(t):t;return this.add(cO({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let i,r;t&&(i=t.data||(t.data={}),r=i[e]||(i[e]=[]),r.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const i in e.index)n(e.index[i],t,"index:"+i)}return this},pushState(t,e,n){this._encode.push(xM(this.add(dO({pulse:t})))),this._parent.push(e),this._lookup.push(n?xM(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,m.fj)(this._parent)},encode(){return(0,m.fj)(this._encode)},lookup(){return(0,m.fj)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if((0,m.HD)(t))return _M(t,e);t.signal||(0,m.vU)("Unsupported field reference: "+(0,m.m8)(t));const n=t.signal;let i=this.field[n];if(!i){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=i=xM(this.add(VM(t)))}return i},compareRef(t){let e=!1;const n=t=>CM(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,i=(0,m.IX)(t.field).map(n),r=(0,m.IX)(t.order).map(n);return e?xM(this.add(JM({fields:i,orders:r}))):kM(i,r)},keyRef(t,e){let n=!1;const i=this.signals;return t=(0,m.IX)(t).map((t=>CM(t)?(n=!0,xM(i[t.signal])):t)),n?xM(this.add(KM({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=DM(t.op,t.field),n=t.order||"ascending";return n.signal?xM(this.add(JM({fields:e,orders:this.signalRef(n.signal)}))):kM(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:t,type:e}),this.events[n]=i}return this.events[n]},hasOwnSignal(t){return(0,m.nr)(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&(0,m.vU)("Duplicate signal name: "+(0,m.m8)(t));const n=e instanceof vM?e:this.add(bM(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(t)),this.signals[t]},signalRef(t){return this.signals[t]?xM(this.signals[t]):((0,m.nr)(this.lambdas,t)||(this.lambdas[t]=this.add(bM(null))),xM(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],i=xC(n,this),r=this.lambdas[n];r.params=i.$params,r.update=i.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&(0,m.Kn)(t)?this.signalRef(t.signal||qN(t)):t},exprRef(t,e){const n={expr:xC(t,this)};return e&&(n.expr.$name=e),xM(this.add(ZM(n)))},addBinding(t,e){this.bindings||(0,m.vU)("Nested signals do not support binding: "+(0,m.m8)(t)),this.bindings.push((0,m.l7)({signal:t},e))},addScaleProj(t,e){(0,m.nr)(this.scales,t)&&(0,m.vU)("Duplicate scale or projection name: "+(0,m.m8)(t)),this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,fO(e))},addProjection(t,e){this.addScaleProj(t,sO(e))},getScale(t){return this.scales[t]||(0,m.vU)("Unrecognized scale name: "+(0,m.m8)(t)),this.scales[t]},scaleRef(t){return xM(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){return(0,m.nr)(this.data,t)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t)),this.data[t]=e},getData(t){return this.data[t]||(0,m.vU)("Undefined data set name: "+(0,m.m8)(t)),this.data[t]},addDataPipeline(t,e){return(0,m.nr)(this.data,t)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t)),this.addData(t,ZT.fromEntries(this,e))}};var JN="5.25.0";(0,m.l7)(Pr,i,o,a,s,c,u,l,f,d,h,p)},76248:t=>{"use strict";var e=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,n){var i,r,o;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function t(n,a,s){var c,l,u,f,d,h,p,m,g,v,y,b;if(n&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===(y=JSON.stringify(n,o)))return y;if(p=r-a.length-s,y.length<=p&&(g=y.replace(e,(function(t,e){return e||t+" "}))).length<=p)return g;if(null!=o&&(n=JSON.parse(y),o=void 0),"object"===typeof n&&null!==n){if(m=a+i,u=[],l=0,Array.isArray(n))for(v="[",c="]",p=n.length;l<p;l++)u.push(t(n[l],m,l===p-1?0:1)||"null");else for(v="{",c="}",p=(h=Object.keys(n)).length;l<p;l++)f=h[l],d=JSON.stringify(f)+": ",void 0!==(b=t(n[f],m,d.length+(l===p-1?0:1)))&&u.push(d+b);if(u.length>0)return[v,i+u.join(",\n"+m),c].join("\n"+a)}return y}(t,"",0)}},18959:(t,e,n)=>{"use strict";n.d(e,{Y:()=>l,w:()=>u});var i,r=n(74552),o=180/Math.PI,a={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function s(t,e,n,i,r,a){var s,c,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,l/=c),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*o,skewX:Math.atan(l)*o,scaleX:s,scaleY:c}}function c(t,e,n,i){function o(t){return t.length?t.pop()+" ":""}return function(a,s){var c=[],l=[];return a=t(a),s=t(s),function(t,i,o,a,s,c){if(t!==o||i!==a){var l=s.push("translate(",null,e,null,n);c.push({i:l-4,x:(0,r.Z)(t,o)},{i:l-2,x:(0,r.Z)(i,a)})}else(o||a)&&s.push("translate("+o+e+a+n)}(a.translateX,a.translateY,s.translateX,s.translateY,c,l),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(o(n)+"rotate(",null,i)-2,x:(0,r.Z)(t,e)})):e&&n.push(o(n)+"rotate("+e+i)}(a.rotate,s.rotate,c,l),function(t,e,n,a){t!==e?a.push({i:n.push(o(n)+"skewX(",null,i)-2,x:(0,r.Z)(t,e)}):e&&n.push(o(n)+"skewX("+e+i)}(a.skewX,s.skewX,c,l),function(t,e,n,i,a,s){if(t!==n||e!==i){var c=a.push(o(a)+"scale(",null,",",null,")");s.push({i:c-4,x:(0,r.Z)(t,n)},{i:c-2,x:(0,r.Z)(e,i)})}else 1===n&&1===i||a.push(o(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,c,l),a=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)c[(e=l[n]).i]=e.x(t);return c.join("")}}}var l=c((function(t){const e=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?a:s(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),u=c((function(t){return null==t?a:(i||(i=document.createElementNS("http://www.w3.org/2000/svg","g")),i.setAttribute("transform",t),(t=i.transform.baseVal.consolidate())?s((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):a)}),", ",")",")")},89121:(t,e,n)=>{"use strict";n.d(e,{B7:()=>g,HT:()=>v,zO:()=>p});var i,r,o=0,a=0,s=0,c=1e3,l=0,u=0,f=0,d="object"===typeof performance&&performance.now?performance:Date,h="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function p(){return u||(h(m),u=d.now()+f)}function m(){u=0}function g(){this._call=this._time=this._next=null}function v(t,e,n){var i=new g;return i.restart(t,e,n),i}function y(){u=(l=d.now())+f,o=a=0;try{!function(){p(),++o;for(var t,e=i;e;)(t=u-e._time)>=0&&e._call.call(void 0,t),e=e._next;--o}()}finally{o=0,function(){var t,e,n=i,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:i=e);r=t,x(o)}(),u=0}}function b(){var t=d.now(),e=t-l;e>c&&(f-=e,l=t)}function x(t){o||(a&&(a=clearTimeout(a)),t-u>24?(t<1/0&&(a=setTimeout(y,t-d.now()-f)),s&&(s=clearInterval(s))):(s||(l=d.now(),s=setInterval(b,c)),o=1,h(y)))}g.prototype=v.prototype={constructor:g,restart:function(t,e,n){if("function"!==typeof t)throw new TypeError("callback is not a function");n=(null==n?p():+n)+(null==e?0:+e),this._next||r===this||(r?r._next=this:i=this,r=this),this._call=t,this._time=n,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}}}}]);