streamlit-nightly 1.39.1.dev20241010__py2.py3-none-any.whl → 1.39.1.dev20241011__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 (34) hide show
  1. streamlit/static/asset-manifest.json +13 -14
  2. streamlit/static/index.html +1 -1
  3. streamlit/static/static/js/223.8bd97055.chunk.js +1 -0
  4. streamlit/static/static/js/3224.fb4ce2a4.chunk.js +1 -0
  5. streamlit/static/static/js/4856.03868952.chunk.js +2 -0
  6. streamlit/static/static/js/5849.e92568db.chunk.js +1 -0
  7. streamlit/static/static/js/6073.192808c1.chunk.js +1 -0
  8. streamlit/static/static/js/6141.d2879825.chunk.js +1 -0
  9. streamlit/static/static/js/8148.aed4a6f0.chunk.js +1 -0
  10. streamlit/static/static/js/8237.5de71f48.chunk.js +1 -0
  11. streamlit/static/static/js/{8460.3529d92b.chunk.js → 8460.40cba8ba.chunk.js} +1 -1
  12. streamlit/static/static/js/9923.21b1d895.chunk.js +1 -0
  13. streamlit/static/static/js/9943.d54fcda3.chunk.js +1 -0
  14. streamlit/static/static/js/main.7269acf4.js +28 -0
  15. {streamlit_nightly-1.39.1.dev20241010.dist-info → streamlit_nightly-1.39.1.dev20241011.dist-info}/METADATA +1 -1
  16. {streamlit_nightly-1.39.1.dev20241010.dist-info → streamlit_nightly-1.39.1.dev20241011.dist-info}/RECORD +22 -23
  17. streamlit/static/static/js/1780.3f47c955.chunk.js +0 -1
  18. streamlit/static/static/js/2133.68768c00.chunk.js +0 -1
  19. streamlit/static/static/js/223.7f001ddb.chunk.js +0 -1
  20. streamlit/static/static/js/238.8d3a7d25.chunk.js +0 -1
  21. streamlit/static/static/js/6141.43a8fda3.chunk.js +0 -1
  22. streamlit/static/static/js/7612.3f409b56.chunk.js +0 -2
  23. streamlit/static/static/js/8148.0afeecaa.chunk.js +0 -1
  24. streamlit/static/static/js/8237.b58252d4.chunk.js +0 -1
  25. streamlit/static/static/js/8776.4a234e13.chunk.js +0 -1
  26. streamlit/static/static/js/9923.50362c7d.chunk.js +0 -1
  27. streamlit/static/static/js/9943.29cd4b6c.chunk.js +0 -1
  28. streamlit/static/static/js/main.d13622b4.js +0 -28
  29. /streamlit/static/static/js/{7612.3f409b56.chunk.js.LICENSE.txt → 4856.03868952.chunk.js.LICENSE.txt} +0 -0
  30. /streamlit/static/static/js/{main.d13622b4.js.LICENSE.txt → main.7269acf4.js.LICENSE.txt} +0 -0
  31. {streamlit_nightly-1.39.1.dev20241010.data → streamlit_nightly-1.39.1.dev20241011.data}/scripts/streamlit.cmd +0 -0
  32. {streamlit_nightly-1.39.1.dev20241010.dist-info → streamlit_nightly-1.39.1.dev20241011.dist-info}/WHEEL +0 -0
  33. {streamlit_nightly-1.39.1.dev20241010.dist-info → streamlit_nightly-1.39.1.dev20241011.dist-info}/entry_points.txt +0 -0
  34. {streamlit_nightly-1.39.1.dev20241010.dist-info → streamlit_nightly-1.39.1.dev20241011.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 7612.3f409b56.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7612],{42274:(e,t,n)=>{var i=n(51596),r=n(44777)((function(e,t,n,r){i(e,t,n,r)}));e.exports=r},72037:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>Yy});var i={};n.r(i),n.d(i,{JsonPatchError:()=>v,_areEquals:()=>S,applyOperation:()=>k,applyPatch:()=>$,applyReducer:()=>E,deepClone:()=>x,getValueByPointer:()=>w,validate:()=>D,validator:()=>A});var r={};n.r(r),n.d(r,{compare:()=>R,generate:()=>z,observe:()=>T,unobserve:()=>O});var o={};n.r(o),n.d(o,{accessPathDepth:()=>Ee,accessPathWithDatum:()=>xe,compile:()=>Fm,contains:()=>Z,deepEqual:()=>Ne,deleteNestedProperty:()=>ye,duplicate:()=>H,entries:()=>he,every:()=>te,fieldIntersection:()=>ue,flatAccessWithDatum:()=>be,getFirstDefined:()=>Ae,hasIntersection:()=>se,hasProperty:()=>Pe,hash:()=>Q,internalField:()=>Fe,isBoolean:()=>pe,isEmpty:()=>ce,isEqual:()=>oe,isInternalField:()=>Me,isNullOrFalse:()=>J,isNumeric:()=>Te,keys:()=>fe,logicalExpr:()=>ge,mergeDeep:()=>ne,never:()=>X,normalize:()=>Bu,normalizeAngle:()=>Oe,omit:()=>K,pick:()=>V,prefixGenerator:()=>le,removePathFromField:()=>$e,replaceAll:()=>ke,replacePathInField:()=>we,resetIdCounter:()=>Ce,setEqual:()=>ae,some:()=>ee,stringify:()=>Re,titleCase:()=>ve,unique:()=>re,uniqueId:()=>Se,vals:()=>de,varName:()=>me,version:()=>Mm});var a={};n.r(a),n.d(a,{carbong10:()=>Og,carbong100:()=>zg,carbong90:()=>Tg,carbonwhite:()=>Mg,dark:()=>Rm,excel:()=>Bm,fivethirtyeight:()=>qm,ggplot2:()=>Gm,googlecharts:()=>dg,latimes:()=>Qm,powerbi:()=>Eg,quartz:()=>eg,urbaninstitute:()=>lg,version:()=>Ng,vox:()=>ng});var s=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=Object.prototype.hasOwnProperty;function u(e,t){return l.call(e,t)}function c(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)u(e,r)&&i.push(r);return i}function f(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function d(e){for(var t,n=0,i=e.length;n<i;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0}function h(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function p(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function m(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(m(e[t]))return!0}else if("object"===typeof e)for(var i=c(e),r=i.length,o=0;o<r;o++)if(m(e[i[o]]))return!0;return!1}function g(e,t){var n=[e];for(var i in t){var r="object"===typeof t[i]?JSON.stringify(t[i],null,2):t[i];"undefined"!==typeof r&&n.push(i+": "+r)}return n.join("\n")}var y=function(e){function t(t,n,i,r,o){var a=this.constructor,s=e.call(this,g(t,{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(t,{name:n,index:i,operation:r,tree:o}),s}return s(t,e),t}(Error),v=y,x=f,b={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,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(e,t,n){var i=w(n,this.from);return k(n,{op:"add",path:this.path,value:f(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:S(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},_={add:function(e,t,n){return d(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:b.move,copy:b.copy,test:b.test,_get:b._get};function w(e,t){if(""==t)return e;var n={op:"_get",path:t};return k(e,n),n.value}function k(e,t,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(t,0,e,t.path):A(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=w(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=S(e,t.value),!1===a.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(n)throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}i||(e=f(e));var s=(t.path||"").split("/"),l=e,u=1,c=s.length,h=void 0,m=void 0,g=void 0;for(g="function"==typeof n?n:A;;){if((m=s[u])&&-1!=m.indexOf("~")&&(m=p(m)),r&&("__proto__"==m||"prototype"==m&&u>0&&"constructor"==s[u-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===l[m]?h=s.slice(0,u).join("/"):u==c-1&&(h=t.path),void 0!==h&&g(t,0,e,h)),u++,Array.isArray(l)){if("-"===m)m=l.length;else{if(n&&!d(m))throw new v("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,t,e);d(m)&&(m=~~m)}if(u>=c){if(n&&"add"===t.op&&m>l.length)throw new v("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=_[t.op].call(t,l,m,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(u>=c){if(!1===(a=b[t.op].call(t,l,m,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[m],n&&u<c&&(!l||"object"!==typeof l))throw new v("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function $(e,t,n,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),n&&!Array.isArray(t))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=f(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=k(e,t[a],n,!0,r,a),e=o[a].newDocument;return o.newDocument=e,o}function E(e,t,n){var i=k(e,t);if(!1===i.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function A(e,t,n,i){if("object"!==typeof e||null===e||Array.isArray(e))throw new v("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!b[e.op])throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!==typeof e.path)throw new v("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new v('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!==typeof e.from)throw new v("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&m(e.value))throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new v("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new v("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=D([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new v("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function D(e,t,n){try{if(!Array.isArray(e))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)$(f(t),f(e),n||!0);else{n=n||A;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof v)return r;throw r}}function S(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,i,r,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((i=e.length)!=t.length)return!1;for(n=i;0!==n--;)if(!S(e[n],t[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((i=s.length)!==Object.keys(t).length)return!1;for(n=i;0!==n--;)if(!t.hasOwnProperty(s[n]))return!1;for(n=i;0!==n--;)if(!S(e[r=s[n]],t[r]))return!1;return!0}return e!==e&&t!==t}var C=new WeakMap,F=function(e){this.observers=new Map,this.obj=e},M=function(e,t){this.callback=e,this.observer=t};function O(e,t){t.unobserve()}function T(e,t){var n,i=function(e){return C.get(e)}(e);if(i){var r=function(e,t){return e.observers.get(t)}(i,t);n=r&&r.observer}else i=new F(e),C.set(e,i);if(n)return n;if(n={},i.value=f(e),t){n.callback=t,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=e,n.unobserve=function(){z(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.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(t,new M(t,n)),n}function z(e,t){void 0===t&&(t=!1);var n=C.get(e.object);N(n.value,e.object,e.patches,"",t),e.patches.length&&$(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function N(e,t,n,i,r){if(t!==e){"function"===typeof t.toJSON&&(t=t.toJSON());for(var o=c(t),a=c(e),s=!1,l=a.length-1;l>=0;l--){var d=e[m=a[l]];if(!u(t,m)||void 0===t[m]&&void 0!==d&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(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:e}),n.push({op:"replace",path:i,value:t}),!0);else{var p=t[m];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?N(d,p,n,i+"/"+h(m),r):d!==p&&(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(l=0;l<o.length;l++){var m;u(e,m=o[l])||void 0===t[m]||n.push({op:"add",path:i+"/"+h(m),value:f(t[m])})}}}function R(e,t,n){void 0===n&&(n=!1);var i=[];return N(e,t,i,"",n),i}Object.assign({},i,r,{JsonPatchError:y,deepClone:f,escapePathComponent:h,unescapePathComponent:p});var P=n(93811),B=n.n(P),L=n(14716),I=n(28430);var U=n(518);function j(e){return Pe(e,"or")}function q(e){return Pe(e,"and")}function W(e){return Pe(e,"not")}function G(e,t){if(W(e))G(e.not,t);else if(q(e))for(const n of e.and)G(n,t);else if(j(e))for(const n of e.or)G(n,t);else t(e)}function Y(e,t){return W(e)?{not:Y(e.not,t)}:q(e)?{and:e.and.map((e=>Y(e,t)))}:j(e)?{or:e.or.map((e=>Y(e,t)))}:t(e)}const H=structuredClone;function X(e){throw new Error(e)}function V(e,t){const n={};for(const i of t)(0,U.mQ)(e,i)&&(n[i]=e[i]);return n}function K(e,t){const n={...e};for(const i of t)delete n[i];return n}function Q(e){if((0,U.Et)(e))return e;const t=(0,U.Kg)(e)?e:Re(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){n=(n<<5)-n+t.charCodeAt(i),n|=0}return n}function J(e){return!1===e||null===e}function Z(e,t){return e.includes(t)}function ee(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function te(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function ne(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(const r of n)ie(e,r??{});return e}function ie(e,t){for(const n of fe(t))(0,U.AU)(e,n,t[n],!0)}function re(e,t){const n=[],i={};let r;for(const o of e)r=t(o),r in i||(i[r]=1,n.push(o));return n}function oe(e,t){const n=fe(e),i=fe(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function ae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function se(e,t){for(const n of e)if(t.has(n))return!0;return!1}function le(e){const t=new Set;for(const n of e){const e=(0,U.iv)(n).map(((e,t)=>0===t?e:`[${e}]`)),i=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const n of i)t.add(n)}return t}function ue(e,t){return void 0===e||void 0===t||se(le(e),le(t))}function ce(e){return 0===fe(e).length}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>Re(e))).join(",")})`};const fe=Object.keys,de=Object.values,he=Object.entries;function pe(e){return!0===e||!1===e}function me(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function ge(e,t){return W(e)?`!(${ge(e.not,t)})`:q(e)?`(${e.and.map((e=>ge(e,t))).join(") && (")})`:j(e)?`(${e.or.map((e=>ge(e,t))).join(") || (")})`:t(e)}function ye(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&ye(e[n],t)&&delete e[n],ce(e)}function ve(e){return e.charAt(0).toUpperCase()+e.substr(1)}function xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const n=(0,U.iv)(e),i=[];for(let r=1;r<=n.length;r++){const e=`[${n.slice(0,r).map(U.r$).join("][")}]`;i.push(`${t}${e}`)}return i.join(" && ")}function be(e){return`${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum"}[${(0,U.r$)((0,U.iv)(e).join("."))}]`}function _e(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function we(e){return`${(0,U.iv)(e).map(_e).join("\\.")}`}function ke(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function $e(e){return`${(0,U.iv)(e).join(".")}`}function Ee(e){return e?(0,U.iv)(e).length:0}function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find((e=>void 0!==e))}let De=42;function Se(e){const t=++De;return e?String(e)+t:t}function Ce(){De=42}function Fe(e){return Me(e)?e:`__${e}`}function Me(e){return e.startsWith("__")}function Oe(e){if(void 0!==e)return(e%360+360)%360}function Te(e){return!!(0,U.Et)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const ze=Object.getPrototypeOf(structuredClone({}));function Ne(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;0!==i--;)if(!Ne(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Ne(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;0!==i--;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==ze.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==ze.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;0!==i--;){const n=r[i];if(!Ne(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Re(e){const t=[];return function e(n){if(n&&n.toJSON&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!==typeof n)return JSON.stringify(n);let i,r;if(Array.isArray(n)){for(r="[",i=0;i<n.length;i++)i&&(r+=","),r+=e(n[i])||"null";return r+"]"}if(null===n)return"null";if(t.includes(n))throw new TypeError("Converting circular structure to JSON");const o=t.push(n)-1,a=Object.keys(n).sort();for(r="",i=0;i<a.length;i++){const t=a[i],o=e(n[t]);o&&(r&&(r+=","),r+=JSON.stringify(t)+":"+o)}return t.splice(o,1),`{${r}}`}(e)}function Pe(e,t){return(0,U.Gv)(e)&&(0,U.mQ)(e,t)&&void 0!==e[t]}const Be="row",Le="column",Ie="facet",Ue="x",je="y",qe="x2",We="y2",Ge="xOffset",Ye="yOffset",He="radius",Xe="radius2",Ve="theta",Ke="theta2",Qe="latitude",Je="longitude",Ze="latitude2",et="longitude2",tt="color",nt="fill",it="stroke",rt="shape",ot="size",at="angle",st="opacity",lt="fillOpacity",ut="strokeOpacity",ct="strokeWidth",ft="strokeDash",dt="text",ht="order",pt="detail",mt="key",gt="tooltip",yt="href",vt="url",xt="description",bt={theta:1,theta2:1,radius:1,radius2:1};function _t(e){return(0,U.mQ)(bt,e)}const wt={longitude:1,longitude2:1,latitude:1,latitude2:1};function kt(e){switch(e){case Qe:return"y";case Ze:return"y2";case Je:return"x";case et:return"x2"}}function $t(e){return(0,U.mQ)(wt,e)}const Et=fe(wt),At={x:1,y:1,x2:1,y2:1,...bt,...wt,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 Dt(e){return e===tt||e===nt||e===it}const St={row:1,column:1,facet:1},Ct=fe(St),Ft={...At,...St},Mt=fe(Ft),{order:Ot,detail:Tt,tooltip:zt,...Nt}=Ft,{row:Rt,column:Pt,facet:Bt,...Lt}=Nt;fe(Nt),fe(Lt);function It(e){return(0,U.mQ)(Ft,e)}const Ut=[qe,We,Ze,et,Ke,Xe];function jt(e){return qt(e)!==e}function qt(e){switch(e){case qe:return Ue;case We:return je;case Ze:return Qe;case et:return Je;case Ke:return Ve;case Xe:return He}return e}function Wt(e){if(_t(e))switch(e){case Ve:return"startAngle";case Ke:return"endAngle";case He:return"outerRadius";case Xe:return"innerRadius"}return e}function Gt(e){switch(e){case Ue:return qe;case je:return We;case Qe:return Ze;case Je:return et;case Ve:return Ke;case He:return Xe}}function Yt(e){switch(e){case Ue:case qe:return"width";case je:case We:return"height"}}function Ht(e){switch(e){case Ue:return"xOffset";case je:return"yOffset";case qe:return"x2Offset";case We:return"y2Offset";case Ve:return"thetaOffset";case He:return"radiusOffset";case Ke:return"theta2Offset";case Xe:return"radius2Offset"}}function Xt(e){switch(e){case Ue:return"xOffset";case je:return"yOffset"}}function Vt(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Kt=fe(At),{x:Qt,y:Jt,x2:Zt,y2:en,xOffset:tn,yOffset:nn,latitude:rn,longitude:on,latitude2:an,longitude2:sn,theta:ln,theta2:un,radius:cn,radius2:fn,...dn}=At,hn=fe(dn),pn={x:1,y:1},mn=fe(pn);function gn(e){return(0,U.mQ)(pn,e)}const yn={theta:1,radius:1},vn=fe(yn);function xn(e){return"width"===e?Ue:je}const bn={xOffset:1,yOffset:1};fe(bn);function _n(e){return(0,U.mQ)(bn,e)}const{text:wn,tooltip:kn,href:$n,url:En,description:An,detail:Dn,key:Sn,order:Cn,...Fn}=dn,Mn=fe(Fn);const On={...pn,...yn,...bn,...Fn},Tn=fe(On);function zn(e){return(0,U.mQ)(On,e)}function Nn(e,t){return function(e){switch(e){case tt:case nt:case it:case xt:case pt:case mt:case gt:case yt:case ht:case st:case lt:case ut:case ct:case Ie:case Be:case Le:return Rn;case Ue:case je:case Ge:case Ye:case Qe:case Je:return Bn;case qe:case We:case Ze:case et:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ot:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case ft:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case rt:return{point:"always",geoshape:"always"};case dt:return{text:"always"};case at:return{point:"always",square:"always",text:"always"};case vt:return{image:"always"};case Ve:case He:return{text:"always",arc:"always"};case Ke:case Xe:return{arc:"always"}}}(e)[t]}const Rn={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:Pn,...Bn}=Rn;function Ln(e){switch(e){case Ue:case je:case Ve:case He:case Ge:case Ye:case ot:case at:case ct:case st:case lt:case ut:case qe:case We:case Ke:case Xe:return;case Ie:case Be:case Le:case rt:case ft:case dt:case gt:case yt:case vt:case xt:return"discrete";case tt:case nt:case it:return"flexible";case Qe:case Je:case Ze:case et:case pt:case mt:case ht:return}}const In={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb: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},Un={count:1,min:1,max:1};function jn(e){return Pe(e,"argmin")}function qn(e){return Pe(e,"argmax")}function Wn(e){return(0,U.Kg)(e)&&(0,U.mQ)(In,e)}const Gn=new Set(["count","valid","missing","distinct"]);function Yn(e){return(0,U.Kg)(e)&&Gn.has(e)}const Hn=new Set(["count","sum","distinct","valid","missing"]),Xn=new Set(["mean","average","median","q1","q3","min","max"]);function Vn(e){return(0,U.Lm)(e)&&(e=fs(e,void 0)),"bin"+fe(e).map((t=>Zn(e[t])?me(`_${t}_${he(e[t])}`):me(`_${t}_${e[t]}`))).join("")}function Kn(e){return!0===e||Jn(e)&&!e.binned}function Qn(e){return"binned"===e||Jn(e)&&!0===e.binned}function Jn(e){return(0,U.Gv)(e)}function Zn(e){return Pe(e,"param")}function ei(e){switch(e){case Be:case Le:case ot:case tt:case nt:case it:case ct:case st:case lt:case ut:case rt:return 6;case ft:return 4;default:return 10}}function ti(e){return Pe(e,"expr")}function ni(e){let{level:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{level:0};const n=fe(e||{}),i={};for(const r of n)i[r]=0===t?di(e[r]):ni(e[r],{level:t-1});return i}function ii(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:a,color:s,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=e,g={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},y={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...m,...s?{fill:s}:{}},subtitleMarkConfig:V(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:g,subtitle:y}}function ri(e){return(0,U.Kg)(e)||(0,U.cy)(e)&&(0,U.Kg)(e[0])}function oi(e){return Pe(e,"signal")}function ai(e){return Pe(e,"step")}function si(e){return!(0,U.cy)(e)&&(Pe(e,"field")&&Pe(e,"data"))}const li=fe({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}),ui={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},ci=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function fi(e){const t=(0,U.cy)(e.condition)?e.condition.map(hi):hi(e.condition);return{...di(e),condition:t}}function di(e){if(ti(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function hi(e){if(ti(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function pi(e){if(ti(e)){const{expr:t,...n}=e;return{signal:t,...n}}return oi(e)?e:void 0!==e?{value:e}:void 0}function mi(e){return oi(e)?e.signal:(0,U.r$)(e.value)}function gi(e){return oi(e)?e.signal:null==e?null:(0,U.r$)(e)}function yi(e,t,n){for(const i of n){const n=bi(i,t.markDef,t.config);void 0!==n&&(e[i]=pi(n))}return e}function vi(e){return[].concat(e.type,e.style??[])}function xi(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:r,ignoreVgConfig:o}=i;return r&&Pe(t,r)?t[r]:void 0!==t[e]?t[e]:!o||r&&r!==e?bi(e,t,n,i):void 0}function bi(e,t,n){let{vgChannel:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=_i(e,t,n.style);return Ae(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function _i(e,t,n){return wi(e,vi(t),n)}function wi(e,t,n){let i;t=(0,U.YO)(t);for(const r of t){const t=n[r];Pe(t,e)&&(i=t[e])}return i}function ki(e,t){return(0,U.YO)(e).reduce(((e,n)=>(e.field.push(Qa(n,t)),e.order.push(n.sort??"ascending"),e)),{field:[],order:[]})}function $i(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(Ne(t,e))return;n.push(e)})),n}function Ei(e,t){return Ne(e,t)||!t?e:e?[...(0,U.YO)(e),...(0,U.YO)(t)].join(", "):t}function Ai(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((ri(n)||oi(n))&&(ri(i)||oi(i)))return{explicit:e.explicit,value:Ei(n,i)};if(ri(n)||oi(n))return{explicit:e.explicit,value:n};if(ri(i)||oi(i))return{explicit:e.explicit,value:i};if(!ri(n)&&!oi(n)&&!ri(i)&&!oi(i))return{explicit:e.explicit,value:$i(n,i)};throw new Error("It should never reach here")}function Di(e){return`Invalid specification ${Re(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Si='Autosize "fit" only works for single views and layered views.';function Ci(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`}function Fi(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Mi(e){return e?`Dropping "fit-${e}" because spec has discrete ${Yt(e)}.`:'Dropping "fit" because spec has discrete size.'}function Oi(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Ti(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function zi(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Ni(e){return`Selection not supported for ${e} yet.`}const Ri="The same selection must be used to override scale domains in a layered view.";function Pi(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Bi(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function Li(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ii(e){return`${e}Offset dropped because ${e} is continuous`}function Ui(e){return`Invalid field type "${e}".`}function ji(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function qi(e,t){return`Dropping ${Re(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function Wi(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Gi(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Yi(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Hi(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function Xi(e){return`Using unaggregated domain with raw field has no effect (${Re(e)}).`}function Vi(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Ki(e){return`Unaggregated domain is currently unsupported for log scale (${Re(e)}).`}function Qi(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Ji(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const Zi="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function er(e,t){return`Invalid ${e}: ${Re(t)}.`}function tr(e){return`1D error band does not support ${e}.`}function nr(e){return`Channel ${e} is required for "binned" bin.`}const ir=(0,U.vF)(U.P$);let rr=ir;function or(){return rr=ir,rr}function ar(){rr.warn(...arguments)}function sr(e){if(e&&(0,U.Gv)(e))for(const t of mr)if(Pe(e,t))return!0;return!1}new WeakMap;const lr=["january","february","march","april","may","june","july","august","september","october","november","december"],ur=lr.map((e=>e.substr(0,3))),cr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fr=cr.map((e=>e.substr(0,3)));function dr(e,t){const n=[];if(t&&void 0!==e.day&&fe(e).length>1&&(ar(function(e){return`Dropping day from datetime ${Re(e)} as day cannot be combined with other units.`}(e)),delete(e=H(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const i=t?function(e){if(Te(e)&&(e=+e),(0,U.Et)(e))return e-1;{const t=e.toLowerCase(),n=lr.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=ur.indexOf(i);if(-1!==r)return r;throw new Error(er("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(Te(e)&&(e=+e),(0,U.Et)(e))return e>4&&ar(er("quarter",e)),e-1;throw new Error(er("quarter",e))}(e.quarter):e.quarter;n.push((0,U.Et)(i)?3*i:`${i}*3`)}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const i=t?function(e){if(Te(e)&&(e=+e),(0,U.Et)(e))return e%7;{const t=e.toLowerCase(),n=cr.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=fr.indexOf(i);if(-1!==r)return r;throw new Error(er("day",e))}}(e.day):e.day;n.push((0,U.Et)(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const t=e[i];n.push("undefined"===typeof t?0:t)}return n}function hr(e){const t=dr(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const pr={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},mr=fe(pr);function gr(e){return(0,U.Gv)(e)?e.binned:yr(e)}function yr(e){return e&&e.startsWith("binned")}function vr(e){return e.startsWith("utc")}const xr={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function br(e){return mr.filter((t=>wr(e,t)))}function _r(e){const t=br(e);return t[t.length-1]}function wr(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function kr(e,t){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const i=xe(t),r=vr(e)?"utc":"";let o;const a={};for(const l of mr)wr(e,l)&&(a[l]="quarter"===(s=l)?`(${r}quarter(${i})-1)`:`${r}${s}(${i})`,o=l);var s;return n&&(a[o]+="+1"),function(e){const t=dr(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function $r(e){if(!e)return;return`timeUnitSpecifier(${Re(br(e))}, ${Re(xr)})`}function Er(e){if(!e)return;let t;return(0,U.Kg)(e)?t=yr(e)?{unit:e.substring(6),binned:!0}:{unit:e}:(0,U.Gv)(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),vr(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substring(3)}(t.unit)),t}function Ar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const n=Er(e),i=_r(n.unit);if(i&&"day"!==i){const e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:r,part:o}=Sr(i,n.step);return`${t(hr({...e,[o]:+e[o]+r}))} - ${t(hr(e))}`}}const Dr={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Sr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(function(e){return(0,L.hasOwnProperty)(Dr,e)}(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:3*t};case"week":return{part:"date",step:7*t}}}function Cr(e){return!!e?.field&&void 0!==e.equal}function Fr(e){return!!e?.field&&void 0!==e.lt}function Mr(e){return!!e?.field&&void 0!==e.lte}function Or(e){return!!e?.field&&void 0!==e.gt}function Tr(e){return!!e?.field&&void 0!==e.gte}function zr(e){if(e?.field){if((0,U.cy)(e.range)&&2===e.range.length)return!0;if(oi(e.range))return!0}return!1}function Nr(e){return!!e?.field&&((0,U.cy)(e.oneOf)||(0,U.cy)(e.in))}function Rr(e){return Nr(e)||Cr(e)||zr(e)||Fr(e)||Or(e)||Mr(e)||Tr(e)}function Pr(e,t){return ps(e,{timeUnit:t,wrapTime:!0})}function Br(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:n}=e,i=Er(e.timeUnit),{unit:r,binned:o}=i||{},a=Qa(e,{expr:"datum"}),s=r?`time(${o?a:kr(r,n)})`:a;if(Cr(e))return`${s}===${Pr(e.equal,r)}`;if(Fr(e)){return`${s}<${Pr(e.lt,r)}`}if(Or(e)){return`${s}>${Pr(e.gt,r)}`}if(Mr(e)){return`${s}<=${Pr(e.lte,r)}`}if(Tr(e)){return`${s}>=${Pr(e.gte,r)}`}if(Nr(e))return`indexof([${function(e,t){return e.map((e=>Pr(e,t)))}(e.oneOf,r).join(",")}], ${s}) !== -1`;if(function(e){return!!e?.field&&void 0!==e.valid}(e))return Lr(s,e.valid);if(zr(e)){const{range:n}=ni(e),i=oi(n)?{signal:`${n.signal}[0]`}:n[0],o=oi(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==o&&t)return"inrange("+s+", ["+Pr(i,r)+", "+Pr(o,r)+"])";const a=[];return null!==i&&a.push(`${s} >= ${Pr(i,r)}`),null!==o&&a.push(`${s} <= ${Pr(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${Re(e)}`)}function Lr(e){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Ir(e){return Rr(e)&&e.timeUnit?{...e,timeUnit:Er(e.timeUnit)}:e}const Ur={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function jr(e){return"quantitative"===e||"temporal"===e}function qr(e){return"ordinal"===e||"nominal"===e}const Wr=Ur.quantitative,Gr=Ur.ordinal,Yr=Ur.temporal,Hr=Ur.nominal,Xr=Ur.geojson;fe(Ur);const Vr={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"},Kr={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"};fe(Kr);function Qr(e,t){const n=Kr[e],i=Kr[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Jr={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 Zr(e){return Jr[e]}const eo=new Set(["linear","log","pow","sqrt","symlog"]),to=new Set([...eo,"time","utc"]);function no(e){return eo.has(e)}const io=new Set(["quantile","quantize","threshold"]),ro=new Set([...to,...io,"sequential","identity"]),oo=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function ao(e){return oo.has(e)}function so(e){return ro.has(e)}function lo(e){return to.has(e)}function uo(e){return io.has(e)}function co(e){return Pe(e,"param")}const fo={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw: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:ho,domain:po,range:mo,rangeMax:go,rangeMin:yo,scheme:vo,...xo}=(fe(fo),fo),bo=fe(xo);function _o(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return lo(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return lo(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return lo(e);case"nice":return lo(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return so(e)&&!Z(["log","time","utc","threshold","quantile"],e)}}function wo(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Dt(e)?void 0:`Cannot use the scale property "${t}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":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 ko={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"},$o=ko.arc,Eo=ko.area,Ao=ko.bar,Do=ko.image,So=ko.line,Co=ko.point,Fo=ko.rect,Mo=ko.rule,Oo=ko.text,To=ko.tick,zo=ko.trail,No=ko.circle,Ro=ko.square,Po=ko.geoshape;function Bo(e){return["line","area","trail"].includes(e)}function Lo(e){return["rect","bar","image","arc","tick"].includes(e)}const Io=new Set(fe(ko));function Uo(e){return Pe(e,"type")}const jo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],qo=fe({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Wo=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Go={area:["line","point"],bar:Wo,rect:Wo,line:["point"],tick:["bandSize","thickness",...Wo]},Yo=fe({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 Ho(e){return Pe(e,"band")}const Xo={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Vo={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},Ko={...Vo,binSpacing:1},Qo={...Vo,thickness:1};function Jo(e,t){let{isPath:n}=t;return void 0===e||"break-paths-show-path-domains"===e?n?"break-paths-show-domains":"filter":null===e?"show":e}function Zo(e){let{markDef:t,config:n,scaleChannel:i,scaleType:r,isCountAggregate:o}=e;if(!r||!so(r)||o)return"always-valid";const a=Jo(xi("invalid",t,n),{isPath:Bo(t.type)}),s=n.scale?.invalid?.[i];return void 0!==s?"show":a}function ea(e){let{scaleName:t,scale:n,mode:i}=e;const r=`domain('${t}')`;if(!n||!t)return;const o=`${r}[0]`,a=`peek(${r})`,s=n.domainHasZero();if("definitely"===s)return{scale:t,value:0};if("maybe"===s){return{signal:`scale('${t}', inrange(0, ${r}) ? 0 : ${"zeroOrMin"===i?o:a})`}}return{signal:`scale('${t}', ${"zeroOrMin"===i?o:a})`}}function ta(e){let{scaleChannel:t,channelDef:n,scale:i,scaleName:r,markDef:o,config:a}=e;const s=i?.get("type"),l=as(n),u=Zo({scaleChannel:t,markDef:o,config:a,scaleType:s,isCountAggregate:Yn(l?.aggregate)});if(l&&"show"===u){const e=a.scale.invalid?.[t]??"zero-or-min";return{test:Lr(Qa(l,{expr:"datum"}),!1),...na(e,i,r)}}}function na(e,t,n){if(i=e,(0,U.Gv)(i)&&"value"in i){const{value:t}=e;return oi(t)?{signal:t.signal}:{value:t}}var i;return ea({scale:t,scaleName:n,mode:"zeroOrMin"})}function ia(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:a}=e,s=qt(t),l=aa(e),u=ta({scaleChannel:s,channelDef:n,scale:r,scaleName:o,markDef:i,config:a});return void 0!==u?[u,l]:l}function ra(e,t,n,i){const r={};if(t&&(r.scale=t),La(e)){const{datum:t}=e;sr(t)?r.signal=hr(t):oi(t)?r.signal=t.signal:ti(t)?r.signal=t.expr:r.value=t}else r.field=Qa(e,n);if(i){const{offset:e,band:t}=i;e&&(r.offset=e),t&&(r.band=t)}return r}function oa(e){let{scaleName:t,fieldOrDatumDef:n,fieldOrDatumDef2:i,offset:r,startSuffix:o,endSuffix:a="end",bandPosition:s=.5}=e;const l=!oi(s)&&0<s&&s<1?"datum":void 0,u=Qa(n,{expr:l,suffix:o}),c=void 0!==i?Qa(i,{expr:l}):Qa(n,{suffix:a,expr:l}),f={};if(0===s||1===s){f.scale=t;const e=0===s?u:c;f.field=e}else{const e=oi(s)?`(1-${s.signal}) * ${u} + ${s.signal} * ${c}`:`${1-s} * ${u} + ${s} * ${c}`;f.signal=`scale("${t}", ${e})`}return r&&(f.offset=r),f}function aa(e){let{channel:t,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:l,offset:u,defaultRef:c,bandPosition:f}=e;if(n){if(qa(n)){const e=s?.get("type");if(Wa(n)){f??(f=Fa({fieldDef:n,fieldDef2:i,markDef:r,config:o}));const{bin:s,timeUnit:c,type:d}=n;if(Kn(s)||f&&c&&d===Yr)return l?.impute?ra(n,a,{binSuffix:"mid"},{offset:u}):f&&!ao(e)?oa({scaleName:a,fieldOrDatumDef:n,bandPosition:f,offset:u}):ra(n,a,gs(n,t)?{binSuffix:"range"}:{},{offset:u});if(Qn(s)){if(Pa(i))return oa({scaleName:a,fieldOrDatumDef:n,fieldOrDatumDef2:i,bandPosition:f,offset:u});ar(nr(t===Ue?qe:We))}}return ra(n,a,ao(e)?{binSuffix:"range"}:{},{offset:u,band:"band"===e?f??n.bandPosition??.5:void 0})}if(Ga(n)){const e=u?{offset:u}:{};return{...sa(t,n.value),...e}}}return(0,U.Tn)(c)&&(c=c()),c?{...c,...u?{offset:u}:{}}:c}function sa(e,t){return Z(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:Z(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:pi(t)}function la(e){return e&&"number"!==e&&"time"!==e}function ua(e,t,n){return`${e}(${t}${n?`, ${Re(n)}`:""})`}const ca=" \u2013 ";function fa(e){let{fieldOrDatumDef:t,format:n,formatType:i,expr:r,normalizeStack:o,config:a}=e;if(la(i))return ha({fieldOrDatumDef:t,format:n,formatType:i,expr:r,config:a});const s=da(t,r,o),l=Ba(t);if(void 0===n&&void 0===i&&a.customFormatTypes){if("quantitative"===l){if(o&&a.normalizedNumberFormatType)return ha({fieldOrDatumDef:t,format:a.normalizedNumberFormat,formatType:a.normalizedNumberFormatType,expr:r,config:a});if(a.numberFormatType)return ha({fieldOrDatumDef:t,format:a.numberFormat,formatType:a.numberFormatType,expr:r,config:a})}if("temporal"===l&&a.timeFormatType&&Pa(t)&&void 0===t.timeUnit)return ha({fieldOrDatumDef:t,format:a.timeFormat,formatType:a.timeFormatType,expr:r,config:a})}if(hs(t)){const e=function(e){let{field:t,timeUnit:n,format:i,formatType:r,rawTimeFormat:o,isUTCScale:a}=e;return!n||i?!n&&r?`${r}(${t}, '${i}')`:(i=(0,U.Kg)(i)?i:o,`${a?"utc":"time"}Format(${t}, '${i}')`):function(e,t,n){if(!e)return;const i=$r(e);return`${n||vr(e)?"utc":"time"}Format(${t}, ${i})`}(n,t,a)}({field:s,timeUnit:Pa(t)?Er(t.timeUnit)?.unit:void 0,format:n,formatType:a.timeFormatType,rawTimeFormat:a.timeFormat,isUTCScale:Ya(t)&&t.scale?.type===Vr.UTC});return e?{signal:e}:void 0}if(n=ga({type:l,specifiedFormat:n,config:a,normalizeStack:o}),Pa(t)&&Kn(t.bin)){return{signal:xa(s,Qa(t,{expr:r,binSuffix:"end"}),n,i,a)}}return n||"quantitative"===Ba(t)?{signal:`${ya(s,n)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function da(e,t,n){return Pa(e)?n?`${Qa(e,{expr:t,suffix:"end"})}-${Qa(e,{expr:t,suffix:"start"})}`:Qa(e,{expr:t}):function(e){const{datum:t}=e;return sr(t)?hr(t):`${Re(t)}`}(e)}function ha(e){let{fieldOrDatumDef:t,format:n,formatType:i,expr:r,normalizeStack:o,config:a,field:s}=e;if(s??(s=da(t,r,o)),"datum.value"!==s&&Pa(t)&&Kn(t.bin)){return{signal:xa(s,Qa(t,{expr:r,binSuffix:"end"}),n,i,a)}}return{signal:ua(i,s,n)}}function pa(e,t,n,i,r,o){if(!(0,U.Kg)(i)||!la(i)){if(void 0===n&&void 0===i&&r.customFormatTypes&&"quantitative"===Ba(e)){if(r.normalizedNumberFormatType&&Ha(e)&&"normalize"===e.stack)return;if(r.numberFormatType)return}if(Ha(e)&&"normalize"===e.stack&&r.normalizedNumberFormat)return ga({type:"quantitative",config:r,normalizeStack:!0});if(hs(e)){const t=Pa(e)?Er(e.timeUnit)?.unit:void 0;if(void 0===t&&r.customFormatTypes&&r.timeFormatType)return;return function(e){let{specifiedFormat:t,timeUnit:n,config:i,omitTimeFormatConfig:r}=e;if(t)return t;if(n)return{signal:$r(n)};return r?void 0:i.timeFormat}({specifiedFormat:n,timeUnit:t,config:r,omitTimeFormatConfig:o})}return ga({type:t,specifiedFormat:n,config:r})}}function ma(e,t,n){return e&&(oi(e)||"number"===e||"time"===e)?e:hs(t)&&"time"!==n&&"utc"!==n?Pa(t)&&Er(t?.timeUnit)?.utc?"utc":"time":void 0}function ga(e){let{type:t,specifiedFormat:n,config:i,normalizeStack:r}=e;return(0,U.Kg)(n)?n:t===Wr?r?i.normalizedNumberFormat:i.numberFormat:void 0}function ya(e,t){return`format(${e}, "${t||""}")`}function va(e,t,n,i){return la(n)?ua(n,e,t):ya(e,((0,U.Kg)(t)?t:void 0)??i.numberFormat)}function xa(e,t,n,i,r){if(void 0===n&&void 0===i&&r.customFormatTypes&&r.numberFormatType)return xa(e,t,r.numberFormat,r.numberFormatType,r);const o=va(e,n,i,r),a=va(t,n,i,r);return`${Lr(e,!1)} ? "null" : ${o} + "${ca}" + ${a}`}const ba="min",_a={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 wa(e){return(0,U.mQ)(_a,e)}function ka(e){return e&&("count"===e.op||Pe(e,"field"))}function $a(e){return e&&(0,U.cy)(e)}function Ea(e){return Pe(e,"row")||Pe(e,"column")}function Aa(e){return Pe(e,"header")}function Da(e){return Pe(e,"facet")}function Sa(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Ca(e){return Pe(e,"sort")}function Fa(e){let{fieldDef:t,fieldDef2:n,markDef:i,config:r}=e;if(qa(t)&&void 0!==t.bandPosition)return t.bandPosition;if(Pa(t)){const{timeUnit:e,bin:o}=t;if(e&&!n)return bi("timeUnitBandPosition",i,r);if(Kn(o))return.5}}function Ma(e){let{channel:t,fieldDef:n,fieldDef2:i,markDef:r,config:o,scaleType:a,useVlSizeChannel:s}=e;const l=Yt(t),u=xi(s?"size":l,r,o,{vgChannel:l});if(void 0!==u)return u;if(Pa(n)){const{timeUnit:e,bin:t}=n;if(e&&!i)return{band:bi("timeUnitBandSize",r,o)};if(Kn(t)&&!ao(a))return{band:1}}return Lo(r.type)?a?ao(a)?o[r.type]?.discreteBandSize||{band:1}:o[r.type]?.continuousBandSize:o[r.type]?.discreteBandSize:void 0}function Oa(e,t,n,i){return!!(Kn(e.bin)||e.timeUnit&&Wa(e)&&"temporal"===e.type)&&void 0!==Fa({fieldDef:e,fieldDef2:t,markDef:n,config:i})}function Ta(e){return Pe(e,"sort")&&!Pe(e,"field")}function za(e){return Pe(e,"condition")}function Na(e){const t=e?.condition;return!!t&&!(0,U.cy)(t)&&Pa(t)}function Ra(e){const t=e?.condition;return!!t&&!(0,U.cy)(t)&&qa(t)}function Pa(e){return Pe(e,"field")||"count"===e?.aggregate}function Ba(e){return e?.type}function La(e){return Pe(e,"datum")}function Ia(e){return Wa(e)&&!Ja(e)||ja(e)}function Ua(e){return Wa(e)&&"quantitative"===e.type&&!e.bin||ja(e)}function ja(e){return La(e)&&(0,U.Et)(e.datum)}function qa(e){return Pa(e)||La(e)}function Wa(e){return e&&(Pe(e,"field")||"count"===e.aggregate)&&Pe(e,"type")}function Ga(e){return Pe(e,"value")}function Ya(e){return Pe(e,"scale")||Pe(e,"sort")}function Ha(e){return Pe(e,"axis")||Pe(e,"stack")||Pe(e,"impute")}function Xa(e){return Pe(e,"legend")}function Va(e){return Pe(e,"format")||Pe(e,"formatType")}function Ka(e){return K(e,["legend","axis","header","scale"])}function Qa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.field;const i=t.prefix;let r=t.suffix,o="";if(function(e){return"count"===e.aggregate}(e))n=Fe("count");else{let i;if(!t.nofn)if(function(e){return Pe(e,"op")}(e))i=e.op;else{const{bin:a,aggregate:s,timeUnit:l}=e;Kn(a)?(i=Vn(a),r=(t.binSuffix??"")+(t.suffix??"")):s?qn(s)?(o=`["${n}"]`,n=`argmax_${s.argmax}`):jn(s)?(o=`["${n}"]`,n=`argmin_${s.argmin}`):i=String(s):l&&!gr(l)&&(i=function(e){const{utc:t,...n}=Er(e);return n.unit?(t?"utc":"")+fe(n).map((e=>me(`${"unit"===e?"":`_${e}_`}${n[e]}`))).join(""):(t?"utc":"")+"timeunit"+fe(n).map((e=>me(`_${e}_${n[e]}`))).join("")}(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}i&&(n=n?`${i}_${n}`:i)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?$e(n):t.expr?be(n,t.expr)+o:we(n)+o}function Ja(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Pa(e)&&!!e.bin;case"temporal":return!1}throw new Error(Ui(e.type))}const Za=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(qn(t))return`${r} for argmax(${t.argmax})`;if(jn(t))return`${r} for argmin(${t.argmin})`;const o=i&&!gr(i)?Er(i):void 0,a=t||o?.unit||o?.maxbins&&"timeunit"||Kn(n)&&"bin";return a?`${a.toUpperCase()}(${r})`:r}(e);default:return function(e,t){const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if("count"===o)return t.countTitle;if(Kn(i))return`${n} (binned)`;if(r&&!gr(r)){const e=Er(r)?.unit;if(e)return`${n} (${br(e).join("-")})`}else if(o)return qn(o)?`${n} for max ${o.argmax}`:jn(o)?`${n} for min ${o.argmin}`:`${ve(o)} of ${n}`;return n}(e,t)}};let es=Za;function ts(e){es=e}function ns(e,t,n){let{allowDisabling:i,includeDefault:r=!0}=n;const o=is(e)?.title;if(!Pa(e))return o??e.title;const a=e,s=r?rs(a,t):void 0;return i?Ae(o,a.title,s):o??a.title??s}function is(e){return Ha(e)&&e.axis?e.axis:Xa(e)&&e.legend?e.legend:Aa(e)&&e.header?e.header:void 0}function rs(e,t){return es(e,t)}function os(e){if(Va(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const t=is(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function as(e){return Pa(e)?e:Na(e)?e.condition:void 0}function ss(e){return qa(e)?e:Ra(e)?e.condition:void 0}function ls(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,U.Kg)(e)||(0,U.Et)(e)||(0,U.Lm)(e)){return ar(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Re(n)}}.`}(t,(0,U.Kg)(e)?"string":(0,U.Et)(e)?"number":"boolean",e)),{value:e}}return qa(e)?us(e,t,n,i):Ra(e)?{...e,condition:us(e.condition,t,n,i)}:e}function us(e,t,n,i){if(Va(e)){const{format:r,formatType:o,...a}=e;if(la(o)&&!n.customFormatTypes)return ar(Li(t)),us(a,t,n,i)}else{const r=Ha(e)?"axis":Xa(e)?"legend":Aa(e)?"header":null;if(r&&e[r]){const{format:o,formatType:a,...s}=e[r];if(la(a)&&!n.customFormatTypes)return ar(Li(t)),us({...e,[r]:s},t,n,i)}}return Pa(e)?cs(e,t,i):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=(0,U.Et)(n)?"quantitative":(0,U.Kg)(n)?"nominal":sr(n)?"temporal":void 0,{...e,type:t}}(e)}function cs(e,t){let{compositeMark:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{aggregate:i,timeUnit:r,bin:o,field:a}=e,s={...e};if(n||!i||Wn(i)||qn(i)||jn(i)||(ar(function(e){return`Invalid aggregation operator "${e}".`}(i)),delete s.aggregate),r&&(s.timeUnit=Er(r)),a&&(s.field=`${a}`),Kn(o)&&(s.bin=fs(o,t)),Qn(o)&&!gn(t)&&ar(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),Wa(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Wr:return"quantitative";case"t":case Yr:return"temporal";case"o":case Gr:return"ordinal";case"n":case Hr:return"nominal";case Xr:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&Yn(i)&&(ar(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,i)),s.type="quantitative")}else if(!jt(t)){const e=function(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ca(e)&&(0,U.cy)(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!qn(n)&&!jn(n))return"quantitative";if(Ya(e)&&e.scale?.type)switch(Kr[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Wa(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Be:case Le:case Ie:return Ja(e)?ds:{compatible:!1,warning:Gi(t)};case Ue:case je:case Ge:case Ye:case tt:case nt:case it:case dt:case pt:case mt:case gt:case yt:case vt:case at:case Ve:case He:case xt:return ds;case Je:case et:case Qe:case Ze:return n!==Wr?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ds;case st:case lt:case ut:case ct:case ot:case Ke:case Xe:case qe:case We:return"nominal"!==n||e.sort?ds:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case rt:case ft:return Ja(e)||Ya(i=e)&&uo(i.scale?.type)?ds:{compatible:!1,warning:Yi(t)};case ht:return"nominal"!==e.type||"sort"in e?ds:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}var i}(s,t)||{};!1===e&&ar(n)}if(Ca(s)&&(0,U.Kg)(s.sort)){const{sort:e}=s;if(wa(e))return{...s,sort:{encoding:e}};const t=e.substring(1);if("-"===e.charAt(0)&&wa(t))return{...s,sort:{encoding:t,order:"descending"}}}if(Aa(s)){const{header:e}=s;if(e){const{orient:t,...n}=e;if(t)return{...s,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}}return s}function fs(e,t){return(0,U.Lm)(e)?{maxbins:ei(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:ei(t)}}const ds={compatible:!0};function hs(e){const{formatType:t}=os(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||Pa(n)&&!!n.timeUnit));var n}function ps(e,t){let{timeUnit:n,type:i,wrapTime:r,undefinedIfExprNotRequired:o}=t;const a=n&&Er(n)?.unit;let s,l=a||"temporal"===i;return ti(e)?s=e.expr:oi(e)?s=e.signal:sr(e)?(l=!0,s=hr(e)):((0,U.Kg)(e)||(0,U.Et)(e))&&l&&(s=`datetime(${Re(e)})`,function(e){return(0,L.hasOwnProperty)(pr,e)}(a)&&((0,U.Et)(e)&&e<1e4||(0,U.Kg)(e)&&isNaN(Date.parse(e)))&&(s=hr({[a]:e}))),s?r&&l?`time(${s})`:s:o?void 0:Re(e)}function ms(e,t){const{type:n}=e;return t.map((t=>{const i=ps(t,{timeUnit:Pa(e)&&!gr(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t}))}function gs(e,t){return Kn(e.bin)?zn(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const ys={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 vs(e){return e?.condition}const xs=["domain","grid","labels","ticks","title"],bs={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"},_s={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},ws={..._s,style:1,labelExpr:1,encoding:1};function ks(e){return(0,U.mQ)(ws,e)}fe(ws);const $s=fe({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 Es(e){return Pe(e,"mark")}class As{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!Es(e)&&(Uo(t=e.mark)?t.type:t)===this.name;var t}}function Ds(e,t){const n=e&&e[t];return!!n&&((0,U.cy)(n)?ee(n,(e=>!!e.field)):Pa(n)||Na(n))}function Ss(e,t){const n=e&&e[t];return!!n&&((0,U.cy)(n)?ee(n,(e=>!!e.field)):Pa(n)||La(n)||Ra(n))}function Cs(e,t){if(gn(t)){const n=e[t];if((Pa(n)||La(n))&&(qr(n.type)||Pa(n)&&n.timeUnit)){return Ss(e,Xt(t))}}return!1}function Fs(e){return ee(Mt,(t=>{if(Ds(e,t)){const n=e[t];if((0,U.cy)(n))return ee(n,(e=>!!e.aggregate));{const e=as(n);return e&&!!e.aggregate}}return!1}))}function Ms(e,t){const n=[],i=[],r=[],o=[],a={};return zs(e,((s,l)=>{if(Pa(s)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=s;if(c||d||f){const e=is(s),p=e?.title;let m=Qa(s,{forAs:!0});const g={...p?[]:{title:ns(s,t,{allowDisabling:!0})},...h,field:m};if(c){let e;if(qn(c)?(e="argmax",m=Qa({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${u}`):jn(c)?(e="argmin",m=Qa({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${u}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};u&&(t.field=u),o.push(t)}}else if(n.push(m),Wa(s)&&Kn(f)){if(i.push({bin:f,field:u,as:m}),n.push(Qa(s,{binSuffix:"end"})),gs(s,l)&&n.push(Qa(s,{binSuffix:"range"})),gn(l)){const e={field:`${m}_end`};a[`${l}2`]=e}g.bin="binned",jt(l)||(g.type=Wr)}else if(d&&!gr(d)){r.push({timeUnit:d,field:u,as:m});const e=Wa(s)&&s.type!==Yr&&"time";e&&(l===dt||l===gt?g.formatType=e:!function(e){return(0,U.mQ)(dn,e)}(l)?gn(l)&&(g.axis={formatType:e,...g.axis}):g.legend={formatType:e,...g.legend})}a[l]=g}else n.push(u),a[l]=e[l]}else a[l]=e[l]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function Os(e,t,n){const i=Nn(t,n);if(!i)return!1;if("binned"===i){const n=e[t===qe?Ue:je];return!!(Pa(n)&&Pa(e[t])&&Qn(n.bin))}return!0}function Ts(e,t){const n={};for(const i of fe(e)){const r=ls(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function zs(e,t,n){if(e)for(const i of fe(e)){const r=e[i];if((0,U.cy)(r))for(const e of r)t.call(n,e,i);else t.call(n,r,i)}}function Ns(e,t){return fe(t).reduce(((n,i)=>{switch(i){case Ue:case je:case yt:case xt:case vt:case qe:case We:case Ge:case Ye:case Ve:case Ke:case He:case Xe:case Qe:case Je:case Ze:case et:case dt:case rt:case at:case gt:return n;case ht:if("line"===e||"trail"===e)return n;case pt:case mt:{const e=t[i];if((0,U.cy)(e)||Pa(e))for(const t of(0,U.YO)(e))t.aggregate||n.push(Qa(t,{}));return n}case ot:if("trail"===e)return n;case tt:case nt:case it:case st:case lt:case ut:case ft:case ct:{const e=as(t[i]);return e&&!e.aggregate&&n.push(Qa(e,{})),n}}}),[])}function Rs(e,t,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map((e=>{let{fieldPrefix:n,titlePrefix:r}=e;const o=i?` of ${Ps(t)}`:"";return{field:n+t.field,type:t.type,title:oi(r)?{signal:`${r}"${escape(o)}"`}:r+o}})),...re(function(e){const t=[];for(const n of fe(e))if(Ds(e,n)){const i=e[n],r=(0,U.YO)(i);for(const e of r)Pa(e)?t.push(e):Na(e)&&t.push(e.condition)}return t}(n).map(Ka),Q)]}}function Ps(e){const{title:t,field:n}=e;return Ae(t,n)}function Bs(e,t,n,i,r){const{scale:o,axis:a}=n;return s=>{let{partName:l,mark:u,positionPrefix:c,endPositionPrefix:f,extraEncoding:d={}}=s;const h=Ps(n);return Ls(e,l,r,{mark:u,encoding:{[t]:{field:`${c}_${n.field}`,type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...(0,U.Kg)(f)?{[`${t}2`]:{field:`${f}_${n.field}`}}:{},...i,...d}})}}function Ls(e,t,n,i){const{clip:r,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...a?{opacity:a}:{},...Uo(i.mark)?i.mark:{type:i.mark},style:`${s}-${String(t)}`,...(0,U.Lm)(e[t])?{}:e[t]}}]:[]}function Is(e,t,n){const{encoding:i}=e,r="vertical"===t?"y":"x",o=i[r],a=i[`${r}2`],s=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:Us(o,n),continuousAxisChannelDef2:Us(a,n),continuousAxisChannelDefError:Us(s,n),continuousAxisChannelDefError2:Us(l,n),continuousAxis:r}}function Us(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&ar(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),i}return e}function js(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(Uo(n)&&n.orient)return n.orient;if(Ia(r)){if(Ia(o)){const e=Pa(r)&&r.aggregate,n=Pa(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return hs(o)&&!hs(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Ia(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}const qs="boxplot",Ws=new As(qs,Ys);function Gs(e){return(0,U.Et)(e)?"tukey":e}function Ys(e,t){let{config:n}=t;e={...e,encoding:Ts(e.encoding,n)};const{mark:i,encoding:r,params:o,projection:a,...s}=e,l=Uo(i)?i:{type:i};o&&ar(Ni("boxplot"));const u=l.extent??n.boxplot.extent,c=xi("size",l,n),f=l.invalid,d=Gs(u),{bins:h,timeUnits:p,transform:m,continuousAxisChannelDef:g,continuousAxis:y,groupby:v,aggregate:x,encodingWithoutContinuousAxis:b,ticksOrient:_,boxOrient:w,customTooltipWithoutAggregatedField:k}=function(e,t,n){const i=js(e,qs),{continuousAxisChannelDef:r,continuousAxis:o}=Is(e,i,qs),a=r.field,s=$e(a),l=Gs(t),u=[...Hs(a),{op:"median",field:a,as:`mid_box_${s}`},{op:"min",field:a,as:("min-max"===l?"lower_whisker_":"min_")+s},{op:"max",field:a,as:("min-max"===l?"upper_whisker_":"max_")+s}],c="min-max"===l||"tukey"===l?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:`iqr_${s}`},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:`upper_whisker_${s}`},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:`lower_whisker_${s}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if((0,U.cy)(t)){for(const e of t)e.aggregate?(i||(i=[]),i.push(e)):(r||(r=[]),r.push(e));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return(0,U.cy)(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(d),{bins:m,timeUnits:g,aggregate:y,groupby:v,encoding:x}=Ms(p,n),b="vertical"===i?"horizontal":"vertical",_=i,w=[...m,...g,{aggregate:[...y,...u],groupby:v},...c];return{bins:m,timeUnits:g,transform:w,groupby:v,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:_,customTooltipWithoutAggregatedField:h}}(e,u,n),$=$e(g.field),{color:E,size:A,...D}=b,S=e=>Bs(l,y,g,e,n.boxplot),C=S(D),F=S(b),M=((0,U.Gv)(n.boxplot.box)?n.boxplot.box.color:n.mark.color)||"#4c78a8",O=S({...D,...A?{size:A}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...E||{value:M}}}}),T=Rs([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),z={type:"tick",color:"black",opacity:1,orient:_,invalid:f,aria:!1},N="min-max"===d?T:Rs([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),R=[...C({partName:"rule",mark:{type:"rule",invalid:f,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:N}),...C({partName:"rule",mark:{type:"rule",invalid:f,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:N}),...C({partName:"ticks",mark:z,positionPrefix:"lower_whisker",extraEncoding:N}),...C({partName:"ticks",mark:z,positionPrefix:"upper_whisker",extraEncoding:N})],P=[..."tukey"!==d?R:[],...F({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:w,invalid:f,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...O({partName:"median",mark:{type:"tick",invalid:f,...(0,U.Gv)(n.boxplot.median)&&n.boxplot.median.color?{color:n.boxplot.median.color}:{},...c?{size:c}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if("min-max"===d)return{...s,transform:(s.transform??[]).concat(m),layer:P};const B=`datum["lower_box_${g.field}"]`,L=`datum["upper_box_${g.field}"]`,I=`(${L} - ${B})`,j=`${B} - ${u} * ${I}`,q=`${L} + ${u} * ${I}`,W=`datum["${g.field}"]`,G={joinaggregate:Hs(g.field),groupby:v},Y={transform:[{filter:`(${j} <= ${W}) && (${W} <= ${q})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${$}`},{op:"max",field:g.field,as:`upper_whisker_${$}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${$}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${$}`},...x],groupby:v}],layer:R},{tooltip:H,...X}=D,{scale:V,axis:Q}=g,J=Ps(g),Z=K(Q,["title"]),ee=Ls(l,"outliers",n.boxplot,{transform:[{filter:`(${W} < ${j}) || (${W} > ${q})`}],mark:"point",encoding:{[y]:{field:g.field,type:g.type,...void 0!==J?{title:J}:{},...void 0!==V?{scale:V}:{},...ce(Z)?{}:{axis:Z}},...X,...E?{color:E}:{},...k?{tooltip:k}:{}}})[0];let te;const ne=[...h,...p,G];return ee?te={transform:ne,layer:[ee,Y]}:(te=Y,te.transform.unshift(...ne)),{...s,layer:[te,{transform:m,layer:P}]}}function Hs(e){const t=$e(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}const Xs="errorbar",Vs=new As(Xs,Ks);function Ks(e,t){let{config:n}=t;e={...e,encoding:Ts(e.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:l,outerSpec:u,tooltipEncoding:c}=Js(e,Xs,n);delete a.size;const f=Bs(l,o,r,a,n.errorbar),d=l.thickness,h=l.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:c}),...f({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:c}),...f({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==d?{size:d}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...u,transform:i,...m.length>1?{layer:m}:{...m[0]}}}function Qs(e,t){const{encoding:n}=e;if(function(e){return(qa(e.x)||qa(e.y))&&!qa(e.x2)&&!qa(e.y2)&&!qa(e.xError)&&!qa(e.xError2)&&!qa(e.yError)&&!qa(e.yError2)}(n))return{orient:js(e,t),inputType:"raw"};const i=function(e){return qa(e.x2)||qa(e.y2)}(n),r=function(e){return qa(e.xError)||qa(e.xError2)||qa(e.yError)||qa(e.yError2)}(n),o=n.x,a=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,i=n.y2;if(qa(e)&&qa(i))throw new Error(`${t} cannot have both x2 and y2`);if(qa(e)){if(Ia(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(qa(i)){if(Ia(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,r=n.yError,s=n.yError2;if(qa(i)&&!qa(e))throw new Error(`${t} cannot have xError2 without xError`);if(qa(s)&&!qa(r))throw new Error(`${t} cannot have yError2 without yError`);if(qa(e)&&qa(r))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(qa(e)){if(Ia(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(qa(r)){if(Ia(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 Js(e,t,n){const{mark:i,encoding:r,params:o,projection:a,...s}=e,l=Uo(i)?i:{type:i};o&&ar(Ni(t));const{orient:u,inputType:c}=Qs(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:m}=Is(e,u,t),{errorBarSpecificAggregate:g,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:x}=function(e,t,n,i,r,o,a,s){let l=[],u=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!==("iqr"===n)&&ar(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)l=[{op:n,field:c,as:`extent_${c}`},{op:t,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:ve(t)},{fieldPrefix:"upper_",titlePrefix:Zs(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:Zs(t,n,"-")}],d=!0;else{let e,t,i;"ci"===n?(e="mean",t="ci0",i="ci1"):(e="median",t="q1",i="q3"),l=[{op:t,field:c,as:`lower_${c}`},{op:i,field:c,as:`upper_${c}`},{op:e,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:ns({field:c,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ns({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ns({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&ar((h=e.center,`${(p=e.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?u.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const e of u)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:ke(ke(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,f,d,h,p,c,t,n),{[m]:b,["x"===m?"x2":"y2"]:_,["x"===m?"xError":"yError"]:w,["x"===m?"xError2":"yError2"]:k,...$}=r,{bins:E,timeUnits:A,aggregate:D,groupby:S,encoding:C}=Ms($,n),F=[...D,...g],M="raw"!==c?[]:S,O=Rs(v,f,C,x);return{transform:[...s.transform??[],...E,...A,...0===F.length?[]:[{aggregate:F,groupby:M}],...y],groupby:M,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:s,tooltipEncoding:O}}function Zs(e,t,n){return`${ve(e)} ${n} ${t}`}const el="errorband",tl=new As(el,nl);function nl(e,t){let{config:n}=t;e={...e,encoding:Ts(e.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:l,tooltipEncoding:u}=Js(e,el,n),c=s,f=Bs(c,o,r,a,n.errorband),d=void 0!==e.encoding.x&&void 0!==e.encoding.y;let h={type:d?"area":"rect"},p={type:d?"line":"rule"};const m={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return d?(h={...h,...m,ariaRoleDescription:"errorband"},p={...p,...m,aria:!1}):c.interpolate?ar(tr("interpolate")):c.tension&&ar(tr("tension")),{...l,transform:i,layer:[...f({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...f({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:u}),...f({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:u})]}}const il={};function rl(e,t,n){const i=new As(e,t);il[e]={normalizer:i,parts:n}}rl(qs,Ys,["box","median","outliers","rule","ticks"]),rl(Xs,Ks,["ticks","rule"]),rl(el,nl,["band","borders"]);const ol=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],al={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"},sl={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"},ll=fe(al),ul=fe(sl),cl=fe({header:1,headerRow:1,headerColumn:1,headerFacet:1}),fl=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],dl={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},hl=(fe(dl),"_vgsid_"),pl={point:{on:"click",fields:[hl],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function ml(e){return"legend"===e||!!e?.legend}function gl(e){return ml(e)&&(0,U.Gv)(e)}function yl(e){return!!e?.select}function vl(e){const t=[];for(const n of e||[]){if(yl(n))continue;const{expr:e,bind:i,...r}=n;if(i&&e){const n={...r,bind:i,init:e};t.push(n)}else{const n={...r,...e?{update:e}:{},...i?{bind:i}:{}};t.push(n)}}return t}function xl(e){return Pe(e,"concat")}function bl(e){return Pe(e,"vconcat")}function _l(e){return Pe(e,"hconcat")}function wl(e){let{step:t,offsetIsDiscrete:n}=e;return n?t.for??"offset":"position"}function kl(e){return Pe(e,"step")}function $l(e){return Pe(e,"view")||Pe(e,"width")||Pe(e,"height")}const El=fe({align:1,bounds:1,center:1,columns:1,spacing:1});function Al(e,t){return e[t]??e["width"===t?"continuousWidth":"continuousHeight"]}function Dl(e,t){const n=Sl(e,t);return kl(n)?n.step:Cl}function Sl(e,t){return Ae(e[t]??e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const Cl=20;const Fl={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Cl},mark:{color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},arc:{},area:{},bar:Ko,circle:{},geoshape:{},image:{},line:{},point:{},rect:Vo,rule:{color:"black"},square:{},text:{color:"black"},tick:Qo,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,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,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:pl,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Ml=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Ol={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Tl={blue:Ml[0],orange:Ml[1],red:Ml[2],teal:Ml[3],green:Ml[4],yellow:Ml[5],purple:Ml[6],pink:Ml[7],brown:Ml[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 zl(e){const t=fe(e||{}),n={};for(const i of t){const t=e[i];n[i]=vs(t)?fi(t):di(t)}return n}const Nl=[...Yo,...$s,...cl,"background","padding","legend","lineBreak","scale","style","title","view"];function Rl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:t,font:n,fontSize:i,selection:r,...o}=e,a=(0,U.io)({},H(Fl),n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{signals:[{name:"color",value:(0,U.Gv)(e)?{...Tl,...e}:Tl}],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"}]}}}(t):{},i?function(e){return{signals:[{name:"fontSize",value:(0,U.Gv)(e)?{...Ol,...e}:Ol}],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,U.AU)(a,"selection",r,!0);const s=K(a,Nl);for(const l of["background","lineBreak","padding"])a[l]&&(s[l]=di(a[l]));for(const l of Yo)a[l]&&(s[l]=ni(a[l]));for(const l of $s)a[l]&&(s[l]=zl(a[l]));for(const l of cl)a[l]&&(s[l]=ni(a[l]));if(a.legend&&(s.legend=ni(a.legend)),a.scale){const{invalid:e,...t}=a.scale,n=ni(e,{level:1});s.scale={...ni(t),...fe(n).length>0?{invalid:n}:{}}}return a.style&&(s.style=function(e){const t=fe(e),n={};for(const i of t)n[i]=zl(e[i]);return n}(a.style)),a.title&&(s.title=ni(a.title)),a.view&&(s.view=ni(a.view)),s}const Pl=new Set(["view",...Io]),Bl=["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"],Ll={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Go};function Il(e){e=H(e);for(const t of Bl)delete e[t];if(e.axis)for(const t in e.axis)vs(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of ol)delete e.legend[t];if(e.mark){for(const t of qo)delete e.mark[t];e.mark.tooltip&&(0,U.Gv)(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(vl(e.params)),delete e.params);for(const t of Pl){for(const i of qo)delete e[t][i];const n=Ll[t];if(n)for(const i of n)delete e[t][i];Ul(e,t)}for(const t of fe(il))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=ii(e.title);ce(t)||(e.style["group-title"]={...e.style["group-title"],...t});ce(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n});ce(i)?delete e.title:e.title=i}(e);for(const t in e)(0,U.Gv)(e[t])&&ce(e[t])&&delete e[t];return ce(e)?void 0:e}function Ul(e,t,n,i){"view"===t&&(n="cell");const r={...i?e[t][i]:e[t],...e.style[n??t]};ce(r)||(e.style[n??t]=r),i||delete e[t]}function jl(e){return Pe(e,"layer")}class ql{map(e,t){return Da(e)?this.mapFacet(e,t):function(e){return Pe(e,"repeat")}(e)?this.mapRepeat(e,t):_l(e)?this.mapHConcat(e,t):bl(e)?this.mapVConcat(e,t):xl(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(jl(e))return this.mapLayer(e,t);if(Es(e))return this.mapUnit(e,t);throw new Error(Di(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...i}=e;return{...i,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}const Wl={zero:1,center:1,normalize:1};const Gl=new Set([$o,Ao,Eo,Mo,Co,No,Ro,So,Oo,To]),Yl=new Set([Ao,Eo,$o]);function Hl(e){return Pa(e)&&"quantitative"===Ba(e)&&!e.bin}function Xl(e,t,n){let{orient:i,type:r}=n;const o="x"===t?"y":"radius",a="x"===t&&["bar","area"].includes(r),s=e[t],l=e[o];if(Pa(s)&&Pa(l))if(Hl(s)&&Hl(l)){if(s.stack)return t;if(l.stack)return o;const e=Pa(s)&&!!s.aggregate;if(e!==(Pa(l)&&!!l.aggregate))return e?t:o;if(a){if("vertical"===i)return o;if("horizontal"===i)return t}}else{if(Hl(s))return t;if(Hl(l))return o}else{if(Hl(s)){if(a&&"vertical"===i)return;return t}if(Hl(l)){if(a&&"horizontal"===i)return;return o}}}function Vl(e,t){const n=Uo(e)?e:{type:e},i=n.type;if(!Gl.has(i))return null;const r=Xl(t,"x",n)||Xl(t,"theta",n);if(!r)return null;const o=t[r],a=Pa(o)?Qa(o,{}):void 0,s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(r),l=[],u=new Set;if(t[s]){const e=t[s],n=Pa(e)?Qa(e,{}):void 0;n&&n!==a&&(l.push(s),u.add(n))}const c="x"===s?"xOffset":"yOffset",f=t[c],d=Pa(f)?Qa(f,{}):void 0;d&&d!==a&&(l.push(c),u.add(d));const h=hn.reduce(((e,n)=>{if("tooltip"!==n&&Ds(t,n)){const i=t[n];for(const t of(0,U.YO)(i)){const i=as(t);if(i.aggregate)continue;const r=Qa(i,{});r&&u.has(r)||e.push({channel:n,fieldDef:i})}}return e}),[]);let p;return void 0!==o.stack?p=(0,U.Lm)(o.stack)?o.stack?"zero":null:o.stack:Yl.has(i)&&(p="zero"),p&&(m=p,(0,U.mQ)(Wl,m))?Fs(t)&&0===h.length?null:(o?.scale?.type&&o?.scale?.type!==Vr.LINEAR&&o?.stack&&ar(function(e){return`Stack is applied to a non-linear scale (${e}).`}(o.scale.type)),qa(t[Gt(r)])?(void 0!==o.stack&&ar(`Cannot stack "${g=r}" if there is already "${g}2".`),null):(Pa(o)&&o.aggregate&&!Hn.has(o.aggregate)&&ar(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:l,groupbyFields:u,fieldChannel:r,impute:null!==o.impute&&Bo(i),stackBy:h,offset:p})):null;var m,g}function Kl(e,t,n){const i=ni(e),r=xi("orient",i,n);if(i.orient=function(e,t,n){switch(e){case Co:case No:case Ro:case Oo:case Fo:case Do:return}const{x:i,y:r,x2:o,y2:a}=t;switch(e){case Ao:if(Pa(i)&&(Qn(i.bin)||Pa(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Pa(r)&&(Qn(r.bin)||Pa(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Pa(i)&&i.type===Wr&&!Kn(i.bin)||ja(i))&&Pa(r)&&Qn(r.bin)?"horizontal":"vertical";if(!a)return(Pa(r)&&r.type===Wr&&!Kn(r.bin)||ja(r))&&Pa(i)&&Qn(i.bin)?"vertical":"horizontal"}case Mo:if(o&&(!Pa(i)||!Qn(i.bin))&&a&&(!Pa(r)||!Qn(r.bin)))return;case Eo:if(a)return Pa(r)&&Qn(r.bin)?"horizontal":"vertical";if(o)return Pa(i)&&Qn(i.bin)?"vertical":"horizontal";if(e===Mo){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case So:case To:{const t=Ua(i),o=Ua(r);if(n)return n;if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o)return"vertical";{const e=Wa(i)&&i.type===Yr,t=Wa(r)&&r.type===Yr;if(e&&!t)return"vertical";if(!e&&t)return"horizontal"}return}}return"vertical"}(i.type,t,r),void 0!==r&&r!==i.orient&&ar(`Specified orient "${i.orient}" overridden with "${r}".`),"bar"===i.type&&i.orient){const e=xi("cornerRadiusEnd",i,n);if(void 0!==e){const n="horizontal"===i.orient&&t.x2||"vertical"===i.orient&&t.y2?["cornerRadius"]:Xo[i.orient];for(const t of n)i[t]=e;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}const o=xi("opacity",i,n),a=xi("fillOpacity",i,n);void 0===o&&void 0===a&&(i.opacity=function(e,t){if(Z([Co,To,No,Ro],e)&&!Fs(t))return.7;return}(i.type,t));return void 0===xi("cursor",i,n)&&(i.cursor=function(e,t,n){if(t.href||e.href||xi("href",e,n))return"pointer";return e.cursor}(i,t,n)),i}function Ql(e){const{point:t,line:n,...i}=e;return fe(i).length>1?i:i.type}function Jl(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:K(e[t],["point","line"])});return e}function Zl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"transparent"===e.point?{opacity:0}:e.point?(0,U.Gv)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?(0,U.Gv)(t.point)?t.point:{}:void 0}function eu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class tu{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(Es(e)){const{mark:n,encoding:i}=e,r=Uo(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!Zl(r,t[r.type],i);case"area":return!!Zl(r,t[r.type],i)||!!eu(r,t[r.type])}}return!1}run(e,t,n){const{config:i}=t,{params:r,projection:o,mark:a,name:s,encoding:l,...u}=e,c=Ts(l,i),f=Uo(a)?a:{type:a},d=Zl(f,i[f.type],c),h="area"===f.type&&eu(f,i[f.type]),p=[{name:s,...r?{params:r}:{},mark:Ql({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:K(c,["shape"])}],m=Vl(Kl(f,c,i),c);let g=c;if(m){const{fieldChannel:e,offset:t}=m;g={...c,[e]:{...c[e],...t?{stack:t}:{}}}}return g=K(g,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...V(f,["clip","interpolate","tension","tooltip"]),...h},encoding:g}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...V(f,["clip","tooltip"]),...d},encoding:g}),n({...u,layer:p},{...t,config:Jl(i)})}}function nu(e,t){return t?Ea(e)?lu(e,t):ou(e,t):e}function iu(e,t){return t?lu(e,t):e}function ru(e,t,n){const i=t[e];return r=i,!(0,U.Kg)(r)&&Pe(r,"repeat")?i.repeat in n?{...t,[e]:n[i.repeat]}:void ar(function(e){return`Unknown repeated value "${e}".`}(i.repeat)):t;var r}function ou(e,t){if(void 0!==(e=ru("field",e,t))){if(null===e)return null;if(Ca(e)&&ka(e.sort)){const n=ru("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function au(e,t){if(Pa(e))return ou(e,t);{const n=ru("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function su(e,t){if(!qa(e)){if(Ra(e)){const n=au(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=au(e,t);if(n)return n;if(za(e))return{condition:e.condition}}}function lu(e,t){const n={};for(const i in e)if(Pe(e,i)){const r=e[i];if((0,U.cy)(r))n[i]=r.map((e=>su(e,t))).filter((e=>e));else{const e=su(r,t);void 0!==e&&(n[i]=e)}}return n}class uu{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(Es(e)){const{encoding:t,mark:n}=e;if("line"===n||Uo(n)&&"line"===n.type)for(const e of Ut){const n=t[qt(e)];if(t[e]&&(Pa(n)&&!Qn(n.bin)||La(n)))return!0}}return!1}run(e,t,n){const{encoding:i,mark:r}=e;var o,a;return ar((o=!!i.x2,a=!!i.y2,`Line mark is for continuous lines and thus cannot be used with ${o&&a?"x2 and y2":o?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n({...e,mark:(0,U.Gv)(r)?{...r,type:"rule"}:"rule"},t)}}function cu(e){let{parentEncoding:t,encoding:n={},layer:i}=e,r={};if(t){const e=new Set([...fe(t),...fe(n)]);for(const o of e){const e=n[o],a=t[o];if(qa(e)){const t={...a,...e};r[o]=t}else Ra(e)?r[o]={...e,condition:{...a,...e.condition}}:e||null===e?r[o]=e:(i||Ga(a)||oi(a)||qa(a)||(0,U.cy)(a))&&(r[o]=a)}}else r=n;return!r||ce(r)?void 0:r}function fu(e){const{parentProjection:t,projection:n}=e;return t&&n&&ar(function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Re(t)} is overridden by a child projection ${Re(n)}.`}({parentProjection:t,projection:n})),n??t}function du(e){return Pe(e,"filter")}function hu(e){return Pe(e,"stop")}function pu(e){return Pe(e,"lookup")}function mu(e){return Pe(e,"pivot")}function gu(e){return Pe(e,"density")}function yu(e){return Pe(e,"quantile")}function vu(e){return Pe(e,"regression")}function xu(e){return Pe(e,"loess")}function bu(e){return Pe(e,"sample")}function _u(e){return Pe(e,"window")}function wu(e){return Pe(e,"joinaggregate")}function ku(e){return Pe(e,"flatten")}function $u(e){return Pe(e,"calculate")}function Eu(e){return Pe(e,"bin")}function Au(e){return Pe(e,"impute")}function Du(e){return Pe(e,"timeUnit")}function Su(e){return Pe(e,"aggregate")}function Cu(e){return Pe(e,"stack")}function Fu(e){return Pe(e,"fold")}function Mu(e){return Pe(e,"extent")&&!Pe(e,"density")&&!Pe(e,"regression")}function Ou(e,t){const{transform:n,...i}=e;if(n){const e=n.map((e=>{if(du(e))return{filter:Nu(e,t)};if(Eu(e)&&Jn(e.bin))return{...e,bin:zu(e.bin)};if(pu(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}));return{...i,transform:e}}return e}function Tu(e,t){const n=H(e);if(Pa(n)&&Jn(n.bin)&&(n.bin=zu(n.bin)),Ya(n)&&n.scale?.domain?.selection){const{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(za(n))if((0,U.cy)(n.condition))n.condition=n.condition.map((e=>{const{selection:n,param:i,test:r,...o}=e;return i?e:{...o,test:Nu(e,t)}}));else{const{selection:e,param:i,test:r,...o}=Tu(n.condition,t);n.condition=i?n.condition:{...o,test:Nu(n.condition,t)}}return n}function zu(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Nu(e,t){const n=e=>Y(e,(e=>{var n;const i={param:e,empty:t.emptySelections[e]??!0};return(n=t.selectionPredicates)[e]??(n[e]=[]),t.selectionPredicates[e].push(i),i}));return e.selection?n(e.selection):Y(e.test||e.filter,(e=>e.selection?n(e.selection):e))}class Ru extends ql{map(e,t){const n=t.selections??[];if(e.params&&!Es(e)){const t=[];for(const i of e.params)yl(i)?n.push(i):t.push(i);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){const n=t.selections;if(!n||!n.length)return e;const i=(t.path??[]).concat(e.name),r=[];for(const o of n)if(o.views&&o.views.length)for(const t of o.views)((0,U.Kg)(t)&&(t===e.name||i.includes(t))||(0,U.cy)(t)&&t.map((e=>i.indexOf(e))).every(((e,t,n)=>-1!==e&&(0===t||e>n[t-1]))))&&r.push(o);else r.push(o);return r.length&&(e.params=r),e}}for(const Xy of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=Ru.prototype[Xy];Ru.prototype[Xy]=function(t,n){return e.call(this,t,Pu(t,n))}}function Pu(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Bu(e,t){void 0===t&&(t=Rl(e.config));const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={config:t};return Uu.map(Lu.map(Iu.map(e,n),n),n)}(e,t),{width:i,height:r}=e,o=function(e,t,n){let{width:i,height:r}=t;const o=Es(e)||jl(e),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&&(ar(Ci("width")),i=void 0),"container"==r&&(ar(Ci("height")),r=void 0));const s={type:"pad",...a,...n?ju(n.autosize):{},...ju(e.autosize)};"fit"!==s.type||o||(ar(Si),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&ar(Fi("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&ar(Fi("height"));if(Ne(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Lu=new class extends ql{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Ws,Vs,tl,new tu,new uu]}map(e,t){if(Es(e)){const n=Ds(e.encoding,Be),i=Ds(e.encoding,Le),r=Ds(e.encoding,Ie);if(n||i||r)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,r=iu(e.encoding,t.repeater),o={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{},...r?{encoding:r}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(o,t);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(o,t.config))return s.run(o,t,a);return o}mapRepeat(e,t){return function(e){return!(0,U.cy)(e.repeat)&&Pe(e.repeat,"layer")}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:i,...r}=e,{row:o,column:a,layer:s}=n,{repeater:l={},repeaterPrefix:u=""}=t;return o||a?this.mapRepeat({...e,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},t):{...r,layer:s.map((e=>{const n={...l,layer:e},r=`${(i.name?`${i.name}_`:"")+u}child__layer_${me(e)}`,o=this.mapLayerOrUnit(i,{...t,repeater:n,repeaterPrefix:r});return o.name=r,o}))}}mapNonLayerRepeat(e,t){const{repeat:n,spec:i,data:r,...o}=e;!(0,U.cy)(n)&&e.columns&&(e=K(e,["columns"]),ar(Pi("repeat")));const a=[],{repeater:s={},repeaterPrefix:l=""}=t,u=!(0,U.cy)(n)&&n.row||[s?s.row:null],c=!(0,U.cy)(n)&&n.column||[s?s.column:null],f=(0,U.cy)(n)&&n||[s?s.repeat:null];for(const h of f)for(const e of u)for(const r of c){const o={repeat:h,row:e,column:r,layer:s.layer},u=(i.name?`${i.name}_`:"")+l+"child__"+((0,U.cy)(n)?`${me(h)}`:(n.row?`row_${me(e)}`:"")+(n.column?`column_${me(r)}`:"")),c=this.map(i,{...t,repeater:o,repeaterPrefix:u});c.name=u,a.push(K(c,["data"]))}const d=(0,U.cy)(n)?e.columns:n.column?n.column.length:1;return{data:i.data??r,align:"all",...o,columns:d,concat:a}}mapFacet(e,t){const{facet:n}=e;return Ea(n)&&e.columns&&(e=K(e,["columns"]),ar(Pi("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:r,parentProjection:o,config:a}=t,s=fu({parentProjection:o,projection:i}),l=cu({parentEncoding:r,encoding:iu(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(e,t){const{row:n,column:i,facet:r,...o}=e.encoding,{mark:a,width:s,projection:l,height:u,view:c,params:f,encoding:d,...h}=e,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},t),g=iu(o,t.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...u?{height:u}:{},...c?{view:c}:{},...l?{projection:l}:{},mark:a,encoding:g,...f?{params:f}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:i,facet:r}=e;if(n||i){r&&ar(`Facet encoding dropped as ${(o=[...n?[Be]:[],...i?[Le]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const t={},a={};for(const n of[Be,Le]){const i=e[n];if(i){const{align:e,center:r,spacing:o,columns:s,...l}=i;t[n]=l;for(const t of["align","center","spacing"])void 0!==i[t]&&(a[t]??(a[t]={}),a[t][n]=i[t])}}return{facetMapping:t,layout:a}}{const{align:e,center:n,spacing:i,columns:o,...a}=r;return{facetMapping:nu(a,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...i?{spacing:i}:{},...o?{columns:o}:{}}}}var o}mapLayer(e,t){let{parentEncoding:n,parentProjection:i,...r}=t;const{encoding:o,projection:a,...s}=e,l={...r,parentEncoding:cu({parentEncoding:n,encoding:o,layer:!0}),parentProjection:fu({parentProjection:i,projection:a})};return super.mapLayer({...s,...e.name?{name:[l.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{}},l)}},Iu=new class extends ql{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=Ou(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=Ou(e,t)).encoding){const n={};for(const[i,r]of he(e.encoding))n[i]=Tu(r,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...i}=e;return n?{...i,params:he(n).map((e=>{let[n,i]=e;const{init:r,bind:o,empty:a,...s}=i;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),t.emptySelections[n]="none"!==a;for(const l of de(t.selectionPredicates[n]??{}))l.empty="none"!==a;return{name:n,value:r,select:s,bind:o}}))}:e}},Uu=new Ru;function ju(e){return(0,U.Kg)(e)?{type:e}:e??{}}const qu=["background","padding"];function Wu(e,t){const n={};for(const i of qu)e&&void 0!==e[i]&&(n[i]=di(e[i]));return t&&(n.params=e.params),n}class Gu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.explicit=e,this.implicit=t}clone(){return new Gu(H(this.explicit),H(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return Ae(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){let{value:n,explicit:i}=t;void 0!==n&&this.set(e,n,i)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){let{explicit:n,implicit:i}=t;void 0!==n[e]?this.set(e,n[e],!0):void 0!==i[e]&&this.set(e,i[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of fe(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Yu(e){return{explicit:!0,value:e}}function Hu(e){return{explicit:!1,value:e}}function Xu(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Vu(t,n,i,r)}}function Vu(e,t,n,i){return e.explicit&&t.explicit&&ar(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using ${Re(n)}.`}(n,i,e.value,t.value)),e}function Ku(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Vu;return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Ne(e.value,t.value)?e:r(e,t,n,i)}class Qu extends Gu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function Ju(e){return Pe(e,"url")}function Zu(e){return Pe(e,"values")}function ec(e){return Pe(e,"name")&&!Ju(e)&&!Zu(e)&&!tc(e)}function tc(e){return e&&(nc(e)||ic(e)||rc(e))}function nc(e){return Pe(e,"sequence")}function ic(e){return Pe(e,"sphere")}function rc(e){return Pe(e,"graticule")}var oc;function ac(e){let{invalid:t,isPath:n}=e;switch(Jo(t,{isPath:n})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:n?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:n?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"}(oc||(oc={}));var sc=n(60646);function lc(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=we(r.field),r}function uc(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U.D_;if((0,U.cy)(e)){const i=e.map((e=>uc(e,t,n)));return t?`[${i.join(", ")}]`:i}return sr(e)?n(t?hr(e):function(e){const t=dr(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(Re(e)):e}function cc(e,t){for(const n of de(e.component.selection??{})){const i=n.name;let r=`${i}${Pf}, ${"global"===n.resolve?"true":`{unit: ${Uf(e)}}`}`;for(const o of If)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Bf,on:[{events:{signal:n.name+Pf},update:`modify(${(0,U.r$)(n.name+Rf)}, ${r})`}]})}return hc(t)}function fc(e,t){if(e.component.selection&&fe(e.component.selection).length){const n=(0,U.r$)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:(0,sc.P)("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return hc(t)}function dc(e,t){for(const n of de(e.component.selection??{}))for(const i of If)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function hc(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}class pc{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.includes(e)?ar("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}}class mc extends pc{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,this._source=this._name=t,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 ${Se()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function gc(e){return void 0!==e.as}function yc(e){return`${e}_end`}class vc extends pc{clone(){return new vc(null,H(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{const{field:r,timeUnit:o}=n;if(o){let a;if(gr(o)){if(Sp(t)){const{mark:e,markDef:i,config:s}=t,l=Fa({fieldDef:n,markDef:i,config:s});(Lo(e)||l)&&(a={timeUnit:Er(o),field:r})}}else a={as:Qa(n,{forAs:!0}),field:r,timeUnit:o};if(Sp(t)){const{mark:e,markDef:r,config:o}=t,s=Fa({fieldDef:n,markDef:r,config:o});Lo(e)&&gn(i)&&.5!==s&&(a.rectBandPosition=s)}a&&(e[Q(a)]=a)}return e}),{});return ce(n)?null:new vc(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...i}={...t},r={...i,timeUnit:Er(n)};return new vc(e,{[Q(r)]:r})}merge(e){this.timeUnits={...this.timeUnits};for(const t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,i]of he(this.timeUnits)){const r=gc(i)?i.as:`${i.field}_end`;e.has(r)||(t[n]=i)}this.timeUnits=t}producedFields(){return new Set(de(this.timeUnits).map((e=>gc(e)?e.as:yc(e.field))))}dependentFields(){return new Set(de(this.timeUnits).map((e=>e.field)))}hash(){return`TimeUnit ${Q(this.timeUnits)}`}assemble(){const e=[];for(const t of de(this.timeUnits)){const{rectBandPosition:n}=t,i=Er(t.timeUnit);if(gc(t)){const{field:r,as:o}=t,{unit:a,utc:s,...l}=i,u=[o,`${o}_end`];e.push({field:we(r),type:"timeunit",...a?{units:br(a)}:{},...s?{timezone:"utc"}:{},...l,as:u}),e.push(...wc(u,n,i))}else if(t){const{field:r}=t,o=r.replaceAll("\\.","."),a=_c({timeUnit:i,field:o}),s=yc(o);e.push({type:"formula",expr:a,as:s}),e.push(...wc([o,s],n,i))}}return e}}const xc="offsetted_rect_start",bc="offsetted_rect_end";function _c(e){let{timeUnit:t,field:n,reverse:i}=e;const{unit:r,utc:o}=t,a=_r(r),{part:s,step:l}=Sr(a,t.step);return`${o?"utcOffset":"timeOffset"}('${s}', datum['${n}'], ${i?-l:l})`}function wc(e,t,n){let[i,r]=e;if(void 0!==t&&.5!==t){const e=`datum['${i}']`,o=`datum['${r}']`;return[{type:"formula",expr:kc([_c({timeUnit:n,field:i,reverse:!0}),e],t+.5),as:`${i}_${xc}`},{type:"formula",expr:kc([e,o],t+.5),as:`${i}_${bc}`}]}return[]}function kc(e,t){let[n,i]=e;return`${1-t} * ${n} + ${t} * ${i}`}const $c="_tuple_fields";class Ec{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Ac={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Ec),o={},a={},s=new Set,l=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=me(`${i}_${n}`);for(let o=1;s.has(r);o++)r=me(`${i}_${n}_${o}`);return s.add(r),{[t]:r}},u=t.type,c=e.config.selection[u],f=void 0!==n.value?(0,U.YO)(n.value):null;let{fields:d,encodings:h}=(0,U.Gv)(n.select)?n.select:{};if(!d&&!h&&f)for(const m of f)if((0,U.Gv)(m))for(const e of fe(m))p=e,(0,U.mQ)(Lt,p)?(h||(h=[])).push(e):"interval"===u?(ar('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),h=c.encodings):(d??(d=[])).push(e);var p;d||h||(h=c.encodings,"fields"in c&&(d=c.fields));for(const m of h??[]){const t=e.fieldDef(m);if(t){let n=t.field;if(t.aggregate){ar(zi(m,t.aggregate));continue}if(!n){ar(Ti(m));continue}if(t.timeUnit&&!gr(t.timeUnit)){n=e.vgField(m);const i={timeUnit:t.timeUnit,as:n,field:t.field};a[Q(i)]=i}if(!o[n]){const i={field:n,channel:m,type:"interval"===u&&zn(m)&&so(e.getScaleComponent(m).get("type"))?"R":t.bin?"R-RE":"E",index:r.items.length};i.signals={...l(i,"data"),...l(i,"visual")},r.items.push(o[n]=i),r.hasField[n]=o[n],r.hasSelectionId=r.hasSelectionId||n===hl,$t(m)?(i.geoChannel=m,i.channel=kt(m),r.hasChannel[i.channel]=o[n]):r.hasChannel[m]=o[n]}}else ar(Ti(m))}for(const m of d??[]){if(r.hasField[m])continue;const e={type:"E",field:m,index:r.items.length};e.signals={...l(e,"data")},r.items.push(e),r.hasField[m]=e,r.hasSelectionId=r.hasSelectionId||m===hl}f&&(t.init=f.map((e=>r.items.map((t=>(0,U.Gv)(e)?void 0!==e[t.geoChannel||t.channel]?e[t.geoChannel||t.channel]:e[t.field]:e))))),ce(a)||(r.timeUnit=new vc(null,a))},signals:(e,t,n)=>{const i=t.name+$c;return n.filter((e=>e.name===i)).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(lc)})}},Dc=Ac,Sc={defined:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!zn(r))continue;const o=e.getScaleComponent(r),a=o?o.get("type"):void 0;"sequential"==a&&ar("Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc"),o&&so(a)?(o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)):ar("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||Mc(e)||0===i.length)return n;const r=n.find((e=>e.name===t.name));let o=r.update;if(o.includes(Lf))r.update=`{${i.map((e=>`${(0,U.r$)(we(e.field))}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of i){const t=`${(0,U.r$)(we(e.field))}: ${e.signals.data}`;o.includes(t)||(o=`${o.substring(0,o.length-1)}, ${t}}`)}r.update=o}return n.concat(i.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!Mc(e))for(const i of t.scales){const e=n.find((e=>e.name===i.signals.data));e.push="outer",delete e.value,delete e.update}return n}},Cc=Sc;function Fc(e,t){return`domain(${(0,U.r$)(e.scaleName(t))})`}function Mc(e){return e.parent&&Mp(e.parent)&&(!e.parent.parent??Mc(e.parent.parent))}const Oc="_brush",Tc="_scale_trigger",zc="geo_interval_init_tick",Nc="_init",Rc={defined:e=>"interval"===e.type,parse:(e,t,n)=>{var i;if(e.hasProjection){const e={...(0,L.isObject)(n.select)?n.select:{}};e.fields=[hl],e.encodings||(e.encodings=n.value?fe(n.value):[Je,Qe]),n.select={type:"interval",...e}}if(t.translate&&!Cc.defined(t)){const e=`!event.item || event.item.mark.name !== ${(0,U.r$)(t.name+Oc)}`;for(const n of t.events){if(!n.between){ar(`${n} is not an ordered event stream for interval selections.`);continue}const t=(0,U.YO)((i=n.between[0]).filter??(i.filter=[]));t.includes(e)||t.push(e)}}},signals:(e,t,n)=>{const i=t.name,r=i+Pf,o=de(t.project.hasChannel).filter((e=>e.channel===Ue||e.channel===je)),a=t.init?t.init[0]:null;if(n.push(...o.reduce(((n,i)=>n.concat(function(e,t,n,i){const r=!e.hasProjection,o=n.channel,a=n.signals.visual,s=(0,U.r$)(r?e.scaleName(o):e.projectionName()),l=e=>`scale(${s}, ${e})`,u=e.getSizeSignalRef(o===Ue?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce(((e,t)=>[...e,{events:t.between[0],update:`[${c}, ${c}]`},{events:t,update:`[${a}[0], clamp(${c}, 0, ${u})]`}]),[]);if(r){const r=n.signals.data,u=Cc.defined(t),c=e.getScaleComponent(o),d=c?c.get("type"):void 0,h=i?{init:uc(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+Tc},update:so(d)?`[${l(`${r}[0]`)}, ${l(`${r}[1]`)}]`:"[0, 0]"}),u?[{name:r,on:[]}]:[{name:a,...h,on:f},{name:r,...i?{init:uc(i)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}{const e=o===Ue?0:1,n=t.name+Nc;return[{name:a,...i?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:f}]}}(e,t,i,a&&a[i.index]))),[])),e.hasProjection){const s=(0,U.r$)(e.projectionName()),l=e.projectionName()+"_center",{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?a&&a[u.index]:`${l}[0]`,p=c?a&&a[c.index]:`${l}[1]`,m=t=>e.getSizeSignalRef(t).signal,g=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":m("width")}, ${d?d+"[1]":m("height")}]]`;if(a&&(n.unshift({name:i+Nc,init:`[scale(${s}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${s}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),!u||!c)){n.find((e=>e.name===l))||n.unshift({name:l,update:`invert(${s}, [${m("width")}/2, ${m("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${g}, {markname: ${(0,U.r$)(e.getName("marks"))}}, unit.mark)`}, ${`{unit: ${Uf(e)}}`})`,v=o.map((e=>e.signals.visual));return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...a?[{signal:zc}]:[]],update:y}]})}{if(!Cc.defined(t)){const t=i+Tc,r=o.map((t=>{const n=t.channel,{data:i,visual:r}=t.signals,o=(0,U.r$)(e.scaleName(n)),a=so(e.getScaleComponent(n).get("type"))?"+":"";return`(!isArray(${i}) || (${a}invert(${o}, ${r})[0] === ${a}${i}[0] && ${a}invert(${o}, ${r})[1] === ${a}${i}[1]))`}));r.length&&n.push({name:t,value:{},on:[{events:o.map((t=>({scale:e.scaleName(t.channel)}))),update:r.join(" && ")+` ? ${t} : {}`}]})}const s=o.map((e=>e.signals.data)),l=`unit: ${Uf(e)}, fields: ${i+$c}, values`;return n.concat({name:r,...a?{init:`{${l}: ${uc(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${l}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(Sp(e)&&e.hasProjection&&t.init){n.filter((e=>e.name===zc)).length||n.unshift({name:zc,value:null,on:[{events:"timer{1}",update:`${zc} === null ? {} : ${zc}`}]})}return n},marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,a=r?.signals.visual,s=o?.signals.visual,l=`data(${(0,U.r$)(t.name+Rf)})`;if(Cc.defined(t)||!r&&!o)return n;const u={x:void 0!==r?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==r?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const g of fe(u))u[g]=[{test:`${l}.length && ${l}[0].unit === ${Uf(e)}`,...u[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=fe(h).reduce(((e,t)=>(e[t]=[{test:[void 0!==r&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:h[t]},{value:null}],e)),{}),m=d??(t.translate?"move":null);return[{name:`${i+Oc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:i+Oc,type:"rect",clip:!0,encode:{enter:{...m?{cursor:{value:m}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}},Pc=Rc;const Bc={defined:e=>"point"===e.type,signals:(e,t,n)=>{const i=t.name,r=i+$c,o=t.project,a="(item().isVoronoi ? datum.datum : datum)",s=de(e.component.selection??{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+Oc):e),[]).map((e=>`indexof(item().mark.name, '${e}') < 0`)).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(s?` && ${s}`:"");let u=`unit: ${Uf(e)}, `;if(t.project.hasSelectionId)u+=`${hl}: ${a}[${(0,U.r$)(hl)}]`;else{u+=`fields: ${r}, values: [${o.items.map((t=>{const n=e.fieldDef(t.channel);return n?.bin?`[${a}[${(0,U.r$)(e.vgField(t.channel,{}))}], ${a}[${(0,U.r$)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${a}[${(0,U.r$)(t.field)}]`})).join(", ")}]`}const c=t.events;return n.concat([{name:i+Pf,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}},Lc=Bc;function Ic(e){let{model:t,channelDef:n,vgChannel:i,invalidValueRef:r,mainRefFn:o}=e;const a=za(n)&&n.condition;let s=[];if(a){s=(0,U.YO)(a).map((e=>{const n=o(e);if(function(e){return Pe(e,"param")}(e)){const{param:i,empty:r}=e;return{test:Vf(t,{param:i,empty:r}),...n}}return{test:Qf(t,e.test),...n}}))}void 0!==r&&s.push(r);const l=o(n);return void 0!==l&&s.push(l),s.length>1||1===s.length&&Boolean(s[0].test)?{[i]:s}:1===s.length?{[i]:s[0]}:{}}function Uc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=e.encoding[t];return Ic({model:e,channelDef:n,vgChannel:t,mainRefFn:t=>jc(t,e.config),invalidValueRef:void 0})}function jc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(e){if(Ga(e))return pi(e.value);if(qa(e)){const{format:i,formatType:r}=os(e);return fa({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function qc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{encoding:n,markDef:i,config:r,stack:o}=e,a=n.tooltip;if((0,U.cy)(a))return{tooltip:Gc({tooltip:a},o,r,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return Ic({model:e,channelDef:a,vgChannel:"tooltip",mainRefFn:e=>{const a=jc(e,r,s);if(a)return a;if(null===e)return;let l=xi("tooltip",i,r);return!0===l&&(l={content:"encoding"}),(0,U.Kg)(l)?{value:l}:(0,U.Gv)(l)?oi(l)?l:"encoding"===l.content?Gc(n,o,r,t):{signal:s}:void 0},invalidValueRef:void 0})}}function Wc(e,t,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r={...n,...n.tooltipFormat},o=new Set,a=i?"datum.datum":"datum",s=[];function l(n,i){const l=qt(i),u=Wa(n)?n:{...n,type:e[l].type},c=u.title||rs(u,r),f=(0,U.YO)(c).join(", ").replaceAll(/"/g,'\\"');let d;if(gn(i)){const t="x"===i?"x2":"y2",n=as(e[t]);if(Qn(u.bin)&&n){const e=Qa(u,{expr:a}),i=Qa(n,{expr:a}),{format:s,formatType:l}=os(u);d=xa(e,i,s,l,r),o.add(t)}}if((gn(i)||i===Ve||i===He)&&t&&t.fieldChannel===i&&"normalize"===t.offset){const{format:e,formatType:t}=os(u);d=fa({fieldOrDatumDef:u,format:e,formatType:t,expr:a,config:r,normalizeStack:!0}).signal}d??(d=jc(u,r,a).signal),s.push({channel:i,key:f,value:d})}zs(e,((e,t)=>{Pa(e)?l(e,t):Na(e)&&l(e.condition,t)}));const u={};for(const{channel:c,key:f,value:d}of s)o.has(c)||u[f]||(u[f]=d);return u}function Gc(e,t,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Wc(e,t,n,{reactiveGeom:i}),o=he(r).map((e=>{let[t,n]=e;return`"${t}": ${n}`}));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Yc(e){const{markDef:t,config:n}=e,i=xi("aria",t,n);return!1===i?{}:{...i?{aria:i}:{},...Hc(e),...Xc(e)}}function Hc(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const r=xi("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:(0,U.mQ)(ui,t)?{}:{ariaRoleDescription:{value:t}}}function Xc(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return Ic({model:e,channelDef:o,vgChannel:"description",mainRefFn:t=>jc(t,e.config),invalidValueRef:void 0});const a=xi("description",n,i);if(null!=a)return{description:pi(a)};if(!1===i.aria)return{};const s=Wc(t,r,i);return ce(s)?void 0:{description:{signal:he(s).map(((e,t)=>{let[n,i]=e;return`"${t>0?"; ":""}${n}: " + (${i})`})).join(" + ")}}}function Vc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markDef:i,encoding:r,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:l}=n;const u=r[e];void 0===s&&(l??(l=xi(e,i,o,{vgChannel:a,ignoreVgConfig:!za(u)})),void 0!==l&&(s=pi(l)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=ta({...c,scaleChannel:e,channelDef:u});return Ic({model:t,channelDef:u,vgChannel:a??e,invalidValueRef:f,mainRefFn:t=>aa({...c,channel:e,channelDef:t,stack:null,defaultRef:s})})}function Kc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0};const{markDef:n,encoding:i,config:r}=e,{type:o}=n,a=t.filled??xi("filled",n,r),s=Z(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=xi(!0===a?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[!0===a&&"color"]??s,u=xi(!1===a?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[!1===a&&"color"],c=a?"fill":"stroke",f={...l?{fill:pi(l)}:{},...u?{stroke:pi(u)}:{}};return n.color&&(a?n.fill:n.stroke)&&ar(ji("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Vc("color",e,{vgChannel:c,defaultValue:a?l:u}),...Vc("fill",e,{defaultValue:i.fill?l:void 0}),...Vc("stroke",e,{defaultValue:i.stroke?u:void 0})}}function Qc(e){const{encoding:t,mark:n}=e,i=t.order;return!Bo(n)&&Ga(i)?Ic({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:e=>pi(e.value),invalidValueRef:void 0}):{}}function Jc(e){let{channel:t,markDef:n,encoding:i={},model:r,bandPosition:o}=e;const a=`${t}Offset`,s=n[a],l=i[a];if(("xOffset"===a||"yOffset"===a)&&l){return{offsetType:"encoding",offset:aa({channel:a,channelDef:l,markDef:n,config:r?.config,scaleName:r.scaleName(a),scale:r.getScaleComponent(a),stack:null,defaultRef:pi(s),bandPosition:o})}}const u=n[a];return u?{offsetType:"visual",offset:u}:{}}function Zc(e,t,n){let{defaultPos:i,vgChannel:r}=n;const{encoding:o,markDef:a,config:s,stack:l}=t,u=o[e],c=o[Gt(e)],f=t.scaleName(e),d=t.getScaleComponent(e),{offset:h,offsetType:p}=Jc({channel:e,markDef:a,encoding:o,model:t,bandPosition:.5}),m=ef({model:t,defaultPos:i,channel:e,scaleName:f,scale:d}),g=!u&&gn(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:a}=e;if(qa(n)&&r&&t===r.fieldChannel){if(Pa(n)){let e=n.bandPosition;if(void 0!==e||"text"!==a.type||"radius"!==t&&"theta"!==t||(e=.5),void 0!==e)return oa({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:e,offset:o})}return ra(n,i,{suffix:"end"},{offset:o})}return ia(e)}({channel:e,channelDef:u,channel2Def:c,markDef:a,config:s,scaleName:f,scale:d,stack:l,offset:h,defaultRef:m,bandPosition:"encoding"===p?0:void 0});return g?{[r||e]:g}:void 0}function ef(e){let{model:t,defaultPos:n,channel:i,scaleName:r,scale:o}=e;const{markDef:a,config:s}=t;return()=>{const e=qt(i),l=Wt(i),u=xi(i,a,s,{vgChannel:l});if(void 0!==u)return sa(i,u);switch(n){case"zeroOrMin":return tf({scaleName:r,scale:o,mode:"zeroOrMin",mainChannel:e,config:s});case"zeroOrMax":return tf({scaleName:r,scale:o,mode:{zeroOrMax:{widthSignal:t.width.signal,heightSignal:t.height.signal}},mainChannel:e,config:s});case"mid":return{...t[Yt(i)],mult:.5}}}}function tf(e){let{mainChannel:t,config:n,...i}=e;const r=ea(i),{mode:o}=i;if(r)return r;switch(t){case"radius":{if("zeroOrMin"===o)return{value:0};const{widthSignal:e,heightSignal:t}=o.zeroOrMax;return{signal:`min(${e},${t})/2`}}case"theta":return"zeroOrMin"===o?{value:0}:{signal:"2*PI"};case"x":return"zeroOrMin"===o?{value:0}:{field:{group:"width"}};case"y":return"zeroOrMin"===o?{field:{group:"height"}}:{value:0}}}const nf={left:"x",center:"xc",right:"x2"},rf={top:"y",middle:"yc",bottom:"y2"};function of(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===e||"theta"===e)return Wt(e);const r="x"===e?"align":"baseline",o=xi(r,t,n);let a;return oi(o)?(ar(function(e){return`The ${e} for range marks cannot be an expression`}(r)),a=void 0):a=o,"x"===e?nf[a||("top"===i?"left":"center")]:rf[a||i]}function af(e,t,n){let{defaultPos:i,defaultPos2:r,range:o}=n;return o?sf(e,t,{defaultPos:i,defaultPos2:r}):Zc(e,t,{defaultPos:i})}function sf(e,t,n){let{defaultPos:i,defaultPos2:r}=n;const{markDef:o,config:a}=t,s=Gt(e),l=Yt(e),u=function(e,t,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=e,l=qt(n),u=Yt(n),c=Wt(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=Jc(n in i||n in o?{channel:n,markDef:o,encoding:i,model:e}:{channel:l,markDef:o,encoding:i,model:e});if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const t=Yt(n),i=e.markDef[t];return null!=i?{[t]:{value:i}}:{[c]:{field:e.getName(n)}}}const m=function(e){let{channel:t,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:l,offset:u,defaultRef:c}=e;if(qa(n)&&l&&t.charAt(0)===l.fieldChannel.charAt(0))return ra(n,a,{suffix:"start"},{offset:u});return ia({channel:t,channelDef:i,scaleName:a,scale:s,stack:l,markDef:r,config:o,offset:u,defaultRef:c})}({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{[c]:m};return lf(n,o)||lf(n,{[n]:_i(n,o,s.style),[u]:_i(u,o,s.style)})||lf(n,s[r])||lf(n,s.mark)||{[c]:ef({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,s);return{...Zc(e,t,{defaultPos:i,vgChannel:u[l]?of(e,o,a):Wt(e)}),...u}}function lf(e,t){const n=Yt(e),i=Wt(e);if(void 0!==t[i])return{[i]:sa(e,t[i])};if(void 0!==t[e])return{[i]:sa(e,t[e])};if(t[n]){const i=t[n];if(!Ho(i))return{[n]:sa(e,i)};ar(function(e){return`Position range does not support relative band size for ${e}.`}(n))}}function uf(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,a=Gt(t),s=Yt(t),l=i[t],u=i[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[s]??i.size??xi("size",r,n,{vgChannel:s}),p=Ht(t),m="bar"===o&&("x"===t?"vertical"===d:"horizontal"===d)||"tick"===o&&("y"===t?"vertical"===d:"horizontal"===d);return!Pa(l)||!(Kn(l.bin)||Qn(l.bin)||l.timeUnit&&!u)||h&&!Ho(h)||i[p]||ao(f)?(qa(l)&&ao(f)||m)&&!u?function(e,t,n){const{markDef:i,encoding:r,config:o,stack:a}=n,s=i.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=Yt(t),f=Gt(t),d=Ht(t),h=n.scaleName(d),p=n.getScaleComponent(Xt(t)),m="tick"===i.type||"horizontal"===s&&"y"===t||"vertical"===s&&"x"===t;let g;(r.size||i.size)&&(m?g=Vc("size",n,{vgChannel:c,defaultRef:pi(i.size)}):ar(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(i.type)));const y=!!g,v=Ma({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(u||p)?.get("type"),useVlSizeChannel:m});g=g||{[c]:cf(c,h||l,p||u,o,v,!!e,i.type)};const x="band"===(u||p)?.get("type")&&Ho(v)&&!y?"top":"middle",b=of(t,i,o,x),_="xc"===b||"yc"===b,{offset:w,offsetType:k}=Jc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),$=ia({channel:t,channelDef:e,markDef:i,config:o,scaleName:l,scale:u,stack:a,offset:w,defaultRef:ef({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?"encoding"===k?0:.5:oi(v)?{signal:`(1-${v})/2`}:Ho(v)?(1-v.band)/2:0});if(c)return{[b]:$,...g};{const e=Wt(f),t=g[c],n=w?{...t,offset:w}:t;return{[b]:$,[e]:(0,U.cy)($)?[$[0],{...$[1],offset:n}]:{...$,offset:n}}}}(l,t,e):sf(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function(e){let{fieldDef:t,fieldDef2:n,channel:i,model:r}=e;const{config:o,markDef:a,encoding:s}=r,l=r.getScaleComponent(i),u=r.scaleName(i),c=l?l.get("type"):void 0,f=l.get("reverse"),d=Ma({channel:i,fieldDef:t,markDef:a,config:o,scaleType:c}),h=r.component.axes[i]?.[0],p=h?.get("translate")??.5,m=gn(i)?xi("binSpacing",a,o)??0:0,g=Gt(i),y=Wt(i),v=Wt(g),x=bi("minBandSize",a,o),{offset:b}=Jc({channel:i,markDef:a,encoding:s,model:r,bandPosition:0}),{offset:_}=Jc({channel:g,markDef:a,encoding:s,model:r,bandPosition:0}),w=function(e){let{scaleName:t,fieldDef:n}=e;const i=Qa(n,{expr:"datum"});return`abs(scale("${t}", ${Qa(n,{expr:"datum",suffix:"end"})}) - scale("${t}", ${i}))`}({fieldDef:t,scaleName:u}),k=ff(i,m,f,p,b,x,w),$=ff(g,m,f,p,_??b,x,w),E=oi(d)?{signal:`(1-${d.signal})/2`}:Ho(d)?(1-d.band)/2:.5,A=Fa({fieldDef:t,fieldDef2:n,markDef:a,config:o});if(Kn(t.bin)||t.timeUnit){const e=t.timeUnit&&.5!==A;return{[v]:df({fieldDef:t,scaleName:u,bandPosition:E,offset:$,useRectOffsetField:e}),[y]:df({fieldDef:t,scaleName:u,bandPosition:oi(E)?{signal:`1-${E.signal}`}:1-E,offset:k,useRectOffsetField:e})}}if(Qn(t.bin)){const e=ra(t,u,{},{offset:$});if(Pa(n))return{[v]:e,[y]:ra(n,u,{},{offset:k})};if(Jn(t.bin)&&t.bin.step)return{[v]:e,[y]:{signal:`scale("${u}", ${Qa(t,{expr:"datum"})} + ${t.bin.step})`,offset:k}}}return void ar(nr(g))}({fieldDef:l,fieldDef2:u,channel:t,model:e})}function cf(e,t,n,i,r,o,a){if(Ho(r)){if(!n)return{mult:r.band,field:{group:e}};{const e=n.get("type");if("band"===e){let e=`bandwidth('${t}')`;1!==r.band&&(e=`${r.band} * ${e}`);const n=bi("minBandSize",{type:a},i);return{signal:n?`max(${gi(n)}, ${e})`:e}}1!==r.band&&(ar(function(e){return`Cannot use the relative band size with ${e} scale.`}(e)),r=void 0)}}else{if(oi(r))return r;if(r)return{value:r}}if(n){const e=n.get("range");if(ai(e)&&(0,U.Et)(e.step))return{value:e.step-2}}if(!o){const{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:r,tickBandPaddingInner:o}=i.scale,s=Ae(t,"tick"===a?o:"bar"===a?n:r);if(oi(s))return{signal:`(1 - (${s.signal})) * ${e}`};if((0,U.Et)(s))return{signal:`${1-s} * ${e}`}}return{value:Dl(i.view,e)-2}}function ff(e,t,n,i,r,o,a){if(_t(e))return 0;const s="x"===e||"y2"===e,l=s?-t/2:t/2;if(oi(n)||oi(r)||oi(i)||o){const e=gi(n),t=gi(r),u=gi(i),c=gi(o),f=o?`(${a} < ${c} ? ${s?"":"-"}0.5 * (${c} - (${a})) : ${l})`:l;return{signal:(u?`${u} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${f})`:f)}}return r=r||0,i+(n?-r-l:+r+l)}function df(e){let{fieldDef:t,scaleName:n,bandPosition:i,offset:r,useRectOffsetField:o}=e;return oa({scaleName:n,fieldOrDatumDef:t,bandPosition:i,offset:r,...o?{startSuffix:xc,endSuffix:bc}:{}})}const hf=new Set(["aria","width","height"]);function pf(e,t){const{fill:n,stroke:i}="include"===t.color?Kc(e):{};return{...gf(e.markDef,t),...mf("fill",n),...mf("stroke",i),...Vc("opacity",e),...Vc("fillOpacity",e),...Vc("strokeOpacity",e),...Vc("strokeWidth",e),...Vc("strokeDash",e),...Qc(e),...qc(e),...Uc(e,"href"),...Yc(e)}}function mf(e,t){return t?{[e]:t}:{}}function gf(e,t){return li.reduce(((n,i)=>(!hf.has(i)&&Pe(e,i)&&"ignore"!==t[i]&&(n[i]=pi(e[i])),n)),{})}function yf(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef(((r,o)=>{let a;if(!zn(o)||!(a=e.getScaleType(o)))return;const s=Yn(r.aggregate),l=Zo({scaleChannel:o,markDef:n,config:t,scaleType:a,isCountAggregate:s});if("break-paths-filter-domains"===(u=l)||"break-paths-show-domains"===u){const t=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});t&&i.add(t)}var u})),i.size>0){return{defined:{signal:[...i].map((e=>Lr(e,!0))).join(" && ")}}}}function vf(e,t){if(void 0!==t)return{[e]:pi(t)}}const xf="voronoi",bf={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(xf)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(Bo(o))return ar(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(xf),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...qc(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,l=!1;return n.forEach(((t,n)=>{const i=t.name??"";i===e.component.mark[0].name?s=n:i.includes(xf)&&(l=!0)})),l||n.splice(s+1,0,a),n}},_f=bf,wf={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!ml(e.bind),parse:(e,t,n)=>qf(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,a=t.init&&t.init[0],s=_f.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((e,r)=>{const l=me(`${i}_${e.field}`);n.filter((e=>e.name===l)).length||n.unshift({name:l,...a?{init:uc(a[r])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${(0,U.r$)(e.field)}] : null`}]:[],bind:o[e.field]??o[e.channel]??o})})),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find((e=>e.name===i+Pf)),a=i+$c,s=r.items.map((e=>me(`${i}_${e.field}`))),l=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${l} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},kf=wf,$f="_toggle",Ef={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+$f,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Pf,i=t.name+$f;return`${i} ? null : ${n}, `+("global"===t.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${Uf(e)}}, `)+`${i} ? ${n} : null`}},Af={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t)=>{t.clear&&(t.clear=(0,U.Kg)(t.clear)?(0,sc.P)(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(kf.defined(t))for(const i of t.project.items){const e=n.findIndex((e=>e.name===me(`${t.name}_${i.field}`)));-1!==e&&n[e].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)for(const r of t.project.items){const e=n.findIndex((e=>e.name===r.signals.visual));if(i(e,"[0, 0]"),-1===e){i(n.findIndex((e=>e.name===r.signals.data)),"null")}}else{let e=n.findIndex((e=>e.name===t.name+Pf));i(e,"null"),Ef.defined(t)&&(e=n.findIndex((e=>e.name===t.name+$f)),i(e,"false"))}return n}},Df={defined:e=>{const t="global"===e.resolve&&e.bind&&ml(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==hl;return t&&!n&&ar("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n)=>{const i=H(n);if(i.select=(0,U.Kg)(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},qf(t,i),(0,L.isObject)(n.select)&&(n.select.on||n.select.clear)){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=(0,U.YO)(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}const r=gl(t.bind)?t.bind.legend:"click",o=(0,U.Kg)(r)?(0,sc.P)(r,"view"):(0,U.YO)(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=gl(t.bind)&&t.bind.legend,o=e=>t=>{const n=H(t);return n.markname=e,n};for(const a of t.project.items){if(!a.hasLegend)continue;const e=`${me(a.field)}_legend`,s=`${i}_${e}`;if(0===n.filter((e=>e.name===s)).length){const i=r.merge.map(o(`${e}_symbols`)).concat(r.merge.map(o(`${e}_labels`))).concat(r.merge.map(o(`${e}_entries`)));n.unshift({name:s,...t.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 : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find((e=>e.name===i+Pf)),a=i+$c,s=r.items.filter((e=>e.hasLegend)).map((e=>me(`${i}_${me(e.field)}_legend`))),l=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);const u=n.find((e=>e.name===i+$f)),c=gl(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:c}):u.on[0].events=c),n}};const Sf="_translate_anchor",Cf="_translate_delta",Ff={defined:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Cc.defined(t),o=i+Sf,{x:a,y:s}=t.project.hasChannel;let l=(0,sc.P)(t.translate,"scope");return r||(l=l.map((e=>(e.between[0].markname=i+Oc,e)))),n.push({name:o,value:{},on:[{events:l.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?`, extent_x: ${r?Fc(e,Ue):`slice(${a.signals.visual})`}`:"")+(void 0!==s?`, extent_y: ${r?Fc(e,je):`slice(${s.signals.visual})`}`:"")+"}"}]},{name:i+Cf,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&Mf(e,t,a,"width",n),void 0!==s&&Mf(e,t,s,"height",n),n}};function Mf(e,t,n,i,r){const o=t.name,a=o+Sf,s=o+Cf,l=n.channel,u=Cc.defined(t),c=r.find((e=>e.name===n.signals[u?"data":"visual"])),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),m=`${a}.extent_${l}`,g=`${u&&d?"log"===h?"panLog":"symlog"===h?"panSymlog":"pow"===h?"panPow":"panLinear":"panLinear"}(${m}, ${`${u?l===Ue?p?"":"-":p?"-":"":""}${s}.${l} / ${u?`${f}`:`span(${m})`}`}${u?"pow"===h?`, ${d.get("exponent")??1}`:"symlog"===h?`, ${d.get("constant")??1}`:"":""})`;c.on.push({events:{signal:s},update:u?g:`clampRange(${g}, 0, ${f})`})}const Of="_zoom_anchor",Tf="_zoom_delta",zf={defined:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Cc.defined(t),o=i+Tf,{x:a,y:s}=t.project.hasChannel,l=(0,U.r$)(e.scaleName(Ue)),u=(0,U.r$)(e.scaleName(je));let c=(0,sc.P)(t.zoom,"scope");return r||(c=c.map((e=>(e.markname=i+Oc,e)))),n.push({name:i+Of,on:[{events:c,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter((e=>e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&Nf(e,t,a,"width",n),void 0!==s&&Nf(e,t,s,"height",n),n}};function Nf(e,t,n,i,r){const o=t.name,a=n.channel,s=Cc.defined(t),l=r.find((e=>e.name===n.signals[s?"data":"visual"])),u=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(a),f=c&&c.get("type"),d=s?Fc(e,a):l.name,h=o+Tf,p=`${s&&c?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${d}, ${`${o}${Of}.${a}`}, ${h}${s?"pow"===f?`, ${c.get("exponent")??1}`:"symlog"===f?`, ${c.get("constant")??1}`:"":""})`;l.on.push({events:{signal:h},update:s?p:`clampRange(${p}, 0, ${u})`})}const Rf="_store",Pf="_tuple",Bf="_modify",Lf="vlSelectionResolve",If=[Lc,Pc,Dc,Ef,kf,Cc,Df,Af,Ff,zf,_f];function Uf(e){let{escape:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},n=t?(0,U.r$)(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!Cp(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of Ct)e[t]&&(n+=` + '__facet_${t}_' + (facet[${(0,U.r$)(i.vgField(t))}])`)}return n}function jf(e){return de(e.component.selection??{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function qf(e,t){!(0,L.isString)(t.select)&&t.select.on||delete e.events,!(0,L.isString)(t.select)&&t.select.clear||delete e.clear,!(0,L.isString)(t.select)&&t.select.toggle||delete e.toggle}var Wf=n(66906);function Gf(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...Gf(e.object)),t.push(...Gf(e.property))),t)}function Yf(e){return"MemberExpression"===e.object.type?Yf(e.object):"datum"===e.object.name}function Hf(e){const t=(0,Wf.YK)(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&Yf(e)&&n.add(Gf(e).slice(1).join("."))})),n}class Xf extends pc{clone(){return new Xf(null,this.model,H(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Qf(this.model,this.filter,this),this._dependentFields=Hf(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Vf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const r=(0,U.Kg)(t)?t:t.param,o=me(r),a=(0,U.r$)(o+Rf);let s;try{s=e.getSelectionComponent(o,r)}catch(c){return`!!${o}`}if(s.project.timeUnit){const t=n??e.component.data.raw,i=s.project.timeUnit.clone();t.parent?i.insertAsParentOf(t):t.parent=i}const l=`${s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${a}, ${i}${"global"===s.resolve?")":`, ${(0,U.r$)(s.resolve)})`}`,u=`length(data(${a}))`;return!1===t.empty?`${u} && ${l}`:`!${u} || ${l}`}function Kf(e,t,n){const i=me(t),r=n.encoding;let o,a=n.field;try{o=e.getSelectionComponent(i,t)}catch(s){return i}if(r||a){if(r&&!a){const e=o.project.items.filter((e=>e.channel===r));!e.length||e.length>1?(a=o.project.items[0].field,ar((e.length?"Multiple ":"No ")+`matching ${(0,U.r$)(r)} encoding found for selection ${(0,U.r$)(n.param)}. `+`Using "field": ${(0,U.r$)(a)}.`)):a=e[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&ar(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${(0,U.r$)(a)}.`);return`${o.name}[${(0,U.r$)(we(a))}]`}function Qf(e,t,n){return ge(t,(t=>(0,U.Kg)(t)?t:function(e){return Pe(e,"param")}(t)?Vf(e,t,n):Br(t)))}function Jf(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function Zf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1};const{disable:r,orient:o,scale:a,labelExpr:s,title:l,zindex:u,...c}=e.combine();if(!r){for(const e in c){const n=e,i=bs[n],r=c[n];if(i&&i!==t&&"both"!==i)delete c[n];else if(vs(r)){const{condition:e,...t}=r,i=(0,U.YO)(e),o=ys[n];if(o){const{vgProp:e,part:r}=o;Jf(c,r,e,[...i.map((e=>{const{test:t,...n}=e;return{test:Qf(null,t),...n}})),t]),delete c[n]}else if(null===o){const e={signal:i.map((e=>{const{test:t,...n}=e;return`${Qf(null,t)} ? ${mi(n)} : `})).join("")+mi(t)};c[n]=e}}else if(oi(r)){const e=ys[n];if(e){const{vgProp:t,part:i}=e;Jf(c,i,t,r),delete c[n]}}Z(["labelAlign","labelBaseline"],n)&&null===c[n]&&delete c[n]}if("grid"===t){if(!c.grid)return;if(c.encode){const{grid:e}=c.encode;c.encode={...e?{grid:e}:{}},ce(c.encode)&&delete c.encode}return{scale:a,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Ae(u,0)}}{if(!i.header&&e.mainExtracted)return;if(void 0!==s){let e=s;c.encode?.labels?.update&&oi(c.encode.labels.update.text)&&(e=ke(s,"datum.label",c.encode.labels.update.text.signal)),Jf(c,"labels","text",{signal:e})}if(null===c.labelAlign&&delete c.labelAlign,c.encode){for(const t of xs)e.hasAxisPart(t)||delete c.encode[t];ce(c.encode)&&delete c.encode}const t=function(e,t){if(e)return(0,U.cy)(e)&&!ri(e)?e.map((e=>rs(e,t))).join(", "):e}(l,n);return{scale:a,orient:o,grid:!1,...t?{title:t}:{},...c,...!1===n.aria?{aria:!1}:{},zindex:Ae(u,0)}}}}function ed(e){const{axes:t}=e.component,n=[];for(const i of mn)if(t[i])for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const t="x"===i?"height":"width",r=e.getSizeSignalRef(t).signal;t!==r&&n.push({name:t,update:r})}return n}function td(e,t,n,i){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",r=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...fe(r),...fe(o)]),s={};for(const t of a.values())s[t]={signal:`${i.signal} === "${e}" ? ${gi(r[t])} : ${gi(o[t])}`};return s}return t[e]}))])}function nd(e,t){const n=[{}];for(const i of e){let e=t[i]?.style;if(e){e=(0,U.YO)(e);for(const i of e)n.push(t.style[i])}}return Object.assign.apply(null,n)}function id(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=wi(e,n,t);if(void 0!==r)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==i[o]?.[e])return{configFrom:o,configValue:i[o][e]};return{}}const rd={scale:e=>{let{model:t,channel:n}=e;return t.scaleName(n)},format:e=>{let{format:t}=e;return t},formatType:e=>{let{formatType:t}=e;return t},grid:e=>{let{fieldOrDatumDef:t,axis:n,scaleType:i}=e;return n.grid??function(e,t){return!ao(e)&&Pa(t)&&!Kn(t?.bin)&&!Qn(t?.bin)}(i,t)},gridScale:e=>{let{model:t,channel:n}=e;return function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(t,n)},labelAlign:e=>{let{axis:t,labelAngle:n,orient:i,channel:r}=e;return t.labelAlign||sd(n,i,r)},labelAngle:e=>{let{labelAngle:t}=e;return t},labelBaseline:e=>{let{axis:t,labelAngle:n,orient:i,channel:r}=e;return t.labelBaseline||ad(n,i,r)},labelFlush:e=>{let{axis:t,fieldOrDatumDef:n,channel:i}=e;return t.labelFlush??function(e,t){if("x"===t&&Z(["quantitative","temporal"],e))return!0;return}(n.type,i)},labelOverlap:e=>{let{axis:t,fieldOrDatumDef:n,scaleType:i}=e;return t.labelOverlap??function(e,t,n,i){if(n&&!(0,U.Gv)(i)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(n.type,i,Pa(n)&&!!n.timeUnit,Pa(n)?n.sort:void 0)},orient:e=>{let{orient:t}=e;return t},tickCount:e=>{let{channel:t,model:n,axis:i,fieldOrDatumDef:r,scaleType:o}=e;const a="x"===t?"width":"y"===t?"height":void 0,s=a?n.getSizeSignalRef(a):void 0;return i.tickCount??function(e){let{fieldOrDatumDef:t,scaleType:n,size:i,values:r}=e;if(!r&&!ao(n)&&"log"!==n){if(Pa(t)){if(Kn(t.bin))return{signal:`ceil(${i.signal}/10)`};if(t.timeUnit&&Z(["month","hours","day","quarter"],Er(t.timeUnit)?.unit))return}return{signal:`ceil(${i.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:o,size:s,values:i.values})},tickMinStep:function(e){let{format:t,fieldOrDatumDef:n}=e;if("d"===t)return 1;if(Pa(n)){const{timeUnit:e}=n;if(e){const t=Ar(e);if(t)return{signal:t}}}return},title:e=>{let{axis:t,model:n,channel:i}=e;if(void 0!==t.title)return t.title;const r=ld(n,i);if(void 0!==r)return r;const o=n.typedFieldDef(i),a="x"===i?"x2":"y2",s=n.fieldDef(a);return $i(o?[Sa(o)]:[],Pa(s)?[Sa(s)]:[])},values:e=>{let{axis:t,fieldOrDatumDef:n}=e;return function(e,t){const n=e.values;if((0,U.cy)(n))return ms(t,n);if(oi(n))return n;return}(t,n)},zindex:e=>{let{axis:t,fieldOrDatumDef:n,mark:i}=e;return t.zindex??function(e,t){if("rect"===e&&Ja(t))return 1;return 0}(i,n)}};function od(e){return`(((${e.signal} % 360) + 360) % 360)`}function ad(e,t,n,i){if(void 0!==e){if("x"===n){if(oi(e)){const n=od(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${oi(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(oi(t)){const n=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${n} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)===("top"===t)?"bottom":"top"}if(oi(e)){const n=od(e);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${oi(t)?`(${t.signal} === "left")`:"left"===t} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(oi(t)){const n=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)===("left"===t)?"top":"bottom"}}function sd(e,t,n){if(void 0===e)return;const i="x"===n,r=i?0:90,o=i?"bottom":"left";if(oi(e)){const n=od(e);return{signal:`(${r?`(${n} + 90)`:n} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${n} && ${n} < ${180+r}) === ${oi(t)?`(${t.signal} === "${o}")`:t===o} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(oi(t)){const n=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${n} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)===(t===o)?"left":"right"}function ld(e,t){const n="x"===t?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,a=r?r.title:void 0;return o&&a?Ei(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class ud extends pc{clone(){return new ud(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=Hf(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef(((t,n)=>{if(Ya(t)&&$a(t.sort)){const{field:i,timeUnit:r}=t,o=t.sort,a=o.map(((e,t)=>`${Br({field:i,timeUnit:r,equal:e})} ? ${t} : `)).join("")+o.length;e=new ud(e,{calculate:a,as:cd(t,n,{forAs:!0})})}})),e}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 ${Q(this.transform)}`}}function cd(e,t,n){return Qa(e,{prefix:t,suffix:"sort_index",...n})}function fd(e,t){return Z(["top","bottom"],t)?"column":Z(["left","right"],t)||"row"===e?"row":"column"}function dd(e,t,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return Ae((t||{})[e],r[e],n.header[e])}function hd(e,t,n,i){const r={};for(const o of e){const e=dd(o,t||{},n,i);void 0!==e&&(r[o]=e)}return r}const pd=["row","column"],md=["header","footer"];function gd(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=hd(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=fd(t,s),u=Oe(a);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...vd(u,l),...yd(l,u,o),...Ed(i,r,t,ll,al)}}}function yd(e,t){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle"){case"start":return{align:"left"};case"end":return{align:"right"}}const n=sd(t,"row"===e?"left":"top","row"===e?"y":"x");return n?{align:n}:{}}function vd(e,t){const n=ad(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function xd(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of md)if(n[r])for(const o of n[r]){const a=wd(e,t,r,n,o);null!=a&&i.push(a)}return i}function bd(e,t){const{sort:n}=e;return ka(n)?{field:Qa(n,{expr:"datum"}),order:n.order??"ascending"}:(0,U.cy)(n)?{field:cd(e,t,{expr:"datum"}),order:"ascending"}:{field:Qa(e,{expr:"datum"}),order:n??"ascending"}}function _d(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:l}=hd(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=fa({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=fd(t,s);return{text:{signal:l?ke(ke(l,"datum.label",u),"datum.value",Qa(e,{expr:"parent"})):u},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...vd(o,c),...yd(c,o,a),...Ed(n,e,t,ul,sl)}}function wd(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:a}=i,s=e.config?e.config:void 0;if(a&&r.labels){const{labelOrient:e}=hd(["labelOrient"],a.header,s,t);("row"===t&&!Z(["top","bottom"],e)||"column"===t&&!Z(["left","right"],e))&&(o=_d(a,t,s))}const l=Cp(e)&&!Ea(e.facet),u=r.axes,c=u?.length>0;if(o||c){const s="row"===t?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:bd(a,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const kd={column:{start:0,end:1},row:{start:1,end:0}};function $d(e,t){return kd[t][e]}function Ed(e,t,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=dd(a,t?.header,e,n);void 0!==i&&(o[r[a]]=i)}return o}function Ad(e){return[...Dd(e,"width"),...Dd(e,"height"),...Dd(e,"childWidth"),...Dd(e,"childHeight")]}function Dd(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const r=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),o=t.get("range");if(ao(i)&&ai(o)){const i=e.scaleName(n);if(Cp(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[Sd(i,o)]}return[Sd(i,o),{name:r,update:Cd(i,t,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=r.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${Al(e.config.view,t?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function Sd(e,t){const n=`${e}_step`;return oi(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function Cd(e,t,n){const i=t.get("type"),r=t.get("padding"),o=Ae(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,`bandspace(${n}, ${gi(a)}, ${gi(o)}) * ${e}_step`}function Fd(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function Md(e,t){return fe(e).reduce(((n,i)=>({...n,...Ic({model:t,channelDef:e[i],vgChannel:i,mainRefFn:e=>pi(e.value),invalidValueRef:void 0})})),{})}function Od(e,t){if(Cp(t))return"theta"===e?"independent":"shared";if(Mp(t))return"shared";if(Fp(t))return gn(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function Td(e,t){const n=e.scale[t],i=gn(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&ar(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[i][t]||"shared"}const zd={...dl,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Nd=fe(zd);class Rd extends Gu{}const Pd={symbols:function(e,t){let{fieldOrDatumDef:n,model:i,channel:r,legendCmpt:o,legendType:a}=t;if("symbol"!==a)return;const{markDef:s,encoding:l,config:u,mark:c}=i,f=s.filled&&"trail"!==c;let d={...yi({},i,jo),...Kc(i,{filled:f})};const h=o.get("symbolOpacity")??u.legend.symbolOpacity,p=o.get("symbolFillColor")??u.legend.symbolFillColor,m=o.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=void 0===h?Bd(l.opacity)??s.opacity:void 0;if(d.fill)if("fill"===r||f&&r===tt)delete d.fill;else if(Pe(d.fill,"field"))p?delete d.fill:(d.fill=pi(u.legend.symbolBaseFillColor??"black"),d.fillOpacity=pi(g??1));else if((0,U.cy)(d.fill)){const e=Ld(l.fill??l.color)??s.fill??(f&&s.color);e&&(d.fill=pi(e))}if(d.stroke)if("stroke"===r||!f&&r===tt)delete d.stroke;else if(Pe(d.stroke,"field")||m)delete d.stroke;else if((0,U.cy)(d.stroke)){const e=Ae(Ld(l.stroke||l.color),s.stroke,f?s.color:void 0);e&&(d.stroke={value:e})}if(r!==st){const e=Pa(n)&&Ud(i,o,n);e?d.opacity=[{test:e,...pi(g??1)},pi(u.legend.unselectedOpacity)]:g&&(d.opacity=pi(g))}return d={...d,...e},ce(d)?void 0:d},gradient:function(e,t){let{model:n,legendType:i,legendCmpt:r}=t;if("gradient"!==i)return;const{config:o,markDef:a,encoding:s}=n;let l={};const u=void 0===(r.get("gradientOpacity")??o.legend.gradientOpacity)?Bd(s.opacity)||a.opacity:void 0;u&&(l.opacity=pi(u));return l={...l,...e},ce(l)?void 0:l},labels:function(e,t){let{fieldOrDatumDef:n,model:i,channel:r,legendCmpt:o}=t;const a=i.legend(r)||{},s=i.config,l=Pa(n)?Ud(i,o,n):void 0,u=l?[{test:l,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:f}=a;let d;la(f)?d=ha({fieldOrDatumDef:n,field:"datum.value",format:c,formatType:f,config:s}):void 0===c&&void 0===f&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?d=ha({fieldOrDatumDef:n,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===n.type&&s.timeFormatType&&Pa(n)&&void 0===n.timeUnit&&(d=ha({fieldOrDatumDef:n,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const h={...u?{opacity:u}:{},...d?{text:d}:{},...e};return ce(h)?void 0:h},entries:function(e,t){let{legendCmpt:n}=t;const i=n.get("selections");return i?.length?{...e,fill:{value:"transparent"}}:e}};function Bd(e){return Id(e,((e,t)=>Math.max(e,t.value)))}function Ld(e){return Id(e,((e,t)=>Ae(e,t.value)))}function Id(e,t){return function(e){const t=e?.condition;return!!t&&((0,U.cy)(t)||Ga(t))}(e)?(0,U.YO)(e.condition).reduce(t,e.value):Ga(e)?e.value:void 0}function Ud(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=(0,U.r$)(n.field);return i.map((e=>`(!length(data(${(0,U.r$)(me(e)+Rf)})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`)).join(" || ")}const jd={direction:e=>{let{direction:t}=e;return t},format:e=>{let{fieldOrDatumDef:t,legend:n,config:i}=e;const{format:r,formatType:o}=n;return pa(t,t.type,r,o,i,!1)},formatType:e=>{let{legend:t,fieldOrDatumDef:n,scaleType:i}=e;const{formatType:r}=t;return ma(r,n,i)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??function(e){let{legendConfig:t,model:n,direction:i,orient:r,scaleType:o}=e;const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:l,gradientVerticalMinLength:u}=t;if(lo(o))return"horizontal"===i?"top"===r||"bottom"===r?Gd(n,"width",s,a):s:Gd(n,"height",u,l);return}(e)},labelOverlap:e=>{let{legend:t,legendConfig:n,scaleType:i}=e;return t.labelOverlap??n.labelOverlap??function(e){if(Z(["quantile","threshold","log","symlog"],e))return"greedy";return}(i)},symbolType:e=>{let{legend:t,markDef:n,channel:i,encoding:r}=e;return t.symbolType??function(e,t,n,i){if("shape"!==t){const e=Ld(n)??i;if(e)return e}switch(e){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"}}(n.type,i,r.shape,n.shape)},title:e=>{let{fieldOrDatumDef:t,config:n}=e;return ns(t,n,{allowDisabling:!0})},type:e=>{let{legendType:t,scaleType:n,channel:i}=e;if(Dt(i)&&lo(n)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:e=>{let{fieldOrDatumDef:t,legend:n}=e;return function(e,t){const n=e.values;if((0,U.cy)(n))return ms(t,n);if(oi(n))return n;return}(n,t)}};function qd(e){const{legend:t}=e;return Ae(t.type,function(e){let{channel:t,timeUnit:n,scaleType:i}=e;if(Dt(t)){if(Z(["quarter","month","day"],n))return"symbol";if(lo(i))return"gradient"}return"symbol"}(e))}function Wd(e){let{legendConfig:t,legendType:n,orient:i,legend:r}=e;return r.direction??t[n?"gradientDirection":"symbolDirection"]??function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(i,n)}function Gd(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Yd(e){const t=Sp(e)?function(e){const{encoding:t}=e,n={};for(const i of[tt,...fl]){const r=ss(t[i]);r&&e.getScaleComponent(i)&&(i===rt&&Pa(r)&&r.type===Xr||(n[i]=Xd(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Yd(i);for(const r of fe(i.component.legends))n.legend[r]=Td(e.component.resolve,r),"shared"===n.legend[r]&&(t[r]=Vd(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of fe(t))for(const t of e.children)t.component.legends[i]&&"shared"===n.legend[i]&&delete t.component.legends[i];return t}(e);return e.component.legends=t,t}function Hd(e,t,n,i){switch(t){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===t&&e===i?.title)return!0}return e===(n||{})[t]}function Xd(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,a=o.legend,s=new Rd({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){const i=e.fieldDef(t)?.field;for(const r of de(e.component.selection??{})){const e=r.project.hasField[i]??r.project.hasChannel[t];if(e&&Df.defined(r)){const t=n.get("selections")??[];t.push(r.name),n.set("selections",t,!1),e.hasLegend=!0}}}(e,t,s);const l=void 0!==n?!n:a.disable;if(s.set("disable",l,void 0!==n),l)return s;n=n||{};const u=e.getScaleComponent(t).get("type"),c=ss(r[t]),f=Pa(c)?Er(c.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=qd({legend:n,channel:t,timeUnit:f,scaleType:u}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:u,orient:d,legendType:h,direction:Wd({legend:n,legendType:h,orient:d,legendConfig:a})};for(const x of Nd){if("gradient"===h&&x.startsWith("symbol")||"symbol"===h&&x.startsWith("gradient"))continue;const i=x in jd?jd[x](p):n[x];if(void 0!==i){const r=Hd(i,x,n,e.fieldDef(t));(r||void 0===o.legend[x])&&s.set(x,i,r)}}const m=n?.encoding??{},g=s.get("selections"),y={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:h};for(const x of["labels","legend","title","symbols","gradient","entries"]){const t=Md(m[x]??{},e),n=x in Pd?Pd[x](t,v):t;void 0===n||ce(n)||(y[x]={...g?.length&&Pa(c)?{name:`${me(c.field)}_legend_${x}`}:{},...g?.length?{interactive:!!g}:{},update:n})}return ce(y)||s.set("encode",y,!!n?.encoding),s}function Vd(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const o of Nd){const n=Ku(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",((e,t)=>{switch(o){case"symbolType":return Kd(e,t);case"title":return Ai(e,t);case"type":return r=!0,Hu("symbol")}return Vu(e,t,o,"legend")}));e.setWithExplicit(o,n)}return r&&(e.implicit?.encode?.gradient&&ye(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&ye(e.explicit,["encode","gradient"])),e}function Kd(e,t){return"circle"===t.value?t:e}function Qd(e){const t=e.component.legends,n={};for(const i of fe(t)){const r=Re(e.getScaleComponent(i).get("domains"));if(n[r])for(const e of n[r]){Vd(e,t[i])||n[r].push(t[i])}else n[r]=[t[i].clone()]}return de(n).flat().map((t=>function(e,t){const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(n)return;!1===t.aria&&void 0==o.aria&&(o.aria=!1);if(o.encode?.symbols){const e=o.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||o.stroke||(e.stroke={value:"transparent"});for(const t of fl)o[t]&&delete e[t]}o.title||delete o.title;if(void 0!==i){let e=i;o.encode?.labels?.update&&oi(o.encode.labels.update.text)&&(e=ke(i,"datum.label",o.encode.labels.update.text.signal)),function(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}(o,"labels","text",{signal:e})}return o}(t,e.config))).filter((e=>void 0!==e))}function Jd(e){return Mp(e)||Fp(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Zd(e))}(e):Zd(e)}function Zd(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const i=oi(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return Z(t,i)||t.push(i),t}),[]);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?`[${o.join(", ")}]`:o[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const eh=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class th extends Gu{constructor(e,t,n,i){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function nh(e){e.component.projection=Sp(e)?function(e){if(e.hasProjection){const t=ni(e.specifiedProjection),n=!(t&&(null!=t.scale||null!=t.translate)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?function(e){const t=[],{encoding:n}=e;for(const i of[[Je,Qe],[et,Ze]])(ss(n[i[0]])||ss(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(rt)&&e.typedFieldDef(rt).type===Xr&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(oc.Main));return t}(e):void 0,o=new th(e.projectionName(!0),{...ni(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}return}(e):function(e){if(0===e.children.length)return;let t;for(const i of e.children)nh(i);const n=te(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=te(eh,(n=>!(0,U.mQ)(e.explicit,n)&&!(0,U.mQ)(t.explicit,n)||!!((0,U.mQ)(e.explicit,n)&&(0,U.mQ)(t.explicit,n)&&Ne(e.get(n),t.get(n)))));if(Ne(e.size,t.size)){if(n)return e;if(Ne(e.explicit,{}))return t;if(Ne(t.explicit,{}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),i=new th(n,t.specifiedProjection,t.size,H(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&i.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return i}return}(e)}function ih(e,t,n,i){if(gs(t,n)){const r=Sp(e)?e.axis(n)??e.legend(n)??{}:{},o=Qa(t,{expr:"datum"}),a=Qa(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Qa(t,{binSuffix:"range",forAs:!0}),formula:xa(o,a,r.format,r.formatType,i)}}return{}}function rh(e,t){return`${Vn(e)}_${t}`}function oh(e,t,n){const i=rh(fs(n,void 0)??{},t);return e.getName(`${i}_bins`)}function ah(e,t,n){let i,r;i=function(e){return"as"in e}(e)?(0,U.Kg)(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Qa(e,{forAs:!0}),Qa(e,{binSuffix:"end",forAs:!0})];const o={...fs(t,void 0)},a=rh(o,e.field),{signal:s,extentSignal:l}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(Zn(o.extent)){const e=o.extent;r=Kf(n,e.param,e),delete o.extent}return{key:a,binComponent:{bin:o,field:e.field,as:[i],...s?{signal:s}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}}}}class sh extends pc{clone(){return new sh(null,H(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{if(Wa(n)&&Kn(n.bin)){const{key:r,binComponent:o}=ah(n,n.bin,t);e[r]={...o,...e[r],...ih(t,n,i,t.config)}}return e}),{});return ce(n)?null:new sh(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=ah(t,t.bin,n);return new sh(e,{[i]:r})}merge(e,t){for(const n of fe(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=re([...this.bins[n].as,...e.bins[n].as],Q)):this.bins[n]=e.bins[n];for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}producedFields(){return new Set(de(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(de(this.bins).map((e=>e.field)))}hash(){return`Bin ${Q(this.bins)}`}assemble(){return de(this.bins).flatMap((e=>{const t=[],[n,...i]=e.as,{extent:r,...o}=e.bin,a={type:"bin",field:we(e.field),as:n,signal:e.signal,...Zn(r)?{extent:null}:{extent:r},...e.span?{span:{signal:`span(${e.span})`}}:{},...o};!r&&e.extentSignal&&(t.push({type:"extent",field:we(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const s of i)for(let e=0;e<2;e++)t.push({type:"formula",expr:Qa({field:n[e]},{expr:"datum"}),as:s[e]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function lh(e,t,n,i){const r=Sp(i)?i.encoding[Gt(t)]:void 0;if(Wa(n)&&Sp(i)&&Oa(n,r,i.markDef,i.config)){e.add(Qa(n,{})),e.add(Qa(n,{suffix:"end"}));const{mark:r,markDef:o,config:a}=i,s=Fa({fieldDef:n,markDef:o,config:a});Lo(r)&&.5!==s&&gn(t)&&(e.add(Qa(n,{suffix:xc})),e.add(Qa(n,{suffix:bc}))),n.bin&&gs(n,t)&&e.add(Qa(n,{binSuffix:"range"}))}else if($t(t)){const n=kt(t);e.add(i.getName(n))}else e.add(Qa(n));return Ya(n)&&function(e){return(0,U.Gv)(e)&&"field"in e}(n.scale?.range)&&e.add(n.scale.range.field),e}class uh extends pc{clone(){return new uh(null,new Set(this.dimensions),H(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const i={},r=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:o,field:a}=e;if(o)if("count"===o)i["*"]??(i["*"]={}),i["*"].count=new Set([Qa(e,{forAs:!0})]);else{if(jn(o)||qn(o)){const e=jn(o)?"argmin":"argmax",t=o[e];i[t]??(i[t]={}),i[t][e]=new Set([Qa({op:e,field:t},{forAs:!0})])}else i[a]??(i[a]={}),i[a][o]=new Set([Qa(e,{forAs:!0})]);zn(n)&&"unaggregated"===t.scaleDomain(n)&&(i[a]??(i[a]={}),i[a].min=new Set([Qa({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Qa({field:a,aggregate:"max"},{forAs:!0})]))}else lh(r,n,e,t)})),r.size+fe(i).length===0?null:new uh(e,r,i)):null}static makeFromTransform(e,t){var n;const i=new Set,r={};for(const o of t.aggregate){const{op:e,field:t,as:i}=o;e&&("count"===e?(r["*"]??(r["*"]={}),r["*"].count=new Set([i||Qa(o,{forAs:!0})])):(r[t]??(r[t]={}),(n=r[t])[e]??(n[e]=new Set),r[t][e].add(i||Qa(o,{forAs:!0}))))}for(const o of t.groupby??[])i.add(o);return i.size+fe(r).length===0?null:new uh(e,i,r)}merge(e){return ae(this.dimensions,e.dimensions)?(function(e,t){for(const n of fe(t)){const i=t[n];for(const t of fe(i))n in e?e[n][t]=new Set([...e[n][t]??[],...i[t]]):e[n]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(){rr.debug(...arguments)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...fe(this.measures)])}producedFields(){const e=new Set;for(const t of fe(this.measures))for(const n of fe(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add(`${n}_${t}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Q({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const i of fe(this.measures))for(const r of fe(this.measures[i]))for(const o of this.measures[i][r])n.push(o),e.push(r),t.push("*"===i?null:we(i));return{type:"aggregate",groupby:[...this.dimensions].map(we),ops:e,fields:t,as:n}}}class ch extends pc{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i;for(const r of Ct){const e=t.facet[r];if(e){const{bin:n,sort:i}=e;this[r]={name:t.getName(`${r}_domain`),fields:[Qa(e),...Kn(n)?[Qa(e,{binSuffix:"end"})]:[]],...ka(i)?{sortField:i}:(0,U.cy)(i)?{sortIndexField:cd(e,r)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of Ct)this[t]&&(e+=` ${t.charAt(0)}:${Q(this[t])}`);return e}get fields(){const e=[];for(const t of Ct)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){const e=new Set(this.fields);for(const t of Ct)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of mn){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(ao(i)&&ai(r)){const n=op(ap(this.childModel,t));n?e[t]=n:ar(Oi(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x",facet:void 0}[e],r=[],o=[],a=[];i&&n&&n[i]&&(t?(r.push(`distinct_${n[i]}`),o.push("max")):(r.push(n[i]),o.push("distinct")),a.push(`distinct_${n[i]}`));const{sortField:s,sortIndexField:l}=this[e];if(s){const{op:e=ba,field:t}=s;r.push(t),o.push(e),a.push(Qa(s,{forAs:!0}))}else l&&(r.push(l),o.push("max"),a.push(l));return{name:this[e].name,source:t??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...r.length?{fields:r,ops:o,as:a}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],r={};for(const s of pd){for(const e of md){const t=(n[s]&&n[s][e])??[];for(const e of t)if(e.axes?.length>0){r[s]=!0;break}}if(r[s]){const e=`length(data("${this.facet.name}"))`,n="row"===s?t?{signal:`ceil(${e} / ${t})`}:1:t?{signal:`min(${e}, ${t})`}:{signal:e};i.push({name:`${this.facet.name}_${s}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:o,column:a}=r;return(o||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:r,facet:o}=this;if(i&&r&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;const i=[].concat(n.x??[],n.y??[]),r=i.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:r}]})}for(const a of[Le,Be])this[a]&&e.push(this.assembleRowColumnHeaderData(a,t,n));if(o){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function fh(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function dh(e){const t={};return G(e.filter,(e=>{if(Rr(e)){let n=null;Cr(e)?n=di(e.equal):Mr(e)?n=di(e.lte):Fr(e)?n=di(e.lt):Or(e)?n=di(e.gt):Tr(e)?n=di(e.gte):zr(e)?n=e.range[0]:Nr(e)&&(n=(e.oneOf??e.in)[0]),n&&(sr(n)?t[e.field]="date":(0,U.Et)(n)?t[e.field]="number":(0,U.Kg)(n)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function hh(e){const t={};function n(e){var n;hs(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,(0,U.Kg)(n)&&Z(["min","max"],n))?t[e.field]="number":Ee(e.field)>1?e.field in t||(t[e.field]="flatten"):Ya(e)&&ka(e.sort)&&Ee(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((Sp(e)||Cp(e))&&e.forEachFieldDef(((t,i)=>{if(Wa(t))n(t);else{const r=qt(i),o=e.fieldDef(r);n({...t,type:o.type})}})),Sp(e)){const{mark:n,markDef:i,encoding:r}=e;if(Bo(n)&&!e.encoding.order){const e=r["horizontal"===i.orient?"y":"x"];Pa(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class ph extends pc{clone(){return new ph(null,H(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${Q(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;return!tc(r)&&r?.format?.parse&&(i=r.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const a of fe(n)){const e=i.getWithExplicit(a);void 0!==e.value&&(e.explicit||e.value===n[a]||"derived"===e.value||"flatten"===n[a]?delete n[a]:ar(Bi(a,n[a],e.value)))}for(const a of fe(t)){const e=i.get(a);void 0!==e&&(e===t[a]?delete t[a]:ar(Bi(a,t[a],e)))}const r=new Gu(t,n);i.copyAll(r);const o={};for(const a of fe(r.combine())){const e=r.get(a);null!==e&&(o[a]=e)}return 0===fe(o).length||i.parseNothing?null:new ph(e,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of fe(this._parse)){const n=this._parse[t];1===Ee(t)&&(e[t]=n)}return e}producedFields(){return new Set(fe(this._parse))}dependentFields(){return new Set(fe(this._parse))}assembleTransforms(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return fe(this._parse).filter((t=>!e||Ee(t)>1)).map((e=>{const t=function(e,t){const n=xe(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(t.startsWith("date:"))return`timeParse(${n},'${fh(t.slice(5,t.length))}')`;if(t.startsWith("utc:"))return`utcParse(${n},'${fh(t.slice(4,t.length))}')`;return ar(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:$e(e)}})).filter((e=>null!==e))}}class mh extends pc{clone(){return new mh(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([hl])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:hl}}}class gh extends pc{clone(){return new gh(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Q(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class yh extends pc{clone(){return new yh(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Q(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class vh extends pc{constructor(e){let t;if(super(null),e??(e={name:"source"}),tc(e)||(t=e.format?{...K(e.format,["parse"])}:{}),Zu(e))this._data={values:e.values};else if(Ju(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];Z(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else ic(e)?this._data={values:[{type:"Sphere"}]}:(ec(e)||tc(e))&&(this._data={});this._generator=tc(e),e.name&&(this._name=e.name),t&&!ce(t)&&(this._data.format=t)}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(e){this._name=e}set parent(e){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 xh,bh=function(e,t,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 t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},_h=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};function wh(e){return e instanceof vh||e instanceof gh||e instanceof yh}class kh{constructor(){xh.set(this,void 0),bh(this,xh,!1,"f")}setModified(){bh(this,xh,!0,"f")}get modifiedFlag(){return _h(this,xh,"f")}}xh=new WeakMap;class $h extends kh{getNodeDepths(e,t,n){n.set(e,t);for(const i of e.children)this.getNodeDepths(i,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const n of t)this.run(n[0]);return this.modifiedFlag}}class Eh extends kh{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class Ah extends Eh{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let i=0;i<t.length;i++)void 0===n[t[i]]?n[t[i]]=[e.children[i]]:n[t[i]].push(e.children[i]);for(const i of fe(n))n[i].length>1&&(this.setModified(),this.mergeNodes(e,n[i]))}}class Dh extends Eh{constructor(e){super(),this.requiresSelectionId=e&&jf(e)}run(e){e instanceof mh&&(this.requiresSelectionId&&(wh(e.parent)||e.parent instanceof uh||e.parent instanceof ph)||(this.setModified(),e.remove()))}}class Sh extends kh{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof vc&&(n=e.producedFields(),se(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const i of e.children)this.run(i,new Set([...t,...n]))}}class Ch extends Eh{constructor(){super()}run(e){e instanceof mc&&!e.isRequired()&&(this.setModified(),e.remove())}}class Fh extends $h{run(e){if(!wh(e)&&!(e.numChildren()>1))for(const t of e.children)if(t instanceof ph)if(e instanceof ph)this.setModified(),e.merge(t);else{if(ue(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class Mh extends $h{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof ph));if(e.numChildren()>1&&n.length>=1){const i={},r=new Set;for(const e of n){const t=e.parse;for(const e of fe(t))e in i?i[e]!==t[e]&&r.add(e):i[e]=t[e]}for(const e of r)delete i[e];if(!ce(i)){this.setModified();const n=new ph(e,i);for(const r of t){if(r instanceof ph)for(const e of fe(i))delete r.parse[e];e.removeChild(r),r.parent=n,r instanceof ph&&0===fe(r.parse).length&&r.remove()}}}}}class Oh extends $h{run(e){e instanceof mc||e.numChildren()>0||e instanceof ch||e instanceof vh||(this.setModified(),e.remove())}}class Th extends $h{run(e){const t=e.children.filter((e=>e instanceof vc)),n=t.pop();for(const i of t)this.setModified(),n.merge(i)}}class zh extends $h{run(e){const t=e.children.filter((e=>e instanceof uh)),n={};for(const i of t){const e=Q(i.groupBy);e in n||(n[e]=[]),n[e].push(i)}for(const i of fe(n)){const t=n[i];if(t.length>1){const n=t.pop();for(const i of t)n.merge(i)&&(e.removeChild(i),i.parent=n,i.remove(),this.setModified())}}}}class Nh extends $h{constructor(e){super(),this.model=e}run(e){const t=!(wh(e)||e instanceof Xf||e instanceof ph||e instanceof mh),n=[],i=[];for(const r of e.children)r instanceof sh&&(t&&!ue(e.producedFields(),r.dependentFields())?n.push(r):i.push(r));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof sh?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class Rh extends $h{run(e){const t=[...e.children];if(!ee(t,(e=>e instanceof mc))||e.numChildren()<=1)return;const n=[];let i;for(const r of t)if(r instanceof mc){let t=r;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof mc))break;t=e}n.push(...t.children),i?(e.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=t,this.setModified()):i=t}else n.push(r);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=i}}}class Ph extends pc{clone(){return new Ph(null,H(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??Qa(e)}hash(){return`JoinAggregateTransform ${Q(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==i?{groupby:i}:{}}}}class Bh extends pc{clone(){return new Bh(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t,n){const{config:i,markDef:r}=t,{marks:o,scales:a}=n;if("include-invalid-values"===o&&"include-invalid-values"===a)return null;const s=t.reduceFieldDef(((e,n,o)=>{const a=zn(o)&&t.getScaleComponent(o);if(a){const t=a.get("type"),{aggregate:s}=n,l=Zo({scaleChannel:o,markDef:r,config:i,scaleType:t,isCountAggregate:Yn(s)});"show"!==l&&"always-valid"!==l&&(e[n.field]=n)}return e}),{});return fe(s).length?new Bh(e,s):null}dependentFields(){return new Set(fe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Q(this.filter)}`}assemble(){const e=fe(this.filter).reduce(((e,t)=>{const n=this.filter[t],i=Qa(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${i}) || (${Lh(i)}))`):"quantitative"===n.type&&e.push(Lh(i))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function Lh(e){return`isValid(${e}) && isFinite(+${e})`}class Ih extends pc{clone(){return new Ih(null,H(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(e,t){const{stack:n,groupby:i,as:r,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const c of t.sort)a.push(c.field),s.push(Ae(c.order,"ascending"));const l={field:a,order:s};let u;return u=function(e){return(0,U.cy)(e)&&e.every((e=>(0,U.Kg)(e)))&&e.length>1}(r)?r:(0,U.Kg)(r)?[r,`${r}_end`]:[`${t.stack}_start`,`${t.stack}_end`],new Ih(e,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:l,facetby:[],as:u})}static makeFromEncoding(e,t){const n=t.stack,{encoding:i}=t;if(!n)return null;const{groupbyChannels:r,fieldChannel:o,offset:a,impute:s}=n,l=r.map((e=>as(i[e]))).filter((e=>!!e)),u=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Qa(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;if((0,U.cy)(c)||Pa(c))f=ki(c);else{const e=Ta(c)?c.sort:"y"===o?"descending":"ascending";f=u.reduce(((t,n)=>(t.field.includes(n)||(t.field.push(n),t.order.push(e)),t)),{field:[],order:[]})}return new Ih(e,{dimensionFieldDefs:l,stackField:t.vgField(o),facetby:[],stackby:u,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Q(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[Qa(e,{binSuffix:"mid"})]:[Qa(e,{}),Qa(e,{binSuffix:"end"})]:[Qa(e)])).flat():n??[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:n,stackField:i,stackby:r,sort:o,offset:a,impute:s,as:l}=this._stack;if(s)for(const u of n){const{bandPosition:n=.5,bin:o}=u;if(o){const t=Qa(u,{expr:"datum"}),i=Qa(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${Lh(t)} ? ${n}*${t}+${1-n}*${i} : ${t}`,as:Qa(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...r,...t],key:Qa(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:o,as:l,offset:a}),e}}class Uh extends pc{clone(){return new Uh(null,H(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach((t=>e.add(t.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??Qa(e)}hash(){return`WindowTransform ${Q(this.transform)}`}assemble(){const e=[],t=[],n=[],i=[];for(const c of this.transform.window)t.push(c.op),n.push(this.getDefaultName(c)),i.push(void 0===c.param?null:c.param),e.push(void 0===c.field?null:c.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&t.every((e=>Wn(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==o?{groupby:o}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const c of this.transform.sort)a.push(c.field),s.push(c.order??"ascending");const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function jh(e){if(e instanceof ch)if(1!==e.numChildren()||e.children[0]instanceof mc){const n=e.model.component.data.main;qh(n);const i=(t=e,function e(n){if(!(n instanceof ch)){const i=n.clone();if(i instanceof mc){const e=Wh+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof uh||i instanceof Ih||i instanceof Uh||i instanceof Ph)&&i.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=i;return[i]}return n.children.flatMap(e)}),r=e.children.map(i).flat();for(const e of r)e.parent=n}else{const t=e.children[0];(t instanceof uh||t instanceof Ih||t instanceof Uh||t instanceof Ph)&&t.addDimensions(e.fields),t.swapWithParent(),jh(e)}else e.children.map(jh);var t}function qh(e){if(e instanceof mc&&e.type===oc.Main&&1===e.numChildren()){const t=e.children[0];t instanceof ch||(t.swapWithParent(),qh(e))}}const Wh="scale_",Gh=5;function Yh(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!Yh(t.children))return!1}return!0}function Hh(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Xh(e,t,n){let i=e.sources,r=!1;return r=Hh(new Ch,i)||r,r=Hh(new Dh(t),i)||r,i=i.filter((e=>e.numChildren()>0)),r=Hh(new Oh,i)||r,i=i.filter((e=>e.numChildren()>0)),n||(r=Hh(new Fh,i)||r,r=Hh(new Nh(t),i)||r,r=Hh(new Sh,i)||r,r=Hh(new Mh,i)||r,r=Hh(new zh,i)||r,r=Hh(new Th,i)||r,r=Hh(new Ah,i)||r,r=Hh(new Rh,i)||r),e.sources=i,r}class Vh{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Vh((()=>e(t)))}}function Kh(e){Sp(e)?function(e){const t=e.component.scales;for(const n of fe(t)){const i=Qh(e,n);if(t[n].setWithExplicit("domains",i),tp(e,n),e.component.data.isFaceted){let t=e;for(;!Cp(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)si(e)&&(e.data=Wh+e.data.replace(Wh,""))}}}(e):function(e){for(const n of e.children)Kh(n);const t=e.component.scales;for(const n of fe(t)){let i,r=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Ku(i,e.getWithExplicit("domains"),"domains","scale",ip);const t=e.get("selectionExtent");r&&t&&r.param!==t.param&&ar(Ri),r=t}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}(e)}function Qh(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=np(t,n);if(!e)return void ar(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=np(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),"x"===t&&ss(i.x2)?ss(i.x)?Ku(Zh(n,r,e,"x"),Zh(n,r,e,"x2"),"domain","scale",ip):Zh(n,r,e,"x2"):"y"===t&&ss(i.y2)?ss(i.y)?Ku(Zh(n,r,e,"y"),Zh(n,r,e,"y2"),"domain","scale",ip):Zh(n,r,e,"y2"):Zh(n,r,e,t)}function Jh(e,t,n){const i=Er(n)?.unit;return"temporal"===t||i?function(e,t,n){return e.map((e=>({signal:`{data: ${ps(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function Zh(e,t,n,i){const{encoding:r,markDef:o,mark:a,config:s,stack:l}=n,u=ss(r[i]),{type:c}=u,f=u.timeUnit,d=function(e){const{marks:t,scales:n}=ac(e);return t===n?oc.Main:"include-invalid-values"===n?oc.PreFilterInvalid:oc.PostFilterInvalid}({invalid:bi("invalid",o,s),isPath:Bo(a)});if(function(e){return Pe(e,"unionWith")}(t)){const r=Zh(e,void 0,n,i);return Yu([...Jh(t.unionWith,c,f),...r.value])}if(oi(t))return Yu([t]);if(t&&"unaggregated"!==t&&!co(t))return Yu(Jh(t,c,f));if(l&&i===l.fieldChannel){if("normalize"===l.offset)return Hu([[0,1]]);const e=n.requestDataName(d);return Hu([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const h=zn(i)&&Pa(u)?function(e,t,n){if(!ao(n))return;const i=e.fieldDef(t),r=i.sort;if($a(r))return{op:"min",field:cd(i,t),order:"ascending"};const{stack:o}=e,a=o?new Set([...o.groupbyFields,...o.stackBy.map((e=>e.fieldDef.field))]):void 0;if(ka(r)){return ep(r,o&&!a.has(r.field))}if(function(e){return Pe(e,"encoding")}(r)){const{encoding:t,order:n}=r,i=e.fieldDef(t),{aggregate:s,field:l}=i,u=o&&!a.has(l);if(jn(s)||qn(s))return ep({field:Qa(i),order:n},u);if(Wn(s)||!s)return ep({op:s,field:l,order:n},u)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(Z(["ascending",void 0],r))return!0}return}(n,i,e):void 0;if(La(u)){return Hu(Jh([u.datum],c,f))}const p=u;if("unaggregated"===t){const{field:e}=u;return Hu([{data:n.requestDataName(d),field:Qa({field:e,aggregate:"min"})},{data:n.requestDataName(d),field:Qa({field:e,aggregate:"max"})}])}if(Kn(p.bin)){if(ao(e))return Hu("bin-ordinal"===e?[]:[{data:pe(h)?n.requestDataName(d):n.requestDataName(oc.Raw),field:n.vgField(i,gs(p,i)?{binSuffix:"range"}:{}),sort:!0!==h&&(0,U.Gv)(h)?h:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=p;if(Kn(e)){const t=oh(n,p.field,e);return Hu([new Vh((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return Hu([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}if(p.timeUnit&&Z(["time","utc"],e)){const e=r[Gt(i)];if(Oa(p,e,o,s)){const t=n.requestDataName(d),r=Fa({fieldDef:p,fieldDef2:e,markDef:o,config:s}),l=Lo(a)&&.5!==r&&gn(i);return Hu([{data:t,field:n.vgField(i,l?{suffix:xc}:{})},{data:t,field:n.vgField(i,{suffix:l?bc:"end"})}])}}return Hu(h?[{data:pe(h)?n.requestDataName(d):n.requestDataName(oc.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function ep(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":ba),...i?{field:we(i)}:{},...r?{order:r}:{}}}function tp(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,o=co(i)?i:void 0,a=Jn(r)&&Zn(r.extent)?r.extent:void 0;(o||a)&&n.set("selectionExtent",o??a,!0)}function np(e,t){const{aggregate:n,type:i}=e;return n?(0,U.Kg)(n)&&!Xn.has(n)?{valid:!1,reason:Vi(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:Ki(e)}:{valid:!0}:{valid:!1,reason:Xi(e)}}function ip(e,t,n,i){return e.explicit&&t.explicit&&ar(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using the union of the two domains.`}(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function rp(e){const t=re(e.map((e=>{if(si(e)){const{sort:t,...n}=e;return n}return e})),Q),n=re(e.map((e=>{if(si(e)){const t=e.sort;return void 0===t||pe(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),Q);if(0===t.length)return;if(1===t.length){const t=e[0];if(si(t)&&n.length>0){let e=n[0];if(n.length>1){ar(Zi);const t=n.filter((e=>(0,U.Gv)(e)&&"op"in e&&"min"!==e.op));e=!n.every((e=>(0,U.Gv)(e)&&"op"in e))||1!==t.length||t[0]}else if((0,U.Gv)(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}const i=re(n.map((e=>pe(e)||!("op"in e)||(0,U.Kg)(e.op)&&(0,U.mQ)(Un,e.op)?e:(ar(function(e){return`Dropping sort property ${Re(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),Q);let r;1===i.length?r=i[0]:i.length>1&&(ar(Zi),r=!0);const o=re(e.map((e=>si(e)?e.data:null)),(e=>e));if(1===o.length&&null!==o[0]){return{data:o[0],fields:t.map((e=>e.field)),...r?{sort:r}:{}}}return{fields:t,...r?{sort:r}:{}}}function op(e){if(si(e)&&(0,U.Kg)(e.field))return e.field;if(function(e){return!(0,U.cy)(e)&&Pe(e,"fields")&&!Pe(e,"data")}(e)){let t;for(const n of e.fields)if(si(n)&&(0,U.Kg)(n.field))if(t){if(t!==n.field)return ar("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return ar("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."),t}if(function(e){return!(0,U.cy)(e)&&Pe(e,"fields")&&Pe(e,"data")}(e)){ar("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 t=e.fields[0];return(0,U.Kg)(t)?t:void 0}}function ap(e,t){const n=e.component.scales[t].get("domains").map((t=>(si(t)&&(t.data=e.lookupDataSource(t.data)),t)));return rp(n)}function sp(e){return Mp(e)||Fp(e)?e.children.reduce(((e,t)=>e.concat(sp(t))),lp(e)):lp(e)}function lp(e){return fe(e.component.scales).reduce(((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:a,selectionExtent:s,domains:l,range:u,reverse:c,...f}=r,d=function(e,t,n,i){if(gn(n)){if(ai(e))return{step:{signal:`${t}_step`}}}else if((0,U.Gv)(e)&&si(e))return{...e,data:i.lookupDataSource(e.data)};return e}(r.range,o,n,e),h=ap(e,n),p=s?function(e,t,n,i){const r=Kf(e,t.param,t);return{signal:so(n.get("type"))&&(0,U.cy)(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}(e,s,i,h):null;return t.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==c?{reverse:c}:{},...f}),t}),[])}class up extends Gu{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainHasZero(){const e=this.get("type");if(Z([Vr.LOG,Vr.TIME,Vr.UTC],e))return"definitely-not";const t=this.get("zero");if(!0===t||void 0===t&&Z([Vr.LINEAR,Vr.SQRT,Vr.POW],e))return"definitely";const n=this.get("domains");if(n.length>0){let e=!1,t=!1,i=!1;for(const r of n){if((0,U.cy)(r)){const n=r[0],i=r[r.length-1];if((0,U.Et)(n)&&(0,U.Et)(i)){if(n<=0&&i>=0){e=!0;continue}t=!0;continue}}i=!0}if(e)return"definitely";if(t&&!i)return"definitely-not"}return"maybe"}}const cp=["range","scheme"];function fp(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,o=Yt(t),a=e.getName(o);if((0,U.Gv)(i)&&i.binned&&void 0!==i.step)return new Vh((()=>{const n=e.scaleName(t),r=`(domain("${n}")[1] - domain("${n}")[0]) / ${i.step}`;return`${e.getSignalName(a)} / (${r})`}));if(Kn(i)){const t=oh(e,r,i);return new Vh((()=>{const n=e.getSignalName(t),i=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(a)} / (${i})`}))}}}function dp(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e).get("type");for(const c of cp)if(void 0!==n[c]){const i=_o(r,c),o=wo(e,c);if(i)if(o)ar(o);else switch(c){case"range":{const i=n.range;if((0,U.cy)(i)){if(gn(e))return Yu(i.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),i=t.getSignalName.bind(t);return Vh.fromName(i,n)}return e})))}else if((0,U.Gv)(i))return Yu({data:t.requestDataName(oc.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}});return Yu(i)}case"scheme":return Yu(hp(n[c]))}else ar(Qi(r,c,e))}const o=e===Ue||"xOffset"===e?"width":"height",a=i[o];if(kl(a))if(gn(e))if(ao(r)){const n=mp(a,t,e);if(n)return Yu({step:n})}else ar(Ji(o));else if(_n(e)){const n=e===Ge?"x":"y";if("band"===t.getScaleComponent(n).get("type")){const e=gp(a,r);if(e)return Yu(e)}}const{rangeMin:s,rangeMax:l}=n,u=function(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:a}=ss(o[e]),s=t.getScaleComponent(e),l=s.get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case Ue:case je:if(Z(["point","band"],l)){const r=yp(e,n,i.view);if(kl(r)){return{step:mp(r,t,e)}}}return pp(e,t,l);case Ge:case Ye:return function(e,t,n){const i=e===Ge?"x":"y",r=t.getScaleComponent(i);if(!r)return pp(i,t,n,{center:!0});const o=r.get("type"),a=t.scaleName(i),{markDef:s,config:l}=t;if("band"===o){const e=yp(i,t.size,t.config.view);if(kl(e)){const t=gp(e,n);if(t)return t}return[0,{signal:`bandwidth('${a}')`}]}{const n=t.encoding[i];if(Pa(n)&&n.timeUnit){const e=Ar(n.timeUnit,(e=>`scale('${a}', ${e})`)),i=t.config.scale.bandWithNestedOffsetPaddingInner,r=Fa({fieldDef:n,markDef:s,config:l})-.5,o=0!==r?` + ${r}`:"";if(i){return[{signal:`${oi(i)?`${i.signal}/2`+o:`${i/2+r}`} * (${e})`},{signal:`${oi(i)?`(1 - ${i.signal}/2)`+o:`${1-i/2+r}`} * (${e})`}]}return[0,{signal:e}]}return X(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}(e,t,l);case ot:{const o=function(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(Wi("size",e))}(r,i),a=function(e,t,n,i){const r={x:fp(n,"x"),y:fp(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=xp(t,r,i.view);return(0,U.Et)(e)?e-1:new Vh((()=>`${e.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 e=xp(t,r,i.view);return(0,U.Et)(e)?Math.pow(vp*e,2):new Vh((()=>`pow(${vp} * ${e.signal}, 2)`))}}throw new Error(Wi("size",e))}(r,n,t,i);return uo(l)?function(e,t,n){const i=()=>{const i=gi(t),r=gi(e),o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};return oi(t)?new Vh(i):{signal:i()}}(o,a,function(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&(0,U.cy)(n)?n.length+1:(ar(function(e){return`Domain for ${e} is required for threshold scale.`}(i)),3)}}(l,i,u,e)):[o,a]}case Ve:return[0,2*Math.PI];case at:return[0,360];case He:return[0,new Vh((()=>`min(${t.getSignalName(Cp(t.parent)?"child_width":"width")},${t.getSignalName(Cp(t.parent)?"child_height":"height")})/2`))];case ct:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case ft:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case rt:return"symbol";case tt:case nt:case it:return"ordinal"===l?"nominal"===a?"category":"ordinal":void 0!==c?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case st:case lt:case ut:return[i.scale.minOpacity,i.scale.maxOpacity]}}(e,t);return(void 0!==s||void 0!==l)&&_o(r,"rangeMin")&&(0,U.cy)(u)&&2===u.length?Yu([s??u[0],l??u[1]]):Hu(u)}function hp(e){return function(e){return!(0,U.Kg)(e)&&Pe(e,"name")}(e)?{scheme:e.name,...K(e,["name"])}:{scheme:e}}function pp(e,t,n){let{center:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Yt(e),o=t.getName(r),a=t.getSignalName.bind(t);return e===je&&so(n)?i?[Vh.fromName((e=>`${a(e)}/2`),o),Vh.fromName((e=>`-${a(e)}/2`),o)]:[Vh.fromName(a,o),0]:i?[Vh.fromName((e=>`-${a(e)}/2`),o),Vh.fromName((e=>`${a(e)}/2`),o)]:[0,Vh.fromName(a,o)]}function mp(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=Xt(n),a=i[o];if("offset"===wl({step:e,offsetIsDiscrete:qa(a)&&qr(a.type)})&&Ss(i,o)){const n=t.getScaleComponent(o);let i=`domain('${t.scaleName(o)}').length`;if("band"===n.get("type")){i=`bandspace(${i}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`}const a=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${i} / (1-${s=a,oi(s)?s.signal:(0,U.r$)(s)})`}}return e.step;var s}function gp(e,t){if("offset"===wl({step:e,offsetIsDiscrete:ao(t)}))return{step:e.step}}function yp(e,t,n){const i=e===Ue?"width":"height",r=t[i];return r||Sl(n,i)}const vp=.95;function xp(e,t,n){const i=kl(e.width)?e.width.step:Dl(n,"width"),r=kl(e.height)?e.height.step:Dl(n,"height");return t.x||t.y?new Vh((()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`)):Math.min(i,r)}function bp(e,t){Sp(e)?function(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:a}=e;for(const s of fe(n)){const l=a[s],u=n[s],c=e.getScaleComponent(s),f=ss(r[s]),d=l[t],h=c.get("type"),p=c.get("padding"),m=c.get("paddingInner"),g=_o(h,t),y=wo(s,t);if(void 0!==d&&(g?y&&ar(y):ar(Qi(h,t,s))),g&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":sr(l[t])||"temporal"===n||e?u.set(t,{signal:ps(l[t],{type:n,timeUnit:e})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const n=Pe(_p,t)?_p[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:i,hasNestedOffsetScale:Cs(r,s),hasSecondaryRangeChannel:!!r[Gt(s)]}):i.scale[t];void 0!==n&&u.set(t,n,!1)}}}(e,t):kp(e,t)}const _p={bins:e=>{let{model:t,fieldOrDatumDef:n}=e;return Pa(n)?function(e,t){const n=t.bin;if(Kn(n)){const i=oh(e,t.field,n);return new Vh((()=>e.getSignalName(i)))}if(Qn(n)&&Jn(n)&&void 0!==n.step)return{step:n.step};return}(t,n):void 0},interpolate:e=>{let{channel:t,fieldOrDatumDef:n}=e;return function(e,t){if(Z([tt,nt,it],e)&&"nominal"!==t)return"hcl";return}(t,n.type)},nice:e=>{let{scaleType:t,channel:n,domain:i,domainMin:r,domainMax:o,fieldOrDatumDef:a}=e;return function(e,t,n,i,r,o){if(as(o)?.bin||(0,U.cy)(n)||null!=r||null!=i||Z([Vr.TIME,Vr.UTC],e))return;return!!gn(t)||void 0}(t,n,i,r,o,a)},padding:e=>{let{channel:t,scaleType:n,fieldOrDatumDef:i,markDef:r,config:o}=e;return function(e,t,n,i,r,o){if(gn(e)){if(lo(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=r;if("bar"===t&&(!Pa(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===Vr.POINT)return n.pointPadding}return}(t,n,o.scale,i,r,o.bar)},paddingInner:e=>{let{scalePadding:t,channel:n,markDef:i,scaleType:r,config:o,hasNestedOffsetScale:a}=e;return function(e,t,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==e)return;if(gn(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i,tickBandPaddingInner:a,bandWithNestedOffsetPaddingInner:s}=r;return o?s:Ae(e,"bar"===n?t:"tick"===n?a:i)}if(_n(t)&&i===Vr.BAND)return r.offsetBandPaddingInner;return}(t,n,i.type,r,o.scale,a)},paddingOuter:e=>{let{scalePadding:t,channel:n,scaleType:i,scalePaddingInner:r,config:o,hasNestedOffsetScale:a}=e;return function(e,t,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==e)return;if(gn(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=r;if(o)return t;if(n===Vr.BAND)return Ae(e,oi(i)?{signal:`${i.signal}/2`}:i/2)}else if(_n(t)){if(n===Vr.POINT)return.5;if(n===Vr.BAND)return r.offsetBandPaddingOuter}return}(t,n,i,r,o.scale,a)},reverse:e=>{let{fieldOrDatumDef:t,scaleType:n,channel:i,config:r}=e;return function(e,t,n,i){if("x"===n&&void 0!==i.xReverse)return so(e)&&"descending"===t?oi(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(so(e)&&"descending"===t)return!0;return}(n,Pa(t)?t.sort:void 0,i,r.scale)},zero:e=>{let{channel:t,fieldOrDatumDef:n,domain:i,markDef:r,scaleType:o,config:a,hasSecondaryRangeChannel:s}=e;return function(e,t,n,i,r,o,a){if(n&&"unaggregated"!==n&&so(r)){if((0,U.cy)(n)){const e=n[0],t=n[n.length-1];if((0,U.Et)(e)&&e<=0&&(0,U.Et)(t)&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!uo(r))return!0;if((!Pa(t)||!t.bin)&&Z([...mn,...vn],e)){const{orient:t,type:n}=i;return(!Z(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e))&&(!(!Z(["bar","area"],n)||a)||o?.zero)}return!1}(t,n,i,r,o,a.scale,s)}};function wp(e){Sp(e)?function(e){const t=e.component.scales;for(const n of Tn){const i=t[n];if(!i)continue;const r=dp(n,e);i.setWithExplicit("range",r)}}(e):kp(e,"range")}function kp(e,t){const n=e.component.scales;for(const i of e.children)"range"===t?wp(i):bp(i,t);for(const i of fe(n)){let r;for(const n of e.children){const e=n.component.scales[i];if(e){r=Ku(r,e.getWithExplicit(t),t,"scale",Xu(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0)))}}n[i].setWithExplicit(t,r)}}function $p(e,t,n,i){const r=function(e,t,n,i){switch(t.type){case"nominal":case"ordinal":if(Dt(e)||"discrete"===Ln(e))return"shape"===e&&"ordinal"===t.type&&ar(Hi(e,"ordinal")),"ordinal";if(gn(e)||_n(e)){if(Z(["rect","bar","image","rule","tick"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&e in yn)return"band";return Ho(n[Yt(e)])||Ha(t)&&t.axis?.tickBand?"band":"point";case"temporal":return Dt(e)?"time":"discrete"===Ln(e)?(ar(Hi(e,"temporal")),"ordinal"):Pa(t)&&t.timeUnit&&Er(t.timeUnit).utc?"utc":"time";case"quantitative":return Dt(e)?Pa(t)&&Kn(t.bin)?"bin-ordinal":"linear":"discrete"===Ln(e)?(ar(Hi(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Ui(t.type))}(t,n,i,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:o}=e;return zn(t)?void 0!==o?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!zn(e))return!1;switch(e){case Ue:case je:case Ge:case Ye:case Ve:case He:return!!lo(t)||"band"===t||"point"===t&&!n;case ot:case ct:case st:case lt:case ut:case at:return lo(t)||uo(t)||Z(["band","point","ordinal"],t);case tt:case nt:case it:return"band"!==t;case ft:case rt:return"ordinal"===t||uo(t)}}(t,o)?Pa(n)&&(a=o,s=n.type,!(Z([Gr,Hr],s)?void 0===a||ao(a):s===Yr?Z([Vr.TIME,Vr.UTC,void 0],a):s!==Wr||no(a)||uo(a)||void 0===a))?(ar(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,r)),r):o:(ar(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,r)),r):r:null;var a,s}function Ep(e){Sp(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of Tn){const a=ss(t[o]);if(a&&n===Po&&o===rt&&a.type===Xr)continue;let s=a&&a.scale;if(a&&null!==s&&!1!==s){s??(s={});const n=$p(s,o,a,i,Cs(t,o));r[o]=new up(e.scaleName(`${o}`,!0),{value:n,explicit:s.type===n})}}return r}(e):e.component.scales=function(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){Ep(o);for(const n of fe(o.component.scales))if((t=r.scale)[n]??(t[n]=Od(n,e)),"shared"===r.scale[n]){const e=i[n],t=o.component.scales[n].getWithExplicit("type");e?Qr(e.value,t.value)?i[n]=Ku(e,t,"type","scale",Ap):(r.scale[n]="independent",delete i[n]):i[n]=t}}for(const o of fe(i)){const t=e.scaleName(o,!0),r=i[o];n[o]=new up(t,r);for(const n of e.children){const e=n.component.scales[o];e&&(n.renameScale(e.get("name"),t),e.merged=!0)}}return n}(e)}const Ap=Xu(((e,t)=>Zr(e)-Zr(t)));class Dp{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function Sp(e){return"unit"===e?.type}function Cp(e){return"facet"===e?.type}function Fp(e){return"concat"===e?.type}function Mp(e){return"layer"===e?.type}class Op{constructor(e,t,n,i,r,o,a){this.type=t,this.parent=n,this.config=r,this.correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=r,this.view=ni(a),this.name=e.name??i,this.title=ri(e.title)?{text:e.title}:e.title?ni(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Dp,this.projectionNameMap=n?n.projectionNameMap:new Dp,this.signalNameMap=n?n.signalNameMap:new Dp,this.data=e.data,this.description=e.description,this.transforms=(e.transform??[]).map((e=>du(e)?{filter:Y(e.filter,Ir)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){const i=n[t],r={},{spacing:o,columns:a}=i;void 0!==o&&(r.spacing=o),void 0!==a&&(Da(e)&&!Ea(e.facet)||xl(e))&&(r.columns=a),bl(e)&&(r.columns=1);for(const s of El)if(void 0!==e[s])if("spacing"===s){const t=e[s];r[s]=(0,U.Et)(t)?t:{row:t.row??o,column:t.column??o}}else r[s]=e[s];return r}(e,t,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:Da(e)||n?.component.data.isFaceted&&void 0===e.data},layoutSize:new Gu,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?H(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(e){let{ignoreRange:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ep(e),Kh(e);for(const n of bo)bp(e,n);t||wp(e)}(this)}parseProjection(){nh(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Yd(this)}assembleEncodeFromView(e){const{style:t,...n}=e,i={};for(const r of fe(n)){const e=n[r];void 0!==e&&(i[r]=pi(e))}return i}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=pi(this.description)),"unit"!==this.type&&"layer"!==this.type)?ce(t)?void 0:t:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...t}}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:i}=this,r=function(e,t){const n={};for(const i of Ct){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:e,titleOrient:o}=hd(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=fd(i,o),s=$d(e,a);void 0!==s&&(n[a]=s)}}return ce(n)?void 0:n}(n.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...t,...r?{titleBand:r}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of Ct)e[n].title&&t.push(gd(this,n));for(const n of pd)t=t.concat(xd(this,n));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map((e=>Zf(e,"grid",t))),...i.map((e=>Zf(e,"grid",t))),...n.map((e=>Zf(e,"main",t))),...i.map((e=>Zf(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return Qd(this)}assembleProjections(){return Jd(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},n={...ii(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return Z(["unit","layer"],this.type)?Z(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),ce(n)?void 0:n}assembleGroup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={};e=e.concat(this.assembleSignals()),e.length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Cp(this.parent)?sp(this):[];i.length>0&&(t.scales=i);const r=this.assembleAxes();r.length>0&&(t.axes=r);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return me((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(oc[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(Cp(this.parent)){const t=xn(Fd(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(ao(e)&&ai(i)){const e=n.get("name"),i=op(ap(this,t));if(i){return{signal:Cd(e,n,Qa({aggregate:"distinct",field:i},{expr:"datum"}))}}return ar(Oi(t)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):It(e)&&zn(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?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(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const t=this.getScaleComponent(e);return t?t.get("type"):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((e=>e.hasOrientSignalRef()))||this.component.axes.y?.some((e=>e.hasOrientSignalRef()))}}class Tp extends Op{vgField(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(e);if(n)return Qa(n,t)}reduceFieldDef(e,t){return function(e,t,n,i){return e?fe(e).reduce(((n,r)=>{const o=e[r];return(0,U.cy)(o)?o.reduce(((e,n)=>t.call(i,e,n,r)),n):t.call(i,n,o,r)}),n):n}(this.getMapping(),((t,n,i)=>{const r=as(n);return r?e(t,r,i):t}),t)}forEachFieldDef(e,t){zs(this.getMapping(),((t,n)=>{const i=as(t);i&&e(i,n)}),t)}}class zp extends pc{clone(){return new zp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Q(this.transform)}`}assemble(){const{density:e,...t}=this.transform,n={type:"kde",field:e,...t};return n.resolve=this.transform.resolve,n}}class Np extends pc{clone(){return new Np(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Q(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}class Rp extends pc{clone(){return new Rp(this.parent,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((e,t)=>i[t]??e))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Q(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class Pp extends pc{clone(){return new Pp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"key",n[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Q(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Bp extends pc{clone(){return new Bp(null,H(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[[Je,Qe],[et,Ze]]){const r=i.map((e=>{const n=ss(t.encoding[e]);return Pa(n)?n.field:La(n)?{expr:`${n.datum}`}:Ga(n)?{expr:`${n.value}`}:void 0}));(r[0]||r[1])&&(e=new Bp(e,r,null,t.getName("geojson_"+n++)))}if(t.channelHasField(rt)){const i=t.typedFieldDef(rt);i.type===Xr&&(e=new Bp(e,null,i.field,t.getName("geojson_"+n++)))}return e}constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(U.Kg);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Q(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Lp extends pc{clone(){return new Lp(null,this.projection,H(this.fields),H(this.as))}constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[Je,Qe],[et,Ze]]){const i=n.map((e=>{const n=ss(t.encoding[e]);return Pa(n)?n.field:La(n)?{expr:`${n.datum}`}:Ga(n)?{expr:`${n.value}`}:void 0})),r=n[0]===et?"2":"";(i[0]||i[1])&&(e=new Lp(e,t.projectionName(),i,[t.getName(`x${r}`),t.getName(`y${r}`)]))}return e}dependentFields(){return new Set(this.fields.filter(U.Kg))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Q(this.fields)} ${Q(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Ip extends pc{clone(){return new Ip(null,H(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e;return{signal:`sequence(${[t,n,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,t){return new Ip(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,r=n.y;if(Pa(i)&&Pa(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:l,frame:u,keyvals:c}=o.impute,f=Ns(t.mark,n);return new Ip(e,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==l?{value:l}:{},...u?{frame:u}:{},...void 0!==c?{keyvals:c}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${Q(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:r,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...n?{keyvals:hu(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_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...r?{groupby:r}:{}},{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[s]}}class Up extends pc{clone(){return new Up(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Q(this.transform)}`}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class jp extends pc{clone(){return new jp(null,H(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,i){const r=t.component.data.sources,{from:o}=n;let a=null;if(function(e){return Pe(e,"data")}(o)){let e=im(o.data,r);e||(e=new vh(o.data),r.push(e));const n=t.getName(`lookup_${i}`);a=new mc(e,n,oc.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return Pe(e,"param")}(o)){const e=o.param;let i;n={as:e,...n};try{i=t.getSelectionComponent(me(e),e)}catch(s){throw new Error(`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`)}if(a=i.materialized,!a)throw new Error(function(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}(e))}return new jp(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,U.YO)(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Q({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:(0,U.YO)(this.transform.as)}:{}};else{let t=this.transform.as;(0,U.Kg)(t)||(ar('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.'),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class qp extends pc{clone(){return new qp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"prob",n[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Q(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class Wp extends pc{clone(){return new Wp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=H(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Q(this.transform)}`}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class Gp extends pc{clone(){return new Gp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re((this.transform.groupby??[]).concat(e),(e=>e))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Q(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:r}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==i?{limit:i}:{},...void 0!==r?{op:r}:{},...void 0!==n?{groupby:n}:{}}}}class Yp extends pc{clone(){return new Yp(null,H(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Q(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Hp(e){let t=0;return function n(i,r){if(i instanceof vh&&!i.isGenerator&&!Ju(i.data)){e.push(r);r={name:null,source:r.name,transform:[]}}if(i instanceof ph&&(i.parent instanceof vh&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof ch)return r.name||(r.name="data_"+t++),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,void e.push(...i.assemble());if((i instanceof gh||i instanceof yh||i instanceof Bh||i instanceof Xf||i instanceof ud||i instanceof Lp||i instanceof uh||i instanceof jp||i instanceof Uh||i instanceof Ph||i instanceof Pp||i instanceof Rp||i instanceof zp||i instanceof Up||i instanceof qp||i instanceof Wp||i instanceof mh||i instanceof Yp||i instanceof Gp||i instanceof Np)&&r.transform.push(i.assemble()),(i instanceof sh||i instanceof vc||i instanceof Ip||i instanceof Ih||i instanceof Bp)&&r.transform.push(...i.assemble()),i instanceof mc)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof mc)i.setSource(r.name);else if(r.name||(r.name="data_"+t++),i.setSource(r.name),1===i.numChildren()){e.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof mc&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_"+t++);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const e of i.children){n(e,{name:null,source:o,transform:[]})}break}}}}function Xp(e){return"top"===e||"left"===e||oi(e)?"header":"footer"}function Vp(e,t){const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],s=dd("title",null,i,t);let l=ns(a,i,{allowDisabling:!0,includeDefault:void 0===s||!!s});r.component.layoutHeaders[t].title&&(l=(0,U.cy)(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const u=dd("labelOrient",a.header,i,t),c=null!==a.header&&Ae(a.header?.labels,i.header.labels,!0),f=Z(["bottom","right"],u)?"footer":"header";o.layoutHeaders[t]={title:null!==a.header?l:null,facetFieldDef:a,[f]:"facet"===t?[]:[Kp(e,t,c)]}}}function Kp(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function Qp(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Td(r,t),"shared"===r.axis[t]){const r="x"===t?"column":"row",o=i[r];for(const i of n.component.axes[t]){const t=Xp(i.get("orient"));o[t]??(o[t]=[Kp(e,r,!1)]);const n=Zf(i,"main",e.config,{header:!0});n&&o[t][0].axes.push(n),i.mainExtracted=!0}}}}function Jp(e){for(const t of e.children)t.parseLayoutSize()}function Zp(e,t){const n=Fd(t),i=xn(n),r=e.component.resolve,o=e.component.layoutSize;let a;for(const s of e.children){const t=s.component.layoutSize.getWithExplicit(n),o=r.scale[i]??Od(i,e);if("independent"===o&&"step"===t.value){a=void 0;break}if(a){if("independent"===o&&a.value!==t.value){a=void 0;break}a=Ku(a,t,n,"")}else a=t}if(a){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function em(e,t){const n="width"===t?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const e=r.get("type"),n=r.get("range");if(ao(e)){const e=Sl(i.view,t);return ai(n)||kl(e)?"step":e}return Al(i.view,t)}if(e.hasProjection||"arc"===e.mark)return Al(i.view,t);{const e=Sl(i.view,t);return kl(e)?e.step:e}}function tm(e,t,n){return Qa(t,{suffix:`by_${Qa(e)}`,...n})}class nm extends Tp{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),this.child=Cm(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Ea(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=fe(e),n={};for(const i of t){if(![Be,Le].includes(i)){ar(Wi(i,"facet"));break}const t=e[i];if(void 0===t.field){ar(qi(t,i));break}n[i]=this.initFacetFieldDef(t,i)}return n}initFacetFieldDef(e,t){const n=cs(e,t);return n.header?n.header=ni(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return Pe(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=rm(this),this.child.parseData()}parseLayoutSize(){Jp(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of Ct)Vp(e,t);Qp(e,"x"),Qp(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const t of Ct)for(const n of md){const i=this.component.layoutHeaders[t],r=i[n],{facetFieldDef:o}=i;if(o){const n=dd("titleOrient",o.header,this.config,t);if(["right","bottom"].includes(n)){const i=fd(t,n);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[i]="end"}}if(r?.[0]){const r="row"===t?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===t||this.child.component.layoutSize.get(r)||(e[o]??(e[o]={}),e[o][t]=.5),i.title&&(e.offset??(e.offset={}),e.offset["row"===t?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"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 nm)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof nm?{...this.channelHasField("column")?{encode:{update:{columns:{field:Qa(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof nm){if(this.child.channelHasField("column")){const i=Qa(this.child.facet.column);e.push(i),t.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of mn){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(ao(o)&&ai(a)){const r=op(ap(this.child,i));r?(e.push(r),t.push("distinct"),n.push(`distinct_${r}`)):ar(Oi(i))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const u of Ct){const e=this.facet[u];if(e){s.push(Qa(e));const{bin:t,sort:l}=e;if(Kn(t)&&s.push(Qa(e,{binSuffix:"end"})),ka(l)){const{field:t,op:s=ba}=l,u=tm(e,l);n&&i?(r.push(u),o.push("max"),a.push(u)):(r.push(t),o.push(s),a.push(u))}else if((0,U.cy)(l)){const t=cd(e,u);r.push(t),o.push("max"),a.push(t)}}}const l=!!n&&!!i;return{name:e,data:t,groupby:s,...l||r.length>0?{aggregate:{...l?{cross:l}:{},...r.length?{fields:r,ops:o,as:a}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,n=t[e];return n?ka(n.sort)?[tm(n,n.sort,{expr:"datum"})]:(0,U.cy)(n.sort)?[cd(n,e,{expr:"datum"})]:[Qa(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(ka(e)?e.order:!(0,U.cy)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return _d(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const i of pd)if(e[i]){const r=dd("labelOrient",e[i]?.header,t,i);if(n[i].includes(r))return _d(e[i],i,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=Hp(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),r=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...r?{style:r}:{},from:{facet:this.assembleFacet()},sort:{field:Ct.map((e=>this.facetSortFields(e))).flat(),order:Ct.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(fc(this,[]))}]}getMapping(){return this.facet}}function im(e,t){for(const n of t){const t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const i=e.format?.mesh,r=t.format?.feature;if(i&&r)continue;const o=e.format?.feature;if((o||r)&&o!==r)continue;const a=t.format?.mesh;if(!i&&!a||i===a)if(Zu(e)&&Zu(t)){if(Ne(e.values,t.values))return n}else if(Ju(e)&&Ju(t)){if(e.url===t.url)return n}else if(ec(e)&&e.name===n.dataName)return n}return null}function rm(e){let t=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new vh({values:[]});return t.push(e),e}const n=im(e.data,t);if(n)return tc(e.data)||(n.data.format=ne({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new vh(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(tc(r)||Ju(r)||Zu(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Qu;tc(r)?(nc(r)?t=new yh(t,r.sequence):rc(r)&&(t=new gh(t,r.graticule)),o.parseNothing=!0):null===r?.format?.parse&&(o.parseNothing=!0),t=ph.makeExplicit(t,e,o)??t,t=new mh(t);const a=e.parent&&Mp(e.parent);(Sp(e)||Cp(e))&&a&&(t=sh.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=function(e,t,n){let i=0;for(const r of t.transforms){let o,a;if($u(r))a=e=new ud(e,r),o="derived";else if(du(r)){const i=dh(r);a=e=ph.makeWithAncestors(e,{},i,n)??e,e=new Xf(e,t,r.filter)}else if(Eu(r))a=e=sh.makeFromTransform(e,r,t),o="number";else if(Du(r))o="date",void 0===n.getWithExplicit(r.field).value&&(e=new ph(e,{[r.field]:o}),n.set(r.field,o,!1)),a=e=vc.makeFromTransform(e,r);else if(Su(r))a=e=uh.makeFromTransform(e,r),o="number",jf(t)&&(e=new mh(e));else if(pu(r))a=e=jp.make(e,t,r,i++),o="derived";else if(_u(r))a=e=new Uh(e,r),o="number";else if(wu(r))a=e=new Ph(e,r),o="number";else if(Cu(r))a=e=Ih.makeFromTransform(e,r),o="derived";else if(Fu(r))a=e=new Pp(e,r),o="derived";else if(Mu(r))a=e=new Np(e,r),o="derived";else if(ku(r))a=e=new Rp(e,r),o="derived";else if(mu(r))a=e=new Gp(e,r),o="derived";else if(bu(r))e=new Yp(e,r);else if(Au(r))a=e=Ip.makeFromTransform(e,r),o="derived";else if(gu(r))a=e=new zp(e,r),o="derived";else if(yu(r))a=e=new qp(e,r),o="derived";else if(vu(r))a=e=new Wp(e,r),o="derived";else{if(!xu(r)){ar(`Ignoring an invalid transform: ${Re(r)}.`);continue}a=e=new Up(e,r),o="derived"}if(a&&void 0!==o)for(const e of a.producedFields()??[])n.set(e,o,!1)}return e}(t,e,o));const s=function(e){const t={};if(Sp(e)&&e.component.selection)for(const n of fe(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&Ee(e.field)>1&&(t[e.field]="flatten")}return t}(e),l=hh(e);t=ph.makeWithAncestors(t,{},{...s,...l},o)??t,Sp(e)&&(t=Bp.parseAll(t,e),t=Lp.parseAll(t,e)),(Sp(e)||Cp(e))&&(a||(t=sh.makeFromEncoding(t,e)??t),t=vc.makeFromEncoding(t,e)??t,t=ud.parseAllForSortIndex(t,e));const u=t=om(oc.Raw,e,t);if(Sp(e)){const n=uh.makeFromEncoding(t,e);n&&(t=n,jf(e)&&(t=new mh(t))),t=Ip.makeFromEncoding(t,e)??t,t=Ih.makeFromEncoding(t,e)??t}let c,f;if(Sp(e)){const{markDef:n,mark:i,config:r}=e,o=xi("invalid",n,r),{marks:a,scales:s}=f=ac({invalid:o,isPath:Bo(i)});a!==s&&"include-invalid-values"===s&&(c=t=om(oc.PreFilterInvalid,e,t)),"exclude-invalid-values"===a&&(t=Bh.make(t,e,f)??t)}const d=t=om(oc.Main,e,t);let h;if(Sp(e)&&f){const{marks:n,scales:i}=f;"include-invalid-values"===n&&"exclude-invalid-values"===i&&(t=Bh.make(t,e,f)??t,h=t=om(oc.PostFilterInvalid,e,t))}Sp(e)&&function(e,t){for(const[n,i]of he(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new mc(new Xf(t,e,{param:n}),r,oc.Lookup,e.component.data.outputNodeRefCounts)}}(e,d);let p=null;if(Cp(e)){const i=e.getName("facet");t=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const r of[n,i])if(ka(r.sort)){const{field:n,op:i=ba}=r.sort;e=t=new Ph(e,{joinaggregate:[{op:i,field:n,as:tm(r,r.sort,{forAs:!0})}],groupby:[Qa(r)]})}return t}return null}(t,e.facet)??t,p=new ch(t,e,i,d.getSource()),n[i]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:u,main:d,facetRoot:p,ancestorParse:o,preFilterInvalid:c,postFilterInvalid:h}}function om(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),a=new mc(n,o,e,r);return i[o]=a,a}class am extends Op{constructor(e,t,n,i){super(e,"concat",t,n,i,e.resolve),"shared"!==e.resolve?.axis?.x&&"shared"!==e.resolve?.axis?.y||ar("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>Cm(e,this,this.getName(`concat_${t}`),void 0,i)))}parseData(){this.component.data=rm(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of fe(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return bl(e)?e.vconcat:_l(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){Jp(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";Zp(e,t),Zp(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=Ad(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}const sm={disable:1,gridScale:1,scale:1,..._s,labelExpr:1,encode:1},lm=fe(sm);class um extends Gu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new um(H(this.explicit),H(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return oi(this.explicit.orient)}}const cm={bottom:"top",top:"bottom",left:"right",right:"left"};function fm(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t[i];if(!!n!==!!r)return;if(n&&r){const t=n.getWithExplicit("orient"),o=r.getWithExplicit("orient");if(t.explicit&&o.explicit&&t.value!==o.value)return;e[i]=dm(n,r)}}}return e}function dm(e,t){for(const n of lm){const i=Ku(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",((e,t)=>{switch(n){case"title":return Ai(e,t);case"gridScale":return{explicit:e.explicit,value:Ae(e.value,t.value)}}return Vu(e,t,n,"axis")}));e.setWithExplicit(n,i)}return e}function hm(e,t,n,i,r){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(oi(n.labelAngle)?n.labelAngle:Oe(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===ld(i,r))return!0}return e===n[t]}const pm=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function mm(e,t){let n=t.axis(e);const i=new um,r=ss(t.encoding[e]),{mark:o,config:a}=t,s=n?.orient||a["x"===e?"axisX":"axisY"]?.orient||a.axis?.orient||function(e){return"x"===e?"bottom":"left"}(e),l=t.getScaleComponent(e).get("type"),u=function(e,t,n,i){const r="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:no(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=oi(n)?"axisOrient":`axis${ve(n)}`,s=[...r,...r.map((e=>o+e.substr(4)))],l=["axis",a,o];return{vlOnlyAxisConfig:td(s,i,e,n),vgAxisConfig:td(l,i,e,n),axisConfigStyle:nd([...l,...s],i)}}(e,l,s,t.config),c=void 0!==n?!n:id("disable",a.style,n?.style,u).configValue;if(i.set("disable",c,void 0!==n),c)return i;n=n||{};const f=function(e,t,n,i,r){const o=t?.labelAngle;if(void 0!==o)return oi(o)?o:Oe(o);{const{configValue:o}=id("labelAngle",i,t?.style,r);return void 0!==o?Oe(o):n!==Ue||!Z([Hr,Gr],e.type)||Pa(e)&&e.timeUnit?void 0:270}}(r,n,e,a.style,u),d=ma(n.formatType,r,l),h=pa(r,r.type,n.format,n.formatType,a,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:l,orient:s,labelAngle:f,format:h,formatType:d,mark:o,config:a};for(const y of lm){const r=y in rd?rd[y](p):ks(y)?n[y]:void 0,o=void 0!==r,s=hm(r,y,n,t,e);if(o&&s)i.set(y,r,s);else{const{configValue:e,configFrom:t}=ks(y)&&"values"!==y?id(y,a.style,n.style,u):{},l=void 0!==e;o&&!l?i.set(y,r,s):("vgAxisConfig"!==t||pm.has(y)&&l||vs(e)||oi(e))&&i.set(y,e,!1)}}const m=n.encoding??{},g=xs.reduce(((n,r)=>{if(!i.hasAxisPart(r))return n;const o=Md(m[r]??{},t),a="labels"===r?function(e,t,n){const{encoding:i,config:r}=e,o=ss(i[t])??ss(i[Gt(t)]),a=e.axis(t)||{},{format:s,formatType:l}=a;if(la(l))return{text:ha({fieldOrDatumDef:o,field:"datum.value",format:s,formatType:l,config:r}),...n};if(void 0===s&&void 0===l&&r.customFormatTypes){if("quantitative"===Ba(o)){if(Ha(o)&&"normalize"===o.stack&&r.normalizedNumberFormatType)return{text:ha({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:ha({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if("temporal"===Ba(o)&&r.timeFormatType&&Pa(o)&&!o.timeUnit)return{text:ha({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}(t,e,o):o;return void 0===a||ce(a)||(n[r]={update:a}),n}),{});return ce(g)||i.set("encode",g,!!n.encoding||void 0!==n.labelAngle),i}function gm(e,t){const{config:n}=e;return{...pf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Zc("x",e,{defaultPos:"mid"}),...Zc("y",e,{defaultPos:"mid"}),...Vc("size",e),...Vc("angle",e),...ym(e,n,t)}}function ym(e,t,n){return n?{shape:{value:n}}:Vc("shape",e)}const vm={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...pf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...af("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...af("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...Vc("size",e,{vgChannel:"strokeWidth"})}:{}}};function xm(e,t,n){if(void 0===xi("align",e,n))return"center"}function bm(e,t,n){if(void 0===xi("baseline",e,n))return"middle"}const _m={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r="horizontal"===i?"x":"y",o="horizontal"===i?"y":"x",a="horizontal"===i?"height":"width";return{...pf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uf(e,r),...Zc(o,e,{defaultPos:"mid",vgChannel:"y"===o?"yc":"xc"}),[a]:pi(xi("thickness",n,t))}}},wm={arc:{vgMark:"arc",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Zc("x",e,{defaultPos:"mid"}),...Zc("y",e,{defaultPos:"mid"}),...uf(e,"radius"),...uf(e,"theta")})},area:{vgMark:"area",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...af("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...af("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...yf(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uf(e,"x"),...uf(e,"y")})},circle:{vgMark:"symbol",encodeEntry:e=>gm(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Pa(n)&&n.type===Xr?{field:Qa(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...uf(e,"x"),...uf(e,"y"),...Uc(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Zc("x",e,{defaultPos:"mid"}),...Zc("y",e,{defaultPos:"mid"}),...Vc("size",e,{vgChannel:"strokeWidth"}),...yf(e)})},point:{vgMark:"symbol",encodeEntry:e=>gm(e)},rect:{vgMark:"rect",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...uf(e,"x"),...uf(e,"y")})},rule:vm,square:{vgMark:"symbol",encodeEntry:e=>gm(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...pf(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Zc("x",e,{defaultPos:"mid"}),...Zc("y",e,{defaultPos:"mid"}),...Uc(e),...Vc("size",e,{vgChannel:"fontSize"}),...Vc("angle",e),...vf("align",xm(e.markDef,n,t)),...vf("baseline",bm(e.markDef,n,t)),...Zc("radius",e,{defaultPos:null}),...Zc("theta",e,{defaultPos:null})}}},tick:_m,trail:{vgMark:"trail",encodeEntry:e=>({...pf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Zc("x",e,{defaultPos:"mid"}),...Zc("y",e,{defaultPos:"mid"}),...Vc("size",e),...yf(e)})}};function km(e){if(Z([So,Eo,zo],e.mark)){const t=Ns(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:$m+e.requestDataName(oc.Main),data:e.requestDataName(oc.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Am(e,{fromPrefix:$m})}]}(e,t)}else if(e.mark===Ao){const t=ci.some((t=>xi(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=Am(e,{fromPrefix:Em}),n=e.scaleName(e.stack.fieldChannel),i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.vgField(e.stack.fieldChannel,t)},r=(e,t)=>`${e}(${[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o={...V(t.encode.update,["y","yc","y2","height",...ci]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...K(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...V(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...K(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of ci){const n=bi(l,e.markDef,e.config);t.encode.update[l]?(o[l]=t.encode.update[l],delete t.encode.update[l]):n&&(o[l]=pi(n)),n&&(t.encode.update[l]={value:0})}const s=[];if(e.stack.groupbyChannels?.length>0)for(const l of e.stack.groupbyChannels){const t=e.fieldDef(l),n=Qa(t);n&&s.push(n),(t?.bin||t?.timeUnit)&&s.push(Qa(t,{binSuffix:"end"}))}o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,i)=>{if(t.encode.update[i])return{...n,[i]:t.encode.update[i]};{const t=bi(i,e.markDef,e.config);return void 0!==t?{...n,[i]:pi(t)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(oc.Main),name:Em+e.requestDataName(oc.Main),groupby:s,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return Am(e)}const $m="faceted_path_";const Em="stack_group_";function Am(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:i,encoding:r,config:o}=e,a=Ae(i.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!(!t?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=vi(i),l=r.key,u=function(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,a=t.order;if(!(!(0,U.cy)(a)&&Ga(a)&&J(a.value)||!a&&J(xi("order",r,o)))){if(((0,U.cy)(a)||Pa(a))&&!n)return ki(a,{expr:"datum"});if(Bo(i)){const e="horizontal"===r.orient?"y":"x";if(Pa(t[e]))return{field:e}}}}(e),c=function(e){if(!e.component.selection)return null;const t=fe(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=fe(i.component.selection).length,i=i.parent;return n?{interactive:t>0||"geoshape"===e.mark||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}(e),f=xi("aria",i,o),d=wm[n].postEncodingTransform?wm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:wm[n].vgMark,...a?{clip:a}:{},...s?{style:s}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...!1===f?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(oc.Main)},encode:{update:wm[n].encodeEntry(e)},...d?{transform:d}:{}}]}class Dm extends Tp{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;super(e,"unit",t,n,r,void 0,$l(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Uo(e.mark)?{...e.mark}:{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,n){let{graticule:i}=n;if(i)return!1;const r=bi("filled",e,t),o=e.type;return Ae(r,o!==Co&&o!==So&&o!==Mo)}(o,r,{graticule:e.data&&rc(e.data)}));const s=this.encoding=function(e,t,n,i){const r={};for(const a of fe(e))It(a)||ar(`${o=a}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let a of Kt){if(!e[a])continue;const o=e[a];if(_n(a)){const e=Vt(a),t=r[e];if(Pa(t)&&jr(t.type)&&Pa(o)&&!t.timeUnit){ar(Ii(e));continue}}if("angle"!==a||"arc"!==t||e.theta||(ar("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Ve),Os(e,a,t)){if(a===ot&&"line"===t){const t=as(e[a]);if(t?.aggregate){ar("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===tt&&(n?"fill"in e:"stroke"in e))ar(ji("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(a===pt||a===ht&&!(0,U.cy)(o)&&!Ga(o)||a===gt&&(0,U.cy)(o)){if(o){if(a===ht){const t=e[a];if(Ta(t)){r[a]=t;continue}}r[a]=(0,U.YO)(o).reduce(((e,t)=>(Pa(t)?e.push(cs(t,a)):ar(qi(t,a)),e)),[])}}else{if(a===gt&&null===o)r[a]=null;else if(!Pa(o)&&!La(o)&&!Ga(o)&&!za(o)&&!oi(o)){ar(qi(o,a));continue}r[a]=ls(o,a,i)}}else ar(Wi(a,t))}return r}(e.encoding||{},a,o.filled,r);this.markDef=Kl(o,s,r),this.size=function(e){let{encoding:t,size:n}=e;for(const i of mn){const e=Yt(i);kl(n[e])&&Ia(t[i])&&(delete n[e],ar(Ji(e)))}return n}({encoding:s,size:$l(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=Vl(this.markDef,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter((e=>yl(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===Po,n=e&&Et.some((t=>qa(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return Tn.reduce(((e,n)=>{const i=ss(t[n]);return i&&(e[n]=this.initScale(i.scale??{})),e}),{})}initScale(e){const{domain:t,range:n}=e,i=ni(e);return(0,U.cy)(t)&&(i.domain=t.map(di)),(0,U.cy)(n)&&(i.range=n.map(di)),i}initAxes(e){return mn.reduce(((t,n)=>{const i=e[n];if(qa(i)||n===Ue&&qa(e.x2)||n===je&&qa(e.y2)){const e=qa(i)?i.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=fe(e),n={};for(const i of t){const t=e[i];n[i]=vs(t)?fi(t):di(t)}return n}initLegends(e){return Mn.reduce(((t,n)=>{const i=ss(e[n]);if(i&&function(e){switch(e){case tt:case nt:case it:case ot:case rt:case st:case ct:case ft:return!0;case lt:case ut:case at:return!1}}(n)){const e=i.legend;t[n]=e?ni(e):e}return t}),{})}parseData(){this.component.data=rm(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of mn){const r=Yt(i);if(t[r]){const e=t[r];n.layoutSize.set(r,kl(e)?"step":e,!0)}else{const t=em(e,r);n.layoutSize.set(r,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const t=me(r.name),o=r.select,a=(0,U.Kg)(o)?o:o.type,s=(0,U.Gv)(o)?H(o):{type:a},l=i[a];for(const e in l)"fields"!==e&&"encodings"!==e&&("mark"===e&&(s.mark={...l.mark,...s.mark}),void 0!==s[e]&&!0!==s[e]||(s[e]=H(l[e]??s[e])));const u=n[t]={...s,name:t,type:a,init:r.value,bind:r.bind,events:(0,U.Kg)(s.on)?(0,sc.P)(s.on,"scope"):(0,U.YO)(H(s.on))},c=H(r);for(const n of If)n.defined(u)&&n.parse&&n.parse(e,u,c)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=km(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,mn.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[mm(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;for(const i of de(e.component.selection??{})){const r=i.name,o=(0,U.r$)(r+Rf);if(0===t.filter((e=>e.name===r)).length){const e="global"===i.resolve?"union":i.resolve,n="point"===i.type?", true, true)":")";t.push({name:i.name,update:`${Lf}(${o}, ${(0,U.r$)(e)}${n}`})}n=!0;for(const n of If)n.defined(i)&&n.topLevelSignals&&(t=n.topLevelSignals(e,i,t))}n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]});return hc(t)}(this,e)}assembleSignals(){return[...ed(this),...cc(this,[])]}assembleSelectionData(e){return function(e,t){const n=[...t],i=Uf(e,{escape:!1});for(const r of de(e.component.selection??{})){const e={name:r.name+Rf};if(r.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:hl}}]),r.init){const t=r.project.items.map(lc);e.values=r.project.hasSelectionId?r.init.map((e=>({unit:i,[hl]:uc(e,!1)[0]}))):r.init.map((e=>({unit:i,fields:t,values:uc(e,!1)})))}n.filter((e=>e.name===r.name+Rf)).length||n.push(e)}return n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Ad(this)}assembleMarks(){let e=this.component.mark??[];return this.parent&&Mp(this.parent)||(e=dc(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return void 0!==e?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Ds(this.encoding,e)}fieldDef(e){return as(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Wa(t)?t:null}}class Sm extends Op{constructor(e,t,n,i,r){super(e,"layer",t,n,r,e.resolve,e.view);const o={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if(jl(e))return new Sm(e,this,this.getName(`layer_${t}`),o,r);if(Es(e))return new Dm(e,this,this.getName(`layer_${t}`),o,r);throw new Error(Di(e))}))}parseData(){this.component.data=rm(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;Jp(e=this),Zp(e,"width"),Zp(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of fe(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const i of fe(r.component.axes))n.axis[i]=Td(e.component.resolve,i),"shared"===n.axis[i]&&(t[i]=fm(t[i],r.component.axes[i]),t[i]||(n.axis[i]="independent",delete t[i]))}for(const r of mn){for(const o of e.children)if(o.component.axes[r]){if("independent"===n.axis[r]){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const e of o.component.axes[r]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!oi(t)){if(i[t]>0&&!n){const n=cm[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete o.component.axes[r]}if("independent"===n.axis[r]&&t[r]&&t[r].length>1)for(const[e,n]of(t[r]||[]).entries())e>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),ed(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),Ad(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleGroupStyle(){const e=new Set;for(const n of this.children)for(const t of(0,U.YO)(n.assembleGroupStyle()))e.add(t);const t=Array.from(e);return t.length>1?t:1===t.length?t[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Sp(n)&&(t=dc(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),Qd(this))}}function Cm(e,t,n,i,r){if(Da(e))return new nm(e,t,n,r);if(jl(e))return new Sm(e,t,n,i,r);if(Es(e))return new Dm(e,t,n,i,r);if(function(e){return bl(e)||_l(e)||xl(e)}(e))return new am(e,t,n,r);throw new Error(Di(e))}function Fm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;t.logger&&(n=t.logger,rr=n),t.fieldTitle&&ts(t.fieldTitle);try{const n=Rl((0,U.io)(t.config,e.config)),i=Bu(e,n),r=Cm(i,null,"",void 0,n);r.parse(),function(e,t){Yh(e.sources);let n=0,i=0;for(let r=0;r<Gh&&Xh(e,t,!0);r++)n++;e.sources.map(jh);for(let r=0;r<Gh&&Xh(e,t,!1);r++)i++;Yh(e.sources),Math.max(n,i)===Gh&&ar(`Maximum optimization runs(${Gh}) reached.`)}(r.component.data,r);const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;const r=e.config?Il(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){const n=[],i=Hp(n);let r=0;for(const a of e.sources){a.hasName()||(a.dataName="source_"+r++);const e=a.assemble();i(a,e)}for(const a of n)0===a.transform.length&&delete a.transform;let o=0;for(const[a,s]of n.entries())0!==(s.transform??[]).length||s.source||n.splice(o++,0,n.splice(a,1)[0]);for(const a of n)for(const t of a.transform??[])"lookup"===t.type&&(t.from=e.outputNodes[t.from].getSource());for(const a of n)a.name in t&&(a.values=t[a.name]);return n}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter((e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...s?{title:s}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...vl(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}(r,function(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===t?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):(0,U.Kg)(t)&&(t={type:t});if(r&&o&&(a=t.type,["fit","fit-x","fit-y"].includes(a)))if("step"===r&&"step"===o)ar(Mi()),t.type="pad";else if("step"===r||"step"===o){const e="step"===r?"width":"height";ar(Mi(xn(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${xn(e)}`:"fit"}(n)}var a;return{...1===fe(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...Wu(n,!1),...Wu(e,!0)}}(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:o,normalized:i}}finally{t.logger&&or(),t.fieldTitle&&ts(Za)}}const Mm="5.21.0";const Om=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};var Tm="2.15.0";const zm="#fff",Nm="#888",Rm={background:"#333",view:{stroke:Nm},title:{color:zm,subtitleColor:zm},style:{"guide-label":{fill:zm},"guide-title":{fill:zm}},axis:{domainColor:zm,gridColor:Nm,tickColor:zm}},Pm="#4572a7",Bm={background:"#fff",arc:{fill:Pm},area:{fill:Pm},line:{stroke:Pm,strokeWidth:2},path:{stroke:Pm},rect:{fill:Pm},shape:{stroke:Pm},symbol:{fill:Pm,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"]}},Lm="#30a2da",Im="#cbcbcb",Um="#f0f0f0",jm="#333",qm={arc:{fill:Lm},area:{fill:Lm},axis:{domainColor:Im,grid:!0,gridColor:Im,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Im,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Um,group:{fill:Um},legend:{labelColor:jm,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:jm,titleFontSize:14,titlePadding:10},line:{stroke:Lm,strokeWidth:2},path:{stroke:Lm,strokeWidth:.5},rect:{fill:Lm},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:Lm},bar:{binSpacing:2,fill:Lm,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Wm="#000",Gm={group:{fill:"#e5e5e5"},arc:{fill:Wm},area:{fill:Wm},line:{stroke:Wm},path:{stroke:Wm},rect:{fill:Wm},shape:{stroke:Wm},symbol:{fill:Wm,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"]}},Ym="Benton Gothic, sans-serif",Hm="#82c6df",Xm="Benton Gothic Bold, sans-serif",Vm="normal",Km={"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"]},Qm={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Xm,fontSize:22,fontWeight:"normal"},arc:{fill:Hm},area:{fill:Hm},line:{stroke:Hm,strokeWidth:2},path:{stroke:Hm},rect:{fill:Hm},shape:{stroke:Hm},symbol:{fill:Hm,size:30},axis:{labelFont:Ym,labelFontSize:11.5,labelFontWeight:"normal",titleFont:Xm,titleFontSize:13,titleFontWeight:Vm},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:Ym,labelFontSize:11.5,symbolType:"square",titleFont:Xm,titleFontSize:13,titleFontWeight:Vm},range:{category:Km["category-6"],diverging:Km["fireandice-6"],heatmap:Km["fire-7"],ordinal:Km["fire-7"],ramp:Km["fire-7"]}},Jm="#ab5787",Zm="#979797",eg={background:"#f9f9f9",arc:{fill:Jm},area:{fill:Jm},line:{stroke:Jm},path:{stroke:Jm},rect:{fill:Jm},shape:{stroke:Jm},symbol:{fill:Jm,size:30},axis:{domainColor:Zm,domainWidth:.5,gridWidth:.2,labelColor:Zm,tickColor:Zm,tickWidth:.2,titleColor:Zm},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"]}},tg="#3e5c69",ng={background:"#fff",arc:{fill:tg},area:{fill:tg},line:{stroke:tg},path:{stroke:tg},rect:{fill:tg},shape:{stroke:tg},symbol:{fill:tg},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"]}},ig="#1696d2",rg="#000000",og="Lato",ag="Lato",sg={"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"]},lg={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:og},axisX:{domain:!0,domainColor:rg,domainWidth:1,grid:!1,labelFontSize:12,labelFont:ag,labelAngle:0,tickColor:rg,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:og},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:ag,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:og,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:ag,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:og,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:sg["six-groups-cat-1"],diverging:sg["diverging-colors"],heatmap:sg["diverging-colors"],ordinal:sg["six-groups-seq"],ramp:sg["shades-blue"]},area:{fill:ig},rect:{fill:ig},line:{color:ig,stroke:ig,strokeWidth:5},trail:{color:ig,stroke:ig,strokeWidth:0,size:1},path:{stroke:ig,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:ig,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:ig,stroke:null}},arc:{fill:ig},shape:{stroke:ig},symbol:{fill:ig,size:30}},ug="#3366CC",cg="#ccc",fg="Arial, sans-serif",dg={arc:{fill:ug},area:{fill:ug},path:{stroke:ug},rect:{fill:ug},shape:{stroke:ug},symbol:{stroke:ug},circle:{fill:ug},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:fg,fontSize:12},"guide-title":{font:fg,fontSize:12},"group-title":{font:fg,fontSize:12}},title:{font:fg,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:cg,tickColor:cg,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},hg=e=>e*(1/3+1),pg=hg(9),mg=hg(10),gg=hg(12),yg="Segoe UI",vg="wf_standard-font, helvetica, arial, sans-serif",xg="#252423",bg="#605E5C",_g="transparent",wg="#118DFF",kg="#DEEFFF",$g=[kg,wg],Eg={view:{stroke:_g},background:_g,font:yg,header:{titleFont:vg,titleFontSize:gg,titleColor:xg,labelFont:yg,labelFontSize:mg,labelColor:bg},axis:{ticks:!1,grid:!1,domain:!1,labelColor:bg,labelFontSize:pg,titleFont:vg,titleColor:xg,titleFontSize:gg,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:wg},line:{stroke:wg,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:yg,fontSize:pg,fill:bg},arc:{fill:wg},area:{fill:wg,line:!0,opacity:.6},path:{stroke:wg},rect:{fill:wg},point:{fill:wg,filled:!0,size:75},shape:{stroke:wg},symbol:{fill:wg,strokeWidth:1.5,size:50},legend:{titleFont:yg,titleFontWeight:"bold",titleColor:bg,labelFont:yg,labelFontSize:mg,labelColor:bg,symbolType:"circle",symbolSize:75},range:{category:[wg,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:$g,heatmap:$g,ordinal:[kg,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",wg]}},Ag='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Dg={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Sg=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Cg=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Fg(e){let{theme:t,background:n}=e;const i=["white","g10"].includes(t)?"light":"dark",r=Dg.gridBg[t],o=Dg.textPrimary[t],a=Dg.textSecondary[t],s="dark"===i?Sg:Cg,l="dark"===i?"#d4bbff":"#6929c4";return{background:n,arc:{fill:l},area:{fill:l},path:{stroke:l},rect:{fill:l},shape:{stroke:l},symbol:{stroke:l},circle:{fill:l},view:{fill:r,stroke:r},group:{fill:r},title:{color:o,anchor:"start",dy:-15,fontSize:16,font:Ag,fontWeight:600},axis:{labelColor:a,labelFontSize:12,labelFont:'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',labelFontWeight:400,titleColor:o,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Dg.layerAccent01[t],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:Ag,fill:a,fontWeight:400},"guide-title":{font:Ag,fill:a,fontWeight:400}},range:{category:s,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 Mg=Fg({theme:"white",background:"#ffffff"}),Og=Fg({theme:"g10",background:"#f4f4f4"}),Tg=Fg({theme:"g90",background:"#262626"}),zg=Fg({theme:"g100",background:"#161616"}),Ng=Tm;function Rg(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,i){if("object"!==typeof i||null===i)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}(t))}var Pg="#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";const Bg="vg-tooltip-element",Lg={offsetX:10,offsetY:10,id:Bg,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2,formatTooltip:function(e,t,n,i){if((0,U.cy)(e))return`[${e.map((e=>t((0,U.Kg)(e)?e:Rg(e,n)))).join(", ")}]`;if((0,U.Gv)(e)){let r="";const{title:o,image:a,...s}=e;o&&(r+=`<h2>${t(o)}</h2>`),a&&(r+=`<img src="${new URL(t(a),i||location.href).href}">`);const l=Object.keys(s);if(l.length>0){r+="<table>";for(const e of l){let i=s[e];void 0!==i&&((0,U.Gv)(i)&&(i=Rg(i,n)),r+=`<tr><td class="key">${t(e)}</td><td class="value">${t(i)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)},baseURL:""};class Ig{constructor(e){this.options={...Lg,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Pg.toString().replace(Bg,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,i){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==i||""===i)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:r,y:o}=function(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let o=e.clientY+i;return o+t.height>window.innerHeight&&(o=+e.clientY-i-t.height),{x:r,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${r}px`}}function Ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jg=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};const qg=Object.freeze({loose:!0}),Wg=Object.freeze({});var Gg=e=>e?"object"!==typeof e?qg:e:Wg,Yg={exports:{}};var Hg={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 Xg="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 e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error("SEMVER",...t)}:()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=Hg,o=Xg,a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=(e,t,n)=>{const i=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=c++;o(e,r,t),u[e]=r,l[r]=t,a[r]=new RegExp(t,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-]${f}*`),h("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),h("FULL",`^${l[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),h("LOOSE",`^${l[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),h("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",l[u.COERCE],!0),h("COERCERTLFULL",l[u.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Yg,Yg.exports);var Vg=Yg.exports;const Kg=/^[0-9]+$/,Qg=(e,t)=>{const n=Kg.test(e),i=Kg.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var Jg={compareIdentifiers:Qg,rcompareIdentifiers:(e,t)=>Qg(t,e)};const Zg=Xg,{MAX_LENGTH:ey,MAX_SAFE_INTEGER:ty}=Hg,{safeRe:ny,t:iy}=Vg,ry=Gg,{compareIdentifiers:oy}=Jg;var ay=class e{constructor(t,n){if(n=ry(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!==typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>ey)throw new TypeError(`version is longer than ${ey} characters`);Zg("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?ny[iy.LOOSE]:ny[iy.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>ty||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ty||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ty||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<ty)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Zg("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"===typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),oy(this.major,t.major)||oy(this.minor,t.minor)||oy(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],i=t.prerelease[n];if(Zg("prerelease compare",n,e,i),void 0===e&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===e)return-1;if(e!==i)return oy(e,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],i=t.build[n];if(Zg("build compare",n,e,i),void 0===e&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===e)return-1;if(e!==i)return oy(e,i)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,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 e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let i=[t,e];!1===n&&(i=[t]),0===oy(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const sy=ay;var ly=(e,t,n)=>new sy(e,n).compare(new sy(t,n));const uy=ly;const cy=ly;const fy=ly;const dy=ly;const hy=ly;const py=ly;const my=(e,t,n)=>0===uy(e,t,n),gy=(e,t,n)=>0!==cy(e,t,n),yy=(e,t,n)=>fy(e,t,n)>0,vy=(e,t,n)=>dy(e,t,n)>=0,xy=(e,t,n)=>hy(e,t,n)<0,by=(e,t,n)=>py(e,t,n)<=0;var _y,wy,ky,$y,Ey=(e,t,n,i)=>{switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e===n;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return my(e,n,i);case"!=":return gy(e,n,i);case">":return yy(e,n,i);case">=":return vy(e,n,i);case"<":return xy(e,n,i);case"<=":return by(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};function Ay(){if($y)return ky;$y=1;class e{constructor(t,r){if(r=n(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&p(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,o=t.get(n);if(o)return o;const p=this.options.loose,m=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(m,A(this.options.includePrerelease)),r("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],l),r("comparator trim",e),e=e.replace(a[s.TILDETRIM],u),r("tilde trim",e),e=e.replace(a[s.CARETTRIM],c),r("caret trim",e);let y=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));p&&(y=y.filter((e=>(r("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),r("range list",y);const v=new Map,x=y.map((e=>new i(e,this.options)));for(const t of x){if(h(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const b=[...v.values()];return t.set(n,b),b}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>m(e,n)&&t.set.some((t=>m(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"===typeof e)try{e=new o(e,this.options)}catch(t){return!1}for(let n=0;n<this.set.length;n++)if(D(this.set[n],e,this.options))return!0;return!1}}ky=e;const t=new jg,n=Gg,i=function(){if(wy)return _y;wy=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(i,r){if(r=n(r),i instanceof t){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===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);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=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"===typeof t)try{t=new s(t,this.options)}catch(n){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,i){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,i).test(this.value):""===e.operator?""===e.value||new l(this.value,i).test(e.semver):(!(i=n(i)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&!(!i.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||!!(o(this.semver,"<",e.semver,i)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,i)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}_y=t;const n=Gg,{safeRe:i,t:r}=Vg,o=Ey,a=Xg,s=ay,l=Ay();return _y}(),r=Xg,o=ay,{safeRe:a,t:s,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:c}=Vg,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=Hg,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,m=(e,t)=>{let n=!0;const i=e.slice();let r=i.pop();for(;n&&i.length;)n=i.every((e=>r.intersects(e,t))),r=i.pop();return n},g=(e,t)=>(r("comp",e,t),e=b(e,t),r("caret",e),e=v(e,t),r("tildes",e),e=w(e,t),r("xrange",e),e=$(e,t),r("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,i,o,a)=>{let s;return r("tilde",e,t,n,i,o,a),y(n)?s="":y(i)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:a?(r("replaceTilde pr",a),s=`>=${n}.${i}.${o}-${a} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,r("tilde return",s),s}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{r("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let l;return r("caret",e,t,n,o,a,s),y(n)?l="":y(o)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:y(a)?l="0"===n?`>=${n}.${o}.0${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${i} <${+n+1}.0.0-0`:s?(r("replaceCaret pr",s),l="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(r("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${a}${i} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),r("caret return",l),l}))},w=(e,t)=>(r("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,i,o,a,s,l)=>{r("xRange",e,n,i,o,a,s,l);const u=y(o),c=u||y(a),f=c||y(s),d=f;return"="===i&&d&&(i=""),l=t.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(a=0),s=0,">"===i?(i=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",c?o=+o+1:a=+a+1),"<"===i&&(l="-0"),n=`${i+o}.${a}.${s}${l}`):c?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${l} <${o}.${+a+1}.0-0`),r("xRange return",n),n}))},$=(e,t)=>(r("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),E=(e,t)=>(r("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),A=e=>(t,n,i,r,o,a,s,l,u,c,f,d)=>`${n=y(i)?"":y(r)?`>=${i}.0.0${e?"-0":""}`:y(o)?`>=${i}.${r}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=y(u)?"":y(c)?`<${+u+1}.0.0-0`:y(f)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${f}-${d}`:e?`<${u}.${c}.${+f+1}-0`:`<=${l}`}`.trim(),D=(e,t,n)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(r(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0};return ky}const Dy=Ay();var Sy=(e,t,n)=>{try{t=new Dy(t,n)}catch(i){return!1}return t.test(e)},Cy=Ug(Sy);var Fy='.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 My(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(const r of n)Oy(e,r);return e}function Oy(e,t){for(const n of Object.keys(t))(0,L.writeConfig)(e,n,t[n],!0)}const Ty=L;let zy=o;const Ny="undefined"!==typeof window?window:void 0;void 0===zy&&Ny?.vl?.compile&&(zy=Ny.vl);const Ry={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Py={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"},By={vega:"Vega","vega-lite":"Vega-Lite"},Ly={vega:Ty.version,"vega-lite":zy?zy.version:"not available"},Iy={vega:e=>e,"vega-lite":(e,t)=>zy.compile(e,{config:t}).spec},Uy='\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>',jy="chart-wrapper";function qy(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(r+e+o),a.document.title=`${By[i]} JSON Source`}function Wy(e){return!(!e||!("load"in e))}function Gy(e){return Wy(e)?e:Ty.loader(e)}async function Yy(e,t){let n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,L.isString)(t)?(i=Gy(r.loader),n=JSON.parse(await i.load(t))):n=t;const o=function(e){const t=e.usermeta?.embedOptions??{};return(0,L.isString)(t.defaultStyle)&&(t.defaultStyle=!1),t}(n),s=o.loader;i&&!s||(i=Gy(r.loader??s));const l=await Hy(o,i),u=await Hy(r,i),c={...My(u,l),config:(0,L.mergeConfig)(u.config??{},l.config??{})};return await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;const r=n.theme?(0,L.mergeConfig)(a[n.theme],n.config??{}):n.config,o=(0,L.isBoolean)(n.actions)?n.actions:My({},Ry,n.actions??{}),s={...Py,...n.i18n},l=n.renderer??"canvas",u=n.logLevel??Ty.Warn,c=n.downloadFileName??"visualization",f="string"===typeof e?document.querySelector(e):e;if(!f)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:i}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(f);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?Fy.toString():n.defaultStyle,i.appendChild(t)}}const d=function(e,t){if(e.$schema){const n=Om(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${By[n.library]}, but mode argument sets ${By[t]??t}.`);const i=n.library;return Cy(Ly[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${By[i]} ${n.version}, but the current version of ${By[i]} is v${Ly[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(t,n.mode);let h=Iy[d](t,r);if("vega-lite"===d&&h.$schema){const e=Om(h.$schema);Cy(Ly.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${Ly.vega}.`)}f.classList.add("vega-embed"),o&&f.classList.add("has-actions");f.innerHTML="";let p=f;if(o){const e=document.createElement("div");e.classList.add(jy),f.appendChild(e),p=e}const m=n.patch;m&&(h=m instanceof Function?m(h):$(h,m,!0,!1).newDocument);n.formatLocale&&Ty.formatLocale(n.formatLocale);n.timeFormatLocale&&Ty.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const a in n.expressionFunctions){const e=n.expressionFunctions[a];"fn"in e?Ty.expressionFunction(a,e.fn,e.visitor):e instanceof Function&&Ty.expressionFunction(a,e)}const{ast:g}=n,y=Ty.parse(h,"vega-lite"===d?{}:r,{ast:g}),v=new(n.viewClass||Ty.View)(y,{loader:i,logLevel:u,renderer:l,...g?{expr:Ty.expressionInterpreter??n.expr??I.P}:{}});if(v.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(p.classList.add("fit-x"),p.classList.remove("fit-y")):"fit-y"==n?(p.classList.remove("fit-x"),p.classList.add("fit-y")):"fit"==n?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const{loader:e,tooltip:t}=n,i=e&&!Wy(e)?e?.baseURL:void 0,r="function"===typeof t?t:new Ig({baseURL:i,...!0===t?{}:t}).call;v.tooltip(r)}let x,{hover:b}=n;void 0===b&&(b="vega"===d);if(b){const{hoverSet:e,updateSet:t}="boolean"===typeof b?{}:b;v.hover(e,t)}n&&(null!=n.width&&v.width(n.width),null!=n.height&&v.height(n.height),null!=n.padding&&v.padding(n.padding));if(await v.initialize(p,n.bind).runAsync(),!1!==o){let e=f;if(!1!==n.defaultStyle||n.forceActionsMenu){const t=document.createElement("details");t.title=s.CLICK_TO_VIEW_ACTIONS,f.append(t),e=t;const n=document.createElement("summary");n.innerHTML=Uy,t.append(n),x=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",x)}const i=document.createElement("div");if(e.append(i),i.classList.add("vega-actions"),!0===o||!1!==o.export)for(const t of["svg","png"])if(!0===o||!0===o.export||o.export[t]){const e=s[`${t.toUpperCase()}_ACTION`],r=document.createElement("a"),o=(0,L.isObject)(n.scaleFactor)?n.scaleFactor[t]:n.scaleFactor;r.text=e,r.href="#",r.target="_blank",r.download=`${c}.${t}`,r.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await v.toImageURL(t,o);this.href=n})),i.append(r)}if(!0===o||!1!==o.source){const e=document.createElement("a");e.text=s.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){qy(B()(t),n.sourceHeader??"",n.sourceFooter??"",d),e.preventDefault()})),i.append(e)}if("vega-lite"===d&&(!0===o||!1!==o.compiled)){const e=document.createElement("a");e.text=s.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){qy(B()(h),n.sourceHeader??"",n.sourceFooter??"","vega"),e.preventDefault()})),i.append(e)}if(!0===o||!1!==o.editor){const e=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=s.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(e,t,n){const i=e.open(t),{origin:r}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===i&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(i.postMessage(n,r),setTimeout(e,250),o-=1)}),250)}(window,e,{config:r,mode:m?"vega":d,renderer:l,spec:B()(m?h:t)}),n.preventDefault()})),i.append(o)}}function _(){x&&document.removeEventListener("click",x),v.finalize()}return{view:v,spec:t,vgSpec:h,finalize:_,embedOptions:n}}(e,n,c,i)}async function Hy(e,t){const n=(0,L.isString)(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=(0,L.isString)(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}},60646:(e,t,n)=>{"use strict";n.d(t,{P:()=>g});const i="view",r="[",o="]",a="{",s="}",l=":",u=",",c="@",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(e,t,n){return p=t||i,m=n||h,v(e.trim()).map(x)}function y(e,t,n,i,r){const o=e.length;let a,s=0;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function v(e){const t=[],n=e.length;let i=0,l=0;for(;l<n;)l=y(e,l,u,r+a,o+s),t.push(e.substring(i,l).trim()),i=++l;if(0===t.length)throw"Empty event selector: "+e;return t}function x(e){return"["===e[0]?function(e){const t=e.length;let n,i=1;if(i=y(e,i,o,r,o),i===t)throw"Empty between selector: "+e;if(n=v(e.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+e;if(e=e.slice(i+1).trim(),e[0]!==f)throw"Expected '>' after between selector: "+e;n=n.map(x);const a=x(e.slice(1).trim());if(a.between)return{between:n,stream:a};a.between=n;return a}(e):function(e){const t={source:p},n=[];let i,f,h=[0,0],g=0,v=0,x=e.length,b=0;if(e[x-1]===s){if(b=e.lastIndexOf(a),!(b>=0))throw"Unmatched right brace: "+e;try{h=function(e){const t=e.split(u);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!==n)throw e;return n}))}(e.substring(b+1,x-1))}catch(w){throw"Invalid throttle specification: "+e}x=(e=e.slice(0,b).trim()).length,b=0}if(!x)throw e;e[0]===c&&(g=++b);i=y(e,b,l),i<x&&(n.push(e.substring(v,i).trim()),v=b=++i);if(b=y(e,b,r),b===x)n.push(e.substring(v,x).trim());else if(n.push(e.substring(v,b).trim()),f=[],v=++b,v===x)throw"Unmatched left bracket: "+e;for(;b<x;){if(b=y(e,b,o),b===x)throw"Unmatched left bracket: "+e;if(f.push(e.substring(v,b).trim()),b<x-1&&e[++b]!==r)throw"Expected left bracket: "+e;v=++b}if(!(x=n.length)||d.test(n[x-1]))throw"Invalid event selector: "+e;x>1?(t.type=n[1],g?t.markname=n[0].slice(1):(_=n[0],m[_]?t.marktype=n[0]:t.source=n[0])):t.type=n[0];var _;"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=f&&(t.filter=f);h[0]&&(t.throttle=h[0]);h[1]&&(t.debounce=h[1]);return t}(e)}},66906:(e,t,n)=>{"use strict";n.d(t,{AA:()=>Ge,Cn:()=>Ye,DG:()=>l,Se:()=>He,YK:()=>We,uS:()=>r});var i=n(518);const r="Literal",o="Property",a="ArrayExpression",s="BinaryExpression",l="CallExpression",u="ConditionalExpression",c="LogicalExpression",f="MemberExpression",d="ObjectExpression",h="UnaryExpression";function p(e){this.type=e}var m,g,y,v,x;p.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case a:return e.elements;case s:case c:return[e.left,e.right];case l:return[e.callee].concat(e.arguments);case u:return[e.test,e.consequent,e.alternate];case f:return[e.object,e.property];case d:return e.properties;case o:return[e.key,e.value];case h:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};var b=1,_=2,w=3,k=4,$=5,E=6,A=7,D=8;(m={})[b]="Boolean",m[_]="<end>",m[w]="Identifier",m[k]="Keyword",m[$]="Null",m[E]="Numeric",m[A]="Punctuator",m[D]="String",m[9]="RegularExpression";var S="ArrayExpression",C="BinaryExpression",F="CallExpression",M="ConditionalExpression",O="Identifier",T="Literal",z="LogicalExpression",N="MemberExpression",R="ObjectExpression",P="Property",B="UnaryExpression",L="Unexpected token %0",I="Unexpected number",U="Unexpected string",j="Unexpected identifier",q="Unexpected reserved word",W="Unexpected end of input",G="Invalid regular expression",Y="Invalid regular expression: missing /",H="Octal literals are not allowed in strict mode.",X="Duplicate data property in object literal not allowed in strict mode",V="ILLEGAL",K="Disabled.",Q=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]"),J=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 Z(e,t){if(!e)throw new Error("ASSERT: "+t)}function ee(e){return e>=48&&e<=57}function te(e){return"0123456789abcdefABCDEF".includes(e)}function ne(e){return"01234567".includes(e)}function ie(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function re(e){return 10===e||13===e||8232===e||8233===e}function oe(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&Q.test(String.fromCharCode(e))}function ae(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&J.test(String.fromCharCode(e))}const se={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 le(){for(;y<v;){const e=g.charCodeAt(y);if(!ie(e)&&!re(e))break;++y}}function ue(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)y<v&&te(g[y])?(i=g[y++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):Ee({},L,V);return String.fromCharCode(r)}function ce(){var e,t,n,i;for(t=0,"}"===(e=g[y])&&Ee({},L,V);y<v&&te(e=g[y++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Ee({},L,V),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function fe(){var e,t;for(e=g.charCodeAt(y++),t=String.fromCharCode(e),92===e&&(117!==g.charCodeAt(y)&&Ee({},L,V),++y,(e=ue("u"))&&"\\"!==e&&oe(e.charCodeAt(0))||Ee({},L,V),t=e);y<v&&ae(e=g.charCodeAt(y));)++y,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==g.charCodeAt(y)&&Ee({},L,V),++y,(e=ue("u"))&&"\\"!==e&&ae(e.charCodeAt(0))||Ee({},L,V),t+=e);return t}function de(){var e,t;return e=y,t=92===g.charCodeAt(y)?fe():function(){var e,t;for(e=y++;y<v;){if(92===(t=g.charCodeAt(y)))return y=e,fe();if(!ae(t))break;++y}return g.slice(e,y)}(),{type:1===t.length?w:se.hasOwnProperty(t)?k:"null"===t?$:"true"===t||"false"===t?b:w,value:t,start:e,end:y}}function he(){var e,t,n,i,r=y,o=g.charCodeAt(y),a=g[y];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++y,{type:A,value:String.fromCharCode(o),start:r,end:y};default:if(61===(e=g.charCodeAt(y+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return y+=2,{type:A,value:String.fromCharCode(o)+String.fromCharCode(e),start:r,end:y};case 33:case 61:return y+=2,61===g.charCodeAt(y)&&++y,{type:A,value:g.slice(r,y),start:r,end:y}}}return">>>="===(i=g.substr(y,4))?{type:A,value:i,start:r,end:y+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:A,value:n,start:r,end:y+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".includes(a)||"=>"===t?{type:A,value:t,start:r,end:y+=2}:("//"===t&&Ee({},L,V),"<>=!+-*%&|^/".includes(a)?(++y,{type:A,value:a,start:r,end:y}):void Ee({},L,V))}function pe(){var e,t,n;if(Z(ee((n=g[y]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=y,e="","."!==n){if(e=g[y++],n=g[y],"0"===e){if("x"===n||"X"===n)return++y,function(e){let t="";for(;y<v&&te(g[y]);)t+=g[y++];return 0===t.length&&Ee({},L,V),oe(g.charCodeAt(y))&&Ee({},L,V),{type:E,value:parseInt("0x"+t,16),start:e,end:y}}(t);if(ne(n))return function(e){let t="0"+g[y++];for(;y<v&&ne(g[y]);)t+=g[y++];return(oe(g.charCodeAt(y))||ee(g.charCodeAt(y)))&&Ee({},L,V),{type:E,value:parseInt(t,8),octal:!0,start:e,end:y}}(t);n&&ee(n.charCodeAt(0))&&Ee({},L,V)}for(;ee(g.charCodeAt(y));)e+=g[y++];n=g[y]}if("."===n){for(e+=g[y++];ee(g.charCodeAt(y));)e+=g[y++];n=g[y]}if("e"===n||"E"===n)if(e+=g[y++],"+"!==(n=g[y])&&"-"!==n||(e+=g[y++]),ee(g.charCodeAt(y)))for(;ee(g.charCodeAt(y));)e+=g[y++];else Ee({},L,V);return oe(g.charCodeAt(y))&&Ee({},L,V),{type:E,value:parseFloat(e),start:t,end:y}}function me(){var e,t,n,i;return x=null,le(),e=y,t=function(){var e,t,n,i;for(Z("/"===(e=g[y]),"Regular expression literal must start with a slash"),t=g[y++],n=!1,i=!1;y<v;)if(t+=e=g[y++],"\\"===e)re((e=g[y++]).charCodeAt(0))&&Ee({},Y),t+=e;else if(re(e.charCodeAt(0)))Ee({},Y);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||Ee({},Y),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";y<v&&ae((e=g[y]).charCodeAt(0));)++y,"\\"===e&&y<v?Ee({},L,V):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ee({},G,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";Ee({},G)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(i){Ee({},G)}try{return new RegExp(e,t)}catch(r){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:y}}function ge(){if(le(),y>=v)return{type:_,start:y,end:y};const e=g.charCodeAt(y);return oe(e)?de():40===e||41===e||59===e?he():39===e||34===e?function(){var e,t,n,i,r="",o=!1;for(Z("'"===(e=g[y])||'"'===e,"String literal must starts with a quote"),t=y,++y;y<v;){if((n=g[y++])===e){e="";break}if("\\"===n)if((n=g[y++])&&re(n.charCodeAt(0)))"\r"===n&&"\n"===g[y]&&++y;else switch(n){case"u":case"x":"{"===g[y]?(++y,r+=ce()):r+=ue(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:ne(n)?(0!==(i="01234567".indexOf(n))&&(o=!0),y<v&&ne(g[y])&&(o=!0,i=8*i+"01234567".indexOf(g[y++]),"0123".includes(n)&&y<v&&ne(g[y])&&(i=8*i+"01234567".indexOf(g[y++]))),r+=String.fromCharCode(i)):r+=n}else{if(re(n.charCodeAt(0)))break;r+=n}}return""!==e&&Ee({},L,V),{type:D,value:r,octal:o,start:t,end:y}}():46===e?ee(g.charCodeAt(y+1))?pe():he():ee(e)?pe():he()}function ye(){const e=x;return y=e.end,x=ge(),y=e.end,e}function ve(){const e=y;x=ge(),y=e}function xe(e,t,n){const i=new p("||"===e||"&&"===e?z:C);return i.operator=e,i.left=t,i.right=n,i}function be(e,t){const n=new p(F);return n.callee=e,n.arguments=t,n}function _e(e){const t=new p(O);return t.name=e,t}function we(e){const t=new p(T);return t.value=e.value,t.raw=g.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function ke(e,t,n){const i=new p(N);return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function $e(e,t,n){const i=new p(P);return i.key=t,i.value=n,i.kind=e,i}function Ee(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,((e,t)=>(Z(t<i.length,"Message reference must be in range"),i[t])));throw(n=new Error(r)).index=y,n.description=r,n}function Ae(e){e.type===_&&Ee(e,W),e.type===E&&Ee(e,I),e.type===D&&Ee(e,U),e.type===w&&Ee(e,j),e.type===k&&Ee(e,q),Ee(e,L,e.value)}function De(e){const t=ye();t.type===A&&t.value===e||Ae(t)}function Se(e){return x.type===A&&x.value===e}function Ce(e){return x.type===k&&x.value===e}function Fe(){const e=[];for(y=x.start,De("[");!Se("]");)Se(",")?(ye(),e.push(null)):(e.push(je()),Se("]")||De(","));return ye(),function(e){const t=new p(S);return t.elements=e,t}(e)}function Me(){y=x.start;const e=ye();return e.type===D||e.type===E?(e.octal&&Ee(e,H),we(e)):_e(e.value)}function Oe(){var e,t,n;return y=x.start,(e=x).type===w?(n=Me(),De(":"),$e("init",n,je())):e.type!==_&&e.type!==A?(t=Me(),De(":"),$e("init",t,je())):void Ae(e)}function Te(){var e,t,n=[],i={},r=String;for(y=x.start,De("{");!Se("}");)t="$"+((e=Oe()).key.type===O?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?Ee({},X):i[t]=!0,n.push(e),Se("}")||De(",");return De("}"),function(e){const t=new p(R);return t.properties=e,t}(n)}const ze={if:1};function Ne(){var e,t,n;if(Se("("))return function(){De("(");const e=qe();return De(")"),e}();if(Se("["))return Fe();if(Se("{"))return Te();if(e=x.type,y=x.start,e===w||ze[x.value])n=_e(ye().value);else if(e===D||e===E)x.octal&&Ee(x,H),n=we(ye());else{if(e===k)throw new Error(K);e===b?((t=ye()).value="true"===t.value,n=we(t)):e===$?((t=ye()).value=null,n=we(t)):Se("/")||Se("/=")?(n=we(me()),ve()):Ae(ye())}return n}function Re(){const e=[];if(De("("),!Se(")"))for(;y<v&&(e.push(je()),!Se(")"));)De(",");return De(")"),e}function Pe(){y=x.start;const e=ye();return function(e){return e.type===w||e.type===k||e.type===b||e.type===$}(e)||Ae(e),_e(e.value)}function Be(){De("[");const e=qe();return De("]"),e}function Le(){const e=function(){var e;for(e=Ne();;)if(Se("."))De("."),e=ke(".",e,Pe());else if(Se("("))e=be(e,Re());else{if(!Se("["))break;e=ke("[",e,Be())}return e}();if(x.type===A&&(Se("++")||Se("--")))throw new Error(K);return e}function Ie(){var e,t;if(x.type!==A&&x.type!==k)t=Le();else{if(Se("++")||Se("--"))throw new Error(K);if(Se("+")||Se("-")||Se("~")||Se("!"))e=ye(),t=Ie(),t=function(e,t){const n=new p(B);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(Ce("delete")||Ce("void")||Ce("typeof"))throw new Error(K);t=Le()}}return t}function Ue(e){let t=0;if(e.type!==A&&e.type!==k)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function je(){var e,t;return e=function(){var e,t,n,i,r,o,a,s,l,u;if(e=x,l=Ie(),0===(r=Ue(i=x)))return l;for(i.prec=r,ye(),t=[e,x],o=[l,i,a=Ie()];(r=Ue(x))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,l=o.pop(),t.pop(),n=xe(s,l,a),o.push(n);(i=ye()).prec=r,o.push(i),t.push(x),n=Ie(),o.push(n)}for(n=o[u=o.length-1],t.pop();u>1;)t.pop(),n=xe(o[u-1].value,o[u-2],n),u-=2;return n}(),Se("?")&&(ye(),t=je(),De(":"),e=function(e,t,n){const i=new p(M);return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,je())),e}function qe(){const e=je();if(Se(","))throw new Error(K);return e}function We(e){y=0,v=(g=e).length,x=null,ve();const t=qe();if(x.type!==_)throw new Error("Unexpect token after expression.");return t}var Ge={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 Ye(e){function t(t,n,i){return r=>function(t,n,i,r){let o=e(n[0]);return i&&(o=i+"("+o+")",0===i.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(r<0?"":0===r?"()":"("+n.slice(1).map(e).join(",")+")")}(t,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(t){t.length<3&&(0,i.z3)("Missing arguments to clamp function."),t.length>3&&(0,i.z3)("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:o,test:t("test",o),if:function(t){t.length<3&&(0,i.z3)("Missing arguments to if function."),t.length>3&&(0,i.z3)("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function He(e){const t=(e=e||{}).allowed?(0,i.M1)(e.allowed):{},n=e.forbidden?(0,i.M1)(e.forbidden):{},r=e.constants||Ge,o=(e.functions||Ye)(d),a=e.globalvar,s=e.fieldvar,l=(0,i.Tn)(a)?a:e=>`${a}["${e}"]`;let u={},c={},f=0;function d(e){if((0,i.Kg)(e))return e;const t=h[e.type];return null==t&&(0,i.z3)("Unsupported type: "+e.type),t(e)}const h={Literal:e=>e.raw,Identifier:e=>{const o=e.name;return f>0?o:(0,i.mQ)(n,o)?(0,i.z3)("Illegal identifier: "+o):(0,i.mQ)(r,o)?r[o]:(0,i.mQ)(t,o)?o:(u[o]=1,l(o))},MemberExpression:e=>{const t=!e.computed,n=d(e.object);t&&(f+=1);const i=d(e.property);return n===s&&(c[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(i)]=1),t&&(f-=1),n+(t?"."+i:"["+i+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&(0,i.z3)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=(0,i.mQ)(o,t)&&o[t];return r||(0,i.z3)("Unrecognized function: "+t),(0,i.Tn)(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(d).join(",")+"]",BinaryExpression:e=>"("+d(e.left)+" "+e.operator+" "+d(e.right)+")",UnaryExpression:e=>"("+e.operator+d(e.argument)+")",ConditionalExpression:e=>"("+d(e.test)+"?"+d(e.consequent)+":"+d(e.alternate)+")",LogicalExpression:e=>"("+d(e.left)+e.operator+d(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(d).join(",")+"}",Property:e=>{f+=1;const t=d(e.key);return f-=1,t+":"+d(e.value)}};function p(e){const t={code:d(e),globals:Object.keys(u),fields:Object.keys(c)};return u={},c={},t}return p.functions=o,p.constants=r,p}},28430:(e,t,n)=>{"use strict";n.d(t,{P:()=>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={"*":(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>>>t},o={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const a=Array.prototype.slice,s=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,a.call(t,1))};var l={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:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,i,r,o,a)=>new Date(e,t||0,null!=n?n:1,i||0,r||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.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:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const u=["view","item","group","xy","x","y"],c=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&c.add(setImmediate);const f={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:i[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),!c.has(i[r]))return i[r];console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),"if"===i?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||l[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>r[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>o[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const i=e(n.key);return e.memberDepth-=1,c.has(e(n.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):t[i]=e(n.value),t}),{})};function d(e,t,n,i,r,o){const a=e=>f[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=i,a.event=r,a.item=o,u.forEach((e=>a.fn[e]=function(){return r.vega[e](...arguments)})),a(e)}var h={operator(e,t){const n=t.ast,i=e.functions;return e=>d(n,i,e)},parameter(e,t){const n=t.ast,i=e.functions;return(e,t)=>d(n,i,t,e)},event(e,t){const n=t.ast,i=e.functions;return e=>d(n,i,void 0,void 0,e)},handler(e,t){const n=t.ast,i=e.functions;return(e,t)=>{const r=t.item&&t.item.datum;return d(n,i,e,r,t)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,l=0;for(const n in i)s=d(i[n].ast,r,t,a,void 0,e),e[n]!==s&&(e[n]=s,l=1);return"rule"!==n&&function(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,i,o),l}}}},518:(e,t,n)=>{"use strict";function i(e,t,n){return e.fields=t||[],e.fname=n,e}function r(e){return null==e?null:e.fname}function o(e){return null==e?null:e.fields}function a(e){return 1===e.length?s(e[0]):l(e)}n.d(t,{$D:()=>b,$G:()=>X,$P:()=>ve,AU:()=>C,B:()=>me,B2:()=>H,BS:()=>Q,Cc:()=>$e,D_:()=>h,EV:()=>Ae,Eb:()=>ke,Et:()=>be,G4:()=>Oe,Gv:()=>A,KH:()=>I,Kg:()=>we,Lm:()=>ye,Ln:()=>Fe,M1:()=>Re,N6:()=>r,NV:()=>x,P$:()=>_,PK:()=>ge,R2:()=>w,Ro:()=>O,SW:()=>Y,Tn:()=>J,UD:()=>ee,VC:()=>L,V_:()=>te,X$:()=>se,Xx:()=>le,YO:()=>K,ZZ:()=>f,ay:()=>ze,bX:()=>pe,co:()=>U,cy:()=>E,dI:()=>Ne,dY:()=>oe,eV:()=>Ce,gd:()=>_e,h1:()=>De,id:()=>d,io:()=>S,iv:()=>c,lL:()=>W,mQ:()=>fe,me:()=>y,n:()=>ue,nG:()=>he,nS:()=>o,oV:()=>G,r$:()=>Me,rt:()=>Be,sY:()=>i,se:()=>M,sg:()=>ae,ux:()=>Se,vF:()=>$,vN:()=>g,v_:()=>p,vu:()=>V,xH:()=>m,xZ:()=>xe,xv:()=>Pe,y:()=>k,z3:()=>u,zy:()=>j});const s=e=>function(t){return t[e]},l=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function u(e){throw Error(e)}function c(e){const t=[],n=e.length;let i,r,o,a=null,s=0,l="";function c(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(o=e[r],"\\"===o)l+=e.substring(i,r++),i=r;else if(o===a)c(),a=null,s=-1;else{if(a)continue;i===s&&'"'===o||i===s&&"'"===o?(i=r+1,a=o):"."!==o||s?"["===o?(r>i&&c(),s=i=r+1):"]"===o&&(s||u("Access path missing open bracket: "+e),s>0&&c(),s=0,i=r+1):r>i?c():i=r+1}return s&&u("Access path missing closing bracket: "+e),a&&u("Access path missing closing quote: "+e),r>i&&(r++,c()),t}function f(e,t,n){const r=c(e);return e=1===r.length?r[0]:e,i((n&&n.get||a)(r),[e],t||e)}const d=f("id"),h=i((e=>e),[],"identity"),p=i((()=>0),[],"zero"),m=i((()=>1),[],"one"),g=i((()=>!0),[],"true"),y=i((()=>!1),[],"false");function v(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const x=0,b=1,_=2,w=3,k=4;function $(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v,i=e||x;return{level(e){return arguments.length?(i=+e,this):i},error(){return i>=b&&n(t||"error","ERROR",arguments),this},warn(){return i>=_&&n(t||"warn","WARN",arguments),this},info(){return i>=w&&n(t||"log","INFO",arguments),this},debug(){return i>=k&&n(t||"log","DEBUG",arguments),this}}}var E=Array.isArray;function A(e){return e===Object(e)}const D=e=>"__proto__"!==e;function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=F(e.signals,t.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;C(e,n,t[n],i)}return e}),{})}function C(e,t,n,i){if(!D(t))return;let r,o;if(A(n)&&!E(n))for(r in o=A(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[r])?C(o,r,n[r]):D(r)&&(o[r]=n[r]);else e[t]=n}function F(e,t){if(null==e)return t;const n={},i=[];function r(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(r),e.forEach(r),i}function M(e){return e[e.length-1]}function O(e){return null==e||""===e?null:+e}const T=e=>t=>e*Math.exp(t),z=e=>t=>Math.log(e*t),N=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),R=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,P=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function B(e,t,n,i){const r=n(e[0]),o=n(M(e)),a=(o-r)*t;return[i(r-a),i(o-a)]}function L(e,t){return B(e,t,O,h)}function I(e,t){var n=Math.sign(e[0]);return B(e,t,z(n),T(n))}function U(e,t,n){return B(e,t,P(n),P(1/n))}function j(e,t,n){return B(e,t,N(n),R(n))}function q(e,t,n,i,r){const o=i(e[0]),a=i(M(e)),s=null!=t?i(t):(o+a)/2;return[r(s+(o-s)*n),r(s+(a-s)*n)]}function W(e,t,n){return q(e,t,n,O,h)}function G(e,t,n){const i=Math.sign(e[0]);return q(e,t,n,z(i),T(i))}function Y(e,t,n,i){return q(e,t,n,P(i),P(1/i))}function H(e,t,n,i){return q(e,t,n,N(i),R(i))}function X(e){return 1+~~(new Date(e).getMonth()/3)}function V(e){return 1+~~(new Date(e).getUTCMonth()/3)}function K(e){return null!=e?E(e)?e:[e]:[]}function Q(e,t,n){let i,r=e[0],o=e[1];return o<r&&(i=o,o=r,r=i),i=o-r,i>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-i),r+i]}function J(e){return"function"===typeof e}const Z="descending";function ee(e,t,n){n=n||{},t=K(t)||[];const r=[],a=[],s={},l=n.comparator||ne;return K(e).forEach(((e,i)=>{null!=e&&(r.push(t[i]===Z?-1:1),a.push(e=J(e)?e:f(e,null,n)),(o(e)||[]).forEach((e=>s[e]=1)))})),0===a.length?null:i(l(a,r),Object.keys(s))}const te=(e,t)=>(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),ne=(e,t)=>1===e.length?ie(e[0],t[0]):re(e,t,e.length),ie=(e,t)=>function(n,i){return te(e(n),e(i))*t},re=(e,t,n)=>(t.push(0),function(i,r){let o,a=0,s=-1;for(;0===a&&++s<n;)o=e[s],a=te(o(i),o(r));return a*t[s]});function oe(e){return J(e)?e:()=>e}function ae(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout((()=>(t(i),n=null)),e)}}function se(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function le(e,t){let n,i,r,o,a=0;if(e&&(n=e.length))if(null==t){for(i=e[a];a<n&&(null==i||i!==i);i=e[++a]);for(r=o=i;a<n;++a)i=e[a],null!=i&&(i<r&&(r=i),i>o&&(o=i))}else{for(i=t(e[a]);a<n&&(null==i||i!==i);i=t(e[++a]));for(r=o=i;a<n;++a)i=t(e[a]),null!=i&&(i<r&&(r=i),i>o&&(o=i))}return[r,o]}function ue(e,t){const n=e.length;let i,r,o,a,s,l=-1;if(null==t){for(;++l<n;)if(r=e[l],null!=r&&r>=r){i=o=r;break}if(l===n)return[-1,-1];for(a=s=l;++l<n;)r=e[l],null!=r&&(i>r&&(i=r,a=l),o<r&&(o=r,s=l))}else{for(;++l<n;)if(r=t(e[l],l,e),null!=r&&r>=r){i=o=r;break}if(l===n)return[-1,-1];for(a=s=l;++l<n;)r=t(e[l],l,e),null!=r&&(i>r&&(i=r,a=l),o<r&&(o=r,s=l))}return[a,s]}const ce=Object.prototype.hasOwnProperty;function fe(e,t){return ce.call(e,t)}const de={};function he(e){let t,n={};function i(e){return fe(n,e)&&n[e]!==de}const r={size:0,empty:0,object:n,has:i,get:e=>i(e)?n[e]:void 0,set(e,t){return i(e)||(++r.size,n[e]===de&&--r.empty),n[e]=t,this},delete(e){return i(e)&&(--r.size,++r.empty,n[e]=de),this},clear(){r.size=r.empty=0,r.object=n={}},test(e){return arguments.length?(t=e,r):t},clean(){const e={};let i=0;for(const r in n){const o=n[r];o===de||t&&t(o)||(e[r]=o,++i)}r.size=i,r.empty=0,r.object=n=e}};return e&&Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}function pe(e,t,n,i,r,o){if(!n&&0!==n)return o;const a=+n;let s,l=e[0],u=M(e);u<l&&(s=l,l=u,u=s),s=Math.abs(t-l);const c=Math.abs(u-t);return s<c&&s<=a?i:c<=a?r:o}function me(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),se(i,n)}function ge(e,t,n,i){let r,o=t[0],a=t[t.length-1];return o>a&&(r=o,o=a,a=r),i=void 0===i||i,((n=void 0===n||n)?o<=e:o<e)&&(i?e<=a:e<a)}function ye(e){return"boolean"===typeof e}function ve(e){return"[object Date]"===Object.prototype.toString.call(e)}function xe(e){return e&&J(e[Symbol.iterator])}function be(e){return"number"===typeof e}function _e(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function we(e){return"string"===typeof e}function ke(e,t,n){e&&(e=t?K(e).map((e=>e.replace(/\\(.)/g,"$1"))):K(e));const r=e&&e.length,o=n&&n.get||a,s=e=>o(t?[e]:c(e));let l;if(r)if(1===r){const t=s(e[0]);l=function(e){return""+t(e)}}else{const t=e.map(s);l=function(e){let n=""+t[0](e),i=0;for(;++i<r;)n+="|"+t[i](e);return n}}else l=function(){return""};return i(l,e,"key")}function $e(e,t){const n=e[0],i=M(e),r=+t;return r?1===r?i:n+r*(i-n):n}const Ee=1e4;function Ae(e){let t,n,i;e=+e||Ee;const r=()=>{t={},n={},i=0},o=(r,o)=>(++i>e&&(n=t,t={},i=1),t[r]=o);return r(),{clear:r,has:e=>fe(t,e)||fe(n,e),get:e=>fe(t,e)?t[e]:fe(n,e)?o(e,n[e]):void 0,set:(e,n)=>fe(t,e)?t[e]=n:o(e,n)}}function De(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const a=i||new t.constructor(r+o);let s=0,l=0,u=0;for(;s<r&&l<o;++u)a[u]=e(t[s],n[l])>0?n[l++]:t[s++];for(;s<r;++s,++u)a[u]=t[s];for(;l<o;++l,++u)a[u]=n[l];return a}function Se(e,t){let n="";for(;--t>=0;)n+=e;return n}function Ce(e,t,n,i){const r=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===i?Se(r,a)+o:"center"===i?Se(r,~~(a/2))+o+Se(r,Math.ceil(a/2)):o+Se(r,a)}function Fe(e){return e&&M(e)-e[0]||0}function Me(e){return E(e)?"["+e.map(Me)+"]":A(e)||we(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Oe(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Te=e=>be(e)||ve(e)?e:Date.parse(e);function ze(e,t){return t=t||Te,null==e||""===e?null:t(e)}function Ne(e){return null==e||""===e?null:e+""}function Re(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Pe(e,t,n,i){const r=null!=i?i:"\u2026",o=e+"",a=o.length,s=Math.max(0,t-r.length);return a<=t?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 Be(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const i=t(e[r]);i&&n(i,r,e)}}else e.forEach(n)}},14716:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>ch,CanvasHandler:()=>Ym,CanvasRenderer:()=>Zm,DATE:()=>Fe,DAY:()=>Me,DAYOFYEAR:()=>Oe,Dataflow:()=>Tr,Debug:()=>m.y,Error:()=>m.$D,EventStream:()=>vr,Gradient:()=>pd,GroupItem:()=>dh,HOURS:()=>Te,Handler:()=>km,HybridHandler:()=>Wg,HybridRenderer:()=>qg,Info:()=>m.R2,Item:()=>fh,MILLISECONDS:()=>Re,MINUTES:()=>ze,MONTH:()=>Se,Marks:()=>sm,MultiPulse:()=>Sr,None:()=>m.NV,Operator:()=>mr,Parameters:()=>dr,Pulse:()=>$r,QUARTER:()=>De,RenderType:()=>Xg,Renderer:()=>Em,ResourceLoader:()=>hh,SECONDS:()=>Ne,SVGHandler:()=>tg,SVGRenderer:()=>Dg,SVGStringRenderer:()=>Ig,Scenegraph:()=>mm,TIME_UNITS:()=>Pe,Transform:()=>Nr,View:()=>HC,WEEK:()=>Ce,Warn:()=>m.P$,YEAR:()=>Ae,accessor:()=>m.sY,accessorFields:()=>m.nS,accessorName:()=>m.N6,array:()=>m.YO,ascending:()=>m.V_,bandwidthNRD:()=>Zr,bin:()=>eo,bootstrapCI:()=>io,boundClip:()=>ny,boundContext:()=>zh,boundItem:()=>lm,boundMark:()=>cm,boundStroke:()=>gh,changeset:()=>cr,clampRange:()=>m.BS,codegenExpression:()=>GA.Se,compare:()=>m.UD,constant:()=>m.dY,cumulativeLogNormal:()=>xo,cumulativeNormal:()=>ho,cumulativeUniform:()=>Eo,dayofyear:()=>We,debounce:()=>m.sg,defaultLocale:()=>wi,definition:()=>Pr,densityLogNormal:()=>vo,densityNormal:()=>fo,densityUniform:()=>$o,domChild:()=>xm,domClear:()=>bm,domCreate:()=>ym,domFind:()=>vm,dotbin:()=>ro,error:()=>m.z3,expressionFunction:()=>qS,extend:()=>m.X$,extent:()=>m.Xx,extentIndex:()=>m.n,falsy:()=>m.me,fastmap:()=>m.nG,field:()=>m.ZZ,flush:()=>m.bX,font:()=>Zp,fontFamily:()=>Jp,fontSize:()=>Hp,format:()=>Yi,formatLocale:()=>pi,formats:()=>Hi,hasOwnProperty:()=>m.mQ,id:()=>m.id,identity:()=>m.D_,inferType:()=>Li,inferTypes:()=>Ii,ingest:()=>rr,inherits:()=>m.B,inrange:()=>m.PK,interpolate:()=>Rf,interpolateColors:()=>Tf,interpolateRange:()=>Of,intersect:()=>Qg,intersectBoxLine:()=>Gh,intersectPath:()=>Uh,intersectPoint:()=>jh,intersectRule:()=>Wh,isArray:()=>m.cy,isBoolean:()=>m.Lm,isDate:()=>m.$P,isFunction:()=>m.Tn,isIterable:()=>m.xZ,isNumber:()=>m.Et,isObject:()=>m.Gv,isRegExp:()=>m.gd,isString:()=>m.Kg,isTuple:()=>tr,key:()=>m.Eb,lerp:()=>m.Cc,lineHeight:()=>Xp,loader:()=>Ki,locale:()=>_i,logger:()=>m.vF,lruCache:()=>m.EV,markup:()=>xg,merge:()=>m.h1,mergeConfig:()=>m.io,multiLineOffset:()=>Kp,one:()=>m.xH,pad:()=>m.eV,panLinear:()=>m.VC,panLog:()=>m.KH,panPow:()=>m.co,panSymlog:()=>m.zy,parse:()=>pz,parseExpression:()=>GA.YK,parseSelector:()=>JC.P,path:()=>bl,pathCurves:()=>gd,pathEqual:()=>oy,pathParse:()=>wd,pathRectangle:()=>Yd,pathRender:()=>Td,pathSymbols:()=>Pd,pathTrail:()=>Hd,peek:()=>m.se,point:()=>wm,projection:()=>pw,quantileLogNormal:()=>bo,quantileNormal:()=>po,quantileUniform:()=>Ao,quantiles:()=>Qr,quantizeInterpolator:()=>zf,quarter:()=>m.$G,quartiles:()=>Jr,random:()=>to,randomInteger:()=>ao,randomKDE:()=>go,randomLCG:()=>oo,randomLogNormal:()=>_o,randomMixture:()=>wo,randomNormal:()=>mo,randomUniform:()=>Do,read:()=>Vi,regressionConstant:()=>So,regressionExp:()=>No,regressionLinear:()=>To,regressionLoess:()=>jo,regressionLog:()=>zo,regressionPoly:()=>Bo,regressionPow:()=>Ro,regressionQuad:()=>Po,renderModule:()=>Kg,repeat:()=>m.ux,resetDefaultLocale:()=>ki,resetSVGClipId:()=>lh,resetSVGDefIds:()=>ay,responseType:()=>Xi,runtimeContext:()=>ZS,sampleCurve:()=>Yo,sampleLogNormal:()=>yo,sampleNormal:()=>co,sampleUniform:()=>ko,scale:()=>wf,sceneEqual:()=>ry,sceneFromJSON:()=>hm,scenePickVisit:()=>np,sceneToJSON:()=>dm,sceneVisit:()=>tp,sceneZOrder:()=>ep,scheme:()=>If,serializeXML:()=>bg,setHybridRendererOptions:()=>jg,setRandom:()=>no,span:()=>m.Ln,splitAccessPath:()=>m.iv,stringValue:()=>m.r$,textMetrics:()=>Up,timeBin:()=>zt,timeFloor:()=>at,timeFormatLocale:()=>xi,timeInterval:()=>dt,timeOffset:()=>mt,timeSequence:()=>vt,timeUnitSpecifier:()=>Ue,timeUnits:()=>Le,toBoolean:()=>m.G4,toDate:()=>m.ay,toNumber:()=>m.Ro,toSet:()=>m.M1,toString:()=>m.dI,transform:()=>Br,transforms:()=>Rr,truncate:()=>m.xv,truthy:()=>m.vN,tupleid:()=>nr,typeParsers:()=>Ri,utcFloor:()=>ut,utcInterval:()=>ht,utcOffset:()=>gt,utcSequence:()=>xt,utcdayofyear:()=>Ke,utcquarter:()=>m.vu,utcweek:()=>Qe,version:()=>mz,visitArray:()=>m.rt,week:()=>Ge,writeConfig:()=>m.AU,zero:()=>m.v_,zoomLinear:()=>m.lL,zoomLog:()=>m.oV,zoomPow:()=>m.SW,zoomSymlog:()=>m.B2});var i={};n.r(i),n.d(i,{aggregate:()=>ca,bin:()=>fa,collect:()=>ha,compare:()=>pa,countpattern:()=>ga,cross:()=>ya,density:()=>_a,dotbin:()=>Aa,expression:()=>Da,extent:()=>Ca,facet:()=>Ma,field:()=>Oa,filter:()=>za,flatten:()=>Na,fold:()=>Ra,formula:()=>Pa,generate:()=>Ba,impute:()=>Ua,joinaggregate:()=>ja,kde:()=>qa,key:()=>Wa,load:()=>Ya,lookup:()=>Xa,multiextent:()=>Va,multivalues:()=>Qa,params:()=>Za,pivot:()=>es,prefacet:()=>ts,project:()=>ns,proxy:()=>is,quantile:()=>rs,relay:()=>os,sample:()=>as,sequence:()=>ss,sieve:()=>ls,subflow:()=>Fa,timeunit:()=>us,tupleindex:()=>fs,values:()=>ds,window:()=>ys});var r={};n.r(r),n.d(r,{interpolate:()=>du.A,interpolateArray:()=>Mu.A,interpolateBasis:()=>Ou.A,interpolateBasisClosed:()=>Tu.A,interpolateCubehelix:()=>Oc,interpolateCubehelixLong:()=>Tc,interpolateDate:()=>zu.A,interpolateDiscrete:()=>Nu,interpolateHcl:()=>xc,interpolateHclLong:()=>bc,interpolateHsl:()=>Xu,interpolateHslLong:()=>Vu,interpolateHue:()=>Pu,interpolateLab:()=>yc,interpolateNumber:()=>Bu.A,interpolateNumberArray:()=>Lu.A,interpolateObject:()=>Iu.A,interpolateRgb:()=>Gu.Ay,interpolateRgbBasis:()=>Gu.Ik,interpolateRgbBasisClosed:()=>Gu.uL,interpolateRound:()=>hu.A,interpolateString:()=>Uu.A,interpolateTransformCss:()=>ju.T,interpolateTransformSvg:()=>ju.I,interpolateZoom:()=>Wu,piecewise:()=>vu,quantize:()=>zc});var o={};n.r(o),n.d(o,{bound:()=>Wy,identifier:()=>Hy,mark:()=>Xy,overlap:()=>Vy,render:()=>nv,viewlayout:()=>$v});var a={};n.r(a),n.d(a,{axisticks:()=>Av,datajoin:()=>Dv,encode:()=>Cv,legendentries:()=>Fv,linkpath:()=>Nv,pie:()=>Iv,scale:()=>Wv,sortitems:()=>Xv,stack:()=>Zv});var s={};n.r(s),n.d(s,{contour:()=>Pw,geojson:()=>Iw,geopath:()=>Uw,geopoint:()=>jw,geoshape:()=>qw,graticule:()=>Ww,heatmap:()=>Gw,isocontour:()=>Dw,kde2d:()=>zw,projection:()=>Hw});var l={};n.r(l),n.d(l,{force:()=>Ck});var u={};n.r(u),n.d(u,{nest:()=>R$,pack:()=>j$,partition:()=>W$,stratify:()=>G$,tree:()=>X$,treelinks:()=>V$,treemap:()=>J$});var c={};n.r(c),n.d(c,{label:()=>_E});var f={};n.r(f),n.d(f,{loess:()=>kE,regression:()=>EE});var d={};n.r(d),n.d(d,{voronoi:()=>rA});var h={};n.r(h),n.d(h,{wordcloud:()=>bA});var p={};n.r(p),n.d(p,{crossfilter:()=>DA,resolvefilter:()=>SA});var m=n(518),g={},y={},v=34,x=10,b=13;function _(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function w(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var i in e)i in t||n.push(t[i]=i)})),n}function k(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function $(e){var t,n=e.getUTCHours(),i=e.getUTCMinutes(),r=e.getUTCSeconds(),o=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":((t=e.getUTCFullYear())<0?"-"+k(-t,6):t>9999?"+"+k(t,6):k(t,4))+"-"+k(e.getUTCMonth()+1,2)+"-"+k(e.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 E(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],o=e.length,a=0,s=0,l=o<=0,u=!1;function c(){if(l)return y;if(u)return u=!1,g;var t,i,r=a;if(e.charCodeAt(r)===v){for(;a++<o&&e.charCodeAt(a)!==v||e.charCodeAt(++a)===v;);return(t=a)>=o?l=!0:(i=e.charCodeAt(a++))===x?u=!0:i===b&&(u=!0,e.charCodeAt(a)===x&&++a),e.slice(r+1,t-1).replace(/""/g,'"')}for(;a<o;){if((i=e.charCodeAt(t=a++))===x)u=!0;else if(i===b)u=!0,e.charCodeAt(a)===x&&++a;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,o)}for(e.charCodeAt(o-1)===x&&--o,e.charCodeAt(o-1)===b&&--o;(i=c())!==y;){for(var f=[];i!==g&&i!==y;)f.push(i),i=c();t&&null==(f=t(f,s++))||r.push(f)}return r}function r(t,n){return t.map((function(t){return n.map((function(e){return a(t[e])})).join(e)}))}function o(t){return t.map(a).join(e)}function a(e){return null==e?"":e instanceof Date?$(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,r,o=i(e,(function(e,i){if(n)return n(e,i-1);r=e,n=t?function(e,t){var n=_(e);return function(i,r){return t(n(i),r,e)}}(e,t):_(e)}));return o.columns=r||[],o},parseRows:i,format:function(t,n){return null==n&&(n=w(t)),[n.map(a).join(e)].concat(r(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=w(e)),r(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function A(e){return e}function D(e,t){return"string"===typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return S(e,t)}))}:S(e,t)}function S(e,t){var n=t.id,i=t.bbox,r=null==t.properties?{}:t.properties,o=C(e,t);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 C(e,t){var n=function(e){if(null==e)return A;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*i+o,c[1]=(n+=e[1])*r+a;l<u;)c[l]=e[l],++l;return c}}(e.transform),i=e.arcs;function r(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],o=0,a=r.length;o<a;++o)t.push(n(r[o],o));e<0&&function(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}(t,a)}function o(e){return n(e)}function a(e){for(var t=[],n=0,i=e.length;n<i;++n)r(e[n],t);return t.length<2&&t.push(t[0]),t}function s(e){for(var t=a(e);t.length<4;)t.push(t[0]);return t}function l(e){return e.map(s)}return function e(t){var n,i=t.type;switch(i){case"GeometryCollection":return{type:i,geometries:t.geometries.map(e)};case"Point":n=o(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(o);break;case"LineString":n=a(t.arcs);break;case"MultiLineString":n=t.arcs.map(a);break;case"Polygon":n=l(t.arcs);break;case"MultiPolygon":n=t.arcs.map(l);break;default:return null}return{type:i,coordinates:n}}(t)}function F(e,t){var n={},i={},r={},o=[],a=-1;function s(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach((function(e){n[e<0?~e:e]=1})),o.push(r)}}return t.forEach((function(n,i){var r,o=e.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=t[++a],t[a]=n,t[i]=r)})),t.forEach((function(t){var n,o,a=function(t){var n,i=e.arcs[t<0?~t:t],r=i[0];e.transform?(n=[0,0],i.forEach((function(e){n[0]+=e[0],n[1]+=e[1]}))):n=i[i.length-1];return t<0?[n,r]:[r,n]}(t),s=a[0],l=a[1];if(n=r[s])if(delete r[n.end],n.push(t),n.end=l,o=i[l]){delete i[o.start];var u=o===n?n:n.concat(o);i[u.start=n.start]=r[u.end=o.end]=u}else i[n.start]=r[n.end]=n;else if(n=i[l])if(delete i[n.start],n.unshift(t),n.start=s,o=r[s]){delete r[o.end];var c=o===n?n:o.concat(n);i[c.start=o.start]=r[c.end=n.end]=c}else i[n.start]=r[n.end]=n;else i[(n=[t]).start=s]=r[n.end=l]=n})),s(r,i),s(i,r),t.forEach((function(e){n[e<0?~e:e]||o.push([e])})),o}function M(e){return C(e,O.apply(this,arguments))}function O(e,t,n){var i,r,o;if(arguments.length>1)i=function(e,t,n){var i,r=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:i})}function s(e){e.forEach(a)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}function c(e){switch(i=e,e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":u(e.arcs)}}return c(t),o.forEach(null==n?function(e){r.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&r.push(e[0].i)}),r}(0,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:F(e,i)}}var T=n(17698),z=n(46047),N=n(16038),R=n(96324),P=n(52102),B=n(55453),L=n(75351);const I=new Date,U=new Date;function j(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),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)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>j((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(I.setTime(+t),U.setTime(+i),e(I),e(U),Math.floor(n(I,U))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const q=1e3,W=6e4,G=36e5,Y=864e5,H=6048e5,X=2592e6,V=31536e6,K=j((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W)/Y),(e=>e.getDate()-1)),Q=(K.range,j((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Y),(e=>e.getUTCDate()-1))),J=(Q.range,j((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Y),(e=>Math.floor(e/Y))));J.range;function Z(e){return j((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W)/H))}const ee=Z(0),te=Z(1),ne=Z(2),ie=Z(3),re=Z(4),oe=Z(5),ae=Z(6);ee.range,te.range,ne.range,ie.range,re.range,oe.range,ae.range;function se(e){return j((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/H))}const le=se(0),ue=se(1),ce=se(2),fe=se(3),de=se(4),he=se(5),pe=se(6),me=(le.range,ue.range,ce.range,fe.range,de.range,he.range,pe.range,j((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));me.every=e=>isFinite(e=Math.floor(e))&&e>0?j((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null;me.range;const ge=j((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));ge.every=e=>isFinite(e=Math.floor(e))&&e>0?j((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null;ge.range;const ye=j((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),ve=(ye.range,j((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),xe=(ve.range,j((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*q-e.getMinutes()*W)}),((e,t)=>{e.setTime(+e+t*G)}),((e,t)=>(t-e)/G),(e=>e.getHours()))),be=(xe.range,j((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*G)}),((e,t)=>(t-e)/G),(e=>e.getUTCHours()))),_e=(be.range,j((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*q)}),((e,t)=>{e.setTime(+e+t*W)}),((e,t)=>(t-e)/W),(e=>e.getMinutes()))),we=(_e.range,j((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*W)}),((e,t)=>(t-e)/W),(e=>e.getUTCMinutes()))),ke=(we.range,j((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*q)}),((e,t)=>(t-e)/q),(e=>e.getUTCSeconds()))),$e=(ke.range,j((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));$e.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?j((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):$e:null);$e.range;var Ee=n(87821);const Ae="year",De="quarter",Se="month",Ce="week",Fe="date",Me="day",Oe="dayofyear",Te="hours",ze="minutes",Ne="seconds",Re="milliseconds",Pe=[Ae,De,Se,Ce,Fe,Me,Oe,Te,ze,Ne,Re],Be=Pe.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Le(e){const t=(0,m.YO)(e).slice(),n={};t.length||(0,m.z3)("Missing time unit."),t.forEach((e=>{(0,m.mQ)(Be,e)?n[e]=1:(0,m.z3)(`Invalid time unit: ${e}.`)}));return(n[Ce]||n[Me]?1:0)+(n[De]||n[Se]||n[Fe]?1:0)+(n[Oe]?1:0)>1&&(0,m.z3)(`Incompatible time units: ${e}`),t.sort(((e,t)=>Be[e]-Be[t])),t}const Ie={[Ae]:"%Y ",[De]:"Q%q ",[Se]:"%b ",[Fe]:"%d ",[Ce]:"W%U ",[Me]:"%a ",[Oe]:"%j ",[Te]:"%H:00",[ze]:"00:%M",[Ne]:":%S",[Re]:".%L",[`${Ae}-${Se}`]:"%Y-%m ",[`${Ae}-${Se}-${Fe}`]:"%Y-%m-%d ",[`${Te}-${ze}`]:"%H:%M"};function Ue(e,t){const n=(0,m.X$)({},Ie,t),i=Le(e),r=i.length;let o,a,s="",l=0;for(l=0;l<r;)for(o=i.length;o>l;--o)if(a=i.slice(l,o).join("-"),null!=n[a]){s+=n[a],l=o;break}return s.trim()}const je=new Date;function qe(e){return je.setFullYear(e),je.setMonth(0),je.setDate(1),je.setHours(0,0,0,0),je}function We(e){return Ye(new Date(e))}function Ge(e){return He(new Date(e))}function Ye(e){return K.count(qe(e.getFullYear())-1,e)}function He(e){return ee.count(qe(e.getFullYear())-1,e)}function Xe(e){return qe(e).getDay()}function Ve(e,t,n,i,r,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,i,r,o,a);return s.setFullYear(e),s}return new Date(e,t,n,i,r,o,a)}function Ke(e){return Je(new Date(e))}function Qe(e){return Ze(new Date(e))}function Je(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Q.count(t-1,e)}function Ze(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return le.count(t-1,e)}function et(e){return je.setTime(Date.UTC(e,0,1)),je.getUTCDay()}function tt(e,t,n,i,r,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,i,r,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,i,r,o,a))}function nt(e,t,n,i,r){const o=t||1,a=(0,m.se)(e),s=(e,t,r)=>function(e,t,n,i){const r=n<=1?e:i?(t,r)=>i+n*Math.floor((e(t,r)-i)/n):(t,i)=>n*Math.floor(e(t,i)/n);return t?(e,n)=>t(r(e,n),n):r}(n[r=r||e],i[r],e===a&&o,t),l=new Date,u=(0,m.M1)(e),c=u[Ae]?s(Ae):(0,m.dY)(2012),f=u[Se]?s(Se):u[De]?s(De):m.v_,d=u[Ce]&&u[Me]?s(Me,1,Ce+Me):u[Ce]?s(Ce,1):u[Me]?s(Me,1):u[Fe]?s(Fe,1):u[Oe]?s(Oe,1):m.xH,h=u[Te]?s(Te):m.v_,p=u[ze]?s(ze):m.v_,g=u[Ne]?s(Ne):m.v_,y=u[Re]?s(Re):m.v_;return function(e){l.setTime(+e);const t=c(l);return r(t,f(l),d(l,t),h(l),p(l),g(l),y(l))}}function it(e,t,n){return t+7*e-(n+6)%7}const rt={[Ae]:e=>e.getFullYear(),[De]:e=>Math.floor(e.getMonth()/3),[Se]:e=>e.getMonth(),[Fe]:e=>e.getDate(),[Te]:e=>e.getHours(),[ze]:e=>e.getMinutes(),[Ne]:e=>e.getSeconds(),[Re]:e=>e.getMilliseconds(),[Oe]:e=>Ye(e),[Ce]:e=>He(e),[Ce+Me]:(e,t)=>it(He(e),e.getDay(),Xe(t)),[Me]:(e,t)=>it(1,e.getDay(),Xe(t))},ot={[De]:e=>3*e,[Ce]:(e,t)=>it(e,0,Xe(t))};function at(e,t){return nt(e,t||1,rt,ot,Ve)}const st={[Ae]:e=>e.getUTCFullYear(),[De]:e=>Math.floor(e.getUTCMonth()/3),[Se]:e=>e.getUTCMonth(),[Fe]:e=>e.getUTCDate(),[Te]:e=>e.getUTCHours(),[ze]:e=>e.getUTCMinutes(),[Ne]:e=>e.getUTCSeconds(),[Re]:e=>e.getUTCMilliseconds(),[Oe]:e=>Je(e),[Ce]:e=>Ze(e),[Me]:(e,t)=>it(1,e.getUTCDay(),et(t)),[Ce+Me]:(e,t)=>it(Ze(e),e.getUTCDay(),et(t))},lt={[De]:e=>3*e,[Ce]:(e,t)=>it(e,0,et(t))};function ut(e,t){return nt(e,t||1,st,lt,tt)}const ct={[Ae]:me,[De]:ye.every(3),[Se]:ye,[Ce]:ee,[Fe]:K,[Me]:K,[Oe]:K,[Te]:xe,[ze]:_e,[Ne]:ke,[Re]:$e},ft={[Ae]:ge,[De]:ve.every(3),[Se]:ve,[Ce]:le,[Fe]:Q,[Me]:Q,[Oe]:Q,[Te]:be,[ze]:we,[Ne]:ke,[Re]:$e};function dt(e){return ct[e]}function ht(e){return ft[e]}function pt(e,t,n){return e?e.offset(t,n):void 0}function mt(e,t,n){return pt(dt(e),t,n)}function gt(e,t,n){return pt(ht(e),t,n)}function yt(e,t,n,i){return e?e.range(t,n,i):void 0}function vt(e,t,n,i){return yt(dt(e),t,n,i)}function xt(e,t,n,i){return yt(ht(e),t,n,i)}const bt=1e3,_t=6e4,wt=36e5,kt=864e5,$t=2592e6,Et=31536e6,At=[Ae,Se,Fe,Te,ze,Ne,Re],Dt=At.slice(0,-1),St=Dt.slice(0,-1),Ct=St.slice(0,-1),Ft=Ct.slice(0,-1),Mt=[Ae,Se],Ot=[Ae],Tt=[[Dt,1,bt],[Dt,5,5e3],[Dt,15,15e3],[Dt,30,3e4],[St,1,_t],[St,5,3e5],[St,15,9e5],[St,30,18e5],[Ct,1,wt],[Ct,3,108e5],[Ct,6,216e5],[Ct,12,432e5],[Ft,1,kt],[[Ae,Ce],1,6048e5],[Mt,1,$t],[Mt,3,7776e6],[Ot,1,Et]];function zt(e){const t=e.extent,n=e.maxbins||40,i=Math.abs((0,m.Ln)(t))/n;let r,o,a=(0,Ee.A)((e=>e[2])).right(Tt,i);return a===Tt.length?(r=Ot,o=(0,T.sG)(t[0]/Et,t[1]/Et,n)):a?(a=Tt[i/Tt[a-1][2]<Tt[a][2]/i?a-1:a],r=a[0],o=a[1]):(r=At,o=Math.max((0,T.sG)(t[0],t[1],n),1)),{units:r,step:o}}function Nt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Rt(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Pt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Bt(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=Kt(r),c=Qt(r),f=Kt(o),d=Qt(o),h=Kt(a),p=Qt(a),m=Kt(s),g=Qt(s),y=Kt(l),v=Qt(l),x={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:xn,e:xn,f:$n,g:Nn,G:Pn,H:bn,I:_n,j:wn,L:kn,m:En,M:An,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ai,s:si,S:Dn,u:Sn,U:Cn,V:Mn,w:On,W:Tn,x:null,X:null,y:zn,Y:Rn,Z:Bn,"%":oi},b={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ln,e:Ln,f:Wn,g:ti,G:ii,H:In,I:Un,j:jn,L:qn,m:Gn,M:Yn,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ai,s:si,S:Hn,u:Xn,U:Vn,V:Qn,w:Jn,W:Zn,x:null,X:null,y:ei,Y:ni,Z:ri,"%":oi},_={a:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return $(e,t,n,i)},d:un,e:un,f:mn,g:on,G:rn,H:fn,I:fn,j:cn,L:pn,m:ln,M:dn,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:sn,Q:yn,s:vn,S:hn,u:Zt,U:en,V:tn,w:Jt,W:nn,x:function(e,t,i){return $(e,n,t,i)},X:function(e,t,n){return $(e,i,t,n)},y:on,Y:rn,Z:an,"%":gn};function w(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=Wt[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var i,r,o=Pt(1900,void 0,1);if($(o,e,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(t&&!("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=Rt(Pt(o.y,0,1))).getUTCDay(),i=r>4||0===r?ue.ceil(i):ue(i),i=Q.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Nt(Pt(o.y,0,1))).getDay(),i=r>4||0===r?te.ceil(i):te(i),i=K.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?Rt(Pt(o.y,0,1)).getUTCDay():Nt(Pt(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,Rt(o)):Nt(o)}}function $(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=_[r in Wt?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return x.x=w(n,x),x.X=w(i,x),x.c=w(t,x),b.x=w(n,b),b.X=w(i,b),b.c=w(t,b),{format:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Lt,It,Ut,jt,qt,Wt={"-":"",_:" ",0:"0"},Gt=/^\s*\d+/,Yt=/^%/,Ht=/[\\^$*+?|[\]().{}]/g;function Xt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Vt(e){return e.replace(Ht,"\\$&")}function Kt(e){return new RegExp("^(?:"+e.map(Vt).join("|")+")","i")}function Qt(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function Jt(e,t,n){var i=Gt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Zt(e,t,n){var i=Gt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function en(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function tn(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function nn(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function rn(e,t,n){var i=Gt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function on(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function an(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function sn(e,t,n){var i=Gt.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function ln(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function un(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function cn(e,t,n){var i=Gt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function fn(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function dn(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function hn(e,t,n){var i=Gt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function pn(e,t,n){var i=Gt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function mn(e,t,n){var i=Gt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function gn(e,t,n){var i=Yt.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function yn(e,t,n){var i=Gt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function vn(e,t,n){var i=Gt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function xn(e,t){return Xt(e.getDate(),t,2)}function bn(e,t){return Xt(e.getHours(),t,2)}function _n(e,t){return Xt(e.getHours()%12||12,t,2)}function wn(e,t){return Xt(1+K.count(me(e),e),t,3)}function kn(e,t){return Xt(e.getMilliseconds(),t,3)}function $n(e,t){return kn(e,t)+"000"}function En(e,t){return Xt(e.getMonth()+1,t,2)}function An(e,t){return Xt(e.getMinutes(),t,2)}function Dn(e,t){return Xt(e.getSeconds(),t,2)}function Sn(e){var t=e.getDay();return 0===t?7:t}function Cn(e,t){return Xt(ee.count(me(e)-1,e),t,2)}function Fn(e){var t=e.getDay();return t>=4||0===t?re(e):re.ceil(e)}function Mn(e,t){return e=Fn(e),Xt(re.count(me(e),e)+(4===me(e).getDay()),t,2)}function On(e){return e.getDay()}function Tn(e,t){return Xt(te.count(me(e)-1,e),t,2)}function zn(e,t){return Xt(e.getFullYear()%100,t,2)}function Nn(e,t){return Xt((e=Fn(e)).getFullYear()%100,t,2)}function Rn(e,t){return Xt(e.getFullYear()%1e4,t,4)}function Pn(e,t){var n=e.getDay();return Xt((e=n>=4||0===n?re(e):re.ceil(e)).getFullYear()%1e4,t,4)}function Bn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Xt(t/60|0,"0",2)+Xt(t%60,"0",2)}function Ln(e,t){return Xt(e.getUTCDate(),t,2)}function In(e,t){return Xt(e.getUTCHours(),t,2)}function Un(e,t){return Xt(e.getUTCHours()%12||12,t,2)}function jn(e,t){return Xt(1+Q.count(ge(e),e),t,3)}function qn(e,t){return Xt(e.getUTCMilliseconds(),t,3)}function Wn(e,t){return qn(e,t)+"000"}function Gn(e,t){return Xt(e.getUTCMonth()+1,t,2)}function Yn(e,t){return Xt(e.getUTCMinutes(),t,2)}function Hn(e,t){return Xt(e.getUTCSeconds(),t,2)}function Xn(e){var t=e.getUTCDay();return 0===t?7:t}function Vn(e,t){return Xt(le.count(ge(e)-1,e),t,2)}function Kn(e){var t=e.getUTCDay();return t>=4||0===t?de(e):de.ceil(e)}function Qn(e,t){return e=Kn(e),Xt(de.count(ge(e),e)+(4===ge(e).getUTCDay()),t,2)}function Jn(e){return e.getUTCDay()}function Zn(e,t){return Xt(ue.count(ge(e)-1,e),t,2)}function ei(e,t){return Xt(e.getUTCFullYear()%100,t,2)}function ti(e,t){return Xt((e=Kn(e)).getUTCFullYear()%100,t,2)}function ni(e,t){return Xt(e.getUTCFullYear()%1e4,t,4)}function ii(e,t){var n=e.getUTCDay();return Xt((e=n>=4||0===n?de(e):de.ceil(e)).getUTCFullYear()%1e4,t,4)}function ri(){return"+0000"}function oi(){return"%"}function ai(e){return+e}function si(e){return Math.floor(+e/1e3)}function li(e){const t={};return n=>t[n]||(t[n]=e(n))}function ui(e){const t=li(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=(0,z.A)(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return i=t(n),r=t(".1f")(1)[1],e=>{const t=i(e),n=t.indexOf(r);if(n<0)return t;let o=function(e,t){let n,i=e.lastIndexOf("e");if(i>0)return i;for(i=e.length;--i>t;)if(n=e.charCodeAt(i),n>=48&&n<=57)return i+1}(t,n);const a=o<t.length?t.slice(o):"";for(;--o>n;)if("0"!==t[o]){++o;break}return t.slice(0,o)+a}}return t(n);var i,r},formatSpan(e,i,r,o){o=(0,z.A)(null==o?",f":o);const a=(0,T.sG)(e,i,r),s=Math.max(Math.abs(e),Math.abs(i));let l;if(null==o.precision)switch(o.type){case"s":return isNaN(l=(0,N.A)(a,s))||(o.precision=l),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(l=(0,R.A)(a,s))||(o.precision=l-("e"===o.type));break;case"f":case"%":isNaN(l=(0,P.A)(a))||(o.precision=l-2*("%"===o.type))}return t(o)}}}let ci,fi;function di(){return ci=ui({format:B.GP,formatPrefix:B.s})}function hi(e){return ui((0,L.A)(e))}function pi(e){return arguments.length?ci=hi(e):ci}function mi(e,t,n){n=n||{},(0,m.Gv)(n)||(0,m.z3)(`Invalid time multi-format specifier: ${n}`);const i=t(Ne),r=t(ze),o=t(Te),a=t(Fe),s=t(Ce),l=t(Se),u=t(De),c=t(Ae),f=e(n[Re]||".%L"),d=e(n[Ne]||":%S"),h=e(n[ze]||"%I:%M"),p=e(n[Te]||"%I %p"),g=e(n[Fe]||n[Me]||"%a %d"),y=e(n[Ce]||"%b %d"),v=e(n[Se]||"%B"),x=e(n[De]||"%B"),b=e(n[Ae]||"%Y");return e=>(i(e)<e?f:r(e)<e?d:o(e)<e?h:a(e)<e?p:l(e)<e?s(e)<e?g:y:c(e)<e?u(e)<e?v:x:b)(e)}function gi(e){const t=li(e.format),n=li(e.utcFormat);return{timeFormat:e=>(0,m.Kg)(e)?t(e):mi(t,dt,e),utcFormat:e=>(0,m.Kg)(e)?n(e):mi(n,ht,e),timeParse:li(e.parse),utcParse:li(e.utcParse)}}function yi(){return fi=gi({format:It,parse:Ut,utcFormat:jt,utcParse:qt})}function vi(e){return gi(Bt(e))}function xi(e){return arguments.length?fi=vi(e):fi}!function(e){Lt=Bt(e),It=Lt.format,Ut=Lt.parse,jt=Lt.utcFormat,qt=Lt.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(),yi();const bi=(e,t)=>(0,m.X$)({},e,t);function _i(e,t){const n=e?hi(e):pi(),i=t?vi(t):xi();return bi(n,i)}function wi(e,t){const n=arguments.length;return n&&2!==n&&(0,m.z3)("defaultLocale expects either zero or two arguments."),n?bi(pi(e),xi(t)):bi(pi(),xi())}function ki(){return di(),yi(),wi()}const $i=/^(data:|([A-Za-z]+:)?\/\/)/,Ei=/^(?:(?:(?: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,Di="file://";async function Si(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Ci(e,t){t=(0,m.X$)({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,a;const s=Ei.test(e.replace(Ai,""));null!=e&&"string"===typeof e&&s||(0,m.z3)("Sanitize failure, invalid URI: "+(0,m.r$)(e));const l=$i.test(e);return(a=t.baseURL)&&!l&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(r=e.startsWith(Di))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(Di.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function Fi(e){return e?t=>new Promise(((n,i)=>{e.readFile(t,((e,t)=>{e?i(e):n(t)}))})):Mi}async function Mi(){(0,m.z3)("No file system access.")}function Oi(e){return e?async function(t,n){const i=(0,m.X$)({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?(0,m.Tn)(o[r])?o[r]():o.text():(0,m.z3)(o.status+""+o.statusText)}:Ti}async function Ti(){(0,m.z3)("No HTTP fetch method available.")}const zi=e=>null!=e&&e===e,Ni=e=>!Number.isNaN(+e)&&!(e instanceof Date),Ri={boolean:m.G4,integer:m.Ro,number:m.Ro,date:m.ay,string:m.dI,unknown:m.D_},Pi=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Ni(e)&&Number.isInteger(+e),Ni,e=>!Number.isNaN(Date.parse(e))],Bi=["boolean","integer","number","date"];function Li(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Pi.length,r=Pi.map(((e,t)=>t+1));for(let o,a,s=0,l=0;s<n;++s)for(a=t?e[s][t]:e[s],o=0;o<i;++o)if(r[o]&&zi(a)&&!Pi[o](a)&&(r[o]=0,++l,l===Pi.length))return"string";return Bi[r.reduce(((e,t)=>0===e?t:e),0)-1]}function Ii(e,t){return t.reduce(((t,n)=>(t[n]=Li(e,n),t)),{})}function Ui(e){const t=function(t,n){const i={delimiter:e};return ji(t,n?(0,m.X$)(n,i):i)};return t.responseType="text",t}function ji(e,t){return t.header&&(e=t.header.map(m.r$).join(t.delimiter)+"\n"+e),E(t.delimiter).parse(e+"")}function qi(e,t){const n=t&&t.property?(0,m.ZZ)(t.property):m.D_;return!(0,m.Gv)(e)||(i=e,"function"===typeof Buffer&&(0,m.Tn)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!(0,m.cy)(e)&&(0,m.xZ)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}ji.responseType="text",qi.responseType="json";const Wi={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Gi(e,t){let n,i,r,o;return e=qi(e,t),t&&t.feature?(n=D,r=t.feature):t&&t.mesh?(n=M,r=t.mesh,o=Wi[t.filter]):(0,m.z3)("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):(0,m.z3)("Invalid TopoJSON object: "+r),i&&i.features||[i]}Gi.responseType="json";const Yi={dsv:ji,csv:Ui(","),tsv:Ui("\t"),json:qi,topojson:Gi};function Hi(e,t){return arguments.length>1?(Yi[e]=t,this):(0,m.mQ)(Yi,e)?Yi[e]:null}function Xi(e){const t=Hi(e);return t&&t.responseType||"text"}function Vi(e,t,n,i){const r=Hi((t=t||{}).type||"json");return r||(0,m.z3)("Unknown data format type: "+t.type),e=r(e,t),t.parse&&function(e,t,n,i){if(!e.length)return;const r=xi();n=n||r.timeParse,i=i||r.utcParse;let o,a,s,l,u,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=Ii(e,f));f=Object.keys(t);const d=f.map((e=>{const r=t[e];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(!Ri[r])throw Error("Illegal format pattern: "+e+":"+r);return Ri[r]}));for(s=0,u=e.length,c=f.length;s<u;++s)for(o=e[s],l=0;l<c;++l)a=f[l],o[a]=d[l](o[a])}(e,t.parse,n,i),(0,m.mQ)(e,"columns")&&delete e.columns,e}const Ki=function(e,t){return n=>({options:n||{},sanitize:Ci,load:Si,fileAccess:!!t,file:Fi(t),http:Oi(e)})}("undefined"!==typeof fetch&&fetch,null);function Qi(e){const t=e||m.D_,n=[],i={};return n.add=e=>{const r=t(e);return i[r]||(i[r]=1,n.push(e)),n},n.remove=e=>{const r=t(e);if(i[r]){i[r]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function Ji(e,t){try{await t(e)}catch(n){e.error(n)}}const Zi=Symbol("vega_id");let er=1;function tr(e){return!(!e||!nr(e))}function nr(e){return e[Zi]}function ir(e,t){return e[Zi]=t,e}function rr(e){const t=e===Object(e)?e:{data:e};return nr(t)?t:ir(t,er++)}function or(e){return ar(e,rr({}))}function ar(e,t){for(const n in e)t[n]=e[n];return t}function sr(e,t){return ir(t,nr(e))}function lr(e,t){return e?t?(n,i)=>e(n,i)||nr(t(n))-nr(t(i)):(t,n)=>e(t,n)||nr(t)-nr(n):null}function ur(e){return e&&e.constructor===cr}function cr(){const e=[],t=[],n=[],i=[],r=[];let o=null,a=!1;return{constructor:cr,insert(t){const n=(0,m.YO)(t),i=n.length;for(let r=0;r<i;++r)e.push(n[r]);return this},remove(e){const n=(0,m.Tn)(e)?i:t,r=(0,m.YO)(e),o=r.length;for(let t=0;t<o;++t)n.push(r[t]);return this},modify(e,t,i){const o={field:t,value:(0,m.dY)(i)};return(0,m.Tn)(e)?(o.filter=e,r.push(o)):(o.tuple=e,n.push(o)),this},encode(e,t){return(0,m.Tn)(e)?r.push({filter:e,field:t}):n.push({tuple:e,field:t}),this},clean(e){return o=e,this},reflow(){return a=!0,this},pulse(s,l){const u={},c={};let f,d,h,p,m,g;for(f=0,d=l.length;f<d;++f)u[nr(l[f])]=1;for(f=0,d=t.length;f<d;++f)m=t[f],u[nr(m)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],l.forEach((e=>{p(e)&&(u[nr(e)]=-1)}));for(f=0,d=e.length;f<d;++f)m=e[f],g=nr(m),u[g]?u[g]=1:s.add.push(rr(e[f]));for(f=0,d=l.length;f<d;++f)m=l[f],u[nr(m)]<0&&s.rem.push(m);function y(e,t,n){n?e[t]=n(e):s.encode=t,a||(c[nr(e)]=e)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=u[nr(m)],g>0&&(y(m,p,h.value),s.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,l.forEach((e=>{p(e)&&u[nr(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||i.length?l.filter((e=>u[nr(e)]>0)):l.slice();else for(g in c)s.mod.push(c[g]);return(o||null==o&&(t.length||i.length))&&s.clean(!0),s}}}const fr="_:mod:_";function dr(){Object.defineProperty(this,fr,{writable:!0,value:{}})}dr.prototype={set(e,t,n,i){const r=this,o=r[e],a=r[fr];return null!=t&&t>=0?(o[t]!==n||i)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||i)&&(r[e]=n,a[e]=(0,m.cy)(n)?1+n.length:-1),r},modified(e,t){const n=this[fr];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if((0,m.cy)(e)){for(let t=0;t<e.length;++t)if(n[e[t]])return!0;return!1}return null!=t&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[fr]={},this}};let hr=0;const pr=new dr;function mr(e,t,n,i){this.id=++hr,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function gr(e){return function(t){const n=this.flags;return 0===arguments.length?!!(n&e):(this.flags=t?n|e:n&~e,this)}}mr.prototype={targets(){return this._targets||(this._targets=Qi(m.id))},set(e){return this.value!==e?(this.value=e,1):0},skip:gr(1),modified:gr(2),parameters(e,t,n){t=!1!==t;const i=this._argval=this._argval||new dr,r=this._argops=this._argops||[],o=[];let a,s,l,u;const c=(e,n,a)=>{a instanceof mr?(a!==this&&(t&&a.targets().add(this),o.push(a)),r.push({op:a,name:e,index:n})):i.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)(0,m.YO)(s).forEach((e=>{e instanceof mr?e!==this&&(e.targets().add(this),o.push(e)):(0,m.z3)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,m.cy)(s))for(i.set(a,-1,Array(l=s.length)),u=0;u<l;++u)c(a,u,s[u]);else c(a,-1,s);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=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===e,t.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 t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};let yr=0;function vr(e,t,n){this.id=++yr,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function xr(e,t,n){return new vr(e,t,n)}vr.prototype={_filter:m.vN,_apply:m.D_,targets(){return this._targets||(this._targets=Qi(m.id))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let e=0;e<i;++e)n[e].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=xr(e);return this.targets().add(t),t},apply(e){const t=xr(null,e);return this.targets().add(t),t},merge(){const e=xr();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter((()=>{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=xr();return this.targets().add(xr(null,null,(0,m.sg)(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(xr(null,null,(()=>n=!0))),t.targets().add(xr(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=m.vN,this._targets=null}};const br={skip:!0};function _r(e,t,n,i,r,o){const a=(0,m.X$)({},o,br);let s,l;(0,m.Tn)(n)||(n=(0,m.dY)(n)),void 0===i?s=t=>e.touch(n(t)):(0,m.Tn)(i)?(l=new mr(null,i,r,!1),s=t=>{l.evaluate(t);const i=n(t),r=l.value;ur(r)?e.pulse(i,r,o):e.update(i,r,a)}):s=t=>e.update(n(t),i,a),t.apply(s)}function wr(e,t,n,i,r,o){if(void 0===i)t.targets().add(n);else{const a=o||{},s=new mr(null,function(e,t){return t=(0,m.Tn)(t)?t:(0,m.dY)(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}(n,i),r,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const kr={};function $r(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Er(e,t){const n=[];return(0,m.rt)(e,t,(e=>n.push(e))),n}function Ar(e,t){const n={};return e.visit(t,(e=>{n[nr(e)]=1})),e=>n[nr(e)]?null:e}function Dr(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}function Sr(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===t){if(a.fields){const e=r.fields||(r.fields={});for(const t in a.fields)e[t]=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 Cr(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}$r.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(e){return new $r(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new $r(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,Ar(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return(0,m.cy)(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?(0,m.cy)(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Dr(n.addF,t)),2&e&&(n.remF=Dr(n.remF,t)),4&e&&(n.modF=Dr(n.modF,t)),16&e&&(n.srcF=Dr(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=Er(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=Er(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=Er(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(16&e)return(0,m.rt)(n.source,n.srcF,i),n;1&e&&(0,m.rt)(n.add,n.addF,i),2&e&&(0,m.rt)(n.rem,n.remF,i),4&e&&(0,m.rt)(n.mod,n.modF,i);const r=n.source;if(8&e&&r){const e=n.add.length+n.mod.length;e===r.length||(e?(0,m.rt)(r,Ar(n,5),i):(0,m.rt)(r,n.srcF,i))}return n}},(0,m.B)(Sr,$r,{fork(e){const t=new $r(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?(0,m.cy)(e)?e.some((e=>n[e])):n[e]:0},filter(){(0,m.z3)("MultiPulse does not support filtering.")},materialize(){(0,m.z3)("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});const Fr={skip:!1,force:!1};function Mr(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Or(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,function(e,t,n){const i=t,r=e.length,o=e[t];let a,s=1+(t<<1);for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,Or(e,i,t,n)}(t,0,e)):i=n,i}}}function Or(e,t,n,i){let r,o;const a=e[n];for(;n>t&&(o=n-1>>1,r=e[o],i(a,r)<0);)e[n]=r,n=o;return e[n]=a}function Tr(){this.logger((0,m.vF)()),this.logLevel(m.$D),this._clock=0,this._rank=0,this._locale=wi();try{this._loader=Ki()}catch(e){}this._touched=Qi(m.id),this._input={},this._pulse=null,this._heap=Mr(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function zr(e){return function(){return this._log[e].apply(this,arguments)}}function Nr(e,t){mr.call(this,e,null,t)}Tr.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:zr("error"),warn:zr("warn"),info:zr("info"),debug:zr("debug"),logLevel:zr("level"),cleanThreshold:1e4,add:function(e,t,n,i){let r,o=1;return e instanceof mr?r=e:e&&e.prototype instanceof mr?r=new e:(0,m.Tn)(e)?r=new mr(null,e):(o=0,r=new mr(e,t)),this.rank(r),o&&(i=n,n=t),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank)return void this.rerank(e)},rank:function(e){e.rank=++this._rank},rerank:function(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&(0,m.z3)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Fr);const i=new $r(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this},touch:function(e,t){const n=t||Fr;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const i=n||Fr;return(e.set(t)||i.force)&&this.touch(e,i),this},changeset:cr,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Vi(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const i=this,r=i._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0===--n.requests&&(e._pending=null,t(e))},e._pending=n}(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(m.vN).insert(o.data||[])),r.done(),o},request:async function(e,t){const n=this;let i,r=0;try{i=await n.loader().load(e,{context:"dataflow",response:Xi(t&&t.type)});try{i=n.parse(i,t)}catch(o){r=-2,n.warn("Data ingestion failed",e,o)}}catch(o){r=-1,n.warn("Loading failed",e,o)}return{data:i,status:r}},events:function(e,t,n,i){const r=this,o=xr(n,i),a=function(e){e.dataflow=r;try{o.receive(e)}catch(t){r.error(t)}finally{r.run()}};let s;s="string"===typeof e&&"undefined"!==typeof document?document.querySelectorAll(e):(0,m.YO)(e);const l=s.length;for(let u=0;u<l;++u)s[u].addEventListener(t,a);return o},on:function(e,t,n,i,r){return(e instanceof mr?wr:_r)(this,e,t,n,i,r),this},evaluate:async function(e,t,n){const i=this,r=[];if(i._pulse)return Cr(i);if(i._pending&&await i._pending,t&&await Ji(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new $r(i,o,e),i._touched.forEach((e=>i._enqueue(e,!0))),i._touched=Qi(m.id);let a,s,l,u=0;try{for(;i._heap.size()>0;)a=i._heap.pop(),a.rank===a.qrank?(s=a.run(i._getPulse(a,e)),s.then?s=await s:s.async&&(r.push(s.async),s=kr),s!==kr&&a._targets&&a._targets.forEach((e=>i._enqueue(e))),++u):i._enqueue(a,!0)}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${u} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const e=i._postrun.sort(((e,t)=>t.priority-e.priority));i._postrun=[];for(let t=0;t<e.length;++t)await Ji(i,e[t].callback)}return n&&await Ji(i,n),r.length&&Promise.all(r).then((e=>i.runAsync(null,(()=>{e.forEach((e=>{try{e(i)}catch(c){i.error(c)}}))})))),i},run:function(e,t,n){return this._pulse?Cr(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}},_enqueue:function(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))},_getPulse:function(e,t){const n=e.source,i=this._clock;return n&&(0,m.cy)(n)?new Sr(this,i,n.map((e=>e.pulse)),t):this._input[e.id]||function(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==kr&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},(0,m.B)(Nr,mr,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then((e=>this.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Rr={};function Pr(e){const t=Br(e);return t&&t.Definition||null}function Br(e){return e=e&&e.toLowerCase(),(0,m.mQ)(Rr,e)?Rr[e]:null}var Lr=n(25638);function Ir(e,t){let n;if(void 0===t)for(const i of e)null!=i&&(n<i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Ur(e,t){let n;if(void 0===t)for(const i of e)null!=i&&(n>i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lr.A;if(e===Lr.A)return qr;if("function"!==typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||0===i?i:(0===e(n,n))-(0===e(t,t))}}function qr(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function Wr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,r=arguments.length>4?arguments[4]:void 0;if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=void 0===r?qr:jr(r);i>n;){if(i-n>600){const o=i-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Wr(e,t,Math.max(n,Math.floor(t-a*l/o+u)),Math.min(i,Math.floor(t+(o-a)*l/o+u)),r)}const o=e[t];let a=n,s=i;for(Gr(e,n,t),r(e[i],o)>0&&Gr(e,n,i);a<s;){for(Gr(e,a,s),++a,--s;r(e[a],o)<0;)++a;for(;r(e[s],o)>0;)--s}0===r(e[n],o)?Gr(e,n,s):(++s,Gr(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}return e}function Gr(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}var Yr=n(2651);function Hr(e,t,n){if((i=(e=Float64Array.from((0,Yr.n)(e,n))).length)&&!isNaN(t=+t)){if(t<=0||i<2)return Ur(e);if(t>=1)return Ir(e);var i,r=(i-1)*t,o=Math.floor(r),a=Ir(Wr(e,o).subarray(0,o+1));return a+(Ur(e.subarray(o+1))-a)*(r-o)}}function Xr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Yr.A;if((i=e.length)&&!isNaN(t=+t)){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(r-o)}}function Vr(e,t){return Hr(e,.5,t)}function*Kr(e,t){if(null==t)for(let n of e)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function Qr(e,t,n){const i=Float64Array.from(Kr(e,n));return i.sort(Lr.A),t.map((e=>Xr(i,e)))}function Jr(e,t){return Qr(e,[.25,.5,.75],t)}function Zr(e,t){const n=e.length,i=function(e,t){const n=function(e,t){let n,i=0,r=0,o=0;if(void 0===t)for(let a of e)null!=a&&(a=+a)>=a&&(n=a-r,r+=n/++i,o+=n*(a-r));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-r,r+=n/++i,o+=n*(s-r))}if(i>1)return o/(i-1)}(e,t);return n?Math.sqrt(n):n}(e,t),r=Jr(e,t),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function eo(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o,a,s,l,u,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(l=h/t,u=0,c=e.steps.length;u<c&&e.steps[u]<l;++u);o=e.steps[Math.max(0,u-1)]}else{for(a=Math.ceil(Math.log(t)/i),s=e.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/i)-a));Math.ceil(h/o)>t;)o*=n;for(u=0,c=r.length;u<c;++u)l=o/r[u],l>=s&&h/l<=t&&(o=l)}l=Math.log(o);const p=l>=0?0:1+~~(-l/i),m=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(f/o+m)*o,f=f<l?l-o:l,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var to=Math.random;function no(e){to=e}function io(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(Kr(e,i)),o=r.length,a=t;let s,l,u,c;for(u=0,c=Array(a);u<a;++u){for(s=0,l=0;l<o;++l)s+=r[~~(to()*o)];c[u]=s/o}return c.sort(Lr.A),[Hr(c,n/2),Hr(c,1-n/2)]}function ro(e,t,n,i){i=i||(e=>e);const r=e.length,o=new Float64Array(r);let a,s=0,l=1,u=i(e[0]),c=u,f=u+t;for(;l<r;++l){if(a=i(e[l]),a>=f){for(c=(u+c)/2;s<l;++s)o[s]=c;f=a+t,u=a}c=a}for(c=(u+c)/2;s<l;++s)o[s]=c;return n?function(e,t){const n=e.length;let i,r,o=0,a=1;for(;e[o]===e[a];)++a;for(;a<n;){for(i=a+1;e[a]===e[i];)++i;if(e[a]-e[a-1]<t){for(r=a+(o+i-a-a>>1);r<a;)e[r++]=e[a];for(;r>a;)e[r--]=e[o]}o=a,a=i}return e}(o,t+t/4):o}function oo(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function ao(e,t){let n,i,r;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,r=i-n,o):n},max(e){return arguments.length?(i=e||0,r=i-n,o):i},sample:()=>n+Math.floor(r*to()),pdf:e=>e===Math.floor(e)&&e>=n&&e<i?1/r:0,cdf(e){const t=Math.floor(e);return t<n?0:t>=i?1:(t-n+1)/r},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*r):NaN};return o.min(e).max(t)}const so=Math.sqrt(2*Math.PI),lo=Math.SQRT2;let uo=NaN;function co(e,t){e=e||0,t=null==t?1:t;let n,i,r=0,o=0;if(uo===uo)r=uo,uo=NaN;else{do{r=2*to()-1,o=2*to()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,uo=o*i}return e+r*t}function fo(e,t,n){const i=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*so)}function ho(e,t,n){const i=(e-(t=t||0))/(n=null==n?1:n),r=Math.abs(i);let o;if(r>37)o=0;else{const e=Math.exp(-r*r/2);let t;r<7.07106781186547?(t=.0352624965998911*r+.700383064443688,t=t*r+6.37396220353165,t=t*r+33.912866078383,t=t*r+112.079291497871,t=t*r+221.213596169931,t=t*r+220.206867912376,o=e*t,t=.0883883476483184*r+1.75566716318264,t=t*r+16.064177579207,t=t*r+86.7807322029461,t=t*r+296.564248779674,t=t*r+637.333633378831,t=t*r+793.826512519948,t=t*r+440.413735824752,o/=t):(t=r+.65,t=r+4/t,t=r+3/t,t=r+2/t,t=r+1/t,o=e/t/2.506628274631)}return i>0?1-o:o}function po(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*lo*function(e){let t,n=-Math.log((1-e)*(1+e));n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0;return t*e}(2*e-1)}function mo(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>co(n,i),pdf:e=>fo(e,n,i),cdf:e=>ho(e,n,i),icdf:e=>po(e,n,i)};return r.mean(e).stdev(t)}function go(e,t){const n=mo();let i=0;const r={data(n){return arguments.length?(e=n,i=n?n.length:0,r.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=Zr(e)),r):t},sample:()=>e[~~(to()*i)]+t*n.sample(),pdf(r){let o=0,a=0;for(;a<i;++a)o+=n.pdf((r-e[a])/t);return o/t/i},cdf(r){let o=0,a=0;for(;a<i;++a)o+=n.cdf((r-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function yo(e,t){return e=e||0,t=null==t?1:t,Math.exp(e+co()*t)}function vo(e,t,n){if(e<=0)return 0;t=t||0,n=null==n?1:n;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*so*e)}function xo(e,t,n){return ho(Math.log(e),t,n)}function bo(e,t,n){return Math.exp(po(e,t,n))}function _o(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>yo(n,i),pdf:e=>vo(e,n,i),cdf:e=>xo(e,n,i),icdf:e=>bo(e,n,i)};return r.mean(e).stdev(t)}function wo(e,t){let n,i=0;const r={weights(e){return arguments.length?(n=function(e){const t=[];let n,r=0;for(n=0;n<i;++n)r+=t[n]=null==e[n]?1:+e[n];for(n=0;n<i;++n)t[n]/=r;return t}(t=e||[]),r):t},distributions(n){return arguments.length?(n?(i=n.length,e=n):(i=0,e=[]),r.weights(t)):e},sample(){const t=to();let r=e[i-1],o=n[0],a=0;for(;a<i-1;o+=n[++a])if(t<o){r=e[a];break}return r.sample()},pdf(t){let r=0,o=0;for(;o<i;++o)r+=n[o]*e[o].pdf(t);return r},cdf(t){let r=0,o=0;for(;o<i;++o)r+=n[o]*e[o].cdf(t);return r},icdf(){throw Error("Mixture icdf not supported.")}};return r.distributions(e).weights(t)}function ko(e,t){return null==t&&(t=null==e?1:e,e=0),e+(t-e)*to()}function $o(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=t&&e<=n?1/(n-t):0}function Eo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Ao(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Do(e,t){let n,i;const r={min(e){return arguments.length?(n=e||0,r):n},max(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>ko(n,i),pdf:e=>$o(e,n,i),cdf:e=>Eo(e,n,i),icdf:e=>Ao(e,n,i)};return null==t&&(t=null==e?1:e,e=0),r.min(e).max(t)}function So(e,t,n){let i=0,r=0;for(const o of e){const e=n(o);null==t(o)||null==e||isNaN(e)||(i+=(e-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Co(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function Fo(e,t,n,i){e=e.filter((e=>{let i=t(e),r=n(e);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r})),i&&e.sort(((e,n)=>t(e)-t(n)));const r=e.length,o=new Float64Array(r),a=new Float64Array(r);let s,l,u,c=0,f=0,d=0;for(u of e)o[c]=s=+t(u),a[c]=l=+n(u),++c,f+=(s-f)/c,d+=(l-d)/c;for(c=0;c<r;++c)o[c]-=f,a[c]-=d;return[o,a,f,d]}function Mo(e,t,n,i){let r,o,a=-1;for(const s of e)r=t(s),o=n(s),null!=r&&(r=+r)>=r&&null!=o&&(o=+o)>=o&&i(r,o,++a)}function Oo(e,t,n,i,r){let o=0,a=0;return Mo(e,t,n,((e,t)=>{const n=t-r(e),s=t-i;o+=n*n,a+=s*s})),1-o/a}function To(e,t,n){let i=0,r=0,o=0,a=0,s=0;Mo(e,t,n,((e,t)=>{++s,i+=(e-i)/s,r+=(t-r)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Co(i,r,o,a),u=e=>l[0]+l[1]*e;return{coef:l,predict:u,rSquared:Oo(e,t,n,r,u)}}function zo(e,t,n){let i=0,r=0,o=0,a=0,s=0;Mo(e,t,n,((e,t)=>{++s,e=Math.log(e),i+=(e-i)/s,r+=(t-r)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Co(i,r,o,a),u=e=>l[0]+l[1]*Math.log(e);return{coef:l,predict:u,rSquared:Oo(e,t,n,r,u)}}function No(e,t,n){const[i,r,o,a]=Fo(e,t,n);let s,l,u,c=0,f=0,d=0,h=0,p=0;Mo(e,t,n,((e,t)=>{s=i[p++],l=Math.log(t),u=s*t,c+=(t*l-c)/p,f+=(u-f)/p,d+=(u*l-d)/p,h+=(s*u-h)/p}));const[m,g]=Co(f/a,c/a,d/a,h/a),y=e=>Math.exp(m+g*(e-o));return{coef:[Math.exp(m-g*o),g],predict:y,rSquared:Oo(e,t,n,a,y)}}function Ro(e,t,n){let i=0,r=0,o=0,a=0,s=0,l=0;Mo(e,t,n,((e,t)=>{const n=Math.log(e),u=Math.log(t);++l,i+=(n-i)/l,r+=(u-r)/l,o+=(n*u-o)/l,a+=(n*n-a)/l,s+=(t-s)/l}));const u=Co(i,r,o,a),c=e=>u[0]*Math.pow(e,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:Oo(e,t,n,s,c)}}function Po(e,t,n){const[i,r,o,a]=Fo(e,t,n),s=i.length;let l,u,c,f,d=0,h=0,p=0,m=0,g=0;for(l=0;l<s;)u=i[l],c=r[l++],f=u*u,d+=(f-d)/l,h+=(f*u-h)/l,p+=(f*f-p)/l,m+=(u*c-m)/l,g+=(f*c-g)/l;const y=p-d*d,v=d*y-h*h,x=(g*d-m*h)/v,b=(m*y-g*h)/v,_=-x*d,w=e=>x*(e-=o)*e+b*e+_+a;return{coef:[_-b*o+x*o*o+a,b-2*x*o,x],predict:w,rSquared:Oo(e,t,n,a,w)}}function Bo(e,t,n,i){if(0===i)return So(e,t,n);if(1===i)return To(e,t,n);if(2===i)return Po(e,t,n);const[r,o,a,s]=Fo(e,t,n),l=r.length,u=[],c=[],f=i+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<l;++p)m+=Math.pow(r[p],d)*o[p];for(u.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<l;++p)m+=Math.pow(r[p],d+h);g[h]=m}c.push(g)}c.push(u);const y=function(e){const t=e.length-1,n=[];let i,r,o,a,s;for(i=0;i<t;++i){for(a=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][a])&&(a=r);for(o=i;o<t+1;++o)s=e[o][i],e[o][i]=e[o][a],e[o][a]=s;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(s=0,o=r+1;o<t;++o)s+=e[o][r]*n[o];n[r]=(e[t][r]-s)/e[r][r]}return n}(c),v=e=>{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d<f;++d)t+=y[d]*Math.pow(e,d);return t};return{coef:Lo(f,y,-a,s),predict:v,rSquared:Oo(e,t,n,s,v)}}function Lo(e,t,n,i){const r=Array(e);let o,a,s,l;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(s=t[o],l=1,r[o]+=s,a=1;a<=o;++a)l*=(o+1-a)/a,r[o-a]+=s*Math.pow(n,a)*l;return r[0]+=i,r}const Io=2,Uo=1e-12;function jo(e,t,n,i){const[r,o,a,s]=Fo(e,t,n,!0),l=r.length,u=Math.max(2,~~(i*l)),c=new Float64Array(l),f=new Float64Array(l),d=new Float64Array(l).fill(1);for(let h=-1;++h<=Io;){const e=[0,u-1];for(let n=0;n<l;++n){const t=r[n],i=e[0],a=e[1],s=t-r[i]>r[a]-t?i:a;let l=0,u=0,h=0,p=0,m=0;const g=1/Math.abs(r[s]-t||1);for(let e=i;e<=a;++e){const n=r[e],i=o[e],a=qo(Math.abs(t-n)*g)*d[e],s=n*a;l+=a,u+=s,h+=i*a,p+=i*s,m+=n*s}const[y,v]=Co(u/l,h/l,p/l,m/l);c[n]=y+v*t,f[n]=Math.abs(o[n]-c[n]),Wo(r,n+1,e)}if(h===Io)break;const t=Vr(f);if(Math.abs(t)<Uo)break;for(let n,i,r=0;r<l;++r)n=f[r]/(6*t),d[r]=n>=1?Uo:(i=1-n*n)*i}return function(e,t,n,i){const r=e.length,o=[];let a,s=0,l=0,u=[];for(;s<r;++s)a=e[s]+n,u[0]===a?u[1]+=(t[s]-u[1])/++l:(l=0,u[1]+=i,u=[a,t[s]],o.push(u));return u[1]+=i,o}(r,c,a,s)}function qo(e){return(e=1-e*e*e)*e*e}function Wo(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}const Go=.5*Math.PI/180;function Yo(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,l=s/i,u=[r(o)],c=[];if(n===i){for(let e=1;e<i;++e)u.push(r(o+e/n*s));return u.push(r(a)),u}c.push(r(a));for(let m=n;--m>0;)c.push(r(o+m/n*s));let f=u[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const e=t[o][1];e<n&&(n=e),e>i&&(i=e)}return 1/(i-n)}(f[1],c);for(;d;){const e=r((f[0]+d[0])/2);e[0]-f[0]>=l&&Ho(f,e,d,h,p)>Go?c.push(e):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function Ho(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),a=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-a)}function Xo(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}function Vo(e){return e&&e.length?1===e.length?e[0]:(t=e,e=>{const n=t.length;let i=1,r=String(t[0](e));for(;i<n;++i)r+="|"+t[i](e);return r}):function(){return""};var t}function Ko(e,t,n){return n||e+(t?"_"+t:"")}const Qo=()=>{},Jo={init:Qo,add:Qo,rem:Qo,idx:0},Zo={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||void 0===e.min)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},ea=Object.keys(Zo).filter((e=>"__count__"!==e));function ta(e,t,n){return Zo[e](n,t)}function na(e,t){return e.idx-t.idx}function ia(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function ra(e,t){null!=e&&""!==e?e===e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function oa(e,t){null!=e&&""!==e?e===e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function aa(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function sa(e,t){const n=t||m.D_,i=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Zo[e]())}))};return e.forEach(n),Object.values(t).sort(na)}(e),r=e.slice().sort(na);function o(e){this._ops=i,this._out=r,this.cell=e,this.init()}return o.prototype.init=ia,o.prototype.add=ra,o.prototype.rem=oa,o.prototype.set=aa,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function la(e){this._key=e?(0,m.ZZ)(e):nr,this.reset()}[...ea,"__count__"].forEach((e=>{Zo[e]=function(e,t){return(n,i)=>(0,m.X$)({name:e,aggregate_param:i,out:n||e},Jo,t)}(e,Zo[e])}));const ua=la.prototype;function ca(e){Nr.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ua.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ua.add=function(e){this._add.push(e)},ua.rem=function(e){this._rem.push(e)},ua.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),a={};let s,l,u;for(s=0;s<r;++s)a[n(t[s])]=1;for(s=0,l=0;s<i;++s)a[n(u=e[s])]?a[n(u)]=0:o[l++]=u;return this._rem=[],this._add=o},ua.distinct=function(e){const t=this.values(),n={};let i,r=t.length,o=0;for(;--r>=0;)i=e(t[r])+"",(0,m.mQ)(n,i)||(n[i]=1,++o);return o},ua.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=(0,m.n)(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},ua.argmin=function(e){return this.extent(e)[0]||{}},ua.argmax=function(e){return this.extent(e)[1]||{}},ua.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},ua.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},ua.quartile=function(e){return this._get===e&&this._q||(this._q=Jr(this.values(),e),this._get=e),this._q},ua.q1=function(e){return this.quartile(e)[0]},ua.q2=function(e){return this.quartile(e)[1]},ua.q3=function(e){return this.quartile(e)[2]},ua.ci=function(e){return this._get===e&&this._ci||(this._ci=io(this.values(),1e3,.05,e),this._get=e),this._ci},ua.ci0=function(e){return this.ci(e)[0]},ua.ci1=function(e){return this.ci(e)[1]},ca.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ea},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},(0,m.B)(ca,Nr,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),i.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter((()=>this.clean())),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map((()=>({}))),r=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o<r;++o)i[o][s=a[n[o]]]=s}o(e._prev),o(t),function o(a,s,l){const u=n[l],c=i[l++];for(const n in c){const i=a?a+"|"+n:n;s[u]=c[n],l<r?o(i,s,l):t[i]||e.cell(i,s)}}("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(e){const n=(0,m.YO)((0,m.nS)(e)),r=n.length;let o,a=0;for(;a<r;++a)i[o=n[a]]||(i[o]=1,t.push(o))}this._dims=(0,m.YO)(e.groupby),this._dnames=this._dims.map((e=>{const t=(0,m.N6)(e);return r(e),n.push(t),t})),this.cellkey=e.key?e.key:Vo(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],l=e.as||[],u=o.length,c={};let f,d,h,p,g,y,v;for(u!==a.length&&(0,m.z3)("Unmatched number of fields and aggregate ops."),v=0;v<u;++v)f=o[v],d=a[v],h=s[v]||null,null==f&&"count"!==d&&(0,m.z3)("Null aggregate field specified."),g=(0,m.N6)(f),y=Ko(d,g,l[v]),n.push(y),"count"!==d?(p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),"count"!==d&&(this._countOnly=!1),p.push(ta(d,h,y))):this._counts.push(y);return this._measures=this._measures.map((e=>sa(e,e.field))),Object.create(null)},cellkey:Vo(),cell(e,t){let n=this.value[e];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[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const e=this._measures,t=e.length;n.agg=Array(t);for(let i=0;i<t;++i)n.agg[i]=new e[i](n)}return n.store&&(n.data=new la),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let a=0;a<r;++a)o[n[a]]=i[a](e);return t?sr(t.tuple,o):rr(o)},clean(){const e=this.value;for(const t in e)0===e[t].num&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const n=e.agg;for(let e=0,i=n.length;e<i;++e)n[e].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,a=e.rem,s=e.mod;let l,u,c,f;if(i)for(u in i)l=i[u],r&&!l.num||a.push(l.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)l=n[c],(0===l.num&&r?a:s).push(this.celltuple(l)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});function fa(e){Nr.call(this,null,e)}function da(e,t,n){const i=e;let r=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[i(e)]=++s,size:()=>r.length,data:(e,t)=>(s&&(r=r.filter((e=>!a[i(e)])),a={},s=0),t&&e&&r.sort(e),o.length&&(r=e?(0,m.h1)(e,r,o.sort(e)):r.concat(o),o=[]),r)}}function ha(e){Nr.call(this,[],e)}function pa(e){mr.call(this,null,ma,e)}function ma(e){return this.value&&!e.modified()?this.value:(0,m.UD)(e.fields,e.orders)}function ga(e){Nr.call(this,null,e)}function ya(e){Nr.call(this,null,e)}fa.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.B)(fa,Nr,{transform(e,t){const n=!1!==e.interval,i=this._bins(e),r=i.start,o=i.step,a=e.as||["bin0","bin1"],s=a[0],l=a[1];let u;return u=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified((0,m.nS)(e.field))?t.ADD_MOD:t.ADD,t.visit(u,n?e=>{const t=i(e);e[s]=t,e[l]=null==t?null:r+o*(1+(t-r)/o)}:e=>e[s]=i(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=eo(e),i=n.step;let r,o,a=n.start,s=a+Math.ceil((n.stop-a)/i)*i;null!=(r=e.anchor)&&(o=r-(a+i*Math.floor((r-a)/i)),a+=o,s+=o);const l=function(e){let n=(0,m.Ro)(t(e));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 l.start=a,l.stop=n.stop,l.step=i,this.value=(0,m.sY)(l,(0,m.nS)(t),e.name||"bin_"+(0,m.N6)(t))}}),ha.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,m.B)(ha,Nr,{transform(e,t){const n=t.fork(t.ALL),i=da(nr,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(lr(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),(0,m.B)(pa,mr),ga.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.B)(ga,Nr,{transform(e,t){const n=t=>n=>{for(var i,r=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],l=0,u=r.length;l<u;++l)a.test(i=r[l])||t(i)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,a=this._stop,s=e.field,l=e.as||["text","count"],u=n((e=>r[e]=1+(r[e]||0))),c=n((e=>r[e]-=1));return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,l,u;for(s in n)l=i[s],u=n[s]||0,!l&&u?(i[s]=l=rr({}),l[r]=s,l[o]=u,a.add.push(l)):0===u?(l&&a.rem.push(l),n[s]=null,i[s]=null):l[o]!==u&&(l[o]=u,a.mod.push(l));return a.modifies(t)}}),ya.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,m.B)(ya,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,i){for(var r,o,a=[],s={},l=e.length,u=0;u<l;++u)for(s[t]=o=e[u],r=0;r<l;++r)s[n]=e[r],i(s)&&(a.push(rr(s)),(s={})[t]=o);return a}(s,r,o,e.filter||m.vN)):n.mod=s,n.source=this.value,n.modifies(i)}});const va={kde:go,mixture:wo,normal:mo,lognormal:_o,uniform:Do},xa="function";function ba(e,t){const n=e[xa];(0,m.mQ)(va,n)||(0,m.z3)("Unknown distribution function: "+n);const i=va[n]();for(const r in e)"field"===r?i.data((e.from||t()).map(e[r])):"distributions"===r?i[r](e[r].map((e=>ba(e,t)))):typeof i[r]===xa&&i[r](e[r]);return i}function _a(e){Nr.call(this,null,e)}const wa=[{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}]}],ka={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:wa},{name:"weights",type:"number",array:!0}]};function $a(e,t){return e?e.map(((e,n)=>t[n]||(0,m.N6)(e))):null}function Ea(e,t,n){const i=[],r=e=>e(l);let o,a,s,l,u,c;if(null==t)i.push(e.map(n));else for(o={},a=0,s=e.length;a<s;++a)l=e[a],u=t.map(r),c=o[u],c||(o[u]=c=[],c.dims=u,i.push(c)),c.push(n(l));return i}_a.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:wa.concat(ka)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.B)(_a,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ba(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&(0,m.z3)("Invalid density method: "+a),e.extent||i.data||(0,m.z3)("Missing density extent parameter."),a=i[a];const s=e.as||["value","density"],l=Yo(a,e.extent||(0,m.Xx)(i.data()),r,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],rr(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Aa(e){Nr.call(this,null,e)}Aa.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 Da(e){mr.call(this,null,Sa,e),this.modified(!0)}function Sa(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:(0,m.sY)((n=>t(n,e)),(0,m.nS)(t),(0,m.N6)(t))}function Ca(e){Nr.call(this,[void 0,void 0],e)}function Fa(e,t){mr.call(this,e),this.parent=t,this.count=0}function Ma(e){Nr.call(this,{},e),this._keys=(0,m.nG)();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,i=t.active;n<i;++n)e(t[n],n,t)}}function Oa(e){mr.call(this,null,Ta,e)}function Ta(e){return this.value&&!e.modified()?this.value:(0,m.cy)(e.name)?(0,m.YO)(e.name).map((e=>(0,m.ZZ)(e))):(0,m.ZZ)(e.name,e.as)}function za(e){Nr.call(this,(0,m.nG)(),e)}function Na(e){Nr.call(this,[],e)}function Ra(e){Nr.call(this,[],e)}function Pa(e){Nr.call(this,null,e)}function Ba(e){Nr.call(this,[],e)}(0,m.B)(Aa,Nr,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,i=Ea(t.source,e.groupby,m.D_),r=e.smooth||!1,o=e.field,a=e.step||((e,t)=>(0,m.Ln)((0,m.Xx)(e,t))/30)(n,o),s=lr(((e,t)=>o(e)-o(t))),l=e.as||"bin",u=i.length;let c,f=1/0,d=-1/0,h=0;for(;h<u;++h){const e=i[h].sort(s);c=-1;for(const t of ro(e,a,r,o))t<f&&(f=t),t>d&&(d=t),e[++c][l]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(l)}}),(0,m.B)(Da,mr),Ca.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,m.B)(Ca,Nr,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],a=n[1];if((r||null==o)&&(o=1/0,a=-1/0),t.visit(r?t.SOURCE:t.ADD,(e=>{const t=(0,m.Ro)(i(e));null!=t&&(t<o&&(o=t),t>a&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=(0,m.N6)(i);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),(0,m.B)(Fa,mr,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),(0,m.B)(Ma,Nr,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o,a,s=(0,m.mQ)(r,e)&&r[e];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new Fa(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(0===e[n].count){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const e=this._targets.filter((e=>e&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&null!=t[r];++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,a=e.modified("key"),s=e=>this.subflow(e,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=nr(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=i(e);o.set(nr(e),t),s(t).add(e)})),a||t.modified(i.fields)?t.visit(t.MOD,(e=>{const t=nr(e),n=o.get(t),r=i(e);n===r?s(r).mod(e):(o.set(t,r),s(n).rem(e),s(r).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(nr(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=nr(e),n=o.get(t),r=i(e);n!==r&&(o.set(t,r),s(n).rem(e),s(r).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),(0,m.B)(Oa,mr),za.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,m.B)(za,Nr,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,a=r.rem,s=r.mod,l=e.expr;let u=!0;function c(t){const n=nr(t),r=l(t,e),c=i.get(n);r&&c?(i.delete(n),o.push(t)):r||c?u&&r&&!c&&s.push(t):(i.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=nr(e);i.has(t)?i.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{l(t,e)?o.push(t):i.set(nr(t),1)})),t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),Na.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.B)(Na,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=$a(i,e.as||[]),o=e.index||null,a=r.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=i.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let l,u,c,f=0;for(;f<s;++f){for(u=or(e),l=0;l<a;++l)u[r[l]]=null==(c=t[l][f])?null:c;o&&(u[o]=f),n.add.push(u)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}}),Ra.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.B)(Ra,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(m.N6),o=e.as||["key","value"],a=o[0],s=o[1],l=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{for(let t,o=0;o<l;++o)t=or(e),t[a]=r[o],t[s]=i[o](e),n.add.push(t)})),this.value=n.source=n.add,n.modifies(o)}}),Pa.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.B)(Pa,Nr,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,(t=>t[i]=n(t,e)))}}),(0,m.B)(Ba,Nr,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r,o,a,s=this.value,l=e.size-s.length;if(l>0){for(r=[];--l>=0;)r.push(a=rr(i(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else o=s.slice(0,-l),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-l);return n.source=this.value=s,n}});const La={value:"value",median:Vr,mean:function(e,t){let n=0,i=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n},min:Ur,max:Ir},Ia=[];function Ua(e){Nr.call(this,[],e)}function ja(e){ca.call(this,e)}function qa(e){Nr.call(this,null,e)}function Wa(e){mr.call(this,null,Ga,e)}function Ga(e){return this.value&&!e.modified()?this.value:(0,m.Eb)(e.fields,e.flat)}function Ya(e){Nr.call(this,[],e),this._pending=null}function Ha(e,t,n){n.forEach(rr);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function Xa(e){Nr.call(this,{},e)}function Va(e){mr.call(this,null,Ka,e)}function Ka(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i,r,o=1/0,a=-1/0;for(i=0;i<n;++i)r=t[i],r[0]<o&&(o=r[0]),r[1]>a&&(a=r[1]);return[o,a]}function Qa(e){mr.call(this,null,Ja,e)}function Ja(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Za(e){Nr.call(this,null,e)}function es(e){ca.call(this,e)}function ts(e){Ma.call(this,e)}function ns(e){Nr.call(this,null,e)}function is(e){Nr.call(this,null,e)}function rs(e){Nr.call(this,null,e)}Ua.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.B)(Ua,Nr,{transform(e,t){var n,i,r,o,a,s,l,u,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||La.value;if(null!=La[n])return n===La.value?(t=void 0!==e.value?e.value:0,()=>t):La[n];(0,m.z3)("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=(0,m.N6)(e.field),y=(0,m.N6)(e.key),v=(e.groupby||[]).map(m.N6),x=function(e,t,n,i){var r,o,a,s,l,u,c,f,d=e=>e(f),h=[],p=i?i.slice():[],m={},g={};for(p.forEach(((e,t)=>m[e]=t+1)),s=0,c=e.length;s<c;++s)u=n(f=e[s]),l=m[u]||(m[u]=p.push(u)),(a=g[o=(r=t?t.map(d):Ia)+""])||(a=g[o]=[],h.push(a),a.values=r),a[l-1]=f;return h.domain=p,h}(t.source,e.groupby,e.key,e.keyvals),b=[],_=this.value,w=x.domain.length;for(a=0,u=x.length;a<u;++a)for(r=(n=x[a]).values,i=NaN,l=0;l<w;++l)if(null==n[l]){for(o=x.domain[l],f={_impute:!0},s=0,c=r.length;s<c;++s)f[v[s]]=r[s];f[y]=o,f[g]=Number.isNaN(i)?i=h(n,p):i,b.push(rr(f))}return b.length&&(d.add=d.materialize(d.ADD).add.concat(b)),_.length&&(d.rem=d.materialize(d.REM).rem.concat(_)),this.value=b,d}}),ja.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:ea},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,m.B)(ja,ca,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,(e=>n.add(e)))):(r=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{(0,m.X$)(e,r[n.cellkey(e)].tuple)})),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}}),qa.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.B)(qa,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Ea(i,e.groupby,e.field),o=(e.groupby||[]).map(m.N6),a=e.bandwidth,s=e.cumulative?"cdf":"pdf",l=e.as||["value","density"],u=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,m.z3)("Invalid density method: "+s),"shared"===e.resolve&&(c||(c=(0,m.Xx)(i,e.field)),f=d=e.steps||d),r.forEach((t=>{const n=go(t,a)[s],i=e.counts?t.length:1;Yo(n,c||(0,m.Xx)(t),f,d).forEach((e=>{const n={};for(let i=0;i<o.length;++i)n[o[i]]=t.dims[i];n[l[0]]=e[0],n[l[1]]=e[1]*i,u.push(rr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),(0,m.B)(Wa,mr),(0,m.B)(Ya,Nr,{transform(e,t){const n=t.dataflow;if(this._pending)return Ha(this,t,this._pending);if(function(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}(e))return t.StopPropagation;if(e.values)return Ha(this,t,n.parse(e.values,e.format));if(e.async){const t=n.request(e.url,e.format).then((e=>(this._pending=(0,m.YO)(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>Ha(this,t,(0,m.YO)(e.data))))}}),Xa.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.B)(Xa,Nr,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let l,u,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return r?(u=r.length,s>1&&!h&&(0,m.z3)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*u&&(0,m.z3)('The "as" parameter has too few output field names.'),h=h||r.map(m.N6),l=function(e){for(var t,a,l=0,c=0;l<s;++l)if(null==(a=i.get(n[l](e))))for(t=0;t<u;++t,++c)e[h[c]]=o;else for(t=0;t<u;++t,++c)e[h[c]]=r[t](a)}):(h||(0,m.z3)("Missing output field names."),l=function(e){for(var t,r=0;r<s;++r)t=i.get(n[r](e)),e[h[r]]=null==t?o:t}),a?d=t.reflow(!0):(c=n.some((e=>t.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,l),d.modifies(h)}}),(0,m.B)(Va,mr),(0,m.B)(Qa,mr),(0,m.B)(Za,Nr,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),es.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:ea,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,m.B)(es,ca,{_transform:ca.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,i=e.value,r=("count"===e.op?"__count__":e.op)||"sum",o=(0,m.nS)(n).concat((0,m.nS)(i)),a=function(e,t,n){const i={},r=[];return n.visit(n.SOURCE,(t=>{const n=e(t);i[n]||(i[n]=1,r.push(n))})),r.sort(m.V_),t?r.slice(0,t):r}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map((()=>r)),fields:a.map((e=>function(e,t,n,i){return(0,m.sY)((i=>t(i)===e?n(i):NaN),i,e+"")}(e,n,i,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),(0,m.B)(ts,Ma,{transform(e,t){const n=e.subflow,i=e.field,r=e=>this.subflow(nr(e),n,t,e);return(e.modified("field")||i&&t.modified((0,m.nS)(i)))&&(0,m.z3)("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,(e=>{const t=r(e);i(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=r(e);i(e).forEach((e=>t.add(rr(e))))})),t.visit(t.REM,(e=>{const t=r(e);i(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>r(e).mod(e))),t.visit(t.ADD,(e=>r(e).add(e))),t.visit(t.REM,(e=>r(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),ns.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.B)(ns,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=$a(e.fields,e.as||[]),o=i?(e,t)=>function(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}(e,t,i,r):ar;let a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,(e=>{const t=nr(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,rr({}));a[nr(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[nr(e)]))})),n}}),(0,m.B)(is,Nr,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),rs.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 os(e){Nr.call(this,null,e)}function as(e){Nr.call(this,[],e),this.count=0}function ss(e){Nr.call(this,null,e)}function ls(e){Nr.call(this,null,e),this.modified(!0)}function us(e){Nr.call(this,null,e)}(0,m.B)(rs,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=Ea(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(m.N6),a=[],s=e.step||.01,l=e.probs||Xo(s/2,1-1e-14,s),u=l.length;return r.forEach((e=>{const t=Qr(e,l);for(let n=0;n<u;++n){const r={};for(let t=0;t<o.length;++t)r[o[t]]=e.dims[t];r[i[0]]=l[n],r[i[1]]=t[n],a.push(rr(r))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,m.B)(os,Nr,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,(e=>{const t=nr(e);n.rem.push(i[t]),i[t]=null})),t.visit(t.ADD,(e=>{const t=or(e);i[nr(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=i[nr(e)];for(const i in e)t[i]=e[i],n.modifies(i);n.mod.push(t)}))),n}}),as.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,m.B)(as,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce(((e,t)=>(e[nr(t)]=1,e)),{});let a=this.value,s=this.count,l=0;function u(e){let t,i;a.length<r?a.push(e):(i=~~((s+1)*to()),i<a.length&&i>=l&&(t=a[i],o[nr(t)]&&n.rem.push(t),a[i]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=nr(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[nr(e)]))),(t.rem.length||i)&&a.length<r&&t.source&&(l=s=a.length,t.visit(t.SOURCE,(e=>{o[nr(e)]||u(e)})),l=-1),i&&a.length>r){const e=a.length-r;for(let t=0;t<e;++t)o[nr(a[t])]=-1,n.rem.push(a[t]);a=a.slice(e)}return t.mod.length&&t.visit(t.MOD,(e=>{o[nr(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=a.filter((e=>!o[nr(e)]))),this.count=s,this.value=n.source=a,n}}),ss.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.B)(ss,Nr,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Xo(e.start,e.stop,e.step||1).map((e=>{const t={};return t[i]=e,rr(t)})),n.add=t.add.concat(this.value),n}}),(0,m.B)(ls,Nr,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const cs=["unit0","unit1"];function fs(e){Nr.call(this,(0,m.nG)(),e)}function ds(e){Nr.call(this,null,e)}us.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Pe,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:cs}]},(0,m.B)(us,Nr,{transform(e,t){const n=e.field,i=!1!==e.interval,r="utc"===e.timezone,o=this._floor(e,t),a=(r?ht:dt)(o.unit).offset,s=e.as||cs,l=s[0],u=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified((0,m.nS)(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let r,s;null==t?(e[l]=null,i&&(e[u]=null)):(e[l]=r=s=o(t),i&&(e[u]=s=a(r,c)),r<f&&(f=r),s>d&&(d=s))})),o.start=f,o.stop=d,t.modifies(i?s:l)},_floor(e,t){const n="utc"===e.timezone,{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:zt({extent:e.extent||(0,m.Xx)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Le(i),a=this.value||{},s=(n?ut:at)(o,r);return s.unit=(0,m.se)(o),s.units=o,s.step=r,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,m.B)(fs,Nr,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=e=>r.set(i(e),e);let a=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>r.delete(i(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}}),(0,m.B)(ds,Nr,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(lr(e.sort)):t.source).map(e.field))}});const hs={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=hs.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){(t=+t)>0||(0,m.z3)("ntile num must be greater than zero.");const n=hs.cume_dist(),i=n.next;return{init:n.init,next:e=>Math.ceil(t*i(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||(0,m.z3)("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return null!=i?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=function(e,t,n){for(let i=t.length;n<i;++n){if(null!=e(t[n]))return n}return-1}(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};const ps=Object.keys(hs);function ms(e){const t=(0,m.YO)(e.ops),n=(0,m.YO)(e.fields),i=(0,m.YO)(e.params),r=(0,m.YO)(e.aggregate_params),o=(0,m.YO)(e.as),a=this.outputs=[],s=this.windows=[],l={},u={},c=[],f=[];let d=!0;function h(e){(0,m.YO)((0,m.nS)(e)).forEach((e=>l[e]=1))}h(e.sort),t.forEach(((e,t)=>{const l=n[t],p=i[t],g=r[t]||null,y=(0,m.N6)(l),v=Ko(e,y,o[t]);if(h(l),a.push(v),(0,m.mQ)(hs,e))s.push(function(e,t,n,i){const r=hs[e](t,n);return{init:r.init||m.v_,update:function(e,t){t[i]=r.next(e)}}}(e,l,p,v));else{if(null==l&&"count"!==e&&(0,m.z3)("Null aggregate field specified."),"count"===e)return void c.push(v);d=!1;let t=u[y];t||(t=u[y]=[],t.field=l,f.push(t)),t.push(ta(e,g,v))}})),(c.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>sa(e,e.field)));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),a=0;a<r;++a)o[a]=new e[a](i);if(i.store)var s=i.data=new la;return i.add=function(e){if(i.num+=1,!n){s&&s.add(e);for(let t=0;t<r;++t)o[t].add(o[t].get(e),e)}},i.rem=function(e){if(i.num-=1,!n){s&&s.rem(e);for(let t=0;t<r;++t)o[t].rem(o[t].get(e),e)}},i.set=function(e){let r,a;for(s&&s.values(),r=0,a=t.length;r<a;++r)e[t[r]]=i.num;if(!n)for(r=0,a=o.length;r<a;++r)o[r].set(e)},i.init=function(){i.num=0,s&&s.reset();for(let e=0;e<r;++e)o[e].init()},i}(f,c,d)),this.inputs=Object.keys(l)}const gs=ms.prototype;function ys(e){Nr.call(this,{},e),this._mlen=0,this._mods=[]}function vs(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,a=i.frame||[null,0],s=e.data(n),l=s.length,u=o?(0,Ee.A)(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,m.dY)(-1)};t.init();for(let f=0;f<l;++f)xs(c,a,f,l),o&&bs(c,u),t.update(c,s[f])}function xs(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=null==t[0]?0:Math.max(0,n-Math.abs(t[0])),e.i1=null==t[1]?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function bs(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,a=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<a&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}function _s(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ws(e){this._context=e}function ks(){}function $s(e){this._context=e}function Es(e){this._context=e}function As(e,t){this._basis=new ws(e),this._beta=t}gs.init=function(){this.windows.forEach((e=>e.init())),this.cell&&this.cell.init()},gs.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let a;if(n){for(a=e.p0;a<e.i0;++a)n.rem(r[a]);for(a=e.p1;a<e.i1;++a)n.add(r[a]);n.set(t)}for(a=0;a<o;++a)i[a].update(e,t)},ys.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ps.concat(ea)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},(0,m.B)(ys,Nr,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=lr(e.sort),r=Vo(e.groupby),o=e=>this.group(r(e));let a=this.state;a&&!n||(a=this.state=new ms(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let s=0,l=this._mlen;s<l;++s)vs(this._mods[s],a,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(a.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=da(nr),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}}),ws.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:_s(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_s(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},$s.prototype={areaStart:ks,areaEnd:ks,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_s(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Es.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:_s(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},As.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i,r=e[0],o=t[0],a=e[n]-r,s=t[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(r+i*a),this._beta*t[l]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Ds=function e(t){function n(e){return 1===t?new ws(e):new As(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function Ss(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Cs(e,t){this._context=e,this._k=(1-t)/6}Cs.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:Ss(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ss(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Fs=function e(t){function n(e){return new Cs(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ms(e,t){this._context=e,this._k=(1-t)/6}Ms.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ss(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Os=function e(t){function n(e){return new Ms(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ts(e,t){this._context=e,this._k=(1-t)/6}Ts.prototype={areaStart:ks,areaEnd:ks,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ss(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zs=function e(t){function n(e){return new Ts(e,t)}return n.tension=function(t){return e(+t)},n}(0),Ns=Math.abs,Rs=Math.atan2,Ps=Math.cos,Bs=Math.max,Ls=Math.min,Is=Math.sin,Us=Math.sqrt,js=1e-12,qs=Math.PI,Ws=qs/2,Gs=2*qs;function Ys(e){return e>=1?Ws:e<=-1?-Ws:Math.asin(e)}function Hs(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>js){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>js){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}function Xs(e,t){this._context=e,this._alpha=t}Xs.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Hs(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Vs=function e(t){function n(e){return t?new Xs(e,t):new Cs(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Ks(e,t){this._context=e,this._alpha=t}Ks.prototype={areaStart:ks,areaEnd:ks,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hs(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Qs=function e(t){function n(e){return t?new Ks(e,t):new Ts(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Js(e,t){this._context=e,this._alpha=t}Js.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hs(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Zs=function e(t){function n(e){return t?new Js(e,t):new Ms(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function el(e){this._context=e}function tl(e){return new el(e)}function nl(e){this._context=e}function il(e){return e<0?-1:1}function rl(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(il(o)+il(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ol(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function al(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function sl(e){this._context=e}function ll(e){this._context=new ul(e)}function ul(e){this._context=e}function cl(e){this._context=e}function fl(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function dl(e,t){this._context=e,this._t=t}function hl(e){return function(){return e}}el.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},nl.prototype={areaStart:ks,areaEnd:ks,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},sl.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:al(this,this._t0,ol(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,al(this,ol(this,n=rl(this,e,t)),n);break;default:al(this,this._t0,n=rl(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ll.prototype=Object.create(sl.prototype)).point=function(e,t){sl.prototype.point.call(this,t,e)},ul.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},cl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=fl(e),r=fl(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},dl.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const pl=Math.PI,ml=2*pl,gl=1e-6,yl=ml-gl;function vl(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class xl{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?vl:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vl;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,r,o){this._append`C${+e},${+t},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(e,t,n,i,r){if(e=+e,t=+t,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,a=this._y1,s=n-e,l=i-t,u=o-e,c=a-t,f=u*u+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>gl)if(Math.abs(c*s-l*u)>gl&&r){let d=n-o,h=i-a,p=s*s+l*l,m=d*d+h*h,g=Math.sqrt(p),y=Math.sqrt(f),v=r*Math.tan((pl-Math.acos((p+f-m)/(2*g*y)))/2),x=v/y,b=v/g;Math.abs(x-1)>gl&&this._append`L${e+x*u},${t+x*c}`,this._append`A${r},${r},0,0,${+(c*d>u*h)},${this._x1=e+b*s},${this._y1=t+b*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,i,r,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),s=n*Math.sin(i),l=e+a,u=t+s,c=1^o,f=o?i-r:r-i;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>gl||Math.abs(this._y1-u)>gl)&&this._append`L${l},${u}`,n&&(f<0&&(f=f%ml+ml),f>yl?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:f>gl&&this._append`A${n},${n},0,${+(f>=pl)},${c},${this._x1=e+n*Math.cos(r)},${this._y1=t+n*Math.sin(r)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function bl(){return new xl}function _l(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new xl(t)}function wl(e){return e.innerRadius}function kl(e){return e.outerRadius}function $l(e){return e.startAngle}function El(e){return e.endAngle}function Al(e){return e&&e.padAngle}function Dl(e,t,n,i,r,o,a){var s=e-n,l=t-i,u=(a?o:-o)/Us(s*s+l*l),c=u*l,f=-u*s,d=e+c,h=t+f,p=n+c,m=i+f,g=(d+p)/2,y=(h+m)/2,v=p-d,x=m-h,b=v*v+x*x,_=r-o,w=d*m-p*h,k=(x<0?-1:1)*Us(Bs(0,_*_*b-w*w)),$=(w*x-v*k)/b,E=(-w*v-x*k)/b,A=(w*x+v*k)/b,D=(-w*v+x*k)/b,S=$-g,C=E-y,F=A-g,M=D-y;return S*S+C*C>F*F+M*M&&($=A,E=D),{cx:$,cy:E,x01:-c,y01:-f,x11:$*(r/_-1),y11:E*(r/_-1)}}bl.prototype=xl.prototype;Array.prototype.slice;function Sl(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function Cl(e){return e[0]}function Fl(e){return e[1]}function Ml(e,t){var n=hl(!0),i=null,r=tl,o=null,a=_l(s);function s(s){var l,u,c,f=(s=Sl(s)).length,d=!1;for(null==i&&(o=r(c=a())),l=0;l<=f;++l)!(l<f&&n(u=s[l],l,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(u,l,s),+t(u,l,s));if(c)return o=null,c+""||null}return e="function"===typeof e?e:void 0===e?Cl:hl(e),t="function"===typeof t?t:void 0===t?Fl:hl(t),s.x=function(t){return arguments.length?(e="function"===typeof t?t:hl(+t),s):e},s.y=function(e){return arguments.length?(t="function"===typeof e?e:hl(+e),s):t},s.defined=function(e){return arguments.length?(n="function"===typeof e?e:hl(!!e),s):n},s.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),s):r},s.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),s):i},s}function Ol(e,t,n){var i=null,r=hl(!0),o=null,a=tl,s=null,l=_l(u);function u(u){var c,f,d,h,p,m=(u=Sl(u)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(p=l())),c=0;c<=m;++c){if(!(c<m&&r(h=u[c],c,u))===g)if(g=!g)f=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}g&&(y[c]=+e(h,c,u),v[c]=+t(h,c,u),s.point(i?+i(h,c,u):y[c],n?+n(h,c,u):v[c]))}if(p)return s=null,p+""||null}function c(){return Ml().defined(r).curve(a).context(o)}return e="function"===typeof e?e:void 0===e?Cl:hl(+e),t="function"===typeof t?t:hl(void 0===t?0:+t),n="function"===typeof n?n:void 0===n?Fl:hl(+n),u.x=function(t){return arguments.length?(e="function"===typeof t?t:hl(+t),i=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:hl(+t),u):e},u.x1=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:hl(+e),u):i},u.y=function(e){return arguments.length?(t="function"===typeof e?e:hl(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"===typeof e?e:hl(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:hl(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(e){return arguments.length?(r="function"===typeof e?e:hl(!!e),u):r},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u}Us(3);const Tl={draw(e,t){const n=Us(t/qs);e.moveTo(n,0),e.arc(0,0,n,0,Gs)}},zl=(Us(1/3),Is(qs/10)/Is(7*qs/10));Is(Gs/10),Ps(Gs/10),Us(3),Us(3),Us(3),Us(12);function Nl(e,t){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Rl=()=>"undefined"!==typeof Image?Image:null;var Pl=n(66384),Bl=n(53142),Ll=n(68558);function Il(e,t){var n,i=0,r=(e=e.slice()).length-1,o=e[i],a=e[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),e[i]=t.floor(o),e[r]=t.ceil(a),e}var Ul=n(95507),jl=n(57113);function ql(e){return Math.log(e)}function Wl(e){return Math.exp(e)}function Gl(e){return-Math.log(-e)}function Yl(e){return-Math.exp(-e)}function Hl(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Xl(e){return(t,n)=>-e(-t,n)}function Vl(e){const t=e(ql,Wl),n=t.domain;let i,r,o=10;function a(){return i=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),r=function(e){return 10===e?Hl:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(i=Xl(i),r=Xl(r),e(Gl,Yl)):e(ql,Wl),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const l=s<a;l&&([a,s]=[s,a]);let u,c,f=i(a),d=i(s);const h=null==e?10:+e;let p=[];if(!(o%1)&&d-f<h){if(f=Math.floor(f),d=Math.ceil(d),a>0){for(;f<=d;++f)for(u=1;u<o;++u)if(c=f<0?u/r(-f):u*r(f),!(c<a)){if(c>s)break;p.push(c)}}else for(;f<=d;++f)for(u=o-1;u>=1;--u)if(c=f>0?u/r(-f):u*r(f),!(c<a)){if(c>s)break;p.push(c)}2*p.length<h&&(p=(0,T.Ay)(a,s,h))}else p=(0,T.Ay)(f,d,Math.min(d-f,h)).map(r);return l?p.reverse():p},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!==typeof n&&(o%1||null!=(n=(0,z.A)(n)).precision||(n.trim=!0),n=(0,B.GP)(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/r(Math.round(i(e)));return t*o<o-.5&&(t*=o),t<=a?n(e):""}},t.nice=()=>n(Il(n(),{floor:e=>r(Math.floor(i(e))),ceil:e=>r(Math.ceil(i(e)))})),t}function Kl(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ql(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Jl(e){return e<0?-e*e:e*e}function Zl(e){var t=e(Ul.D_,Ul.D_),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(Ul.D_,Ul.D_):.5===n?e(Ql,Jl):e(Kl(n),Kl(1/n)):n},(0,Bl.C)(t)}function eu(){var e=Zl((0,Ul.Gu)());return e.copy=function(){return(0,Ul.C)(e,eu()).exponent(e.exponent())},jl.C.apply(e,arguments),e}function tu(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function nu(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function iu(e){var t=1,n=e(tu(t),nu(t));return n.constant=function(n){return arguments.length?e(tu(t=+n),nu(t)):t},(0,Bl.C)(n)}function ru(e,t,n,i,r,o){const a=[[ke,1,q],[ke,5,5e3],[ke,15,15e3],[ke,30,3e4],[o,1,W],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,G],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,Y],[i,2,1728e5],[n,1,H],[t,1,X],[t,3,7776e6],[e,1,V]];function s(t,n,i){const r=Math.abs(n-t)/i,o=(0,Ee.A)((e=>{let[,,t]=e;return t})).right(a,r);if(o===a.length)return e.every((0,T.sG)(t/V,n/V,i));if(0===o)return $e.every(Math.max((0,T.sG)(t,n,i),1));const[s,l]=a[r/a[o-1][2]<a[o][2]/r?o-1:o];return s.every(l)}return[function(e,t,n){const i=t<e;i&&([e,t]=[t,e]);const r=n&&"function"===typeof n.range?n:s(e,t,n),o=r?r.range(e,+t+1):[];return i?o.reverse():o},s]}const[ou,au]=ru(ge,ve,le,J,be,we),[su,lu]=ru(me,ye,ee,K,xe,_e);function uu(e){return new Date(e)}function cu(e){return e instanceof Date?+e:+new Date(+e)}function fu(e,t,n,i,r,o,a,s,l,u){var c=(0,Ul.Ay)(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),x=u("%B"),b=u("%Y");function _(e){return(l(e)<e?h:s(e)<e?p:a(e)<e?m:o(e)<e?g:i(e)<e?r(e)<e?y:v:n(e)<e?x:b)(e)}return c.invert=function(e){return new Date(f(e))},c.domain=function(e){return arguments.length?d(Array.from(e,cu)):d().map(uu)},c.ticks=function(t){var n=d();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?_:u(t)},c.nice=function(e){var n=d();return e&&"function"===typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?d(Il(n,e)):c},c.copy=function(){return(0,Ul.C)(c,fu(e,t,n,i,r,o,a,s,l,u))},c}var du=n(80039),hu=n(72970);function pu(){var e,t,n,i,r,o=0,a=1,s=Ul.D_,l=!1;function u(t){return null==t||isNaN(t=+t)?r:s(0===n?.5:(t=(i(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,i;return arguments.length?([n,i]=t,s=e(n,i),u):[s(0),s(1)]}}return u.domain=function(r){return arguments.length?([o,a]=r,e=i(o=+o),t=i(a=+a),n=e===t?0:1/(t-e),u):[o,a]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(s=e,u):s},u.range=c(du.A),u.rangeRound=c(hu.A),u.unknown=function(e){return arguments.length?(r=e,u):r},function(r){return i=r,e=r(o),t=r(a),n=e===t?0:1/(t-e),u}}function mu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gu(){var e=(0,Bl.C)(pu()(Ul.D_));return e.copy=function(){return mu(e,gu())},jl.K.apply(e,arguments)}function yu(){var e=Zl(pu());return e.copy=function(){return mu(e,yu()).exponent(e.exponent())},jl.K.apply(e,arguments)}function vu(e,t){void 0===t&&(t=e,e=du.A);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return o[t](e-t)}}function xu(){var e,t,n,i,r,o,a,s=0,l=.5,u=1,c=1,f=Ul.D_,d=!1;function h(e){return isNaN(e=+e)?a:(e=.5+((e=+o(e))-t)*(c*e<c*t?i:r),f(d?Math.max(0,Math.min(1,e)):e))}function p(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,f=vu(e,[n,i,r]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,l,u]=a,e=o(s=+s),t=o(l=+l),n=o(u=+u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,h):[s,l,u]},h.clamp=function(e){return arguments.length?(d=!!e,h):d},h.interpolator=function(e){return arguments.length?(f=e,h):f},h.range=p(du.A),h.rangeRound=p(hu.A),h.unknown=function(e){return arguments.length?(a=e,h):a},function(a){return o=a,e=a(s),t=a(l),n=a(u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,h}}function bu(){var e=Zl(xu());return e.copy=function(){return mu(e,bu()).exponent(e.exponent())},jl.K.apply(e,arguments)}var _u=n(31708);class wu extends Map{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[n,i]of e)this.set(n,i)}get(e){return super.get($u(this,e))}has(e){return super.has($u(this,e))}set(e,t){return super.set(Eu(this,e),t)}delete(e){return super.delete(Au(this,e))}}class ku extends Set{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const n of e)this.add(n)}has(e){return super.has($u(this,e))}add(e){return super.add(Eu(this,e))}delete(e){return super.delete(Au(this,e))}}function $u(e,t){let{_intern:n,_key:i}=e;const r=i(t);return n.has(r)?n.get(r):t}function Eu(e,t){let{_intern:n,_key:i}=e;const r=i(t);return n.has(r)?n.get(r):(n.set(r,t),t)}function Au(e,t){let{_intern:n,_key:i}=e;const r=i(t);return n.has(r)&&(t=n.get(r),n.delete(r)),t}function Du(e){return null!==e&&"object"===typeof e?e.valueOf():e}const Su=Symbol("implicit");function Cu(){var e=new wu,t=[],n=[],i=Su;function r(r){let o=e.get(r);if(void 0===o){if(i!==Su)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new wu;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return Cu(t,n).unknown(i)},jl.C.apply(r,arguments),r}var Fu=n(10545),Mu=n(63535),Ou=n(36368),Tu=n(16284),zu=n(44700);function Nu(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Ru=n(73637);function Pu(e,t){var n=(0,Ru.lG)(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var Bu=n(48853),Lu=n(30032),Iu=n(47983),Uu=n(56409),ju=n(83749);function qu(e){return((e=Math.exp(e))+1/e)/2}const Wu=function e(t,n,i){function r(e,r){var o,a,s=e[0],l=e[1],u=e[2],c=r[0],f=r[1],d=r[2],h=c-s,p=f-l,m=h*h+p*p;if(m<1e-12)a=Math.log(d/u)/t,o=function(e){return[s+e*h,l+e*p,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(d*d-u*u+i*m)/(2*u*n*g),v=(d*d-u*u-i*m)/(2*d*n*g),x=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(v*v+1)-v);a=(b-x)/t,o=function(e){var i=e*a,r=qu(x),o=u/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+x)-function(e){return((e=Math.exp(e))-1/e)/2}(x));return[s+o*h,l+o*p,u*r/qu(t*i+x)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return r.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},r}(Math.SQRT2,2,4);var Gu=n(70701),Yu=n(89421);function Hu(e){return function(t,n){var i=e((t=(0,Yu.KI)(t)).h,(n=(0,Yu.KI)(n)).h),r=(0,Ru.Ay)(t.s,n.s),o=(0,Ru.Ay)(t.l,n.l),a=(0,Ru.Ay)(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=o(e),t.opacity=a(e),t+""}}}const Xu=Hu(Ru.lG);var Vu=Hu(Ru.Ay),Ku=n(39655);const Qu=Math.PI/180,Ju=180/Math.PI,Zu=.96422,ec=1,tc=.82521,nc=4/29,ic=6/29,rc=3*ic*ic,oc=.008856451679035631;function ac(e){if(e instanceof lc)return new lc(e.l,e.a,e.b,e.opacity);if(e instanceof mc)return gc(e);e instanceof Yu.Gw||(e=(0,Yu.b)(e));var t,n,i=dc(e.r),r=dc(e.g),o=dc(e.b),a=uc((.2225045*i+.7168786*r+.0606169*o)/ec);return i===r&&r===o?t=n=a:(t=uc((.4360747*i+.3850649*r+.1430804*o)/Zu),n=uc((.0139322*i+.0971045*r+.7141733*o)/tc)),new lc(116*a-16,500*(t-a),200*(a-n),e.opacity)}function sc(e,t,n,i){return 1===arguments.length?ac(e):new lc(e,t,n,null==i?1:i)}function lc(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function uc(e){return e>oc?Math.pow(e,1/3):e/rc+nc}function cc(e){return e>ic?e*e*e:rc*(e-nc)}function fc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function dc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function hc(e){if(e instanceof mc)return new mc(e.h,e.c,e.l,e.opacity);if(e instanceof lc||(e=ac(e)),0===e.a&&0===e.b)return new mc(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ju;return new mc(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function pc(e,t,n,i){return 1===arguments.length?hc(e):new mc(e,t,n,null==i?1:i)}function mc(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function gc(e){if(isNaN(e.h))return new lc(e.l,0,0,e.opacity);var t=e.h*Qu;return new lc(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function yc(e,t){var n=(0,Ru.Ay)((e=sc(e)).l,(t=sc(t)).l),i=(0,Ru.Ay)(e.a,t.a),r=(0,Ru.Ay)(e.b,t.b),o=(0,Ru.Ay)(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=o(t),e+""}}function vc(e){return function(t,n){var i=e((t=pc(t)).h,(n=pc(n)).h),r=(0,Ru.Ay)(t.c,n.c),o=(0,Ru.Ay)(t.l,n.l),a=(0,Ru.Ay)(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=o(e),t.opacity=a(e),t+""}}}(0,Ku.A)(lc,sc,(0,Ku.X)(Yu.Q1,{brighter(e){return new lc(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new lc(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Zu*cc(t),e=ec*cc(e),n=tc*cc(n),new Yu.Gw(fc(3.1338561*t-1.6168667*e-.4906146*n),fc(-.9787684*t+1.9161415*e+.033454*n),fc(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),(0,Ku.A)(mc,pc,(0,Ku.X)(Yu.Q1,{brighter(e){return new mc(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new mc(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return gc(this).rgb()}}));const xc=vc(Ru.lG);var bc=vc(Ru.Ay),_c=-.14861,wc=1.78277,kc=-.29227,$c=-.90649,Ec=1.97294,Ac=Ec*$c,Dc=Ec*wc,Sc=wc*kc-$c*_c;function Cc(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Fc)return new Fc(e.h,e.s,e.l,e.opacity);e instanceof Yu.Gw||(e=(0,Yu.b)(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(Sc*i+Ac*t-Dc*n)/(Sc+Ac-Dc),o=i-r,a=(Ec*(n-r)-kc*o)/$c,s=Math.sqrt(a*a+o*o)/(Ec*r*(1-r)),l=s?Math.atan2(a,o)*Ju-120:NaN;return new Fc(l<0?l+360:l,s,r,e.opacity)}(e):new Fc(e,t,n,null==i?1:i)}function Fc(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Mc(e){return function t(n){function i(t,i){var r=e((t=Cc(t)).h,(i=Cc(i)).h),o=(0,Ru.Ay)(t.s,i.s),a=(0,Ru.Ay)(t.l,i.l),s=(0,Ru.Ay)(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,i.gamma=t,i}(1)}(0,Ku.A)(Fc,Cc,(0,Ku.X)(Yu.Q1,{brighter(e){return e=null==e?Yu.Uw:Math.pow(Yu.Uw,e),new Fc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Yu.ef:Math.pow(Yu.ef,e),new Fc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Qu,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new Yu.Gw(255*(t+n*(_c*i+wc*r)),255*(t+n*(kc*i+$c*r)),255*(t+n*(Ec*i)),this.opacity)}}));const Oc=Mc(Ru.lG);var Tc=Mc(Ru.Ay);function zc(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}function Nc(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}const Rc=Nc("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Pc=Nc("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Bc=Nc("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Lc=Nc("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),Ic=Nc("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Uc=Nc("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),jc=Nc("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),qc=Nc("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Wc=Nc("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Gc=Nc("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Yc(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}const Hc="linear",Xc="log",Vc="pow",Kc="sqrt",Qc="symlog",Jc="time",Zc="utc",ef="sequential",tf="diverging",nf="quantile",rf="quantize",of="threshold",af="ordinal",sf="point",lf="band",uf="bin-ordinal",cf="continuous",ff="discrete",df="discretizing",hf="interpolating",pf="temporal";function mf(){const e=Cu().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){const e=t().length,c=o[1]<o[0],f=o[1-c],d=Yc(e,s,l);let h=o[c-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*u,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=Xo(e).map((e=>h+i*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const i=o[1]<o[0],a=i?n().reverse():n(),s=a.length-1;let l,u,c,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(c=f,f=d,d=c),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,(0,Pl.Jj)(a,f)-1),u=f===d?l:(0,Pl.Jj)(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(c=l,l=s-u,u=s-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return mf().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(u)},c()}function gf(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return gf(t())},e}var yf=Array.prototype.map;const vf=Array.prototype.slice;const xf=new Map,bf=Symbol("vega_scale");function _f(e){return e[bf]=!0,e}function wf(e,t,n){return arguments.length>1?(xf.set(e,function(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){const n=e.range();let i,r,o,a,s=t[0],l=t[1],u=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(u<0&&(u=o),i=o);if(!(u<0))return s=e.invertExtent(n[u]),l=e.invertExtent(n[i]),[void 0===s[0]?s[1]:s[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,_f(n)};return i.metadata=(0,m.M1)((0,m.YO)(n)),i}(e,t,n)),this):kf(e)?xf.get(e):void 0}function kf(e){return xf.has(e)}function $f(e,t){const n=xf.get(e);return n&&n.metadata[t]}function Ef(e){return $f(e,cf)}function Af(e){return $f(e,ff)}function Df(e){return $f(e,df)}function Sf(e){return $f(e,Xc)}function Cf(e){return $f(e,hf)}function Ff(e){return $f(e,nf)}wf("identity",(function e(t){var n;function i(e){return null==e||isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,Ll.A),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Ll.A):[0,1],(0,Bl.C)(i)})),wf(Hc,Bl.A,cf),wf(Xc,(function e(){const t=Vl((0,Ul.Gu)()).domain([1,10]);return t.copy=()=>(0,Ul.C)(t,e()).base(t.base()),jl.C.apply(t,arguments),t}),[cf,Xc]),wf(Vc,eu,cf),wf(Kc,(function(){return eu.apply(null,arguments).exponent(.5)}),cf),wf(Qc,(function e(){var t=iu((0,Ul.Gu)());return t.copy=function(){return(0,Ul.C)(t,e()).constant(t.constant())},jl.C.apply(t,arguments)}),cf),wf(Jc,(function(){return jl.C.apply(fu(su,lu,me,ye,ee,K,xe,_e,ke,It).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[cf,pf]),wf(Zc,(function(){return jl.C.apply(fu(ou,au,ge,ve,le,Q,be,we,ke,jt).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[cf,pf]),wf(ef,gu,[cf,hf]),wf(`${ef}-${Hc}`,gu,[cf,hf]),wf(`${ef}-${Xc}`,(function e(){var t=Vl(pu()).domain([1,10]);return t.copy=function(){return mu(t,e()).base(t.base())},jl.K.apply(t,arguments)}),[cf,hf,Xc]),wf(`${ef}-${Vc}`,yu,[cf,hf]),wf(`${ef}-${Kc}`,(function(){return yu.apply(null,arguments).exponent(.5)}),[cf,hf]),wf(`${ef}-${Qc}`,(function e(){var t=iu(pu());return t.copy=function(){return mu(t,e()).constant(t.constant())},jl.K.apply(t,arguments)}),[cf,hf]),wf(`${tf}-${Hc}`,(function e(){var t=(0,Bl.C)(xu()(Ul.D_));return t.copy=function(){return mu(t,e())},jl.K.apply(t,arguments)}),[cf,hf]),wf(`${tf}-${Xc}`,(function e(){var t=Vl(xu()).domain([.1,1,10]);return t.copy=function(){return mu(t,e()).base(t.base())},jl.K.apply(t,arguments)}),[cf,hf,Xc]),wf(`${tf}-${Vc}`,bu,[cf,hf]),wf(`${tf}-${Kc}`,(function(){return bu.apply(null,arguments).exponent(.5)}),[cf,hf]),wf(`${tf}-${Qc}`,(function e(){var t=iu(xu());return t.copy=function(){return mu(t,e()).constant(t.constant())},jl.K.apply(t,arguments)}),[cf,hf]),wf(nf,(function e(){var t,n=[],i=[],r=[];function o(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=Xr(n,e/t);return a}function a(e){return null==e||isNaN(e=+e)?t:i[(0,Pl.Ay)(r,e)]}return a.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},a.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(Lr.A),o()},a.range=function(e){return arguments.length?(i=Array.from(e),o()):i.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return r.slice()},a.copy=function(){return e().domain(n).range(i).unknown(t)},jl.C.apply(a,arguments)}),[df,nf]),wf(rf,(function e(){var t,n=0,i=1,r=1,o=[.5],a=[0,1];function s(e){return null!=e&&e<=e?a[(0,Pl.Ay)(o,e,0,r)]:t}function l(){var e=-1;for(o=new Array(r);++e<r;)o[e]=((e+1)*i-(e-r)*n)/(r+1);return s}return s.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,l()):[n,i]},s.range=function(e){return arguments.length?(r=(a=Array.from(e)).length-1,l()):a.slice()},s.invertExtent=function(e){var t=a.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,o[0]]:t>=r?[o[r-1],i]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,i]).range(a).unknown(t)},jl.C.apply((0,Bl.C)(s),arguments)}),df),wf(of,_u.A,df),wf(uf,(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[((0,Pl.Ay)(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return yf.call(e,m.Ro)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=vf.call(e),i):n.slice()},i.tickFormat=function(e,n){return(0,Fu.A)(t[0],(0,m.se)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[ff,df]),wf(af,Cu,ff),wf(lf,mf,ff),wf(sf,(function(){return gf(mf().paddingInner(1))}),ff);const Mf=["clamp","base","constant","exponent"];function Of(e,t){const n=t[0],i=(0,m.se)(t)-n;return function(t){return e(n+t*i)}}function Tf(e,t,n){return vu(Rf(t||"rgb",n),e)}function zf(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function Nf(e,t,n){const i=n-t;let r,o,a;return i&&Number.isFinite(i)?(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),a=wf(o)().domain([t,n]).range([0,1]),Mf.forEach((t=>e[t]?a[t](e[t]()):0)),a):(0,m.dY)(.5)}function Rf(e,t){const n=r[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function Pf(e){if((0,m.cy)(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function Bf(e,t){for(const n in e)If(n,t(e[n]))}const Lf={};function If(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Lf[e]=t,this):Lf[e]}Bf({accent:Rc,category10:Pc,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:Bc,observable10:Lc,paired:Ic,pastel1:Uc,pastel2:jc,set1:qc,set2:Wc,set3:Gc,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"},Pf),Bf({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"},(e=>Tf(Pf(e))));const Uf="symbol",jf="discrete",qf=e=>(0,m.cy)(e)?e.map((e=>String(e))):String(e),Wf=(e,t)=>e[1]-t[1],Gf=(e,t)=>t[1]-e[1];function Yf(e,t,n){let i;return(0,m.Et)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor((0,m.Ln)(e.domain())/n||1)+1))),(0,m.Gv)(t)&&(i=t.step,t=t.interval),(0,m.Kg)(t)&&(t=e.type===Jc?dt(t):e.type==Zc?ht(t):(0,m.z3)("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function Hf(e,t,n){let i=e.range(),r=i[0],o=(0,m.se)(i),a=Wf;if(r>o&&(i=o,o=r,r=i,a=Gf),r=Math.floor(r),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>r<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],(0,m.se)(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function Xf(e,t){return e.bins?Hf(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Vf(e,t,n,i,r,o){const a=t.type;let s=qf;if(a===Jc||r===Jc)s=e.timeFormat(i);else if(a===Zc||r===Zc)s=e.utcFormat(i);else if(Sf(a)){const r=e.formatFloat(i);if(o||t.bins)s=r;else{const e=Kf(t,n,!1);s=t=>e(t)?r(t):""}}else if(t.tickFormat){const r=t.domain();s=e.formatSpan(r[0],r[r.length-1],n,i)}else i&&(s=e.format(i));return s}function Kf(e,t,n){const i=Xf(e,t),r=e.base(),o=Math.log(r),a=Math.max(1,r*t/i.length),s=e=>{let t=e/Math.pow(r,Math.round(Math.log(e)/o));return t*r<r-.5&&(t*=r),t<=a};return n?i.filter(s):s}const Qf={[nf]:"quantiles",[rf]:"thresholds",[of]:"domain"},Jf={[nf]:"quantiles",[rf]:"domain"};function Zf(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=(0,m.se)(e),t}(e.bins):e.type===Xc?Kf(e,t,!0):Qf[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[Qf[e.type]]()):Xf(e,t)}const ed=e=>Qf[e.type]||e.bins;function td(e,t,n,i,r,o,a){const s=Jf[t.type]&&o!==Jc&&o!==Zc?function(e,t,n){const i=t[Jf[t.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 e.formatSpan(0,a,30,n)}(e,t,r):Vf(e,t,n,r,o,a);return i===Uf&&ed(t)?nd(s):i===jf?rd(s):od(s)}const nd=e=>(t,n,i)=>{const r=id(i[n+1],id(i.max,1/0)),o=ad(t,e),a=ad(r,e);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},id=(e,t)=>null!=e?e:t,rd=e=>(t,n)=>n?e(t):null,od=e=>t=>e(t),ad=(e,t)=>Number.isFinite(e)?t(e):null;function sd(e,t,n,i){const r=i||t.type;return(0,m.Kg)(n)&&$f(r,pf)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==Jc?n||r!==Zc?td(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function ld(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=sd(e,t,n.format,n.formatType);if(Df(t.type)){const e=Zf(t).slice(1).map(r),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(Af(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>i?e.slice(0,i-2).map(r).join(", ")+", ending with "+e.slice(-1).map(r):e.map(r).join(", ")}`}{const e=t.domain();return`values from ${r(e[0])} to ${r((0,m.se)(e))}`}}let ud=0;const cd="p_";function fd(e){return e&&e.gradient}function dd(e,t,n){const i=e.gradient;let r=e.id,o="radial"===i?cd:"";return r||(r=e.id="gradient_"+ud++,"radial"===i?(e.x1=hd(e.x1,.5),e.y1=hd(e.y1,.5),e.r1=hd(e.r1,0),e.x2=hd(e.x2,.5),e.y2=hd(e.y2,.5),e.r2=hd(e.r2,.5),o=cd):(e.x1=hd(e.x1,0),e.y1=hd(e.y1,0),e.x2=hd(e.x2,1),e.y2=hd(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function hd(e,t){return null!=e?e:t}function pd(e,t){var n,i=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:i,stop:function(e,t){return i.push({offset:e,color:t}),n}}}const md={basis:{curve:function(e){return new ws(e)}},"basis-closed":{curve:function(e){return new $s(e)}},"basis-open":{curve:function(e){return new Es(e)}},bundle:{curve:Ds,tension:"beta",value:.85},cardinal:{curve:Fs,tension:"tension",value:0},"cardinal-open":{curve:Os,tension:"tension",value:0},"cardinal-closed":{curve:zs,tension:"tension",value:0},"catmull-rom":{curve:Vs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Qs,tension:"alpha",value:.5},"catmull-rom-open":{curve:Zs,tension:"alpha",value:.5},linear:{curve:tl},"linear-closed":{curve:function(e){return new nl(e)}},monotone:{horizontal:function(e){return new ll(e)},vertical:function(e){return new sl(e)}},natural:{curve:function(e){return new cl(e)}},step:{curve:function(e){return new dl(e,.5)}},"step-after":{curve:function(e){return new dl(e,1)}},"step-before":{curve:function(e){return new dl(e,0)}}};function gd(e,t,n){var i=(0,m.mQ)(md,e)&&md[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const yd={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},vd=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,xd=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,bd=/^((\s+,?\s*)|(,\s*))/,_d=/^[01]/;function wd(e){const t=[];return(e.match(vd)||[]).forEach((e=>{let n=e[0];const i=n.toLowerCase(),r=yd[i],o=function(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const t="a"!==e||3!==o&&4!==o?xd:_d,a=n.slice(r).match(t);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(bd);null!==s&&(r+=s[0].length)}return i}(i,r,e.slice(1).trim()),a=o.length;if(a<r||a&&a%r!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([n,...o.slice(0,r)]),a!==r){"m"===i&&(n="M"===n?"L":"l");for(let e=r;e<a;e+=r)t.push([n,...o.slice(e,e+r)])}})),t}const kd=Math.PI/180,$d=Math.PI/2,Ed=2*Math.PI,Ad=Math.sqrt(3)/2;var Dd={},Sd={},Cd=[].join;function Fd(e){const t=Cd.call(e);if(Sd[t])return Sd[t];var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7];const c=u*a,f=-l*s,d=l*a,h=u*s,p=Math.cos(r),m=Math.sin(r),g=Math.cos(o),y=Math.sin(o),v=.5*(o-r),x=Math.sin(.5*v),b=8/3*x*x/Math.sin(v),_=n+p-b*m,w=i+m+b*p,k=n+g,$=i+y,E=k+b*y,A=$-b*g;return Sd[t]=[c*_+f*w,d*_+h*w,c*E+f*A,d*E+h*A,c*k+f*$,d*k+h*$]}const Md=["l",0,0,0,0,0,0,0];function Od(e,t,n){const i=Md[0]=e[0];if("a"===i||"A"===i)Md[1]=t*e[1],Md[2]=n*e[2],Md[3]=e[3],Md[4]=e[4],Md[5]=e[5],Md[6]=t*e[6],Md[7]=n*e[7];else if("h"===i||"H"===i)Md[1]=t*e[1];else if("v"===i||"V"===i)Md[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)Md[r]=(r%2==1?t:n)*e[r];return Md}function Td(e,t,n,i,r,o){var a,s,l,u,c,f=null,d=0,h=0,p=0,m=0,g=0,y=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),e.beginPath&&e.beginPath();for(var v=0,x=t.length;v<x;++v){switch(a=t[v],1===r&&1===o||(a=Od(a,r,o)),a[0]){case"l":d+=a[1],h+=a[2],e.lineTo(d+n,h+i);break;case"L":d=a[1],h=a[2],e.lineTo(d+n,h+i);break;case"h":d+=a[1],e.lineTo(d+n,h+i);break;case"H":d=a[1],e.lineTo(d+n,h+i);break;case"v":h+=a[1],e.lineTo(d+n,h+i);break;case"V":h=a[1],e.lineTo(d+n,h+i);break;case"m":g=d+=a[1],y=h+=a[2],e.moveTo(d+n,h+i);break;case"M":g=d=a[1],y=h=a[2],e.moveTo(d+n,h+i);break;case"c":s=d+a[5],l=h+a[6],p=d+a[3],m=h+a[4],e.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,m+i,s+n,l+i),d=s,h=l;break;case"C":d=a[5],h=a[6],p=a[3],m=a[4],e.bezierCurveTo(a[1]+n,a[2]+i,p+n,m+i,d+n,h+i);break;case"s":s=d+a[3],l=h+a[4],p=2*d-p,m=2*h-m,e.bezierCurveTo(p+n,m+i,d+a[1]+n,h+a[2]+i,s+n,l+i),p=d+a[1],m=h+a[2],d=s,h=l;break;case"S":s=a[3],l=a[4],p=2*d-p,m=2*h-m,e.bezierCurveTo(p+n,m+i,a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],m=a[2];break;case"q":s=d+a[3],l=h+a[4],p=d+a[1],m=h+a[2],e.quadraticCurveTo(p+n,m+i,s+n,l+i),d=s,h=l;break;case"Q":s=a[3],l=a[4],e.quadraticCurveTo(a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],m=a[2];break;case"t":s=d+a[1],l=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,m=h):"t"===f[0]?(p=2*d-u,m=2*h-c):"q"===f[0]&&(p=2*d-p,m=2*h-m),u=p,c=m,e.quadraticCurveTo(p+n,m+i,s+n,l+i),h=l,p=(d=s)+a[1],m=h+a[2];break;case"T":s=a[1],l=a[2],p=2*d-p,m=2*h-m,e.quadraticCurveTo(p+n,m+i,s+n,l+i),d=s,h=l;break;case"a":zd(e,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":zd(e,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=y,e.closePath()}f=a}}function zd(e,t,n,i){const r=function(e,t,n,i,r,o,a,s,l){const u=Cd.call(arguments);if(Dd[u])return Dd[u];const c=a*kd,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(l-t)*.5,p=d*(l-t)*.5-f*(s-e)*.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,y=f/n,v=-f/i,x=d/i,b=g*s+y*l,_=v*s+x*l,w=g*e+y*t,k=v*e+x*t;let $=1/((w-b)*(w-b)+(k-_)*(k-_))-.25;$<0&&($=0);let E=Math.sqrt($);o==r&&(E=-E);const A=.5*(b+w)-E*(k-_),D=.5*(_+k)+E*(w-b),S=Math.atan2(_-D,b-A);let C=Math.atan2(k-D,w-A)-S;C<0&&1===o?C+=Ed:C>0&&0===o&&(C-=Ed);const F=Math.ceil(Math.abs(C/($d+.001))),M=[];for(let O=0;O<F;++O){const e=S+O*C/F,t=S+(O+1)*C/F;M[O]=[A,D,e,t,n,i,f,d]}return Dd[u]=M}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const t=Fd(r[o]);e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}const Nd=.5773502691896257,Rd={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Ed)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n,r=i-n*Nd,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n,r=i-n*Nd;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ad*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function Pd(e){return(0,m.mQ)(Rd,e)?Rd[e]:function(e){if(!(0,m.mQ)(Bd,e)){const t=wd(e);Bd[e]={draw:function(e,n){Td(e,t,0,0,Math.sqrt(n)/2)}}}return Bd[e]}(e)}var Bd={};const Ld=.448084975506;function Id(e){return e.x}function Ud(e){return e.y}function jd(e){return e.width}function qd(e){return e.height}function Wd(e){return"function"===typeof e?e:()=>+e}function Gd(e,t,n){return Math.max(t,Math.min(e,n))}function Yd(){var e=Id,t=Ud,n=jd,i=qd,r=Wd(0),o=r,a=r,s=r,l=null;function u(u,c,f){var d,h=null!=c?c:+e.call(this,u),p=null!=f?f:+t.call(this,u),m=+n.call(this,u),g=+i.call(this,u),y=Math.min(m,g)/2,v=Gd(+r.call(this,u),0,y),x=Gd(+o.call(this,u),0,y),b=Gd(+a.call(this,u),0,y),_=Gd(+s.call(this,u),0,y);if(l||(l=d=bl()),v<=0&&x<=0&&b<=0&&_<=0)l.rect(h,p,m,g);else{var w=h+m,k=p+g;l.moveTo(h+v,p),l.lineTo(w-x,p),l.bezierCurveTo(w-Ld*x,p,w,p+Ld*x,w,p+x),l.lineTo(w,k-_),l.bezierCurveTo(w,k-Ld*_,w-Ld*_,k,w-_,k),l.lineTo(h+b,k),l.bezierCurveTo(h+Ld*b,k,h,k-Ld*b,h,k-b),l.lineTo(h,p+v),l.bezierCurveTo(h,p+Ld*v,h+Ld*v,p,h+v,p),l.closePath()}if(d)return l=null,d+""||null}return u.x=function(t){return arguments.length?(e=Wd(t),u):e},u.y=function(e){return arguments.length?(t=Wd(e),u):t},u.width=function(e){return arguments.length?(n=Wd(e),u):n},u.height=function(e){return arguments.length?(i=Wd(e),u):i},u.cornerRadius=function(e,t,n,i){return arguments.length?(r=Wd(e),o=null!=t?Wd(t):r,s=null!=n?Wd(n):r,a=null!=i?Wd(i):o,u):r},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}function Hd(){var e,t,n,i,r,o,a,s,l=null;function u(e,t,n){const i=n/2;if(r){var u=a-t,c=e-o;if(u||c){var f=Math.hypot(u,c),d=(u/=f)*s,h=(c/=f)*s,p=Math.atan2(c,u);l.moveTo(o-d,a-h),l.lineTo(e-u*i,t-c*i),l.arc(e,t,i,p-Math.PI,p),l.lineTo(o+d,a+h),l.arc(o,a,s,p,p+Math.PI)}else l.arc(e,t,i,0,Ed);l.closePath()}else r=1;o=e,a=t,s=i}function c(o){var a,s,c,f=o.length,d=!1;for(null==l&&(l=c=bl()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&u(+e(s,a,o),+t(s,a,o),+n(s,a,o));if(c)return l=null,c+""||null}return c.x=function(t){return arguments.length?(e=t,c):e},c.y=function(e){return arguments.length?(t=e,c):t},c.size=function(e){return arguments.length?(n=e,c):n},c.defined=function(e){return arguments.length?(i=e,c):i},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}function Xd(e,t){return null!=e?e:t}const Vd=e=>e.x||0,Kd=e=>e.y||0,Qd=e=>!(!1===e.defined),Jd=function(){var e=wl,t=kl,n=hl(0),i=null,r=$l,o=El,a=Al,s=null,l=_l(u);function u(){var u,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=r.apply(this,arguments)-Ws,p=o.apply(this,arguments)-Ws,m=Ns(p-h),g=p>h;if(s||(s=u=l()),d<f&&(c=d,d=f,f=c),d>js)if(m>Gs-js)s.moveTo(d*Ps(h),d*Is(h)),s.arc(0,0,d,h,p,!g),f>js&&(s.moveTo(f*Ps(p),f*Is(p)),s.arc(0,0,f,p,h,g));else{var y,v,x=h,b=p,_=h,w=p,k=m,$=m,E=a.apply(this,arguments)/2,A=E>js&&(i?+i.apply(this,arguments):Us(f*f+d*d)),D=Ls(Ns(d-f)/2,+n.apply(this,arguments)),S=D,C=D;if(A>js){var F=Ys(A/f*Is(E)),M=Ys(A/d*Is(E));(k-=2*F)>js?(_+=F*=g?1:-1,w-=F):(k=0,_=w=(h+p)/2),($-=2*M)>js?(x+=M*=g?1:-1,b-=M):($=0,x=b=(h+p)/2)}var O=d*Ps(x),T=d*Is(x),z=f*Ps(w),N=f*Is(w);if(D>js){var R,P=d*Ps(b),B=d*Is(b),L=f*Ps(_),I=f*Is(_);if(m<qs)if(R=function(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=a-r,f=s-o,d=f*l-c*u;if(!(d*d<js))return[e+(d=(c*(t-o)-f*(e-r))/d)*l,t+d*u]}(O,T,L,I,P,B,z,N)){var U=O-R[0],j=T-R[1],q=P-R[0],W=B-R[1],G=1/Is(function(e){return e>1?0:e<-1?qs:Math.acos(e)}((U*q+j*W)/(Us(U*U+j*j)*Us(q*q+W*W)))/2),Y=Us(R[0]*R[0]+R[1]*R[1]);S=Ls(D,(f-Y)/(G-1)),C=Ls(D,(d-Y)/(G+1))}else S=C=0}$>js?C>js?(y=Dl(L,I,O,T,d,C,g),v=Dl(P,B,z,N,d,C,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),C<D?s.arc(y.cx,y.cy,C,Rs(y.y01,y.x01),Rs(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,C,Rs(y.y01,y.x01),Rs(y.y11,y.x11),!g),s.arc(0,0,d,Rs(y.cy+y.y11,y.cx+y.x11),Rs(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,C,Rs(v.y11,v.x11),Rs(v.y01,v.x01),!g))):(s.moveTo(O,T),s.arc(0,0,d,x,b,!g)):s.moveTo(O,T),f>js&&k>js?S>js?(y=Dl(z,N,P,B,f,-S,g),v=Dl(O,T,L,I,f,-S,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),S<D?s.arc(y.cx,y.cy,S,Rs(y.y01,y.x01),Rs(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,S,Rs(y.y01,y.x01),Rs(y.y11,y.x11),!g),s.arc(0,0,f,Rs(y.cy+y.y11,y.cx+y.x11),Rs(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,S,Rs(v.y11,v.x11),Rs(v.y01,v.x01),!g))):s.arc(0,0,f,w,_,g):s.lineTo(z,N)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-qs/2;return[Ps(i)*n,Is(i)*n]},u.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:hl(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:hl(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"===typeof e?e:hl(+e),u):n},u.padRadius=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:hl(+e),u):i},u.startAngle=function(e){return arguments.length?(r="function"===typeof e?e:hl(+e),u):r},u.endAngle=function(e){return arguments.length?(o="function"===typeof e?e:hl(+e),u):o},u.padAngle=function(e){return arguments.length?(a="function"===typeof e?e:hl(+e),u):a},u.context=function(e){return arguments.length?(s=null==e?null:e,u):s},u}().startAngle((e=>e.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),Zd=Ol().x(Vd).y1(Kd).y0((e=>(e.y||0)+(e.height||0))).defined(Qd),eh=Ol().y(Kd).x1(Vd).x0((e=>(e.x||0)+(e.width||0))).defined(Qd),th=Ml().x(Vd).y(Kd).defined(Qd),nh=Yd().x(Vd).y(Kd).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>Xd(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>Xd(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>Xd(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>Xd(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),ih=function(e,t){let n=null,i=_l(r);function r(){let r;if(n||(n=r=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"===typeof e?e:hl(e||Tl),t="function"===typeof t?t:hl(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"===typeof t?t:hl(t),r):e},r.size=function(e){return arguments.length?(t="function"===typeof e?e:hl(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type((e=>Pd(e.shape||"circle"))).size((e=>Xd(e.size,64))),rh=Hd().x(Vd).y(Kd).defined(Qd).size((e=>e.size||1));function oh(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function ah(e,t,n,i){return nh.context(e)(t,n,i)}var sh=1;function lh(){sh=1}function uh(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+sh++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,m.Tn)(i)?a.path=i(null):oh(n)?a.path=ah(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function ch(e){this.clear(),e&&this.union(e)}function fh(e){this.mark=e,this.bounds=this.bounds||new ch}function dh(e){fh.call(this,e),this.items=this.items||[]}ch.prototype={clone(){return new ch(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:a}=this,s=Math.cos(e),l=Math.sin(e),u=t-t*s+n*l,c=n-t*l-n*s;return[s*i-l*r+u,l*i+s*r+c,s*i-l*a+u,l*i+s*a+c,s*o-l*r+u,l*o+s*r+c,s*o-l*a+u,l*o+s*a+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,m.B)(dh,fh);class hh{constructor(e){this._pending=0,this._loader=e||Ki()}pending(){return this._pending}sanitizeURL(e){const t=this;return ph(t),t._loader.sanitize(e,{context:"href"}).then((e=>(mh(t),e))).catch((()=>(mh(t),null)))}loadImage(e){const t=this,n=Rl();return ph(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const i=e.href;if(!i||!n)throw{url:i};const r=new n,o=(0,m.mQ)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>mh(t),r.onerror=()=>mh(t),r.src=i,r})).catch((e=>(mh(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))}ready(){const e=this;return new Promise((t=>{!function n(i){e.pending()?setTimeout((()=>{n(!0)}),10):t(i)}(!1)}))}}function ph(e){e._pending+=1}function mh(e){e._pending-=1}function gh(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const i=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(i+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,i):0))}return e}const yh=Ed-1e-8;let vh,xh,bh,_h,wh,kh,$h,Eh;const Ah=(e,t)=>vh.add(e,t),Dh=(e,t)=>Ah(xh=e,bh=t),Sh=e=>Ah(e,vh.y1),Ch=e=>Ah(vh.x1,e),Fh=(e,t)=>wh*e+$h*t,Mh=(e,t)=>kh*e+Eh*t,Oh=(e,t)=>Ah(Fh(e,t),Mh(e,t)),Th=(e,t)=>Dh(Fh(e,t),Mh(e,t));function zh(e,t){return vh=e,t?(_h=t*kd,wh=Eh=Math.cos(_h),kh=Math.sin(_h),$h=-kh):(wh=Eh=1,_h=kh=$h=0),Nh}const Nh={beginPath(){},closePath(){},moveTo:Th,lineTo:Th,rect(e,t,n,i){_h?(Oh(e+n,t),Oh(e+n,t+i),Oh(e,t+i),Th(e,t)):(Ah(e+n,t+i),Dh(e,t))},quadraticCurveTo(e,t,n,i){const r=Fh(e,t),o=Mh(e,t),a=Fh(n,i),s=Mh(n,i);Rh(xh,r,a,Sh),Rh(bh,o,s,Ch),Dh(a,s)},bezierCurveTo(e,t,n,i,r,o){const a=Fh(e,t),s=Mh(e,t),l=Fh(n,i),u=Mh(n,i),c=Fh(r,o),f=Mh(r,o);Ph(xh,a,l,c,Sh),Ph(bh,s,u,f,Ch),Dh(c,f)},arc(e,t,n,i,r,o){if(i+=_h,r+=_h,xh=n*Math.cos(r)+e,bh=n*Math.sin(r)+t,Math.abs(r-i)>yh)Ah(e-n,t-n),Ah(e+n,t+n);else{const a=i=>Ah(n*Math.cos(i)+e,n*Math.sin(i)+t);let s,l;if(a(i),a(r),r!==i)if((i%=Ed)<0&&(i+=Ed),(r%=Ed)<0&&(r+=Ed),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=Ed,s=i-i%$d,l=0;l<4&&s>r;++l,s-=$d)a(s);else for(s=i-i%$d+$d,l=0;l<4&&s<r;++l,s+=$d)a(s)}}};function Rh(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function Ph(e,t,n,i,r){const o=i-e+3*t-3*n,a=e+n-2*t,s=e-t;let l,u=0,c=0;Math.abs(o)>1e-14?(l=a*a+s*o,l>=0&&(l=Math.sqrt(l),u=(-a+l)/o,c=(-a-l)/o)):u=.5*s/a,0<u&&u<1&&r(Bh(u,e,t,n,i)),0<c&&c<1&&r(Bh(c,e,t,n,i))}function Bh(e,t,n,i,r){const o=1-e,a=o*o,s=e*e;return a*o*t+3*a*e*n+3*o*s*i+s*e*r}var Lh=(Lh=Nl(1,1))?Lh.getContext("2d"):null;const Ih=new ch;function Uh(e){return function(t,n){if(!Lh)return!0;e(Lh,t),Ih.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=Ih;for(let e=r;e<=a;++e)for(let t=i;t<=o;++t)if(Lh.isPointInPath(t,e))return!0;return!1}}function jh(e,t){return t.contains(e.x||0,e.y||0)}function qh(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(Ih.set(n,i,n+r,i+o))}function Wh(e,t){const n=e.x||0,i=e.y||0;return Gh(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}function Gh(e,t,n,i,r){const{x1:o,y1:a,x2:s,y2:l}=e,u=i-t,c=r-n;let f,d,h,p,m=0,g=1;for(p=0;p<4;++p){if(0===p&&(f=-u,d=-(o-t)),1===p&&(f=u,d=s-t),2===p&&(f=-c,d=-(a-n)),3===p&&(f=c,d=l-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 Yh(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Hh(e,t){return null==e?t:e}function Xh(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Vh(e,t,n){return fd(n)?function(e,t,n){const i=n.width(),r=n.height();let o;if("radial"===t.gradient)o=e.createRadialGradient(n.x1+Hh(t.x1,.5)*i,n.y1+Hh(t.y1,.5)*r,Math.max(i,r)*Hh(t.r1,0),n.x1+Hh(t.x2,.5)*i,n.y1+Hh(t.y2,.5)*r,Math.max(i,r)*Hh(t.r2,.5));else{const a=Hh(t.x1,0),s=Hh(t.y1,0),l=Hh(t.x2,1),u=Hh(t.y2,0);if(a!==l&&s!==u&&i!==r){const n=Nl(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=Xh(o.createLinearGradient(a,s,l,u),t.stops),o.fillRect(0,0,i,r),e.createPattern(n,"no-repeat")}o=e.createLinearGradient(n.x1+a*i,n.y1+s*r,n.x1+l*i,n.y1+u*r)}return Xh(o,t.stops)}(e,n,t.bounds):n}function Kh(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=Vh(e,t,t.fill),!0)}var Qh=[];function Jh(e,t,n){var i=null!=(i=t.strokeWidth)?i:1;return!(i<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=Vh(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Qh),e.lineDashOffset=t.strokeDashOffset||0),!0))}function Zh(e,t){return e.zindex-t.zindex||e.index-t.index}function ep(e){if(!e.zdirty)return e.zitems;var t,n,i,r=e.items,o=[];for(n=0,i=r.length;n<i;++n)(t=r[n]).index=n,t.zindex&&o.push(t);return e.zdirty=!1,e.zitems=o.sort(Zh)}function tp(e,t){var n,i,r=e.items;if(!r||!r.length)return;const o=ep(e);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||t(r[n]);r=o}for(n=0,i=r.length;n<i;++n)t(r[n])}function np(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const o=ep(e);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=t(r[i]))return n;if(r===o)for(i=(r=e.items).length;--i>=0;)if(!r[i].zindex&&(n=t(r[i])))return n;return null}function ip(e){return function(t,n,i){tp(n,(n=>{i&&!i.intersects(n.bounds)||op(e,t,n,n)}))}}function rp(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||op(e,t,n.items[0],n.items)}}function op(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(Yh(t,n),n.fill&&Kh(t,n,r)&&t.fill(),n.stroke&&Jh(t,n,r)&&t.stroke()))}function ap(e){return e=e||m.vN,function(t,n,i,r,o,a){return i*=t.pixelRatio,r*=t.pixelRatio,np(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,i,r,o,a)?n:void 0}))}}function sp(e,t){return function(n,i,r,o){var a,s,l=Array.isArray(i)?i[0]:i,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(a=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,i)&&(u&&n.isPointInPath(r,o)||c&&n.isPointInStroke(r,o))}}function lp(e){return ap(sp(e))}function up(e,t){return"translate("+e+","+t+")"}function cp(e){return"rotate("+e+")"}function fp(e){return up(e.x||0,e.y||0)}function dp(e,t,n){function i(e,n){var i=n.x||0,r=n.y||0,o=n.angle||0;e.translate(i,r),o&&e.rotate(o*=kd),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-i,-r)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return up(e.x||0,e.y||0)+(e.angle?" "+cp(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(zh(e,n.angle),n),gh(e,n).translate(n.x||0,n.y||0)},draw:ip(i),pick:lp(i),isect:n||Uh(i)}}var hp=dp("arc",(function(e,t){return Jd.context(e)(t)}));function pp(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=sp(i);return{type:e,tag:"path",nested:!0,attr:function(e,n){var i=n.mark.items;i.length&&e("d",t(null,i))},bound:function(e,n){var i=n.items;return 0===i.length?e:(t(zh(e),i),gh(e,i[0]))},draw:rp(i),pick:function(e,t,n,i,o,a){var s=t.items,l=t.bounds;return!s||!s.length||l&&!l.contains(o,a)?null:(n*=e.pixelRatio,i*=e.pixelRatio,r(e,s,n,i)?s[0]:null)},isect:jh,tip:n}}var mp=pp("area",(function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?eh:Zd).curve(gd(i,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,i,r="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(i=Math.abs(e[a][o]-r))<s&&(s=i,n=e[a]);return n}));function gp(e,t){e.beginPath(),oh(t)?ah(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function yp(e){const t=Hh(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function vp(e,t){const n=yp(t);e("d",ah(null,t,n,n))}function xp(e,t,n,i){const r=yp(t);e.beginPath(),ah(e,t,(n||0)+r,(i||0)+r)}const bp=sp(xp),_p=sp(xp,!1),wp=sp(xp,!0);var kp={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",fp(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let t=0;t<i;++t)e.union(n[t].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),gh(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n,i){tp(t,(t=>{const r=t.x||0,o=t.y||0,a=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(xp(e,t,r,o),Yh(e,t),t.fill&&Kh(e,t,s)&&e.fill(),t.stroke&&!a&&Jh(e,t,s)&&e.stroke()),e.save(),e.translate(r,o),t.clip&&gp(e,t),n&&n.translate(-r,-o),tp(t,(t=>{("group"===t.marktype||null==i||i.includes(t.marktype))&&this.draw(e,t,n,i)})),n&&n.translate(r,o),e.restore(),a&&t.stroke&&s&&(xp(e,t,r,o),Yh(e,t),Jh(e,t,s)&&e.stroke())}))},pick:function(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const a=n*e.pixelRatio,s=i*e.pixelRatio;return np(t,(l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(r,o))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),m=l.clip;if(m&&(r<c||r>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,m&&oh(l)&&!wp(e,l,a,s))return e.restore(),null;const g=l.strokeForeground,y=!1!==t.interactive;return y&&g&&l.stroke&&_p(e,l,a,s)?(e.restore(),l):(u=np(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,i,c,f):null)),!u&&y&&(l.fill||!g&&l.stroke)&&bp(e,l,a,s)&&(u=l),e.restore(),u||null)}))},isect:qh,content:function(e,t,n){e("clip-path",t.clip?uh(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),vp(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?vp(e,t):e("d","")}},$p={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Ep(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function Ap(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function Dp(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Sp(e,t){return"center"===e?t/2:"right"===e?t:0}function Cp(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Fp={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=Ep(t,n),r=Ap(t,i),o=Dp(t,i),a=(t.x||0)-Sp(t.align,r),s=(t.y||0)-Cp(t.baseline,o);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",$p["xmlns:xlink"],"xlink:href"),e("transform",up(a,s)),e("width",r),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=Ap(t,n),r=Dp(t,n),o=(t.x||0)-Sp(t.align,i),a=(t.y||0)-Cp(t.baseline,r);return e.set(o,a,o+i,a+r)},draw:function(e,t,n){tp(t,(t=>{if(n&&!n.intersects(t.bounds))return;const i=Ep(t,this);let r=Ap(t,i),o=Dp(t,i);if(0===r||0===o)return;let a,s,l,u,c=(t.x||0)-Sp(t.align,r),f=(t.y||0)-Cp(t.baseline,o);!1!==t.aspect&&(s=i.width/i.height,l=t.width/t.height,s===s&&l===l&&s!==l&&(l<s?(u=r/s,f+=(o-u)/2,o=u):(u=o*s,c+=(r-u)/2,r=u))),(i.complete||i.toDataURL)&&(Yh(e,t),e.globalAlpha=null!=(a=t.opacity)?a:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,c,f,r,o))}))},pick:ap(),isect:m.vN,get:Ep,xOffset:Sp,yOffset:Cp},Mp=pp("line",(function(e,t){const n=t[0],i=n.interpolate||"linear";return th.curve(gd(i,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,i,r=Math.pow(e[0].strokeWidth||1,2),o=e.length;--o>=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(i=e[o].y-t[1])*i<r)return e[o];return null}));function Op(e,t){var n=t.path;if(null==n)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,a=t.scaleY||1,s=(t.angle||0)*kd,l=t.pathCache;l&&l.path===n||((t.pathCache=l=wd(n)).path=n),s&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(s),Td(e,l,0,0,o,a),e.rotate(-s),e.translate(-i,-r)):Td(e,l,i,r,o,a)}var Tp={type:"path",tag:"path",nested:!1,attr:function(e,t){var n=t.scaleX||1,i=t.scaleY||1;1===n&&1===i||e("vector-effect","non-scaling-stroke"),e("transform",function(e){return up(e.x||0,e.y||0)+(e.angle?" "+cp(e.angle):"")+(e.scaleX||e.scaleY?" "+function(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}(t)),e("d",t.path)},bound:function(e,t){return Op(zh(e,t.angle),t)?e.set(0,0,0,0):gh(e,t,!0)},draw:ip(Op),pick:lp(Op),isect:Uh(Op)};function zp(e,t){e.beginPath(),ah(e,t)}var Np={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",ah(null,t))},bound:function(e,t){var n,i;return gh(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:ip(zp),pick:lp(zp),isect:qh};function Rp(e,t,n){var i,r,o,a;return!(!t.stroke||!Jh(e,t,n))&&(i=t.x||0,r=t.y||0,o=null!=t.x2?t.x2:i,a=null!=t.y2?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,a),!0)}var Pp={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",fp(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function(e,t){var n,i;return gh(e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i),t)},draw:function(e,t,n){tp(t,(t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&Rp(e,t,i)&&(Yh(e,t),e.stroke())}}))},pick:ap((function(e,t,n,i){return!!e.isPointInStroke&&(Rp(e,t,1)&&e.isPointInStroke(n,i))})),isect:Wh},Bp=dp("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),Lp=dp("symbol",(function(e,t){return ih.context(e)(t)}),jh);const Ip=(0,m.EV)();var Up={height:Hp,measureWidth:Gp,estimateWidth:qp,width:qp,canvas:jp};function jp(e){Up.width=e&&Lh?Gp:qp}function qp(e,t){return Wp(Qp(e,t),Hp(e))}function Wp(e,t){return~~(.8*e.length*t)}function Gp(e,t){return Hp(e)<=0||!(t=Qp(e,t))?0:Yp(t,Zp(e))}function Yp(e,t){const n=`(${t}) ${e}`;let i=Ip.get(n);return void 0===i&&(Lh.font=t,i=Lh.measureText(e).width,Ip.set(n,i)),i}function Hp(e){return null!=e.fontSize?+e.fontSize||0:11}function Xp(e){return null!=e.lineHeight?e.lineHeight:Hp(e)+2}function Vp(e){return t=e.lineBreak&&e.text&&!(0,m.cy)(e.text)?e.text.split(e.lineBreak):e.text,(0,m.cy)(t)?t.length>1?t:t[0]:t;var t}function Kp(e){const t=Vp(e);return((0,m.cy)(t)?t.length-1:0)*Xp(e)}function Qp(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,i=function(e){if(Up.width===Gp){const t=Zp(e);return e=>Yp(e,t)}if(Up.width===qp){const t=Hp(e);return e=>Wp(e,t)}return t=>Up.width(e,t)}(e);if(i(t)<n)return t;var r,o=e.ellipsis||"\u2026",a="rtl"===e.dir,s=0,l=t.length;if(n-=i(o),a){for(;s<l;)r=s+l>>>1,i(t.slice(r))>n?s=r+1:l=r;return o+t.slice(s)}for(;s<l;)r=1+(s+l>>>1),i(t.slice(0,r))<n?s=r:l=r-1;return t.slice(0,s)+o}(e,n):n}function Jp(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Zp(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Hp(e)+"px "+Jp(e,t)}function em(e){var t=e.baseline,n=Hp(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*Xp(e):"line-bottom"===t?.29*n-.5*Xp(e):0)}jp(!0);const tm={left:"start",center:"middle",right:"end"},nm=new ch;function im(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-$d,n+=r*Math.cos(t),i+=r*Math.sin(t)),nm.x1=n,nm.y1=i,nm}function rm(e,t,n){var i,r=Up.height(t),o=t.align,a=im(t),s=a.x1,l=a.y1,u=t.dx||0,c=(t.dy||0)+em(t)-Math.round(.8*r),f=Vp(t);if((0,m.cy)(f)?(r+=Xp(t)*(f.length-1),i=f.reduce(((e,n)=>Math.max(e,Up.width(t,n))),0)):i=Up.width(t,f),"center"===o?u-=i/2:"right"===o&&(u-=i),e.set(u+=s,c+=l,u+i,c+r),t.angle&&!n)e.rotate(t.angle*kd,s,l);else if(2===n)return e.rotatedPoints(t.angle*kd,s,l);return e}var om={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+em(t),o=im(t),a=o.x1,s=o.y1,l=t.angle||0;e("text-anchor",tm[t.align]||"start"),l?(n=up(a,s)+" "+cp(l),(i||r)&&(n+=" "+up(i,r))):n=up(a+i,s+r),e("transform",n)},bound:rm,draw:function(e,t,n){tp(t,(t=>{var i,r,o,a,s,l,u,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=Zp(t),e.textAlign=t.align||"left",r=(i=im(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(r,o),e.rotate(t.angle*kd),r=o=0),r+=t.dx||0,o+=(t.dy||0)+em(t),l=Vp(t),Yh(e,t),(0,m.cy)(l))for(s=Xp(t),a=0;a<l.length;++a)u=Qp(t,l[a]),t.fill&&Kh(e,t,c)&&e.fillText(u,r,o),t.stroke&&Jh(e,t,c)&&e.strokeText(u,r,o),o+=s;else u=Qp(t,l),t.fill&&Kh(e,t,c)&&e.fillText(u,r,o),t.stroke&&Jh(e,t,c)&&e.strokeText(u,r,o);t.angle&&e.restore()}}))},pick:ap((function(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=im(t),s=a.x1,l=a.y1,u=rm(nm,t,1),c=-t.angle*kd,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(s-f*s+d*l),p=d*r+f*o+(l-d*s-f*l);return u.contains(h,p)})),isect:function(e,t){const n=rm(nm,e,2);return Gh(t,n[0],n[1],n[2],n[3])||Gh(t,n[0],n[1],n[4],n[5])||Gh(t,n[4],n[5],n[6],n[7])||Gh(t,n[2],n[3],n[6],n[7])}},am=pp("trail",(function(e,t){return rh.context(e)(t)}),(function(e,t){for(var n,i,r=e.length;--r>=0;)if(!1!==e[r].defined&&(n=e[r].x-t[0])*n+(i=e[r].y-t[1])*i<(n=e[r].size||1)*n)return e[r];return null})),sm={arc:hp,area:mp,group:kp,image:Fp,line:Mp,path:Tp,rect:Np,rule:Pp,shape:Bp,symbol:Lp,text:om,trail:am};function lm(e,t,n){var i=sm[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new ch),e,n)}var um={mark:null};function cm(e,t,n){var i,r,o,a,s=sm[e.marktype],l=s.bound,u=e.items,c=u&&u.length;if(s.nested)return c?o=u[0]:(um.mark=e,o=um),a=lm(o,l,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new ch,c)for(i=0,r=u.length;i<r;++i)t.union(lm(u[i],l,n));return e.bounds=t}const fm=["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 dm(e,t){return JSON.stringify(e,fm,t)}function hm(e){return pm("string"===typeof e?JSON.parse(e):e)}function pm(e){var t,n,i,r=e.marktype,o=e.items;if(o)for(n=0,i=o.length;n<i;++n)t=r?"mark":"group",o[n][t]=e,o[n].zindex&&(o[n][t].zdirty=!0),"group"===(r||t)&&pm(o[n]);return r&&cm(e),e}class mm{constructor(e){arguments.length?this.root=hm(e):(this.root=gm({marktype:"group",name:"root",role:"frame"}),this.root.items=[new dh(this.root)])}toJSON(e){return dm(this.root,e||0)}mark(e,t,n){const i=gm(e,t=t||this.root.items[0]);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}}function gm(e,t){const n={bounds:new ch,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return null!=e.aria&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function ym(e,t,n){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function vm(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function xm(e,t,n,i){var r,o=e.childNodes[t];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=ym(e.ownerDocument,n,i),e.insertBefore(o,r)),o}function bm(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function _m(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function wm(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}class km{constructor(e,t){this._active=null,this._handlers={},this._loader=e||Ki(),this._tooltip=t||$m}initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1}handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const i in t)n.push(...t[i]);return n}eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),i=ym(null,"a");for(const e in t)i.setAttribute(e,t[e]);i.dispatchEvent(n)})).catch((()=>{}))}handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,i){var r,o,a=e&&e.mark;if(a&&(r=sm[a.marktype]).tip){for((o=wm(t,n))[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=r.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}}getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,o=r.width(),a=r.height();let s=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,l+=e.y||0;return{x:s,y:l,width:o,height:a,left:s,top:l,right:s+o,bottom:l+a}}}function $m(e,t,n,i){e.element().setAttribute("title",i||"")}class Em{constructor(e){this._el=null,this._bgcolor=null,this._loader=new hh(e)}initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this}dirty(){}render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)}_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const Am="dragenter",Dm="dragleave",Sm="dragover",Cm="pointerdown",Fm="pointermove",Mm="pointerout",Om="pointerover",Tm="mousedown",zm="mousemove",Nm="mouseout",Rm="mouseover",Pm="click",Bm="mousewheel",Lm="touchstart",Im="touchmove",Um="touchend",jm=["keydown","keypress","keyup",Am,Dm,Sm,Cm,"pointerup",Fm,Mm,Om,Tm,"mouseup",zm,Nm,Rm,Pm,"dblclick","wheel",Bm,Lm,Im,Um],qm=Fm,Wm=Nm,Gm=Pm;class Ym extends km{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=jm,this.pointermove=Km([Fm,zm],[Om,Rm],[Mm,Nm]),this.dragover=Km([Sm],[Am],[Dm]),this.pointerout=Qm([Mm,Nm]),this.dragleave=Qm([Dm])}initialize(e,t,n){return this._canvas=e&&vm(e,"canvas"),[Pm,Tm,Cm,Fm,Mm,Dm].forEach((e=>Xm(this,e))),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(Bm,e)}pointerdown(e){this._down=this._active,this.fire(Cm,e)}mousedown(e){this._down=this._active,this.fire(Tm,e)}click(e){this._down===this._active&&(this.fire(Pm,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Lm,e,!0)}touchmove(e){this.fire(Im,e,!0)}touchend(e){this.fire(Um,e,!0),this._touch=null}fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===Gm&&i&&i.href?this.handleHref(t,i,i.href):e!==qm&&e!==Wm||this.handleTooltip(t,i,e!==Wm),r)for(let o=0,a=r.length;o<a;++o)r[o].handler.call(this._obj,t,i)}on(e,t){const n=this.eventName(e),i=this._handlers;return this._handlerIndex(i[n],e,t)<0&&(Xm(this,e),(i[n]||(i[n]=[])).push({type:e,handler:t})),this}off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&i.splice(r,1),this}pickEvent(e){const t=wm(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,i,r){const o=this.context();return sm[e.marktype].pick.call(this,o,e,t,n,i,r)}}const Hm=e=>e===Lm||e===Im||e===Um?[Lm,Im,Um]:[e];function Xm(e,t){Hm(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function Vm(e,t,n){t.forEach((t=>e.fire(t,n)))}function Km(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||Vm(this,n,i),this._active=o,Vm(this,t,i)),Vm(this,e,i)}}function Qm(e){return function(t){Vm(this,e,t),this._active=null}}function Jm(e,t,n,i,r,o){const a="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),l=a?"undefined"!==typeof window&&window.devicePixelRatio||1:r;e.width=t*l,e.height=n*l;for(const u in o)s[u]=o[u];return a&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=l,s.setTransform(l,0,0,l,l*i[0],l*i[1]),e}class Zm extends Em{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new ch,this._tempb=new ch}initialize(e,t,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Nl(1,1,this._options.type),e&&this._canvas&&(bm(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,t,n,i,r)}resize(e,t,n,i){if(super.resize(e,t,n,i),this._canvas)Jm(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||(0,m.z3)("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.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(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){const n=this.context(),i=this._origin,r=this._width,o=this._height,a=this._dirty,s=eg(i,r,o);n.save();const l=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio);return t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,s.intersect(a),i);return this.clear(-i[0],-i[1],r,o),this.draw(n,e,l,t),n.restore(),a.clear(),this}draw(e,t,n,i){if("group"!==t.marktype&&null!=i&&!i.includes(t.marktype))return;const r=sm[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),(0,m.Tn)(n)?(e.beginPath(),n(e),e.clip()):gp(e,t.group)}(e,t),r.draw.call(this,e,t,n,i),t.clip&&e.restore()}clear(e,t,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(e,t,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,i))}}const eg=(e,t,n)=>(new ch).set(0,0,t,n).translate(-e[0],-e[1]);class tg extends km{constructor(e,t){super(e,t);const n=this;n._hrefHandler=ng(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=ng(n,((e,t)=>{n.handleTooltip(e,t,e.type!==Wm)}))}initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(Gm,this._hrefHandler),i.removeEventListener(qm,this._tooltipHandler),i.removeEventListener(Wm,this._tooltipHandler)),this._svg=i=e&&vm(e,"svg"),i&&(i.addEventListener(Gm,this._hrefHandler),i.addEventListener(qm,this._tooltipHandler),i.addEventListener(Wm,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const r={type:e,handler:t,listener:ng(this,t)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this}off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}}const ng=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},ig="aria-hidden",rg="aria-label",og="role",ag="aria-roledescription",sg="graphics-object",lg="graphics-symbol",ug=(e,t,n)=>({[og]:e,[ag]:t,[rg]:n||void 0}),cg=(0,m.M1)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),fg={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?gg(e):null,r=e.context,o=r.scales[t.scale].value,a=r.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${Af(s)?"discrete":s} scale`+` with ${ld(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?gg(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),a=e.context,s=a.scales[r[o[0]]].value,l=a.dataflow.locale();return function(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(i)+(n?` titled '${n}'`:"")+` for ${function(e){return e=e.map((e=>e+("fill"===e||"stroke"===e?" color":""))),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+(0,m.se)(e)}(o)}`+` with ${ld(l,s,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${mg(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${mg(e)}'`}},dg={ariaRole:og,ariaRoleDescription:ag,description:rg};function hg(e,t){const n=!1===t.aria;if(e(ig,n||void 0),n||null==t.description)for(const i in dg)e(dg[i],void 0);else{const n=t.mark.marktype;e(rg,t.description),e(og,t.ariaRole||("group"===n?sg:lg)),e(ag,t.ariaRoleDescription||`${n} mark`)}}function pg(e){return!1===e.aria?{[ig]:!0}:cg[e.role]?null:fg[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return ug(t.role||lg,t.desc,n.description||i(n))}catch(n){return null}}(e,fg[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return ug(n?sg:lg,`${t} mark container`,e.description)}(e)}function mg(e){return(0,m.YO)(e.text).join(" ")}function gg(e){try{return(0,m.YO)((0,m.se)(e.items).items[0].text).join(" ")}catch(t){return null}}const yg=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),vg=e=>yg(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function xg(){let e="",t="",n="";const i=[],r=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${vg(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,r()),i.push(o)})(s),t="<"+s;for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];for(const e of u)for(const t in e)o(t,e[t]);return a},close(){const o=i.pop();return e+=t?t+(n?`>${n}</${o}>`:"/>"):`</${o}>`,r(),a},attr:o,text:e=>(n+=yg(e),a),toString:()=>e};return a}const bg=e=>_g(xg(),e)+"";function _g(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let t=0;t<i;++t)e.attr(n[t].name,n[t].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const t of n)3===t.nodeType?e.text(t.nodeValue):_g(e,t)}return e.close()}const wg={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"},kg={blend:"mix-blend-mode"},$g={fill:"none","stroke-miterlimit":10},Eg="http://www.w3.org/2000/xmlns/",Ag=$p.xmlns;class Dg extends Em{constructor(e){super(e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=xm(e,0,"svg",Ag),this._svg.setAttributeNS(Eg,"xmlns",Ag),this._svg.setAttributeNS(Eg,"xmlns:xlink",$p["xmlns:xlink"]),this._svg.setAttribute("version",$p.version),this._svg.setAttribute("class","marks"),bm(e,1),this._root=xm(this._svg,0,"g",Ag),Pg(this._root,$g),bm(this._svg,1)),this.background(this._bgcolor),super.initialize(e,t,n,i,r)}background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),super.background(...arguments)}resize(e,t,n,i){return super.resize(e,t,n,i),this._svg&&(Pg(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=xm(e,0,"rect",Ag),Pg(n,{width:this._width,height:this._height,fill:t}));const i=bg(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i}_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),bm(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))}isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,i,r,o,a,s,l;for(a=0,s=e.length;a<s;++a)n=e[a],i=n.mark,i.marktype!==r&&(r=i.marktype,o=sm[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,Sg(n,t),i.items.forEach((e=>{e.dirty=t}))),i.zdirty||(n.exit?(o.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=o.nested?i.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,Sg(n,t)),n._update=t)));return!this._dirtyAll}mark(e,t,n,i){if(!this.isDirty(t))return t._svg;const r=this._svg,o=t.marktype,a=sm[o],s=!1===t.interactive?"none":null,l="g"===a.tag,u=Mg(t,e,n,"g",r);if("group"!==o&&null!=i&&!i.includes(o))return bm(u,0),t._svg;u.setAttribute("class",_m(t));const c=pg(t);for(const p in c)Bg(u,p,c[p]);l||Bg(u,"pointer-events",s),Bg(u,"clip-path",t.clip?uh(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=Mg(e,u,f,a.tag,r);t&&(this._update(a,n,e),l&&function(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;tp(n,(n=>{r=e.mark(t,n,r,i),++o})),bm(t,1+o)}(this,n,e,i)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):tp(t,h),bm(u,d),u}_update(e,t,n){Og=t,Tg=t.__values__,hg(Ng,n),e.attr(Ng,n,this);const i=zg[e.type];i&&i.call(this,e,t,n),Og&&this.style(Og,n)}style(e,t){if(null!=t){for(const n in wg){let i="font"===n?Jp(t):t[n];if(i===Tg[n])continue;const r=wg[n];null==i?e.removeAttribute(r):(fd(i)&&(i=dd(i,this._defs.gradient,Lg())),e.setAttribute(r,i+"")),Tg[n]=i}for(const n in kg)Rg(e,kg[n],t[n])}}defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=xm(e,1,"defs",Ag)),i=Cg(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=xm(e,1,"defs",Ag)),i=Fg(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):bm(n,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function Sg(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function Cg(e,t,n){let i,r,o;if("radial"===t.gradient){let i=xm(e,n++,"pattern",Ag);Pg(i,{id:cd+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=xm(i,0,"rect",Ag),Pg(i,{width:1,height:1,fill:`url(${Lg()}#${t.id})`}),Pg(e=xm(e,n++,"radialGradient",Ag),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else Pg(e=xm(e,n++,"linearGradient",Ag),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=xm(e,i,"stop",Ag),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return bm(e,i),n}function Fg(e,t,n){let i;return(e=xm(e,n,"clipPath",Ag)).setAttribute("id",t.id),t.path?(i=xm(e,0,"path",Ag),i.setAttribute("d",t.path)):(i=xm(e,0,"rect",Ag),Pg(i,{x:0,y:0,width:t.width,height:t.height})),bm(e,1),n+1}function Mg(e,t,n,i,r){let o,a=e._svg;if(!a&&(o=t.ownerDocument,a=ym(o,i,Ag),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:"default"},"g"===i))){const t=ym(o,"path",Ag);a.appendChild(t),t.__data__=e;const n=ym(o,"g",Ag);a.appendChild(n),n.__data__=e;const i=ym(o,"path",Ag);a.appendChild(i),i.__data__=e,i.__values__={fill:"default"}}return(a.ownerSVGElement!==r||function(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}let Og=null,Tg=null;const zg={group(e,t,n){const i=Og=t.childNodes[2];Tg=i.__values__,e.foreground(Ng,n,this),Tg=t.__values__,Og=t.childNodes[1],e.content(Ng,n,this);const r=Og=t.childNodes[0];e.background(Ng,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Tg.events&&(Bg(i,"pointer-events",o),Bg(r,"pointer-events",o),Tg.events=o),n.strokeForeground&&n.stroke){const e=n.fill;Bg(i,"display",null),this.style(r,n),Bg(r,"stroke",null),e&&(n.fill=null),Tg=i.__values__,this.style(i,n),e&&(n.fill=e),Og=null}else Bg(i,"display","none")},image(e,t,n){!1===n.smooth?(Rg(t,"image-rendering","optimizeSpeed"),Rg(t,"image-rendering","pixelated")):Rg(t,"image-rendering",null)},text(e,t,n){const i=Vp(n);let r,o,a,s;(0,m.cy)(i)?(o=i.map((e=>Qp(n,e))),r=o.join("\n"),r!==Tg.text&&(bm(t,0),a=t.ownerDocument,s=Xp(n),o.forEach(((e,i)=>{const r=ym(a,"tspan",Ag);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),t.appendChild(r)})),Tg.text=r)):(o=Qp(n,i),o!==Tg.text&&(t.textContent=o,Tg.text=o)),Bg(t,"font-family",Jp(n)),Bg(t,"font-size",Hp(n)+"px"),Bg(t,"font-style",n.fontStyle),Bg(t,"font-variant",n.fontVariant),Bg(t,"font-weight",n.fontWeight)}};function Ng(e,t,n){t!==Tg[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(Og,e,t,n):Bg(Og,e,t),Tg[e]=t)}function Rg(e,t,n){n!==Tg[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Tg[t]=n)}function Pg(e,t){for(const n in t)Bg(e,n,t[n])}function Bg(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Lg(){let e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class Ig extends Em{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const t=xg();t.open("svg",(0,m.X$)({},$p,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",$g,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this}mark(e,t){const n=sm[t.marktype],i=n.tag,r=[hg,n.attr];e.open("g",{class:_m(t),"clip-path":t.clip?uh(this,t,t.group):null},pg(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(i,this.attr(t,o,r,"g"!==i?i:null)),"text"===i){const t=Vp(o);if((0,m.cy)(t)){const n={x:0,dy:Xp(o)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(Qp(o,t[i])).close()}else e.text(Qp(o,t))}else if("g"===i){const i=o.strokeForeground,r=o.fill,a=o.stroke;i&&a&&(o.stroke=null),e.open("path",this.attr(t,o,n.background,"bgrect")).close(),e.open("g",this.attr(t,o,n.content)),tp(o,(t=>this.mark(e,t))),e.close(),i&&a?(r&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),r&&(o.fill=r)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):tp(t,o),e.close()}href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null}attr(e,t,n,i){const r={},o=(e,t,n,i)=>{r[i||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),i&&function(e,t,n,i,r){let o;if(null==t)return e;"bgrect"===i&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===i&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(e["font-family"]=Jp(t),e["font-size"]=Hp(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in wg){let n=t[a];const i=wg[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&(fd(n)&&(n=dd(n,r.gradient,"")),e[i]=n)}for(const a in kg){const e=t[a];null!=e&&(o=o||[],o.push(`${kg[a]}: ${e};`))}o&&(e.style=o.join(" "))}(r,t,e,i,this._defs),r}defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const i=t[n],r=i.stops;"radial"===i.gradient?(e.open("pattern",{id:cd+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):e.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let t=0;t<r.length;++t)e.open("stop",{offset:r[t].offset,"stop-color":r[t].color}).close();e.close()}for(const t in n){const i=n[t];e.open("clipPath",{id:t}),i.path?e.open("path",{d:i.path}).close():e.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),e.close()}e.close()}}}const Ug={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function jg(e){Ug.svgMarkTypes=e.svgMarkTypes??["text"],Ug.svgOnTop=e.svgOnTop??!0,Ug.debug=e.debug??!1}class qg extends Em{constructor(e){super(e),this._svgRenderer=new Dg(e),this._canvasRenderer=new Zm(e)}initialize(e,t,n,i,r){this._root_el=xm(e,0,"div");const o=xm(this._root_el,0,"div"),a=xm(this._root_el,1,"div");return this._root_el.style.position="relative",Ug.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=Ug.svgOnTop?a:o,this._canvasEl=Ug.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,t,n,i,r),this._svgRenderer.initialize(this._svgEl,t,n,i,r),super.initialize(e,t,n,i,r)}dirty(e){return Ug.svgMarkTypes.includes(e.mark.marktype)?this._svgRenderer.dirty(e):this._canvasRenderer.dirty(e),this}_render(e,t){const n=(t??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter((e=>!Ug.svgMarkTypes.includes(e)));this._svgRenderer.render(e,Ug.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,i){return super.resize(e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this}background(e){return Ug.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class Wg extends Ym{constructor(e,t){super(e,t)}initialize(e,t,n){const i=xm(xm(e,0,"div"),Ug.svgOnTop?0:1,"div");return super.initialize(i,t,n)}}const Gg="canvas",Yg="hybrid",Hg="none",Xg={Canvas:Gg,PNG:"png",SVG:"svg",Hybrid:Yg,None:Hg},Vg={};function Kg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Vg[e]=t,this):Vg[e]}function Qg(e,t,n){const i=[],r=(new ch).union(t),o=e.marktype;return o?Jg(e,r,n,i):"group"===o?Zg(e,r,n,i):(0,m.z3)("Intersect scene must be mark node or group item.")}function Jg(e,t,n,i){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const r=e.items,o=e.marktype,a=r.length;let s=0;if("group"===o)for(;s<a;++s)Zg(r[s],t,n,i);else for(const e=sm[o].isect;s<a;++s){const n=r[s];ey(n,t,e)&&i.push(n)}}return i}function Zg(e,t,n,i){n&&n(e.mark)&&ey(e,t,sm.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const a=e.x||0,s=e.y||0;t.translate(-a,-s);for(let e=0;e<o;++e)Jg(r[e],t,n,i);t.translate(a,s)}return i}function ey(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}Vg[Gg]=Vg.png={renderer:Zm,headless:Zm,handler:Ym},Vg.svg={renderer:Dg,headless:Ig,handler:tg},Vg[Yg]={renderer:qg,headless:qg,handler:Wg},Vg[Hg]={};const ty=new ch;function ny(e){const t=e.clip;if((0,m.Tn)(t))t(zh(ty.clear()));else{if(!t)return;ty.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(ty)}const iy=1e-9;function ry(e,t,n){return e===t||("path"===n?oy(e,t):e instanceof Date&&t instanceof Date?+e===+t:(0,m.Et)(e)&&(0,m.Et)(t)?Math.abs(e-t)<=iy:e&&t&&((0,m.Gv)(e)||(0,m.Gv)(t))?function(e,t){var n,i,r=Object.keys(e),o=Object.keys(t);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(!ry(e[n=r[i]],t[n],n))return!1;return typeof e===typeof t}(e,t):e==t)}function oy(e,t){return ry(wd(e),wd(t))}function ay(){lh(),ud=0}const sy="top",ly="left",uy="right",cy="bottom",fy="top-left",dy="top-right",hy="bottom-left",py="bottom-right",my="start",gy="middle",yy="end",vy="x",xy="y",by="group",_y="axis",wy="title",ky="frame",$y="scope",Ey="legend",Ay="row-header",Dy="row-footer",Sy="row-title",Cy="column-header",Fy="column-footer",My="column-title",Oy="padding",Ty="symbol",zy="fit",Ny="fit-x",Ry="fit-y",Py="pad",By="none",Ly="all",Iy="each",Uy="flush",jy="column",qy="row";function Wy(e){Nr.call(this,null,e)}function Gy(e,t,n){return t(e.bounds.clear(),e,n)}(0,m.B)(Wy,Nr,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=sm[r],a=o.bound;let s,l=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),l=Gy(i,a),i.items.forEach((e=>{e.bounds.clear().union(l)}));else if(r===by||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),l.clear(),i.items.forEach((e=>l.union(Gy(e,a)))),i.role){case _y:case Ey:case wy:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{l.union(Gy(e,a))})),t.visit(t.MOD,(e=>{s=s||l.alignsWith(e.bounds),n.dirty(e),l.union(Gy(e,a))})),s&&(l.clear(),i.items.forEach((e=>l.union(e.bounds))));return ny(i),t.modifies("bounds")}});const Yy=":vega_identifier:";function Hy(e){Nr.call(this,0,e)}function Xy(e){Nr.call(this,null,e)}function Vy(e){Nr.call(this,null,e)}Hy.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,m.B)(Hy,Nr,{transform(e,t){const n=(r=t.dataflow)._signals[Yy]||(r._signals[Yy]=r.add(0)),i=e.as;var r;let o=n.value;return t.visit(t.ADD,(e=>e[i]=e[i]||++o)),n.set(this.value=o),t}}),(0,m.B)(Xy,Nr,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===by?dh:fh;return t.visit(t.ADD,(e=>i.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const Ky={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,i)=>i&&Qy(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},Qy=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Jy=(e,t)=>{for(var n,i=1,r=e.length,o=e[0].bounds;i<r;o=n,++i)if(Qy(o,n=e[i].bounds,t))return!0},Zy=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},ev=e=>(e.forEach((e=>e.opacity=1)),e),tv=(e,t)=>e.reflow(t.modified()).modifies("opacity");function nv(e){Nr.call(this,null,e)}(0,m.B)(Vy,Nr,{transform(e,t){const n=Ky[e.method]||Ky.parity,i=e.separation||0;let r,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(ev(a),t=tv(t,e)),t;if(a=a.filter(Zy),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),r=ev(a),t=tv(t,e),r.length>=3&&Jy(r,i)){do{r=n(r,i)}while(r.length>=3&&Jy(r,i));r.length<3&&!(0,m.se)(a).opacity&&(r.length>1&&((0,m.se)(r).opacity=0),(0,m.se)(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var i=e.range(),r=new ch;return t===sy||t===cy?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),e=>r.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=r[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),(0,m.B)(nv,Nr,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const iv=new ch;function rv(e,t,n){return e[t]===n?0:(e[t]=n,1)}function ov(e){var t=e.items[0].orient;return t===ly||t===uy}function av(e,t,n,i){var r,o,a=t.items[0],s=a.datum,l=null!=a.translate?a.translate:.5,u=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,x=g&&Kp(g),b=0,_=0;switch(iv.clear().union(v),v.clear(),(r=c[0])>-1&&v.union(a.items[r].bounds),(r=c[1])>-1&&v.union(a.items[r].bounds),u){case sy:b=h||0,_=-d,o=Math.max(p,Math.min(m,-v.y1)),v.add(0,-o).add(f,0),g&&sv(e,g,o,y,x,0,-1,v);break;case ly:b=-d,_=h||0,o=Math.max(p,Math.min(m,-v.x1)),v.add(-o,0).add(0,f),g&&sv(e,g,o,y,x,1,-1,v);break;case uy:b=n+d,_=h||0,o=Math.max(p,Math.min(m,v.x2)),v.add(0,0).add(o,f),g&&sv(e,g,o,y,x,1,1,v);break;case cy:b=h||0,_=i+d,o=Math.max(p,Math.min(m,v.y2)),v.add(0,0).add(f,o),g&&sv(e,g,o,y,0,0,1,v);break;default:b=a.x,_=a.y}return gh(v.translate(b,_),a),rv(a,"x",b+l)|rv(a,"y",_+l)&&(a.bounds=iv,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function sv(e,t,n,i,r,o,a,s){const l=t.bounds;if(t.auto){const s=a*(n+r+i);let u=0,c=0;e.dirty(t),o?u=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(l.translate(-u,-c)),e.dirty(t)}s.union(l)}const lv=(e,t)=>Math.floor(Math.min(e,t)),uv=(e,t)=>Math.ceil(Math.max(e,t));function cv(e){return(new ch).set(0,0,e.width||0,e.height||0)}function fv(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function dv(e,t,n){const i=(0,m.Gv)(e)?e[t]:e;return null!=i?i:void 0!==n?n:0}function hv(e){return e<0?Math.ceil(-e):0}function pv(e,t,n){var i,r,o,a,s,l,u,c,f,d,h,p=!n.nodirty,m=n.bounds===Uy?cv:fv,g=iv.set(0,0,0,0),y=dv(n.align,jy),v=dv(n.align,qy),x=dv(n.padding,jy),b=dv(n.padding,qy),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,$=Array(k),E=Array(_),A=0,D=Array(k),S=Array(w),C=0,F=Array(k),M=Array(k),O=Array(k);for(r=0;r<_;++r)E[r]=0;for(r=0;r<w;++r)S[r]=0;for(r=0;r<k;++r)l=t[r],s=O[r]=m(l),l.x=l.x||0,F[r]=0,l.y=l.y||0,M[r]=0,o=r%_,a=~~(r/_),A=Math.max(A,u=Math.ceil(s.x2)),C=Math.max(C,c=Math.ceil(s.y2)),E[o]=Math.max(E[o],u),S[a]=Math.max(S[a],c),$[r]=x+hv(s.x1),D[r]=b+hv(s.y1),p&&e.dirty(t[r]);for(r=0;r<k;++r)r%_===0&&($[r]=0),r<_&&(D[r]=0);if(y===Iy)for(o=1;o<_;++o){for(h=0,r=o;r<k;r+=_)h<$[r]&&(h=$[r]);for(r=o;r<k;r+=_)$[r]=h+E[o-1]}else if(y===Ly){for(h=0,r=0;r<k;++r)r%_&&h<$[r]&&(h=$[r]);for(r=0;r<k;++r)r%_&&($[r]=h+A)}else for(y=!1,o=1;o<_;++o)for(r=o;r<k;r+=_)$[r]+=E[o-1];if(v===Iy)for(a=1;a<w;++a){for(h=0,i=(r=a*_)+_;r<i;++r)h<D[r]&&(h=D[r]);for(r=a*_;r<i;++r)D[r]=h+S[a-1]}else if(v===Ly){for(h=0,r=_;r<k;++r)h<D[r]&&(h=D[r]);for(r=_;r<k;++r)D[r]=h+C}else for(v=!1,a=1;a<w;++a)for(i=(r=a*_)+_;r<i;++r)D[r]+=S[a-1];for(f=0,r=0;r<k;++r)f=$[r]+(r%_?f:0),F[r]+=f-t[r].x;for(o=0;o<_;++o)for(d=0,r=o;r<k;r+=_)d+=D[r],M[r]+=d-t[r].y;if(y&&dv(n.center,jy)&&w>1)for(r=0;r<k;++r)(f=(s=y===Ly?A:E[r%_])-O[r].x2-t[r].x-F[r])>0&&(F[r]+=f/2);if(v&&dv(n.center,qy)&&1!==_)for(r=0;r<k;++r)(d=(s=v===Ly?C:S[~~(r/_)])-O[r].y2-t[r].y-M[r])>0&&(M[r]+=d/2);for(r=0;r<k;++r)g.union(O[r].translate(F[r],M[r]));switch(f=dv(n.anchor,vy),d=dv(n.anchor,xy),dv(n.anchor,jy)){case yy:f-=g.width();break;case gy:f-=g.width()/2}switch(dv(n.anchor,qy)){case yy:d-=g.height();break;case gy:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),r=0;r<k;++r)t[r].mark.bounds.clear();for(r=0;r<k;++r)(l=t[r]).x+=F[r]+=f,l.y+=M[r]+=d,g.union(l.mark.bounds.union(l.bounds.translate(F[r],M[r]))),p&&e.dirty(l);return g}function mv(e,t,n){var i,r,o,a,s,l,u,c=function(e){var t,n,i=e.items,r=i.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<r;++o)if(n=(t=i[o]).items,t.marktype===by)switch(t.role){case _y:case Ey:case wy:break;case Ay:a.rowheaders.push(...n);break;case Dy:a.rowfooters.push(...n);break;case Cy:a.colheaders.push(...n);break;case Fy:a.colfooters.push(...n);break;case Sy:a.rowtitle=n[0];break;case My:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(t),f=c.marks,d=n.bounds===Uy?gv:yv,h=n.offset,p=n.columns||f.length,m=p<=0?1:Math.ceil(f.length/p),g=m*p;const y=pv(e,f,n);y.empty()&&y.set(0,0,0,0),c.rowheaders&&(l=dv(n.headerBand,qy,null),i=vv(e,c.rowheaders,f,p,m,-dv(h,"rowHeader"),lv,0,d,"x1",0,p,1,l)),c.colheaders&&(l=dv(n.headerBand,jy,null),r=vv(e,c.colheaders,f,p,p,-dv(h,"columnHeader"),lv,1,d,"y1",0,1,p,l)),c.rowfooters&&(l=dv(n.footerBand,qy,null),o=vv(e,c.rowfooters,f,p,m,dv(h,"rowFooter"),uv,0,d,"x2",p-1,p,1,l)),c.colfooters&&(l=dv(n.footerBand,jy,null),a=vv(e,c.colfooters,f,p,p,dv(h,"columnFooter"),uv,1,d,"y2",g-p,1,p,l)),c.rowtitle&&(s=dv(n.titleAnchor,qy),u=dv(h,"rowTitle"),u=s===yy?o+u:i-u,l=dv(n.titleBand,qy,.5),xv(e,c.rowtitle,u,0,y,l)),c.coltitle&&(s=dv(n.titleAnchor,jy),u=dv(h,"columnTitle"),u=s===yy?a+u:r-u,l=dv(n.titleBand,jy,.5),xv(e,c.coltitle,u,1,y,l))}function gv(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function yv(e,t){return e.bounds[t]}function vv(e,t,n,i,r,o,a,s,l,u,c,f,d,h){var p,m,g,y,v,x,b,_,w,k=n.length,$=0,E=0;if(!k)return $;for(p=c;p<k;p+=f)n[p]&&($=a($,l(n[p],u)));if(!t.length)return $;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),$+=o,m=0,y=t.length;m<y;++m)e.dirty(t[m]),t[m].mark.bounds.clear();for(p=c,m=0,y=t.length;m<y;++m,p+=f){for(v=(x=t[m]).mark.bounds,g=p;g>=0&&null==(b=n[g]);g-=d);s?(_=null==h?b.x:Math.round(b.bounds.x1+h*b.bounds.width()),w=$):(_=$,w=null==h?b.y:Math.round(b.bounds.y1+h*b.bounds.height())),v.union(x.bounds.translate(_-(x.x||0),w-(x.y||0))),x.x=_,x.y=w,e.dirty(x),E=a(E,v[u])}return E}function xv(e,t,n,i,r,o){if(t){e.dirty(t);var a=n,s=n;i?a=Math.round(r.x1+o*r.width()):s=Math.round(r.y1+o*r.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function bv(e,t,n,i,r,o,a){const s=function(e,t){const n=e[t]||{};return(t,i)=>null!=n[t]?n[t]:null!=e[t]?e[t]:i}(n,t),l=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),u=s("anchor",my),c=u===yy?1:u===gy?.5:0,f={align:Iy,bounds:s("bounds",Uy),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case ly:f.anchor={x:Math.floor(i.x1)-l,column:yy,y:c*(a||i.height()+2*i.y1),row:u};break;case uy:f.anchor={x:Math.ceil(i.x2)+l,y:c*(a||i.height()+2*i.y1),row:u};break;case sy:f.anchor={y:Math.floor(r.y1)-l,row:yy,x:c*(o||r.width()+2*r.x1),column:u};break;case cy:f.anchor={y:Math.ceil(r.y2)+l,x:c*(o||r.width()+2*r.x1),column:u};break;case fy:f.anchor={x:l,y:l};break;case dy:f.anchor={x:o-l,y:l,column:yy};break;case hy:f.anchor={x:l,y:a-l,row:yy};break;case py:f.anchor={x:o-l,y:a-l,column:yy,row:yy}}return f}function _v(e,t){var n,i,r=t.items[0],o=r.datum,a=r.orient,s=r.bounds,l=r.x,u=r.y;return r._bounds?r._bounds.clear().union(s):r._bounds=s.clone(),s.clear(),function(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,l=t.titlePadding||0,u=i-a.x,c=i-a.y;switch(a.orient){case ly:r+=Math.ceil(a.bounds.width())+l;break;case uy:case cy:break;default:o+=a.bounds.height()+l}switch((r||o)&&kv(e,n,r,o),a.orient){case ly:c+=wv(t,n,a,s,1,1);break;case uy:u+=wv(t,n,a,yy,0,0)+l,c+=wv(t,n,a,s,1,1);break;case cy:u+=wv(t,n,a,s,0,0),c+=wv(t,n,a,yy,-1,0,1)+l;break;default:u+=wv(t,n,a,s,0,0)}(u||c)&&kv(e,a,u,c),(u=Math.round(a.bounds.x1-i))<0&&(kv(e,n,-u,0),kv(e,a,-u,0))}else(r||o)&&kv(e,n,r,o)}(e,r,r.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(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===Ty&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(r.items[0].items[0].items[0].items),a!==By&&(r.x=l=0,r.y=u=0),r.width=n,r.height=i,gh(s.set(l,u,l+n,u+i),r),r.mark.bounds.clear().union(s),r}function wv(e,t,n,i,r,o,a){const s="symbol"!==e.datum.type,l=n.datum.vgrad,u=(!s||!o&&l||a?t:t.items[0]).bounds[r?"y2":"x2"]-e.padding,c=l&&o?u:0,f=l&&o?0:u,d=r<=0?0:Kp(n);return Math.round(i===my?c:i===yy?f-d:.5*(u-d))}function kv(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function $v(e){Nr.call(this,null,e)}function Ev(e,t){let n=0;if(void 0===t)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function Av(e){Nr.call(this,null,e)}function Dv(e){Nr.call(this,null,e)}function Sv(){return rr({})}function Cv(e){Nr.call(this,null,e)}function Fv(e){Nr.call(this,[],e)}(0,m.B)($v,Nr,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&mv(n,t,e.layout),function(e,t,n){var i,r,o,a,s,l=t.items,u=Math.max(0,t.width||0),c=Math.max(0,t.height||0),f=(new ch).set(0,0,u,c),d=f.clone(),h=f.clone(),p=[];for(a=0,s=l.length;a<s;++a)switch((r=l[a]).role){case _y:(ov(r)?d:h).union(av(e,r,u,c));break;case wy:i=r;break;case Ey:p.push(_v(e,r));break;case ky:case $y:case Ay:case Dy:case Sy:case Cy:case Fy:case My:d.union(r.bounds),h.union(r.bounds);break;default:f.union(r.bounds)}if(p.length){const t={};p.forEach((e=>{(o=e.orient||uy)!==By&&(t[o]||(t[o]=[])).push(e)}));for(const i in t){const r=t[i];pv(e,r,bv(r,i,n.legends,d,h,u,c))}p.forEach((t=>{const i=t.bounds;if(i.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=i,e.dirty(t)),!n.autosize||n.autosize.type!==zy&&n.autosize.type!==Ny&&n.autosize.type!==Ry)f.union(i);else switch(t.orient){case ly:case uy:f.add(i.x1,0).add(i.x2,0);break;case sy:case cy:f.add(0,i.y1).add(0,i.y2)}}))}f.union(d).union(h),i&&f.union(function(e,t,n,i,r){var o,a=t.items[0],s=a.frame,l=a.orient,u=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=l===ly||l===uy?i:n,m=0,g=0,y=0,v=0,x=0;if(s!==by?l===ly?(m=r.y2,p=r.y1):l===uy?(m=r.y1,p=r.y2):(m=r.x1,p=r.x2):l===ly&&(m=i,p=0),o=u===my?m:u===yy?p:(m+p)/2,h&&h.text){switch(l){case sy:case cy:x=d.bounds.height()+f;break;case ly:v=d.bounds.width()+f;break;case uy:v=-d.bounds.width()-f}iv.clear().union(h.bounds),iv.translate(v-(h.x||0),x-(h.y||0)),rv(h,"x",v)|rv(h,"y",x)&&(e.dirty(h),h.bounds.clear().union(iv),h.mark.bounds.clear().union(iv),e.dirty(h)),iv.clear().union(h.bounds)}else iv.clear();switch(iv.union(d.bounds),l){case sy:g=o,y=r.y1-iv.height()-c;break;case ly:g=r.x1-iv.width()-c,y=o;break;case uy:g=r.x2+iv.width()+c,y=o;break;case cy:g=o,y=r.y2+c;break;default:g=a.x,y=a.y}return rv(a,"x",g)|rv(a,"y",y)&&(iv.translate(g,y),e.dirty(a),a.bounds.clear().union(iv),t.bounds.clear().union(iv),e.dirty(a)),a.bounds}(e,i,u,c,f));t.clip&&f.set(0,0,t.width||0,t.height||0);!function(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===Oy){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===By?(u=0,f=0,l=a,c=s):o===zy?(l=Math.max(0,a-u-d),c=Math.max(0,s-f-h)):o===Ny?(l=Math.max(0,a-u-d),s=c+f+h):o===Ry?(a=l+u+d,c=Math.max(0,s-f-h)):o===Py&&(a=l+u+d,s=c+f+h);e._resizeView(a,s,l,c,[u,f],r.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),(0,m.B)(Av,Nr,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,a=Yf(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||Vf(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?Hf(o,e.values,a):Xf(o,a);return r&&(i.rem=r),r=l.map(((e,t)=>rr({index:t/(l.length-1||1),value:e,label:s(e)}))),e.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.B)(Dv,Nr,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Sv,o=e.key||nr,a=this.value;return(0,m.cy)(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(o))&&(0,m.z3)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=(0,m.nG)().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,i.add.push(n)):i.mod.push(n):(n=r(e),a.set(t,n),i.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,i.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}}),(0,m.B)(Cv,Nr,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if((0,m.cy)(o)){if(!n.changed()&&!o.every((e=>r[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=r.update||m.me,l=r.enter||m.me,u=r.exit||m.me,c=(o&&!a?r[o]:s)||m.me;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{l(t,e),s(t,e)})),n.modifies(l.output),n.modifies(s.output),c!==m.me&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&u!==m.me&&(t.visit(t.REM,(t=>{u(t,e)})),n.modifies(u.output)),a||c!==m.me){const r=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(r,(t=>{const r=l(t,e)||i;(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(l.output)):t.visit(r,(t=>{(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),(0,m.B)(Fv,Nr,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,i,r,o,a,s=t.dataflow.locale(),l=t.fork(t.NO_SOURCE|t.NO_FIELDS),u=this.value,c=e.type||Uf,f=e.scale,d=+e.limit,h=Yf(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===Uf,g=e.format||td(s,f,h,c,e.formatSpecifier,e.formatType,p),y=e.values||Zf(f,h);return u&&(l.rem=u),c===Uf?(d&&y.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),u=y.slice(0,d-1),a=!0):u=y,(0,m.Tn)(r=e.size)?(e.values||0!==f(u[0])||(u=u.slice(1)),o=u.reduce(((t,n)=>Math.max(t,r(n,e))),0)):r=(0,m.dY)(o=r||8),u=u.map(((t,n)=>rr({index:n,label:g(t,n,u),value:t,offset:o,size:r(t,e)}))),a&&(a=y[u.length],u.push(rr({index:u.length,label:`\u2026${y.length-u.length} entries`,value:a,offset:o,size:r(a,e)})))):"gradient"===c?(n=f.domain(),i=Nf(f,n[0],(0,m.se)(n)),y.length<3&&!e.values&&n[0]!==(0,m.se)(n)&&(y=[n[0],(0,m.se)(n)]),u=y.map(((e,t)=>rr({index:t,label:g(e,t,y),value:e,perc:i(e)})))):(r=y.length-1,i=function(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+(0,m.se)(t),o=r-i;if(e.type===of){const e=n?o/n:.1;i-=e,r+=e,o=r-i}return e=>(e-i)/o}(f),u=y.map(((e,t)=>rr({index:t,label:g(e,t,y),value:e,perc:t?i(e):0,perc2:t===r?1:i(y[t+1])})))),l.source=u,l.add=u,this.value=u,l}});const Mv=e=>e.source.x,Ov=e=>e.source.y,Tv=e=>e.target.x,zv=e=>e.target.y;function Nv(e){Nr.call(this,{},e)}Nv.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.B)(Nv,Nr,{transform(e,t){var n=e.sourceX||Mv,i=e.sourceY||Ov,r=e.targetX||Tv,o=e.targetY||zv,a=e.as||"path",s=e.orient||"vertical",l=e.shape||"line",u=Lv.get(l+"-"+s)||Lv.get(l);return u||(0,m.z3)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=u(n(e),i(e),r(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const Rv=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Pv=(e,t,n,i)=>{var r=n-e,o=i-t,a=Math.hypot(r,o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,r)/Math.PI+" 0 1 "+n+","+i},Bv=(e,t,n,i)=>{const r=n-e,o=i-t,a=.2*(r+o),s=.2*(o-r);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(i-a)+" "+n+","+i},Lv=(0,m.nG)({line:Rv,"line-radial":(e,t,n,i)=>Rv(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),arc:Pv,"arc-radial":(e,t,n,i)=>Pv(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),curve:Bv,"curve-radial":(e,t,n,i)=>Bv(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+i*a+","+i*s},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*o+"C"+l*r+","+l*o+" "+l*a+","+l*s+" "+i*a+","+i*s}});function Iv(e){Nr.call(this,null,e)}Iv.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.B)(Iv,Nr,{transform(e,t){var n,i,r,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],l=e.field||m.xH,u=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(l),h=d.length,p=u,g=(c-u)/Ev(d),y=Xo(h);for(e.sort&&y.sort(((e,t)=>d[e]-d[t])),n=0;n<h;++n)r=d[y[n]],(i=f[y[n]])[a]=p,i[s]=p+=r*g;return this.value=d,t.reflow(e.modified()).modifies(o)}});const Uv=5;function jv(e){return Ef(e)&&e!==ef}const qv=(0,m.M1)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function Wv(e){Nr.call(this,null,e),this.modified(!0)}function Gv(e,t,n){if(Sf(e)){var i=Math.abs(t.reduce(((e,t)=>e+(t<0?-1:t>0?1:0)),0));i!==t.length&&n.warn("Log scale domain includes zero: "+(0,m.r$)(t))}return t}function Yv(e,t,n){return(0,m.Tn)(e)&&(t||n)?Of(e,Hv(t||[0,1],n)):e}function Hv(e,t){return t?e.slice().reverse():e}function Xv(e){Nr.call(this,null,e)}(0,m.B)(Wv,Nr,{transform(e,t){var n=t.dataflow,i=this.value,r=function(e){var t,n=e.type,i="";if(n===ef)return ef+"-"+Hc;(function(e){const t=e.type;return Ef(t)&&t!==Jc&&t!==Zc&&(e.scheme||e.range&&e.range.length&&e.range.every(m.Kg))})(e)&&(i=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?ef+"-":3===t?tf+"-":"");return(i+n||Hc).toLowerCase()}(e);for(r in i&&r===i.type||(this.value=i=wf(r)()),e)if(!qv[r]){if("padding"===r&&jv(i.type))continue;(0,m.Tn)(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return function(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==lf&&e!==sf&&(0,m.z3)("Only band and point scales support rangeStep.");var i=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,r=e===sf?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Yc(n,r,i)]}(i,t,n);else if(t.scheme&&(o=function(e,t,n){var i,r=t.schemeExtent;(0,m.cy)(t.scheme)?i=Tf(t.scheme,t.interpolate,t.interpolateGamma):(i=If(t.scheme.toLowerCase()))||(0,m.z3)(`Unrecognized scheme name: ${t.scheme}`);return n=e===of?n+1:e===uf?n-1:e===nf||e===rf?+t.schemeCount||Uv:n,Cf(e)?Yv(i,r,t.reverse):(0,m.Tn)(i)?zf(Yv(i,r),n):e===af?i:i.slice(0,n)}(i,t,n),(0,m.Tn)(o))){if(e.interpolator)return e.interpolator(o);(0,m.z3)(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&Cf(i))return e.interpolator(Tf(Hv(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Rf(t.interpolate,t.interpolateGamma)):(0,m.Tn)(e.round)?e.round(r):(0,m.Tn)(e.rangeRound)&&e.interpolate(r?hu.A:du.A);o&&e.range(Hv(o,t.reverse))}(i,e,function(e,t,n){let i=t.bins;if(i&&!(0,m.cy)(i)){const t=e.domain(),n=t[0],r=(0,m.se)(t),o=i.step;let a=null==i.start?n:i.start,s=null==i.stop?r:i.stop;o||(0,m.z3)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>r&&(s=o*Math.floor(r/o)),i=Xo(a,s+o/2,o)}i?e.bins=i:e.bins&&delete e.bins;e.type===uf&&(i?t.domain||t.domainRaw||(e.domain(i),n=i.length):e.bins=e.domain());return n}(i,e,function(e,t,n){const i=function(e,t,n){return t?(e.domain(Gv(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(i>-1)return i;var r,o,a=t.domain,s=e.type,l=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===Hc||t===Vc||t===Kc)}(e);if(!a)return 0;if((l||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(r=(a=a.slice()).length-1||1,l&&(a[0]>0&&(a[0]=0),a[r]<0&&(a[r]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[r]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[r]?r+1:o<a[0]?0:r;e!==r&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(e,0,o)}jv(s)&&t.padding&&a[0]!==(0,m.se)(a)&&(a=function(e,t,n,i,r,o){var a=Math.abs((0,m.se)(n)-n[0]),s=a/(a-2*i),l=e===Xc?(0,m.oV)(t,null,s):e===Kc?(0,m.SW)(t,null,s,.5):e===Vc?(0,m.SW)(t,null,s,r||1):e===Qc?(0,m.B2)(t,null,s,o||1):(0,m.lL)(t,null,s);return t=t.slice(),t[0]=l[0],t[t.length-1]=l[1],t}(s,a,t.range,t.padding,t.exponent,t.constant));e.domain(Gv(s,a,n)),s===af&&e.unknown(t.domainImplicit?Su:void 0);t.nice&&e.nice&&e.nice(!0!==t.nice&&Yf(e,t.nice)||null);return a.length}(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),(0,m.B)(Xv,Nr,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(lr(e.sort)),this.modified(n),t}});const Vv="zero",Kv="center",Qv="normalize",Jv=["y0","y1"];function Zv(e){Nr.call(this,null,e)}function ex(e,t,n,i,r){for(var o,a=(t-e.sum)/2,s=e.length,l=0;l<s;++l)(o=e[l])[i]=a,o[r]=a+=Math.abs(n(o))}function tx(e,t,n,i,r){for(var o,a=1/e.sum,s=0,l=e.length,u=0,c=0;u<l;++u)(o=e[u])[i]=s,o[r]=s=a*(c+=Math.abs(n(o)))}function nx(e,t,n,i,r){for(var o,a,s=0,l=0,u=e.length,c=0;c<u;++c)(o=+n(a=e[c]))<0?(a[i]=l,a[r]=l+=o):(a[i]=s,a[r]=s+=o)}Zv.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:Vv,values:[Vv,Kv,Qv]},{name:"as",type:"string",array:!0,length:2,default:Jv}]},(0,m.B)(Zv,Nr,{transform(e,t){var n,i,r,o,a=e.as||Jv,s=a[0],l=a[1],u=lr(e.sort),c=e.field||m.xH,f=e.offset===Kv?ex:e.offset===Qv?tx:nx;for(n=function(e,t,n,i){var r,o,a,s,l,u,c,f,d,h=[],p=e=>e(l);if(null==t)h.push(e.slice());else for(r={},o=0,a=e.length;o<a;++o)l=e[o],(c=r[u=t.map(p)])||(r[u]=c=[],h.push(c)),c.push(l);for(u=0,d=0,s=h.length;u<s;++u){for(o=0,f=0,a=(c=h[u]).length;o<a;++o)f+=Math.abs(i(c[o]));c.sum=f,f>d&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,u,c),i=0,r=n.length,o=n.max;i<r;++i)f(n[i],o,c,s,l);return t.reflow(e.modified()).modifies(a)}});const ix=e=>e;function rx(e,t){e&&ax.hasOwnProperty(e.type)&&ax[e.type](e,t)}var ox={Feature:function(e,t){rx(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)rx(n[i].geometry,t)}},ax={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){sx(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)sx(n[i],t,0)},Polygon:function(e,t){lx(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)lx(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)rx(n[i],t)}};function sx(e,t,n){var i,r=-1,o=e.length-n;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function lx(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)sx(e[n],t,1);t.polygonEnd()}function ux(e,t){e&&ox.hasOwnProperty(e.type)?ox[e.type](e,t):rx(e,t)}class cx{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=t[i],o=e+r,a=Math.abs(e)<Math.abs(r)?e-(o-r):r-(o-e);a&&(t[n++]=a),e=o}return t[n]=e,this._n=n+1,this}valueOf(){const e=this._partials;let t,n,i,r=this._n,o=0;if(r>0){for(o=e[--r];r>0&&(t=o,n=e[--r],o=t+n,i=n-(o-t),!i););r>0&&(i<0&&e[r-1]<0||i>0&&e[r-1]>0)&&(n=2*i,t=o+n,n==t-o&&(o=t))}return o}}var fx=1e-6,dx=1e-12,hx=Math.PI,px=hx/2,mx=hx/4,gx=2*hx,yx=180/hx,vx=hx/180,xx=Math.abs,bx=Math.atan,_x=Math.atan2,wx=Math.cos,kx=Math.ceil,$x=Math.exp,Ex=(Math.floor,Math.hypot),Ax=Math.log,Dx=Math.pow,Sx=Math.sin,Cx=Math.sign||function(e){return e>0?1:e<0?-1:0},Fx=Math.sqrt,Mx=Math.tan;function Ox(e){return e>1?0:e<-1?hx:Math.acos(e)}function Tx(e){return e>1?px:e<-1?-px:Math.asin(e)}function zx(){}var Nx,Rx,Px,Bx,Lx=new cx,Ix=new cx,Ux={point:zx,lineStart:zx,lineEnd:zx,polygonStart:function(){Ux.lineStart=jx,Ux.lineEnd=Gx},polygonEnd:function(){Ux.lineStart=Ux.lineEnd=Ux.point=zx,Lx.add(xx(Ix)),Ix=new cx},result:function(){var e=Lx/2;return Lx=new cx,e}};function jx(){Ux.point=qx}function qx(e,t){Ux.point=Wx,Nx=Px=e,Rx=Bx=t}function Wx(e,t){Ix.add(Bx*e-Px*t),Px=e,Bx=t}function Gx(){Wx(Nx,Rx)}const Yx=Ux;var Hx=1/0,Xx=Hx,Vx=-Hx,Kx=Vx,Qx={point:function(e,t){e<Hx&&(Hx=e);e>Vx&&(Vx=e);t<Xx&&(Xx=t);t>Kx&&(Kx=t)},lineStart:zx,lineEnd:zx,polygonStart:zx,polygonEnd:zx,result:function(){var e=[[Hx,Xx],[Vx,Kx]];return Vx=Kx=-(Xx=Hx=1/0),e}};const Jx=Qx;var Zx,eb,tb,nb,ib=0,rb=0,ob=0,ab=0,sb=0,lb=0,ub=0,cb=0,fb=0,db={point:hb,lineStart:pb,lineEnd:yb,polygonStart:function(){db.lineStart=vb,db.lineEnd=xb},polygonEnd:function(){db.point=hb,db.lineStart=pb,db.lineEnd=yb},result:function(){var e=fb?[ub/fb,cb/fb]:lb?[ab/lb,sb/lb]:ob?[ib/ob,rb/ob]:[NaN,NaN];return ib=rb=ob=ab=sb=lb=ub=cb=fb=0,e}};function hb(e,t){ib+=e,rb+=t,++ob}function pb(){db.point=mb}function mb(e,t){db.point=gb,hb(tb=e,nb=t)}function gb(e,t){var n=e-tb,i=t-nb,r=Fx(n*n+i*i);ab+=r*(tb+e)/2,sb+=r*(nb+t)/2,lb+=r,hb(tb=e,nb=t)}function yb(){db.point=hb}function vb(){db.point=bb}function xb(){_b(Zx,eb)}function bb(e,t){db.point=_b,hb(Zx=tb=e,eb=nb=t)}function _b(e,t){var n=e-tb,i=t-nb,r=Fx(n*n+i*i);ab+=r*(tb+e)/2,sb+=r*(nb+t)/2,lb+=r,ub+=(r=nb*e-tb*t)*(tb+e),cb+=r*(nb+t),fb+=3*r,hb(tb=e,nb=t)}const wb=db;function kb(e){this._context=e}kb.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,gx)}},result:zx};var $b,Eb,Ab,Db,Sb,Cb=new cx,Fb={point:zx,lineStart:function(){Fb.point=Mb},lineEnd:function(){$b&&Ob(Eb,Ab),Fb.point=zx},polygonStart:function(){$b=!0},polygonEnd:function(){$b=null},result:function(){var e=+Cb;return Cb=new cx,e}};function Mb(e,t){Fb.point=Ob,Eb=Db=e,Ab=Sb=t}function Ob(e,t){Db-=e,Sb-=t,Cb.add(Fx(Db*Db+Sb*Sb)),Db=e,Sb=t}const Tb=Fb;let zb,Nb,Rb,Pb;class Bb{constructor(e){this._append=null==e?Lb:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Lb;if(t!==zb){const e=10**t;zb=t,Nb=function(t){let n=1;this._+=t[0];for(const i=t.length;n<i;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return Nb}(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==Rb||this._append!==Nb){const e=this._radius,t=this._;this._="",this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,Rb=e,Nb=this._append,Pb=this._,this._=t}this._+=Pb}}result(){const e=this._;return this._="",e.length?e:null}}function Lb(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ib(e,t){let n,i,r=3,o=4.5;function a(e){return e&&("function"===typeof o&&i.pointRadius(+o.apply(this,arguments)),ux(e,n(i))),i.result()}return a.area=function(e){return ux(e,n(Yx)),Yx.result()},a.measure=function(e){return ux(e,n(Tb)),Tb.result()},a.bounds=function(e){return ux(e,n(Jx)),Jx.result()},a.centroid=function(e){return ux(e,n(wb)),wb.result()},a.projection=function(t){return arguments.length?(n=null==t?(e=null,ix):(e=t).stream,a):e},a.context=function(e){return arguments.length?(i=null==e?(t=null,new Bb(r)):new kb(t=e),"function"!==typeof o&&i.pointRadius(o),a):t},a.pointRadius=function(e){return arguments.length?(o="function"===typeof e?e:(i.pointRadius(+e),+e),a):o},a.digits=function(e){if(!arguments.length)return r;if(null==e)r=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);r=t}return null===t&&(i=new Bb(r)),a},a.projection(e).digits(r).context(t)}function Ub(){var e,t=[];return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:zx,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function jb(e,t){return xx(e[0]-t[0])<fx&&xx(e[1]-t[1])<fx}function qb(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Wb(e,t,n,i,r){var o,a,s=[],l=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,i=e[0],a=e[t];if(jb(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),o=0;o<t;++o)r.point((i=e[o])[0],i[1]);return void r.lineEnd()}a[0]+=2*fx}s.push(n=new qb(i,e,null,!0)),l.push(n.o=new qb(i,null,n,!1)),s.push(n=new qb(a,e,null,!1)),l.push(n.o=new qb(a,null,n,!0))}})),s.length){for(l.sort(t),Gb(s),Gb(l),o=0,a=l.length;o<a;++o)l[o].e=n=!n;for(var u,c,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=u.length;o<a;++o)r.point((c=u[o])[0],c[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(u=d.p.z,o=u.length-1;o>=0;--o)r.point((c=u[o])[0],c[1]);else i(d.x,d.p.x,-1,r);d=d.p}u=(d=d.o).z,h=!h}while(!d.v);r.lineEnd()}}}function Gb(e){if(t=e.length){for(var t,n,i=0,r=e[0];++i<t;)r.n=n=e[i],n.p=r,r=n;r.n=n=e[0],n.p=r}}function Yb(e){return[_x(e[1],e[0]),Tx(e[2])]}function Hb(e){var t=e[0],n=e[1],i=wx(n);return[i*wx(t),i*Sx(t),Sx(n)]}function Xb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Kb(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qb(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Jb(e){var t=Fx(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Zb(e){return xx(e[0])<=hx?e[0]:Cx(e[0])*((xx(e[0])+hx)%gx-hx)}function e_(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function t_(e,t,n,i){return function(r){var o,a,s,l=t(r),u=Ub(),c=t(u),f=!1,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=v,d.lineEnd=x,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,a=e_(a);var e=function(e,t){var n=Zb(t),i=t[1],r=Sx(i),o=[Sx(n),-wx(n),0],a=0,s=0,l=new cx;1===r?i=px+fx:-1===r&&(i=-px-fx);for(var u=0,c=e.length;u<c;++u)if(d=(f=e[u]).length)for(var f,d,h=f[d-1],p=Zb(h),m=h[1]/2+mx,g=Sx(m),y=wx(m),v=0;v<d;++v,p=b,g=w,y=k,h=x){var x=f[v],b=Zb(x),_=x[1]/2+mx,w=Sx(_),k=wx(_),$=b-p,E=$>=0?1:-1,A=E*$,D=A>hx,S=g*w;if(l.add(_x(S*E*Sx(A),y*k+S*wx(A))),a+=D?$+E*gx:$,D^p>=n^b>=n){var C=Vb(Hb(h),Hb(x));Jb(C);var F=Vb(o,C);Jb(F);var M=(D^$>=0?-1:1)*Tx(F[2]);(i>M||i===M&&(C[0]||C[1]))&&(s+=D^$>=0?1:-1)}}return(a<-fx||a<fx&&l<-dx)^1&s}(o,i);a.length?(f||(r.polygonStart(),f=!0),Wb(a,i_,e,n,r)):e&&(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(t,n){e(t,n)&&r.point(t,n)}function p(e,t){l.point(e,t)}function m(){d.point=p,l.lineStart()}function g(){d.point=h,l.lineEnd()}function y(e,t){s.push([e,t]),c.point(e,t)}function v(){c.lineStart(),s=[]}function x(){y(s[0][0],s[0][1]),c.lineEnd();var e,t,n,i,l=c.clean(),d=u.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&l){if((t=(n=d[0]).length-1)>0){for(f||(r.polygonStart(),f=!0),r.lineStart(),e=0;e<t;++e)r.point((i=n[e])[0],i[1]);r.lineEnd()}}else h>1&&2&l&&d.push(d.pop().concat(d.shift())),a.push(d.filter(n_))}return d}}function n_(e){return e.length>1}function i_(e,t){return((e=e.x)[0]<0?e[1]-px-fx:px-e[1])-((t=t.x)[0]<0?t[1]-px-fx:px-t[1])}const r_=t_((function(){return!0}),(function(e){var t,n=NaN,i=NaN,r=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?hx:-hx,l=xx(o-n);xx(l-hx)<fx?(e.point(n,i=(i+a)/2>0?px:-px),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(s,i),e.point(o,i),t=0):r!==s&&l>=hx&&(xx(n-r)<fx&&(n-=r*fx),xx(o-s)<fx&&(o-=s*fx),i=function(e,t,n,i){var r,o,a=Sx(e-n);return xx(a)>fx?bx((Sx(t)*(o=wx(i))*Sx(n)-Sx(i)*(r=wx(t))*Sx(e))/(r*o*a)):(t+i)/2}(n,i,o,a),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(s,i),t=0),e.point(n=o,i=a),r=s},lineEnd:function(){e.lineEnd(),n=i=NaN},clean:function(){return 2-t}}}),(function(e,t,n,i){var r;if(null==e)r=n*px,i.point(-hx,r),i.point(0,r),i.point(hx,r),i.point(hx,0),i.point(hx,-r),i.point(0,-r),i.point(-hx,-r),i.point(-hx,0),i.point(-hx,r);else if(xx(e[0]-t[0])>fx){var o=e[0]<t[0]?hx:-hx;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}),[-hx,-px]);function o_(e,t,n,i,r,o){if(n){var a=wx(t),s=Sx(t),l=i*n;null==r?(r=t+i*gx,o=t-l/2):(r=a_(a,r),o=a_(a,o),(i>0?r<o:r>o)&&(r+=i*gx));for(var u,c=r;i>0?c>o:c<o;c-=l)u=Yb([a,-s*wx(c),-s*Sx(c)]),e.point(u[0],u[1])}}function a_(e,t){(t=Hb(t))[0]-=e,Jb(t);var n=Ox(-t[1]);return((-t[2]<0?-n:n)+gx-fx)%gx}var s_=1e9,l_=-s_;function u_(e,t,n,i){function r(r,o){return e<=r&&r<=n&&t<=o&&o<=i}function o(r,o,s,u){var c=0,f=0;if(null==r||(c=a(r,s))!==(f=a(o,s))||l(r,o)<0^s>0)do{u.point(0===c||3===c?e:n,c>1?i:t)}while((c=(c+s+4)%4)!==f);else u.point(o[0],o[1])}function a(i,r){return xx(i[0]-e)<fx?r>0?0:3:xx(i[0]-n)<fx?r>0?2:1:xx(i[1]-t)<fx?r>0?1:0:r>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),i=a(t,1);return n!==i?n-i:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,f,d,h,p,m,g,y,v,x=a,b=Ub(),_={point:w,lineStart:function(){_.point=k,u&&u.push(c=[]);y=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(k(f,d),h&&g&&b.rejoin(),l.push(b.result()));_.point=w,g&&x.lineEnd()},polygonStart:function(){x=b,l=[],u=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,r=u.length;n<r;++n)for(var o,a,s=u[n],l=1,c=s.length,f=s[0],d=f[0],h=f[1];l<c;++l)o=d,a=h,d=(f=s[l])[0],h=f[1],a<=i?h>i&&(d-o)*(i-a)>(h-a)*(e-o)&&++t:h<=i&&(d-o)*(i-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,r=(l=e_(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&Wb(l,s,t,o,a),a.polygonEnd());x=a,l=u=c=null}};function w(e,t){r(e,t)&&x.point(e,t)}function k(o,a){var s=r(o,a);if(u&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(x.lineStart(),x.point(o,a));else if(s&&g)x.point(o,a);else{var l=[p=Math.max(l_,Math.min(s_,p)),m=Math.max(l_,Math.min(s_,m))],b=[o=Math.max(l_,Math.min(s_,o)),a=Math.max(l_,Math.min(s_,a))];!function(e,t,n,i,r,o){var a,s=e[0],l=e[1],u=0,c=1,f=t[0]-s,d=t[1]-l;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<u)return;a<c&&(c=a)}else if(f>0){if(a>c)return;a>u&&(u=a)}if(a=r-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>u&&(u=a)}else if(f>0){if(a<u)return;a<c&&(c=a)}if(a=i-l,d||!(a>0)){if(a/=d,d<0){if(a<u)return;a<c&&(c=a)}else if(d>0){if(a>c)return;a>u&&(u=a)}if(a=o-l,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>u&&(u=a)}else if(d>0){if(a<u)return;a<c&&(c=a)}return u>0&&(e[0]=s+u*f,e[1]=l+u*d),c<1&&(t[0]=s+c*f,t[1]=l+c*d),!0}}}}}(l,b,e,t,n,i)?s&&(x.lineStart(),x.point(o,a),v=!1):(g||(x.lineStart(),x.point(l[0],l[1])),x.point(b[0],b[1]),s||x.lineEnd(),v=!1)}p=o,m=a,g=s}return _}}function c_(e,t){function n(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,i){return(n=t.invert(n,i))&&e.invert(n[0],n[1])}),n}function f_(e,t){return xx(e)>hx&&(e-=Math.round(e/gx)*gx),[e,t]}function d_(e,t,n){return(e%=gx)?t||n?c_(p_(e),m_(t,n)):p_(e):t||n?m_(t,n):f_}function h_(e){return function(t,n){return xx(t+=e)>hx&&(t-=Math.round(t/gx)*gx),[t,n]}}function p_(e){var t=h_(e);return t.invert=h_(-e),t}function m_(e,t){var n=wx(e),i=Sx(e),r=wx(t),o=Sx(t);function a(e,t){var a=wx(t),s=wx(e)*a,l=Sx(e)*a,u=Sx(t),c=u*n+s*i;return[_x(l*r-c*o,s*n-u*i),Tx(c*r+l*o)]}return a.invert=function(e,t){var a=wx(t),s=wx(e)*a,l=Sx(e)*a,u=Sx(t),c=u*r-l*o;return[_x(l*r+u*o,s*n+c*i),Tx(c*n-s*i)]},a}function g_(e){return function(t){var n=new y_;for(var i in e)n[i]=e[i];return n.stream=t,n}}function y_(){}function v_(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=i&&e.clipExtent(null),ux(n,e.stream(Jx)),t(Jx.result()),null!=i&&e.clipExtent(i),e}function x_(e,t,n){return v_(e,(function(n){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(r-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function b_(e,t,n){return x_(e,[[0,0],t],n)}function __(e,t,n){return v_(e,(function(n){var i=+t,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];e.scale(150*r).translate([o,a])}),n)}function w_(e,t,n){return v_(e,(function(n){var i=+t,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;e.scale(150*r).translate([o,a])}),n)}f_.invert=f_,y_.prototype={constructor:y_,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var k_=16,$_=wx(30*vx);function E_(e,t){return+t?function(e,t){function n(i,r,o,a,s,l,u,c,f,d,h,p,m,g){var y=u-i,v=c-r,x=y*y+v*v;if(x>4*t&&m--){var b=a+d,_=s+h,w=l+p,k=Fx(b*b+_*_+w*w),$=Tx(w/=k),E=xx(xx(w)-1)<fx||xx(o-f)<fx?(o+f)/2:_x(_,b),A=e(E,$),D=A[0],S=A[1],C=D-i,F=S-r,M=v*C-y*F;(M*M/x>t||xx((y*C+v*F)/x-.5)>.3||a*d+s*h+l*p<$_)&&(n(i,r,o,a,s,l,D,S,E,b/=k,_/=k,w,m,g),g.point(D,S),n(D,S,E,b,_,w,u,c,f,d,h,p,m,g))}}return function(t){var i,r,o,a,s,l,u,c,f,d,h,p,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){t.polygonStart(),m.lineStart=b},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function g(n,i){n=e(n,i),t.point(n[0],n[1])}function y(){c=NaN,m.point=v,t.lineStart()}function v(i,r){var o=Hb([i,r]),a=e(i,r);n(c,f,u,d,h,p,c=a[0],f=a[1],u=i,d=o[0],h=o[1],p=o[2],k_,t),t.point(c,f)}function x(){m.point=g,t.lineEnd()}function b(){y(),m.point=_,m.lineEnd=w}function _(e,t){v(i=e,t),r=c,o=f,a=d,s=h,l=p,m.point=v}function w(){n(c,f,u,d,h,p,r,o,i,a,s,l,k_,t),m.lineEnd=x,x()}return m}}(e,t):function(e){return g_({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var A_=g_({point:function(e,t){this.stream.point(e*vx,t*vx)}});function D_(e,t,n,i,r,o){if(!o)return function(e,t,n,i,r){function o(o,a){return[t+e*(o*=i),n-e*(a*=r)]}return o.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},o}(e,t,n,i,r);var a=wx(o),s=Sx(o),l=a*e,u=s*e,c=a/e,f=s/e,d=(s*n-a*t)/e,h=(s*t+a*n)/e;function p(e,o){return[l*(e*=i)-u*(o*=r)+t,n-u*e-l*o]}return p.invert=function(e,t){return[i*(c*e-f*t+d),r*(h-f*e-c*t)]},p}function S_(e){return C_((function(){return e}))()}function C_(e){var t,n,i,r,o,a,s,l,u,c,f=150,d=480,h=250,p=0,m=0,g=0,y=0,v=0,x=0,b=1,_=1,w=null,k=r_,$=null,E=ix,A=.5;function D(e){return l(e[0]*vx,e[1]*vx)}function S(e){return(e=l.invert(e[0],e[1]))&&[e[0]*yx,e[1]*yx]}function C(){var e=D_(f,0,0,b,_,x).apply(null,t(p,m)),i=D_(f,d-e[0],h-e[1],b,_,x);return n=d_(g,y,v),s=c_(t,i),l=c_(n,s),a=E_(s,A),F()}function F(){return u=c=null,D}return D.stream=function(e){return u&&c===e?u:u=A_(function(e){return g_({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}(n)(k(a(E(c=e)))))},D.preclip=function(e){return arguments.length?(k=e,w=void 0,F()):k},D.postclip=function(e){return arguments.length?(E=e,$=i=r=o=null,F()):E},D.clipAngle=function(e){return arguments.length?(k=+e?function(e){var t=wx(e),n=6*vx,i=t>0,r=xx(t)>fx;function o(e,n){return wx(e)*wx(n)>t}function a(e,n,i){var r=[1,0,0],o=Vb(Hb(e),Hb(n)),a=Xb(o,o),s=o[0],l=a-s*s;if(!l)return!i&&e;var u=t*a/l,c=-t*s/l,f=Vb(r,o),d=Qb(r,u);Kb(d,Qb(o,c));var h=f,p=Xb(d,h),m=Xb(h,h),g=p*p-m*(Xb(d,d)-1);if(!(g<0)){var y=Fx(g),v=Qb(h,(-p-y)/m);if(Kb(v,d),v=Yb(v),!i)return v;var x,b=e[0],_=n[0],w=e[1],k=n[1];_<b&&(x=b,b=_,_=x);var $=_-b,E=xx($-hx)<fx;if(!E&&k<w&&(x=w,w=k,k=x),E||$<fx?E?w+k>0^v[1]<(xx(v[0]-b)<fx?w:k):w<=v[1]&&v[1]<=k:$>hx^(b<=v[0]&&v[0]<=_)){var A=Qb(h,(-p+y)/m);return Kb(A,d),[v,Yb(A)]}}}function s(t,n){var r=i?e:hx-e,o=0;return t<-r?o|=1:t>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return t_(o,(function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=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?hx:-hx),d):0;if(!t&&(u=l=m)&&e.lineStart(),m!==l&&(!(h=a(t,p))||jb(t,h)||jb(p,h))&&(p[2]=1),m!==l)c=0,m?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(r&&t&&i^m){var y;g&n||!(y=a(p,t,!0))||(c=0,i?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||t&&jb(t,p)||e.point(p[0],p[1]),t=p,l=m,n=g},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),(function(t,i,r,o){o_(o,e,n,r,t,i)}),i?[0,-e]:[-hx,e-hx])}(w=e*vx):(w=null,r_),F()):w*yx},D.clipExtent=function(e){return arguments.length?(E=null==e?($=i=r=o=null,ix):u_($=+e[0][0],i=+e[0][1],r=+e[1][0],o=+e[1][1]),F()):null==$?null:[[$,i],[r,o]]},D.scale=function(e){return arguments.length?(f=+e,C()):f},D.translate=function(e){return arguments.length?(d=+e[0],h=+e[1],C()):[d,h]},D.center=function(e){return arguments.length?(p=e[0]%360*vx,m=e[1]%360*vx,C()):[p*yx,m*yx]},D.rotate=function(e){return arguments.length?(g=e[0]%360*vx,y=e[1]%360*vx,v=e.length>2?e[2]%360*vx:0,C()):[g*yx,y*yx,v*yx]},D.angle=function(e){return arguments.length?(x=e%360*vx,C()):x*yx},D.reflectX=function(e){return arguments.length?(b=e?-1:1,C()):b<0},D.reflectY=function(e){return arguments.length?(_=e?-1:1,C()):_<0},D.precision=function(e){return arguments.length?(a=E_(s,A=e*e),F()):Fx(A)},D.fitExtent=function(e,t){return x_(D,e,t)},D.fitSize=function(e,t){return b_(D,e,t)},D.fitWidth=function(e,t){return __(D,e,t)},D.fitHeight=function(e,t){return w_(D,e,t)},function(){return t=e.apply(this,arguments),D.invert=t.invert&&S,C()}}function F_(e){var t=0,n=hx/3,i=C_(e),r=i(t,n);return r.parallels=function(e){return arguments.length?i(t=e[0]*vx,n=e[1]*vx):[t*yx,n*yx]},r}function M_(e,t){var n=Sx(e),i=(n+Sx(t))/2;if(xx(i)<fx)return function(e){var t=wx(e);function n(e,n){return[e*t,Sx(n)/t]}return n.invert=function(e,n){return[e/t,Tx(n*t)]},n}(e);var r=1+n*(2*i-n),o=Fx(r)/i;function a(e,t){var n=Fx(r-2*i*Sx(t))/i;return[n*Sx(e*=i),o-n*wx(e)]}return a.invert=function(e,t){var n=o-t,a=_x(e,xx(n))*Cx(n);return n*i<0&&(a-=hx*Cx(e)*Cx(n)),[a/i,Tx((r-(e*e+n*n)*i*i)/(2*i))]},a}function O_(){return F_(M_).scale(155.424).center([0,33.6442])}function T_(){return O_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function z_(e){return function(t,n){var i=wx(t),r=wx(n),o=e(i*r);return o===1/0?[2,0]:[o*r*Sx(t),o*Sx(n)]}}function N_(e){return function(t,n){var i=Fx(t*t+n*n),r=e(i),o=Sx(r),a=wx(r);return[_x(t*o,i*a),Tx(i&&n*o/i)]}}var R_=z_((function(e){return Fx(2/(1+e))}));R_.invert=N_((function(e){return 2*Tx(e/2)}));var P_=z_((function(e){return(e=Ox(e))&&e/Sx(e)}));function B_(e,t){return[e,Ax(Mx((px+t)/2))]}function L_(e){var t,n,i,r=S_(e),o=r.center,a=r.scale,s=r.translate,l=r.clipExtent,u=null;function c(){var o=hx*a(),s=r(function(e){function t(t){return(t=e(t[0]*vx,t[1]*vx))[0]*=yx,t[1]*=yx,t}return e=d_(e[0]*vx,e[1]*vx,e.length>2?e[2]*vx:0),t.invert=function(t){return(t=e.invert(t[0]*vx,t[1]*vx))[0]*=yx,t[1]*=yx,t},t}(r.rotate()).invert([0,0]));return l(null==u?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===B_?[[Math.max(s[0]-o,u),t],[Math.min(s[0]+o,n),i]]:[[u,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(e){return arguments.length?(a(e),c()):a()},r.translate=function(e){return arguments.length?(s(e),c()):s()},r.center=function(e){return arguments.length?(o(e),c()):o()},r.clipExtent=function(e){return arguments.length?(null==e?u=t=n=i=null:(u=+e[0][0],t=+e[0][1],n=+e[1][0],i=+e[1][1]),c()):null==u?null:[[u,t],[n,i]]},c()}function I_(e){return Mx((px+e)/2)}function U_(e,t){var n=wx(e),i=e===t?Sx(e):Ax(n/wx(t))/Ax(I_(t)/I_(e)),r=n*Dx(I_(e),i)/i;if(!i)return B_;function o(e,t){r>0?t<-px+fx&&(t=-px+fx):t>px-fx&&(t=px-fx);var n=r/Dx(I_(t),i);return[n*Sx(i*e),r-n*wx(i*e)]}return o.invert=function(e,t){var n=r-t,o=Cx(i)*Fx(e*e+n*n),a=_x(e,xx(n))*Cx(n);return n*i<0&&(a-=hx*Cx(e)*Cx(n)),[a/i,2*bx(Dx(r/o,1/i))-px]},o}function j_(e,t){return[e,t]}function q_(e,t){var n=wx(e),i=e===t?Sx(e):(n-wx(t))/(t-e),r=n/i+e;if(xx(i)<fx)return j_;function o(e,t){var n=r-t,o=i*e;return[n*Sx(o),r-n*wx(o)]}return o.invert=function(e,t){var n=r-t,o=_x(e,xx(n))*Cx(n);return n*i<0&&(o-=hx*Cx(e)*Cx(n)),[o/i,r-Cx(i)*Fx(e*e+n*n)]},o}P_.invert=N_((function(e){return e})),B_.invert=function(e,t){return[e,2*bx($x(t))-px]},j_.invert=j_;var W_=1.340264,G_=-.081106,Y_=893e-6,H_=.003796,X_=Fx(3)/2;function V_(e,t){var n=Tx(X_*Sx(t)),i=n*n,r=i*i*i;return[e*wx(n)/(X_*(W_+3*G_*i+r*(7*Y_+9*H_*i))),n*(W_+G_*i+r*(Y_+H_*i))]}function K_(e,t){var n=wx(t),i=wx(e)*n;return[n*Sx(e)/i,Sx(t)/i]}function Q_(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),t*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function J_(e,t){return[wx(t)*Sx(e),Sx(t)]}function Z_(e,t){var n=wx(t),i=1+wx(e)*n;return[n*Sx(e)/i,Sx(t)/i]}function ew(e,t){return[Ax(Mx((px+t)/2)),-e]}V_.invert=function(e,t){for(var n,i=t,r=i*i,o=r*r*r,a=0;a<12&&(o=(r=(i-=n=(i*(W_+G_*r+o*(Y_+H_*r))-t)/(W_+3*G_*r+o*(7*Y_+9*H_*r)))*i)*r*r,!(xx(n)<dx));++a);return[X_*e*(W_+3*G_*r+o*(7*Y_+9*H_*r))/wx(i),Tx(Sx(i)/X_)]},K_.invert=N_(bx),Q_.invert=function(e,t){var n,i=t,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(xx(n)>fx&&--r>0);return[e/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},J_.invert=N_(Tx),Z_.invert=N_((function(e){return 2*bx(e)})),ew.invert=function(e,t){return[-t,2*bx($x(e))-px]};var tw=Math.abs,nw=(Math.atan,Math.atan2,Math.ceil,Math.cos),iw=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),rw=(Math.tan,1e-6),ow=Math.PI,aw=ow/2,sw=(Math.SQRT1_2,uw(2));uw(ow);function lw(e){return e>1?aw:e<-1?-aw:Math.asin(e)}function uw(e){return e>0?Math.sqrt(e):0}function cw(e,t){var n,i=e*iw(t),r=30;do{t-=n=(t+iw(t)-i)/(1+nw(t))}while(tw(n)>rw&&--r>0);return t/2}var fw=function(e,t,n){function i(i,r){return[e*i*nw(r=cw(n,r)),t*iw(r)]}return i.invert=function(i,r){return r=lw(r/t),[i/(e*nw(r)),lw((2*r+iw(2*r))/n)]},i}(sw/aw,sw,ow);const dw=Ib(),hw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function pw(e,t){if(!e||"string"!==typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(gw[e]=function(e,t){return function n(){const i=t();return i.type=e,i.path=Ib().projection(i),i.copy=i.copy||function(){const e=n();return hw.forEach((t=>{i[t]&&e[t](i[t]())})),e.path.pointRadius(i.path.pointRadius()),e},_f(i)}}(e,t),this):gw[e]||null}function mw(e){return e&&e.path||dw}const gw={albers:T_,albersusa:function(){var e,t,n,i,r,o,a=T_(),s=O_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=O_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(i.point(t,a),o)||(r.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),i=(e[0]-n[0])/t,r=(e[1]-n[1])/t;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:a).invert(e)},c.stream=function(n){return e&&t===n?e:e=function(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}([a.stream(t=n),s.stream(n),l.stream(n)])},c.precision=function(e){return arguments.length?(a.precision(e),s.precision(e),l.precision(e),f()):a.precision()},c.scale=function(e){return arguments.length?(a.scale(e),s.scale(.35*e),l.scale(e),c.translate(a.translate())):a.scale()},c.translate=function(e){if(!arguments.length)return a.translate();var t=a.scale(),o=+e[0],c=+e[1];return n=a.translate(e).clipExtent([[o-.455*t,c-.238*t],[o+.455*t,c+.238*t]]).stream(u),i=s.translate([o-.307*t,c+.201*t]).clipExtent([[o-.425*t+fx,c+.12*t+fx],[o-.214*t-fx,c+.234*t-fx]]).stream(u),r=l.translate([o-.205*t,c+.212*t]).clipExtent([[o-.214*t+fx,c+.166*t+fx],[o-.115*t-fx,c+.234*t-fx]]).stream(u),f()},c.fitExtent=function(e,t){return x_(c,e,t)},c.fitSize=function(e,t){return b_(c,e,t)},c.fitWidth=function(e,t){return __(c,e,t)},c.fitHeight=function(e,t){return w_(c,e,t)},c.scale(1070)},azimuthalequalarea:function(){return S_(R_).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return S_(P_).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return F_(U_).scale(109.5).parallels([30,30])},conicequalarea:O_,conicequidistant:function(){return F_(q_).scale(131.154).center([0,13.9389])},equalEarth:function(){return S_(V_).scale(177.158)},equirectangular:function(){return S_(j_).scale(152.63)},gnomonic:function(){return S_(K_).scale(144.049).clipAngle(60)},identity:function(){var e,t,n,i,r,o,a,s=1,l=0,u=0,c=1,f=1,d=0,h=null,p=1,m=1,g=g_({point:function(e,t){var n=x([e,t]);this.stream.point(n[0],n[1])}}),y=ix;function v(){return p=s*c,m=s*f,o=a=null,x}function x(n){var i=n[0]*p,r=n[1]*m;if(d){var o=r*e-i*t;i=i*e+r*t,r=o}return[i+l,r+u]}return x.invert=function(n){var i=n[0]-l,r=n[1]-u;if(d){var o=r*e+i*t;i=i*e-r*t,r=o}return[i/p,r/m]},x.stream=function(e){return o&&a===e?o:o=g(y(a=e))},x.postclip=function(e){return arguments.length?(y=e,h=n=i=r=null,v()):y},x.clipExtent=function(e){return arguments.length?(y=null==e?(h=n=i=r=null,ix):u_(h=+e[0][0],n=+e[0][1],i=+e[1][0],r=+e[1][1]),v()):null==h?null:[[h,n],[i,r]]},x.scale=function(e){return arguments.length?(s=+e,v()):s},x.translate=function(e){return arguments.length?(l=+e[0],u=+e[1],v()):[l,u]},x.angle=function(n){return arguments.length?(t=Sx(d=n%360*vx),e=wx(d),v()):d*yx},x.reflectX=function(e){return arguments.length?(c=e?-1:1,v()):c<0},x.reflectY=function(e){return arguments.length?(f=e?-1:1,v()):f<0},x.fitExtent=function(e,t){return x_(x,e,t)},x.fitSize=function(e,t){return b_(x,e,t)},x.fitWidth=function(e,t){return __(x,e,t)},x.fitHeight=function(e,t){return w_(x,e,t)},x},mercator:function(){return L_(B_).scale(961/gx)},mollweide:function(){return S_(fw).scale(169.529)},naturalEarth1:function(){return S_(Q_).scale(175.295)},orthographic:function(){return S_(J_).scale(249.5).clipAngle(90+fx)},stereographic:function(){return S_(Z_).scale(250).clipAngle(142)},transversemercator:function(){var e=L_(ew),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const gz in gw)pw(gz,gw[gz]);function yw(e,t,n){var i=Xo(e,t-fx,n).concat(t);return function(e){return i.map((function(t){return[e,t]}))}}function vw(e,t,n){var i=Xo(e,t-fx,n).concat(t);return function(e){return i.map((function(t){return[t,e]}))}}function xw(){var e,t,n,i,r,o,a,s,l,u,c,f,d=10,h=d,p=90,m=360,g=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return Xo(kx(i/p)*p,n,p).map(c).concat(Xo(kx(s/m)*m,a,m).map(f)).concat(Xo(kx(t/d)*d,e,d).filter((function(e){return xx(e%p)>fx})).map(l)).concat(Xo(kx(o/h)*h,r,h).filter((function(e){return xx(e%m)>fx})).map(u))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(i).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],i>n&&(e=i,i=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(g)):[[i,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],r=+n[1][1],t>e&&(n=t,t=e,e=n),o>r&&(n=o,o=r,r=n),y.precision(g)):[[t,o],[e,r]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],m=+e[1],y):[p,m]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(g=+d,l=yw(o,r,90),u=vw(t,e,g),c=yw(s,a,90),f=vw(i,n,g),y):g},y.extentMajor([[-180,-90+fx],[180,90-fx]]).extentMinor([[-180,-80-fx],[180,80+fx]])}function bw(){}const _w=[[],[[[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 ww(){var e=1,t=1,n=a;function i(e,t){return t.map((t=>r(e,t)))}function r(i,r){var a=[],s=[];return function(n,i,r){var a,s,l,u,c,f,d=[],h=[];a=s=-1,u=n[0]>=i,_w[u<<1].forEach(p);for(;++a<e-1;)l=u,u=n[a+1]>=i,_w[l|u<<1].forEach(p);_w[u|0].forEach(p);for(;++s<t-1;){for(a=-1,u=n[s*e+e]>=i,c=n[s*e]>=i,_w[u<<1|c<<2].forEach(p);++a<e-1;)l=u,u=n[s*e+e+a+1]>=i,f=c,c=n[s*e+a+1]>=i,_w[l|u<<1|c<<2|f<<3].forEach(p);_w[u|c<<3].forEach(p)}a=-1,c=n[s*e]>=i,_w[c<<2].forEach(p);for(;++a<e-1;)f=c,c=n[s*e+a+1]>=i,_w[c<<2|f<<3].forEach(p);function p(e){var t,n,i=[e[0][0]+a,e[0][1]+s],l=[e[1][0]+a,e[1][1]+s],u=o(i),c=o(l);(t=h[u])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(l),r(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(l),h[t.end=c]=t):(t=d[c])?(n=h[u])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(l),r(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(i),d[t.start=u]=t):d[u]=h[c]={start:u,end:c,ring:[i,l]}}_w[c<<3].forEach(p)}(i,r,(e=>{n(e,i,r),function(e){var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];for(;++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}(e)>0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,i=a.length;n<i;++n)if(-1!==kw((t=a[n])[0],e))return void t.push(e)})),{type:"MultiPolygon",value:r,coordinates:a}}function o(t){return 2*t[0]+t[1]*(e+1)*4}function a(n,i,r){n.forEach((n=>{var o,a=n[0],s=n[1],l=0|a,u=0|s,c=i[u*e+l];a>0&&a<e&&l===a&&(o=i[u*e+l-1],n[0]=a+(r-o)/(c-o)-.5),s>0&&s<t&&u===s&&(o=i[(u-1)*e+l],n[1]=s+(r-o)/(c-o)-.5)}))}return i.contour=r,i.size=function(n){if(!arguments.length)return[e,t];var r=Math.floor(n[0]),o=Math.floor(n[1]);return r>=0&&o>=0||(0,m.z3)("invalid size"),e=r,t=o,i},i.smooth=function(e){return arguments.length?(n=e?a:bw,i):n===a},i}function kw(e,t){for(var n,i=-1,r=t.length;++i<r;)if(n=$w(e,t[i]))return n;return 0}function $w(e,t){for(var n=t[0],i=t[1],r=-1,o=0,a=e.length,s=a-1;o<a;s=o++){var l=e[o],u=l[0],c=l[1],f=e[s],d=f[0],h=f[1];if(Ew(l,f,t))return 0;c>i!==h>i&&n<(d-u)*(i-c)/(h-c)+u&&(r=-r)}return r}function Ew(e,t,n){var i,r,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(r=e[i=+(e[0]===t[0])],o=n[i],a=t[i],r<=o&&o<=a||a<=o&&o<=r)}function Aw(e,t,n){return function(i){var r=(0,m.Xx)(i),o=n?Math.min(r[0],0):r[0],a=r[1],s=a-o,l=t?(0,T.sG)(o,a,e):s/(e+1);return Xo(o+l,a,l)}}function Dw(e){Nr.call(this,null,e)}function Sw(e,t,n,i,r){const o=e.x1||0,a=e.y1||0,s=t*n<0;function l(e){e.forEach(u)}function u(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+i,e[1]=(e[1]-a)*n+r}return function(e){return e.coordinates.forEach(l),e}}function Cw(e,t,n){const i=e>=0?e:Zr(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Fw(e){return(0,m.Tn)(e)?e:(0,m.dY)(+e)}function Mw(){var e=e=>e[0],t=e=>e[1],n=m.xH,i=[-1,-1],r=960,o=500,a=2;function s(s,l){const u=Cw(i[0],s,e)>>a,c=Cw(i[1],s,t)>>a,f=u?u+2:0,d=c?c+2:0,h=2*f+(r>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let y=m;s.forEach((i=>{const r=f+(+e(i)>>a),o=d+(+t(i)>>a);r>=0&&r<h&&o>=0&&o<p&&(m[r+o*h]+=+n(i))})),u>0&&c>0?(Ow(h,p,m,g,u),Tw(h,p,g,m,c),Ow(h,p,m,g,u),Tw(h,p,g,m,c),Ow(h,p,m,g,u),Tw(h,p,g,m,c)):u>0?(Ow(h,p,m,g,u),Ow(h,p,g,m,u),Ow(h,p,m,g,u),y=g):c>0&&(Tw(h,p,m,g,c),Tw(h,p,g,m,c),Tw(h,p,m,g,c),y=g);const v=l?Math.pow(2,-2*a):1/Ev(y);for(let e=0,t=h*p;e<t;++e)y[e]*=v;return{values:y,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(r>>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=Fw(t),s):e},s.y=function(e){return arguments.length?(t=Fw(e),s):t},s.weight=function(e){return arguments.length?(n=Fw(e),s):n},s.size=function(e){if(!arguments.length)return[r,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||(0,m.z3)("invalid size"),r=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||(0,m.z3)("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<<a},s.bandwidth=function(e){return arguments.length?(1===(e=(0,m.YO)(e)).length&&(e=[+e[0],+e[0]]),2!==e.length&&(0,m.z3)("invalid bandwidth"),i=e,s):i},s}function Ow(e,t,n,i,r){const o=1+(r<<1);for(let a=0;a<t;++a)for(let t=0,s=0;t<e+r;++t)t<e&&(s+=n[t+a*e]),t>=r&&(t>=o&&(s-=n[t-o+a*e]),i[t-r+a*e]=s/Math.min(t+1,e-1+o-t,o))}function Tw(e,t,n,i,r){const o=1+(r<<1);for(let a=0;a<e;++a)for(let s=0,l=0;s<t+r;++s)s<t&&(l+=n[a+s*e]),s>=r&&(s>=o&&(l-=n[a+(s-o)*e]),i[a+(s-r)*e]=l/Math.min(s+1,t-1+o-s,o))}function zw(e){Nr.call(this,null,e)}Dw.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.B)(Dw,Nr,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||m.D_,o=ww().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const i=Aw(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(e.map((e=>Ir(t(e).values))))}(i,r,e),s=null===e.as?null:e.as||"contour",l=[];return i.forEach((t=>{const n=r(t),i=o.size([n.width,n.height])(n.values,(0,m.cy)(a)?a:a(n.values));!function(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;(0,m.Tn)(r)&&(r=r(n,i));(0,m.Tn)(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const a=((0,m.Et)(r)?r:r[0])||1,s=((0,m.Et)(r)?r:r[1])||1,l=o&&o[0]||0,u=o&&o[1]||0;e.forEach(Sw(t,a,s,l,u))}(i,n,t,e),i.forEach((e=>{l.push(ar(t,rr(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),zw.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const Nw=["x","y","weight","size","cellSize","bandwidth"];function Rw(e,t){return Nw.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function Pw(e){Nr.call(this,null,e)}(0,m.B)(zw,Nr,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=function(e,t){var n,i,r,o,a,s,l=[],u=e=>e(o);if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)o=e[i],(s=n[a=t.map(u)])||(n[a]=s=[],s.dims=a,l.push(s)),s.push(o);return l}(t.materialize(t.SOURCE).source,e.groupby),o=(e.groupby||[]).map(m.N6),a=Rw(Mw(),e),s=e.as||"grid";return n=r.map((t=>rr(function(e,t){for(let n=0;n<o.length;++n)e[o[n]]=t[n];return e}({[s]:a(t,e.counts)},t.dims)))),this.value&&(i.rem=this.value),this.value=i.source=i.add=n,i}}),Pw.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.B)(Pw,Nr,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=ww().smooth(!1!==e.smooth),a=e.values,s=e.thresholds||Aw(e.count||10,e.nice,!!a),l=e.size;return a||(a=t.materialize(t.SOURCE).source,i=Sw(n=Rw(Mw(),e)(a,!0),n.scale||1,n.scale||1,0,0),l=[n.width,n.height],a=n.values),s=(0,m.cy)(s)?s:s(a),a=o.size(l)(a,s),i&&a.forEach(i),this.value&&(r.rem=this.value),this.value=r.source=r.add=(a||[]).map(rr),r}});const Bw="Feature",Lw="FeatureCollection";function Iw(e){Nr.call(this,null,e)}function Uw(e){Nr.call(this,null,e)}function jw(e){Nr.call(this,null,e)}function qw(e){Nr.call(this,null,e)}function Ww(e){Nr.call(this,[],e),this.generator=xw()}function Gw(e){Nr.call(this,null,e)}function Yw(e){if(!(0,m.Tn)(e))return!1;const t=(0,m.M1)((0,m.nS)(e));return t.$x||t.$y||t.$value||t.$max}function Hw(e){Nr.call(this,null,e),this.modified(!0)}function Xw(e,t,n){(0,m.Tn)(e[t])&&e[t](n)}function Vw(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o,a,s,l,u,c,f,d,h=e._root,p={data:i},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a,r=h,!(h=h[f=c<<1|u]))return r[f]=p,e;if(s=+e._x.call(null,h.data),l=+e._y.call(null,h.data),t===s&&n===l)return p.next=h,r?r[f]=p:e._root=p,e;do{r=r?r[f]=new Array(4):e._root=new Array(4),(u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a}while((f=c<<1|u)===(d=(l>=a)<<1|s>=o));return r[d]=h,r[f]=p,e}function Kw(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function Qw(e){return e[0]}function Jw(e){return e[1]}function Zw(e,t,n){var i=new ek(null==t?Qw:t,null==n?Jw:n,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function ek(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function tk(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}Iw.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,m.B)(Iw,Nr,{transform(e,t){var n,i=this._features,r=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],l=e.geojson||!o&&m.D_,u=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified((0,m.nS)(l))||a&&t.modified((0,m.nS)(a))||s&&t.modified((0,m.nS)(s)),this.value&&!n||(u=t.SOURCE,this._features=i=[],this._points=r=[]),l&&t.visit(u,(e=>i.push(l(e)))),a&&s&&(t.visit(u,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&r.push([t,n])})),i=i.concat({type:Bw,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:Lw,features:i}}}),Uw.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.B)(Uw,Nr,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||m.D_,o=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=mw(e.projection),n.materialize().reflow()):a=r===m.D_||t.modified(r.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(i,e.pointRadius);return n.visit(a,(e=>e[o]=i(r(e)))),i.pointRadius(s),n.modifies(o)}}),jw.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.B)(jw,Nr,{transform(e,t){var n,i=e.projection,r=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],l=a[1];function u(e){const t=i([r(e),o(e)]);t?(e[s]=t[0],e[l]=t[1]):(e[s]=void 0,e[l]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(n=t.modified(r.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,u)),t.modifies(a)}}),qw.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.B)(qw,Nr,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return i&&!e.modified()||(this.value=i=function(e,t,n){const i=null==n?n=>e(t(n)):i=>{var r=e.pointRadius(),o=e.pointRadius(n)(t(i));return e.pointRadius(r),o};return i.context=t=>(e.context(t),i),i}(mw(e.projection),e.field||(0,m.ZZ)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[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.B)(Ww,Nr,{transform(e,t){var n,i=this.value,r=this.generator;if(!i.length||e.modified())for(const o in e)(0,m.Tn)(r[o])&&r[o](e[o]);return n=r(),i.length?t.mod.push(sr(i[0],n)):t.add.push(rr(n)),i[0]=n,t}}),Gw.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.B)(Gw,Nr,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i="shared"===e.resolve,r=e.field||m.D_,o=function(e,t){let n;(0,m.Tn)(e)?(n=n=>e(n,t),n.dep=Yw(e)):e?n=(0,m.dY)(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;(0,m.Tn)(e)?(n=n=>(0,Yu.Qh)(e(n,t)),n.dep=Yw(e)):n=(0,m.dY)((0,Yu.Qh)(e||"#888"));return n}(e.color,e),s=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?Ir(n.map((e=>Ir(r(e).values)))):0};return n.forEach((e=>{const t=r(e),n=(0,m.X$)({},e,l);i||(n.$max=Ir(t.values||[])),e[s]=function(e,t,n,i){const r=e.width,o=e.height,a=e.x1||0,s=e.y1||0,l=e.x2||r,u=e.y2||o,c=e.values,f=c?e=>c[e]:m.v_,d=Nl(l-a,u-s),h=d.getContext("2d"),p=h.getImageData(0,0,l-a,u-s),g=p.data;for(let m=s,y=0;m<u;++m){t.$y=m-s;for(let e=a,o=m*r;e<l;++e,y+=4){t.$x=e-a,t.$value=f(e+o);const r=n(t);g[y+0]=r.r,g[y+1]=r.g,g[y+2]=r.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}(t,n,a.dep?a:(0,m.dY)(a(n)),o.dep?o:(0,m.dY)(o(n)))})),t.reflow(!0).modifies(s)}}),(0,m.B)(Hw,Nr,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=function(e){const t=pw((e||"mercator").toLowerCase());t||(0,m.z3)("Unrecognized projection type: "+e);return t()}(e.type),hw.forEach((t=>{null!=e[t]&&Xw(n,t,e[t])}))):hw.forEach((t=>{e.modified(t)&&Xw(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return e=(0,m.YO)(e),1===e.length?e[0]:{type:Lw,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===Lw?e.features:(0,m.YO)(e).filter((e=>null!=e)).map((e=>e.type===Bw?e:{type:Bw,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var nk=Zw.prototype=ek.prototype;function ik(e){return function(){return e}}function rk(e){return 1e-6*(e()-.5)}function ok(e){return e.x+e.vx}function ak(e){return e.y+e.vy}nk.copy=function(){var e,t,n=new ek(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=tk(i),n;for(e=[{source:i,target:n._root=new Array(4)}];i=e.pop();)for(var r=0;r<4;++r)(t=i.source[r])&&(t.length?e.push({source:t,target:i.target[r]=new Array(4)}):i.target[r]=tk(t));return n},nk.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Vw(this.cover(t,n),t,n,e)},nk.addAll=function(e){var t,n,i,r,o=e.length,a=new Array(o),s=new Array(o),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(a[n]=i,s[n]=r,i<l&&(l=i),i>c&&(c=i),r<u&&(u=r),r>f&&(f=r));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;n<o;++n)Vw(this,a[n],s[n],e[n]);return this},nk.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var a,s,l=r-n||1,u=this._root;n>e||e>=r||i>t||t>=o;)switch(s=(t<i)<<1|e<n,(a=new Array(4))[s]=u,u=a,l*=2,s){case 0:r=n+l,o=i+l;break;case 1:n=r-l,o=i+l;break;case 2:r=n+l,i=o-l;break;case 3:n=r-l,i=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},nk.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},nk.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},nk.find=function(e,t,n){var i,r,o,a,s,l,u,c=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],m=this._root;for(m&&p.push(new Kw(m,c,f,d,h)),null==n?n=1/0:(c=e-n,f=t-n,d=e+n,h=t+n,n*=n);l=p.pop();)if(!(!(m=l.node)||(r=l.x0)>d||(o=l.y0)>h||(a=l.x1)<c||(s=l.y1)<f))if(m.length){var g=(r+a)/2,y=(o+s)/2;p.push(new Kw(m[3],g,y,a,s),new Kw(m[2],r,y,g,s),new Kw(m[1],g,o,a,y),new Kw(m[0],r,o,g,y)),(u=(t>=y)<<1|e>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,m.data),x=t-+this._y.call(null,m.data),b=v*v+x*x;if(b<n){var _=Math.sqrt(n=b);c=e-_,f=t-_,d=e+_,h=t+_,i=m.data}}return i},nk.remove=function(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,n,i,r,o,a,s,l,u,c,f,d,h=this._root,p=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!h)return this;if(h.length)for(;;){if((u=o>=(s=(p+g)/2))?p=s:g=s,(c=a>=(l=(m+y)/2))?m=l:y=l,t=h,!(h=h[f=c<<1|u]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(i=h,!(h=h.next))return this;return(r=h.next)&&delete h.next,i?(r?i.next=r:delete i.next,this):t?(r?t[f]=r:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=r,this)},nk.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},nk.root=function(){return this._root},nk.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},nk.visit=function(e){var t,n,i,r,o,a,s=[],l=this._root;for(l&&s.push(new Kw(l,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(l=t.node,i=t.x0,r=t.y0,o=t.x1,a=t.y1)&&l.length){var u=(i+o)/2,c=(r+a)/2;(n=l[3])&&s.push(new Kw(n,u,c,o,a)),(n=l[2])&&s.push(new Kw(n,i,c,u,a)),(n=l[1])&&s.push(new Kw(n,u,r,o,c)),(n=l[0])&&s.push(new Kw(n,i,r,u,c))}return this},nk.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new Kw(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var r=t.node;if(r.length){var o,a=t.x0,s=t.y0,l=t.x1,u=t.y1,c=(a+l)/2,f=(s+u)/2;(o=r[0])&&n.push(new Kw(o,a,s,c,f)),(o=r[1])&&n.push(new Kw(o,c,s,l,f)),(o=r[2])&&n.push(new Kw(o,a,f,c,u)),(o=r[3])&&n.push(new Kw(o,c,f,l,u))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},nk.x=function(e){return arguments.length?(this._x=e,this):this._x},nk.y=function(e){return arguments.length?(this._y=e,this):this._y};var sk={value:()=>{}};function lk(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new uk(i)}function uk(e){this._=e}function ck(e,t){for(var n,i=0,r=e.length;i<r;++i)if((n=e[i]).name===t)return n.value}function fk(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=sk,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}uk.prototype=lk.prototype={constructor:uk,on:function(e,t){var n,i,r=this._,o=(i=r,(e+"").trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=o[a]).type)r[n]=fk(r[n],e.name,t);else if(null==t)for(n in r)r[n]=fk(r[n],e.name,null);return this}for(;++a<s;)if((n=(e=o[a]).type)&&(n=ck(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new uk(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(o=0,n=(i=this._[e]).length;o<n;++o)i[o].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};const dk=lk;var hk=n(79341);const pk=1664525,mk=1013904223,gk=4294967296;function yk(e){return e.x}function vk(e){return e.y}var xk=10,bk=Math.PI*(3-Math.sqrt(5));function _k(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=new Map,l=(0,hk.O1)(f),u=dk("tick","end"),c=function(){let e=1;return()=>(e=(pk*e+mk)%gk)/gk}();function f(){d(),u.call("tick",t),n<i&&(l.stop(),u.call("end",t))}function d(i){var l,u,c=e.length;void 0===i&&(i=1);for(var f=0;f<i;++f)for(n+=(o-n)*r,s.forEach((function(e){e(n)})),l=0;l<c;++l)null==(u=e[l]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return t}function h(){for(var t,n=0,i=e.length;n<i;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var r=xk*Math.sqrt(.5+n),o=n*bk;t.x=r*Math.cos(o),t.y=r*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e,c),t}return null==e&&(e=[]),h(),t={tick:d,restart:function(){return l.restart(f),t},stop:function(){return l.stop(),t},nodes:function(n){return arguments.length?(e=n,h(),s.forEach(p),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(i=+e,t):i},alphaDecay:function(e){return arguments.length?(r=+e,t):+r},alphaTarget:function(e){return arguments.length?(o=+e,t):o},velocityDecay:function(e){return arguments.length?(a=1-e,t):1-a},randomSource:function(e){return arguments.length?(c=e,s.forEach(p),t):c},force:function(e,n){return arguments.length>1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,i){var r,o,a,s,l,u=0,c=e.length;for(null==i?i=1/0:i*=i,u=0;u<c;++u)(a=(r=t-(s=e[u]).x)*r+(o=n-s.y)*o)<i&&(l=s,i=a);return l},on:function(e,n){return arguments.length>1?(u.on(e,n),t):u.on(e)}}}function wk(e){return e.index}function kk(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const $k={center:function(e,t){var n,i=1;function r(){var r,o,a=n.length,s=0,l=0;for(r=0;r<a;++r)s+=(o=n[r]).x,l+=o.y;for(s=(s/a-e)*i,l=(l/a-t)*i,r=0;r<a;++r)(o=n[r]).x-=s,o.y-=l}return null==e&&(e=0),null==t&&(t=0),r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r.strength=function(e){return arguments.length?(i=+e,r):i},r},collide:function(e){var t,n,i,r=1,o=1;function a(){for(var e,a,l,u,c,f,d,h=t.length,p=0;p<o;++p)for(a=Zw(t,ok,ak).visitAfter(s),e=0;e<h;++e)l=t[e],f=n[l.index],d=f*f,u=l.x+l.vx,c=l.y+l.vy,a.visit(m);function m(e,t,n,o,a){var s=e.data,h=e.r,p=f+h;if(!s)return t>u+p||o<u-p||n>c+p||a<c-p;if(s.index>l.index){var m=u-s.x-s.vx,g=c-s.y-s.vy,y=m*m+g*g;y<p*p&&(0===m&&(y+=(m=rk(i))*m),0===g&&(y+=(g=rk(i))*g),y=(p-(y=Math.sqrt(y)))/y*r,l.vx+=(m*=y)*(p=(h*=h)/(d+h)),l.vy+=(g*=y)*p,s.vx-=m*(p=1-p),s.vy-=g*p)}}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function l(){if(t){var i,r,o=t.length;for(n=new Array(o),i=0;i<o;++i)r=t[i],n[r.index]=+e(r,i,t)}}return"function"!==typeof e&&(e=ik(null==e?1:+e)),a.initialize=function(e,n){t=e,i=n,l()},a.iterations=function(e){return arguments.length?(o=+e,a):o},a.strength=function(e){return arguments.length?(r=+e,a):r},a.radius=function(t){return arguments.length?(e="function"===typeof t?t:ik(+t),l(),a):e},a},nbody:function(){var e,t,n,i,r,o=ik(-30),a=1,s=1/0,l=.81;function u(n){var r,o=e.length,a=Zw(e,yk,vk).visitAfter(f);for(i=n,r=0;r<o;++r)t=e[r],a.visit(d)}function c(){if(e){var t,n,i=e.length;for(r=new Array(i),t=0;t<i;++t)n=e[t],r[n.index]=+o(n,t,e)}}function f(e){var t,n,i,o,a,s=0,l=0;if(e.length){for(i=o=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(s+=t.value,l+=n,i+=n*t.x,o+=n*t.y);e.x=i/l,e.y=o/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=r[t.data.index]}while(t=t.next)}e.value=s}function d(e,o,u,c){if(!e.value)return!0;var f=e.x-t.x,d=e.y-t.y,h=c-o,p=f*f+d*d;if(h*h/l<p)return p<s&&(0===f&&(p+=(f=rk(n))*f),0===d&&(p+=(d=rk(n))*d),p<a&&(p=Math.sqrt(a*p)),t.vx+=f*e.value*i/p,t.vy+=d*e.value*i/p),!0;if(!(e.length||p>=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=rk(n))*f),0===d&&(p+=(d=rk(n))*d),p<a&&(p=Math.sqrt(a*p)));do{e.data!==t&&(h=r[e.data.index]*i/p,t.vx+=f*h,t.vy+=d*h)}while(e=e.next)}}return u.initialize=function(t,i){e=t,n=i,c()},u.strength=function(e){return arguments.length?(o="function"===typeof e?e:ik(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.distanceMax=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u.theta=function(e){return arguments.length?(l=e*e,u):Math.sqrt(l)},u},link:function(e){var t,n,i,r,o,a,s=wk,l=function(e){return 1/Math.min(r[e.source.index],r[e.target.index])},u=ik(30),c=1;function f(i){for(var r=0,s=e.length;r<c;++r)for(var l,u,f,d,h,p,m,g=0;g<s;++g)u=(l=e[g]).source,d=(f=l.target).x+f.vx-u.x-u.vx||rk(a),h=f.y+f.vy-u.y-u.vy||rk(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*i*t[g],h*=p,f.vx-=d*(m=o[g]),f.vy-=h*m,u.vx+=d*(m=1-m),u.vy+=h*m}function d(){if(i){var a,l,u=i.length,c=e.length,f=new Map(i.map(((e,t)=>[s(e,t,i),e])));for(a=0,r=new Array(u);a<c;++a)(l=e[a]).index=a,"object"!==typeof l.source&&(l.source=kk(f,l.source)),"object"!==typeof l.target&&(l.target=kk(f,l.target)),r[l.source.index]=(r[l.source.index]||0)+1,r[l.target.index]=(r[l.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)l=e[a],o[a]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);t=new Array(c),h(),n=new Array(c),p()}}function h(){if(i)for(var n=0,r=e.length;n<r;++n)t[n]=+l(e[n],n,e)}function p(){if(i)for(var t=0,r=e.length;t<r;++t)n[t]=+u(e[t],t,e)}return null==e&&(e=[]),f.initialize=function(e,t){i=e,a=t,d()},f.links=function(t){return arguments.length?(e=t,d(),f):e},f.id=function(e){return arguments.length?(s=e,f):s},f.iterations=function(e){return arguments.length?(c=+e,f):c},f.strength=function(e){return arguments.length?(l="function"===typeof e?e:ik(+e),h(),f):l},f.distance=function(e){return arguments.length?(u="function"===typeof e?e:ik(+e),p(),f):u},f},x:function(e){var t,n,i,r=ik(.1);function o(e){for(var r,o=0,a=t.length;o<a;++o)(r=t[o]).vx+=(i[o]-r.x)*n[o]*e}function a(){if(t){var o,a=t.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+e(t[o],o,t))?0:+r(t[o],o,t)}}return"function"!==typeof e&&(e=ik(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:ik(+e),a(),o):r},o.x=function(t){return arguments.length?(e="function"===typeof t?t:ik(+t),a(),o):e},o},y:function(e){var t,n,i,r=ik(.1);function o(e){for(var r,o=0,a=t.length;o<a;++o)(r=t[o]).vy+=(i[o]-r.y)*n[o]*e}function a(){if(t){var o,a=t.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+e(t[o],o,t))?0:+r(t[o],o,t)}}return"function"!==typeof e&&(e=ik(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:ik(+e),a(),o):r},o.y=function(t){return arguments.length?(e="function"===typeof t?t:ik(+t),a(),o):e},o}},Ek="forces",Ak=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Dk=["static","iterations"],Sk=["x","y","vx","vy"];function Ck(e){Nr.call(this,null,e)}function Fk(e,t,n,i){var r,o,a,s,l=(0,m.YO)(t.forces);for(r=0,o=Ak.length;r<o;++r)(a=Ak[r])!==Ek&&t.modified(a)&&e[a](t[a]);for(r=0,o=l.length;r<o;++r)s=Ek+r,(a=n||t.modified(Ek,r)?Ok(l[r]):i&&Mk(l[r],i)?e.force(s):null)&&e.force(s,a);for(o=e.numForces||0;r<o;++r)e.force(Ek+r,null);return e.numForces=l.length,e}function Mk(e,t){var n,i;for(n in e)if((0,m.Tn)(i=e[n])&&t.modified((0,m.nS)(i)))return 1;return 0}function Ok(e){var t,n;for(n in(0,m.mQ)($k,e.force)||(0,m.z3)("Unrecognized force: "+e.force),t=$k[e.force](),e)(0,m.Tn)(t[n])&&Tk(t[n],e[n],e);return t}function Tk(e,t,n){e((0,m.Tn)(t)?e=>t(e,n):t)}function zk(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Nk(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Pk)):void 0===t&&(t=Rk);for(var n,i,r,o,a,s=new Ik(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Ik(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Lk)}function Rk(e){return e.children}function Pk(e){return Array.isArray(e)?e[1]:null}function Bk(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Lk(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ik(e){this.data=e,this.depth=this.height=0,this.parent=null}function Uk(e){return null==e?null:jk(e)}function jk(e){if("function"!==typeof e)throw new Error;return e}function qk(){return 0}function Wk(e){return function(){return e}}Ck.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:Sk}]},(0,m.B)(Ck,Nr,{transform(e,t){var n,i,r=this.value,o=t.changed(t.ADD_REM),a=e.modified(Ak),s=e.iterations||300;if(r?(o&&(t.modifies("index"),r.nodes(t.source)),(a||t.changed(t.MOD))&&Fk(r,e,0,t)):(this.value=r=function(e,t){const n=_k(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),Fk(n,t,!0).on("end",(()=>o=!0))}(t.source,e),r.on("tick",(n=t.dataflow,i=this,()=>n.touch(i).run())),e.static||(o=!0,r.tick()),t.modifies("index")),a||o||e.modified(Dk)||t.changed()&&e.restart)if(r.alpha(Math.max(r.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/s)),e.static)for(r.stop();--s>=0;)r.tick();else if(r.stopped()&&r.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let s,l=this._argops,u=0,c=l.length;u<c;++u)if(s=l[u],s.name===Ek&&"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 t.reflow(e.modified()).modifies(Sk)}}),Ik.prototype=Nk.prototype={constructor:Ik,count:function(){return this.eachAfter(zk)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-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();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Nk(this).eachBefore(Bk)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};const Gk=1664525,Yk=1013904223,Hk=4294967296;function Xk(e,t){for(var n,i,r=0,o=(e=function(e,t){let n,i,r=e.length;for(;r;)i=t()*r--|0,n=e[r],e[r]=e[i],e[i]=n;return e}(Array.from(e),t)).length,a=[];r<o;)n=e[r],i&&Qk(i,n)?++r:(i=Zk(a=Vk(a,n)),r=0);return i}function Vk(e,t){var n,i;if(Jk(t,e))return[t];for(n=0;n<e.length;++n)if(Kk(t,e[n])&&Jk(e$(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(Kk(e$(e[n],e[i]),t)&&Kk(e$(e[n],t),e[i])&&Kk(e$(e[i],t),e[n])&&Jk(t$(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Kk(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Qk(e,t){var n=e.r-t.r+1e-9*Math.max(e.r,t.r,1),i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Jk(e,t){for(var n=0;n<t.length;++n)if(!Qk(e,t[n]))return!1;return!0}function Zk(e){switch(e.length){case 1:return function(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return e$(e[0],e[1]);case 3:return t$(e[0],e[1],e[2])}}function e$(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,a=t.y,s=t.r,l=o-n,u=a-i,c=s-r,f=Math.sqrt(l*l+u*u);return{x:(n+o+l/f*c)/2,y:(i+a+u/f*c)/2,r:(f+r+s)/2}}function t$(e,t,n){var i=e.x,r=e.y,o=e.r,a=t.x,s=t.y,l=t.r,u=n.x,c=n.y,f=n.r,d=i-a,h=i-u,p=r-s,m=r-c,g=l-o,y=f-o,v=i*i+r*r-o*o,x=v-a*a-s*s+l*l,b=v-u*u-c*c+f*f,_=h*p-d*m,w=(p*b-m*x)/(2*_)-i,k=(m*g-p*y)/_,$=(h*x-d*b)/(2*_)-r,E=(d*y-h*g)/_,A=k*k+E*E-1,D=2*(o+w*k+$*E),S=w*w+$*$-o*o,C=-(Math.abs(A)>1e-6?(D+Math.sqrt(D*D-4*A*S))/(2*A):S/D);return{x:i+w+k*C,y:r+$+E*C,r:C}}function n$(e,t,n){var i,r,o,a,s=e.x-t.x,l=e.y-t.y,u=s*s+l*l;u?(r=t.r+n.r,r*=r,a=e.r+n.r,r>(a*=a)?(i=(u+a-r)/(2*u),o=Math.sqrt(Math.max(0,a/u-i*i)),n.x=e.x-i*s-o*l,n.y=e.y-i*l+o*s):(i=(u+r-a)/(2*u),o=Math.sqrt(Math.max(0,r/u-i*i)),n.x=t.x+i*s-o*l,n.y=t.y+i*l+o*s)):(n.x=t.x+n.r,n.y=t.y)}function i$(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function r$(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function o$(e){this._=e,this.next=null,this.previous=null}function a$(e,t){if(!(o=(e=function(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,i,r,o,a,s,l,u,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;n$(i,n,r=e[2]),n=new o$(n),i=new o$(i),r=new o$(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;l<o;++l){n$(n._,i._,r=e[l]),r=new o$(r),u=i.next,c=n.previous,f=i._.r,d=n._.r;do{if(f<=d){if(i$(u._,r._)){i=u,n.next=i,i.previous=n,--l;continue e}f+=u._.r,u=u.next}else{if(i$(c._,r._)){(n=c).next=i,i.previous=n,--l;continue e}d+=c._.r,c=c.previous}}while(u!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=r$(n);(r=r.next)!==i;)(s=r$(r))<a&&(n=r,a=s);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Xk(n,t),l=0;l<o;++l)(n=e[l]).x-=r.x,n.y-=r.y;return r.r}function s$(e){return Math.sqrt(e.value)}function l$(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function u$(e,t,n){return function(i){if(r=i.children){var r,o,a,s=r.length,l=e(i)*t||0;if(l)for(o=0;o<s;++o)r[o].r+=l;if(a=a$(r,n),l)for(o=0;o<s;++o)r[o].r-=l;i.r=a+l}}}function c$(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function f$(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function d$(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,u=e.value&&(i-t)/e.value;++s<l;)(o=a[s]).y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*u}var h$={depth:-1},p$={},m$={};function g$(e){return e.id}function y$(e){return e.parentId}function v$(){var e,t=g$,n=y$;function i(i){var r,o,a,s,l,u,c,f,d=Array.from(i),h=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;b$(e,t-1)&&!b$(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(x$),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(x$(e)),d.push(m$));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],u=d[a]=new Ik(o),null!=(c=h(o,a,i))&&(c+="")&&(f=u.id=c,m.set(f,m.has(f)?p$:u)),null!=(c=p(o,a,i))&&(c+="")&&(u.parent=c);for(a=0;a<r;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===p$)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===m$&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(u=d[e]).data===m$;--e)u.data=null}if(s.parent=h$,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Lk),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Uk(e),i):t},i.parentId=function(e){return arguments.length?(n=Uk(e),i):n},i.path=function(t){return arguments.length?(e=Uk(t),i):e},i}function x$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!b$(e,t););return e.slice(0,t)}function b$(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0===(1&n))return!0}return!1}function _$(e,t){return e.parent===t.parent?1:2}function w$(e){var t=e.children;return t?t[0]:e.t}function k$(e){var t=e.children;return t?t[t.length-1]:e.t}function $$(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function E$(e,t,n){return e.a.parent===t.parent?e.a:n}function A$(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function D$(e,t){return e.parent===t.parent?1:2}function S$(e,t){return e+t.x}function C$(e,t){return Math.max(e,t.y)}function F$(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,u=e.value&&(r-n)/e.value;++s<l;)(o=a[s]).x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*u}A$.prototype=Object.create(Ik.prototype);var M$=(1+Math.sqrt(5))/2;function O$(e,t,n,i,r,o){for(var a,s,l,u,c,f,d,h,p,m,g,y=[],v=t.children,x=0,b=0,_=v.length,w=t.value;x<_;){l=r-n,u=o-i;do{c=v[b++].value}while(!c&&b<_);for(f=d=c,g=c*c*(m=Math.max(u/l,l/u)/(w*e)),p=Math.max(d/g,g/f);b<_;++b){if(c+=s=v[b].value,s<f&&(f=s),s>d&&(d=s),g=c*c*m,(h=Math.max(d/g,g/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:l<u,children:v.slice(x,b)}),a.dice?d$(a,n,i,r,w?i+=u*c/w:o):F$(a,n,i,w?n+=l*c/w:r,o),w-=c,x=b}return y}const T$=function e(t){function n(e,n,i,r,o){O$(t,e,n,i,r,o)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(M$),z$=function e(t){function n(e,n,i,r,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,l,u,c,f=-1,d=a.length,h=e.value;++f<d;){for(l=(s=a[f]).children,u=s.value=0,c=l.length;u<c;++u)s.value+=l[u].value;s.dice?d$(s,n,i,r,h?i+=(o-i)*s.value/h:o):F$(s,n,i,h?n+=(r-n)*s.value/h:r,o),h-=s.value}else e._squarify=a=O$(t,e,n,i,r,o),a.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(M$);function N$(e,t,n){const i={};return e.each((e=>{const r=e.data;n(r)&&(i[t(r)]=e)})),e.lookup=i,e}function R$(e){Nr.call(this,null,e)}R$.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const P$=e=>e.values;function B$(){const e=[],t={entries:e=>i(n(e,0),0),key:n=>(e.push(n),t)};function n(t,i){if(i>=e.length)return t;const r=t.length,o=e[i++],a={},s={};let l,u,c,f=-1;for(;++f<r;)l=o(u=t[f])+"",(c=a[l])?c.push(u):a[l]=[u];for(l in a)s[l]=n(a[l],i);return s}function i(t,n){if(++n>e.length)return t;const r=[];for(const e in t)r.push({key:e,values:i(t[e],n)});return r}return t}function L$(e){Nr.call(this,null,e)}(0,m.B)(R$,Nr,{transform(e,t){t.source||(0,m.z3)("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each((e=>{e.children&&tr(e.data)&&r.rem.push(e.data)})),this.value=o=Nk({values:(0,m.YO)(e.keys).reduce(((e,t)=>(e.key(t),e)),B$()).entries(r.source)},P$),n&&o.each((e=>{e.children&&(e=rr(e.data),r.add.push(e),r.source.push(e))})),N$(o,nr,nr)),r.source.root=o,r}});const I$=(e,t)=>e.parent===t.parent?1:2;(0,m.B)(L$,Nr,{transform(e,t){t.source&&t.source.root||(0,m.z3)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(lr(e.sort,(e=>e.data))),function(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}(n,this.params,e),n.separation&&n.separation(!1!==e.separation?I$:m.xH);try{this.value=n(r)}catch(a){(0,m.z3)(a)}return r.each((e=>function(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}(e,i,o))),t.reflow(e.modified()).modifies(o).modifies("leaf")}});const U$=["x","y","r","depth","children"];function j$(e){L$.call(this,e)}j$.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:U$.length,default:U$}]},(0,m.B)(j$,L$,{layout:function(){var e=null,t=1,n=1,i=qk;function r(r){const o=function(){let e=1;return()=>(e=(Gk*e+Yk)%Hk)/Hk}();return r.x=t/2,r.y=n/2,e?r.eachBefore(l$(e)).eachAfter(u$(i,.5,o)).eachBefore(c$(1)):r.eachBefore(l$(s$)).eachAfter(u$(qk,1,o)).eachAfter(u$(i,r.r/Math.min(t,n),o)).eachBefore(c$(Math.min(t,n)/(2*r.r))),r}return r.radius=function(t){return arguments.length?(e=Uk(t),r):e},r.size=function(e){return arguments.length?(t=+e[0],n=+e[1],r):[t,n]},r.padding=function(e){return arguments.length?(i="function"===typeof e?e:Wk(+e),r):i},r},params:["radius","size","padding"],fields:U$});const q$=["x0","y0","x1","y1","depth","children"];function W$(e){L$.call(this,e)}function G$(e){Nr.call(this,null,e)}W$.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:q$.length,default:q$}]},(0,m.B)(W$,L$,{layout:function(){var e=1,t=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=e,r.y1=t/o,r.eachBefore(function(e,t){return function(i){i.children&&d$(i,i.x0,e*(i.depth+1)/t,i.x1,e*(i.depth+2)/t);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}}(t,o)),i&&r.eachBefore(f$),r}return r.round=function(e){return arguments.length?(i=!!e,r):i},r.size=function(n){return arguments.length?(e=+n[0],t=+n[1],r):[e,t]},r.padding=function(e){return arguments.length?(n=+e,r):n},r},params:["size","round","padding"],fields:q$}),G$.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,m.B)(G$,Nr,{transform(e,t){t.source||(0,m.z3)("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?N$(v$().id(e.key).parentId(e.parentKey)(r.source),e.key,m.vN):N$(v$()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Y$={tidy:function(){var e=_$,t=1,n=1,i=null;function r(r){var l=function(e){for(var t,n,i,r,o,a=new A$(e,0),s=[a];t=s.pop();)if(i=t._.children)for(t.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=t.children[r]=new A$(i[r],r)),n.parent=t;return(a.parent=new A$(null,0)).children=[a],a}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),i)r.eachBefore(s);else{var u=r,c=r,f=r;r.eachBefore((function(e){e.x<u.x&&(u=e),e.x>c.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=u===c?1:e(u,c)/2,h=d-u.x,p=t/(c.x+d+h),m=n/(f.depth||1);r.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*m}))}return r}function o(t){var n=t.children,i=t.parent.children,r=t.i?i[t.i-1]:null;if(n){!function(e){for(var t,n=0,i=0,r=e.children,o=r.length;--o>=0;)(t=r[o]).z+=n,t.m+=n,n+=t.s+(i+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;r?(t.z=r.z+e(t._,r._),t.m=t.z-o):t.z=o}else r&&(t.z=r.z+e(t._,r._));t.parent.A=function(t,n,i){if(n){for(var r,o=t,a=t,s=n,l=o.parent.children[0],u=o.m,c=a.m,f=s.m,d=l.m;s=k$(s),o=w$(o),s&&o;)l=w$(l),(a=k$(a)).a=t,(r=s.z+f-o.z-u+e(s._,o._))>0&&($$(E$(s,t,i),t,r),u+=r,c+=r),f+=s.m,u+=o.m,d+=l.m,c+=a.m;s&&!k$(a)&&(a.t=s,a.m+=f-c),o&&!w$(l)&&(l.t=o,l.m+=u-d,i=t)}return i}(t,r,t.parent.A||i[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r},cluster:function(){var e=D$,t=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(S$,0)/e.length}(n),t.y=function(e){return 1+e.reduce(C$,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(r),l=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(r),u=s.x-e(s,l)/2,c=l.x+e(l,s)/2;return r.eachAfter(i?function(e){e.x=(e.x-r.x)*t,e.y=(r.y-e.y)*n}:function(e){e.x=(e.x-u)/(c-u)*t,e.y=(1-(r.y?e.y/r.y:1))*n})}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r}},H$=["x","y","depth","children"];function X$(e){L$.call(this,e)}function V$(e){Nr.call(this,[],e)}X$.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:H$.length,default:H$}]},(0,m.B)(X$,L$,{layout(e){const t=e||"tidy";if((0,m.mQ)(Y$,t))return Y$[t]();(0,m.z3)("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:H$}),V$.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,m.B)(V$,Nr,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||(0,m.z3)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,(e=>o[nr(e)]=1)),i.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[nr(t)]&&o[nr(n)]&&r.add.push(rr({source:n,target:t}))})),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[nr(e)]=1)),n.forEach((e=>{(o[nr(e.source)]||o[nr(e.target)])&&r.mod.push(e)}))),r}});const K$={binary:function(e,t,n,i,r){var o,a,s=e.children,l=s.length,u=new Array(l+1);for(u[0]=a=o=0;o<l;++o)u[o+1]=a+=s[o].value;!function e(t,n,i,r,o,a,l){if(t>=n-1){var c=s[t];return c.x0=r,c.y0=o,c.x1=a,void(c.y1=l)}var f=u[t],d=i/2+f,h=t+1,p=n-1;for(;h<p;){var m=h+p>>>1;u[m]<d?h=m+1:p=m}d-u[h-1]<u[h]-d&&t+1<h&&--h;var g=u[h]-f,y=i-g;if(a-r>l-o){var v=i?(r*y+a*g)/i:a;e(t,h,g,r,o,v,l),e(h,n,y,v,o,a,l)}else{var x=i?(o*y+l*g)/i:l;e(t,h,g,r,o,a,x),e(h,n,y,r,x,a,l)}}(0,l,e.value,t,n,i,r)},dice:d$,slice:F$,slicedice:function(e,t,n,i,r){(1&e.depth?F$:d$)(e,t,n,i,r)},squarify:T$,resquarify:z$},Q$=["x0","y0","x1","y1","depth","children"];function J$(e){L$.call(this,e)}J$.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:Q$.length,default:Q$}]},(0,m.B)(J$,L$,{layout(){const e=function(){var e=T$,t=!1,n=1,i=1,r=[0],o=qk,a=qk,s=qk,l=qk,u=qk;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=i,e.eachBefore(f),r=[0],t&&e.eachBefore(f$),e}function f(t){var n=r[t.depth],i=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f<i&&(i=f=(i+f)/2),d<c&&(c=d=(c+d)/2),t.x0=i,t.y0=c,t.x1=f,t.y1=d,t.children&&(n=r[t.depth+1]=o(t)/2,i+=u(t)-n,c+=a(t)-n,(f-=s(t)-n)<i&&(i=f=(i+f)/2),(d-=l(t)-n)<c&&(c=d=(c+d)/2),e(t,i,c,f,d))}return c.round=function(e){return arguments.length?(t=!!e,c):t},c.size=function(e){return arguments.length?(n=+e[0],i=+e[1],c):[n,i]},c.tile=function(t){return arguments.length?(e=jk(t),c):e},c.padding=function(e){return arguments.length?c.paddingInner(e).paddingOuter(e):c.paddingInner()},c.paddingInner=function(e){return arguments.length?(o="function"===typeof e?e:Wk(+e),c):o},c.paddingOuter=function(e){return arguments.length?c.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):c.paddingTop()},c.paddingTop=function(e){return arguments.length?(a="function"===typeof e?e:Wk(+e),c):a},c.paddingRight=function(e){return arguments.length?(s="function"===typeof e?e:Wk(+e),c):s},c.paddingBottom=function(e){return arguments.length?(l="function"===typeof e?e:Wk(+e),c):l},c.paddingLeft=function(e){return arguments.length?(u="function"===typeof e?e:Wk(+e),c):u},c}();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{(0,m.mQ)(K$,t)?e.tile(K$[t]):(0,m.z3)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Q$});const Z$=4278190080;function eE(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function tE(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;"group"===i?t.forEach((t=>{t.items.forEach((t=>tE(e,t.items,n)))})):sm[i].draw(e,{items:n?t.map(nE):t})}function nE(e){const t=ar(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const iE=5,rE=31,oE=32,aE=new Uint32Array(oE+1),sE=new Uint32Array(oE+1);sE[0]=0,aE[0]=~sE[0];for(let gz=1;gz<=oE;++gz)sE[gz]=sE[gz-1]<<1|1,aE[gz]=~sE[gz];function lE(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),a=e=>~~((e+n)/i);return a.invert=e=>e*i-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+oE)/oE));function i(e,t){n[e]|=t}function r(e,t){n[e]&=t}return{array:n,get:(t,i)=>{const r=i*e+t;return n[r>>>iE]&1<<(r&rE)},set:(t,n)=>{const r=n*e+t;i(r>>>iE,1<<(r&rE))},clear:(t,n)=>{const i=n*e+t;r(i>>>iE,~(1<<(i&rE)))},getRange:(t,i,r,o)=>{let a,s,l,u,c=o;for(;c>=i;--c)if(a=c*e+t,s=c*e+r,l=a>>>iE,u=s>>>iE,l===u){if(n[l]&aE[a&rE]&sE[1+(s&rE)])return!0}else{if(n[l]&aE[a&rE])return!0;if(n[u]&sE[1+(s&rE)])return!0;for(let e=l+1;e<u;++e)if(n[e])return!0}return!1},setRange:(t,n,r,o)=>{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,l=a>>>iE,u=s>>>iE,l===u)i(l,aE[a&rE]&sE[1+(s&rE)]);else for(i(l,aE[a&rE]),i(u,sE[1+(s&rE)]),c=l+1;c<u;++c)i(c,4294967295)},clearRange:(t,n,i,o)=>{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,l=a>>>iE,u=s>>>iE,l===u)r(l,sE[a&rE]|aE[1+(s&rE)]);else for(r(l,sE[a&rE]),r(u,aE[1+(s&rE)]),c=l+1;c<u;++c)r(c,0)},outOfBounds:(n,i,r,o)=>n<0||i<0||o>=t||r>=e}}(r,o),a.ratio=i,a.padding=n,a.width=e,a.height=t,a}function uE(e,t,n,i,r,o){let a=n/2;return e-a<0||e+a>r||t-(a=i/2)<0||t+a>o}function cE(e,t,n,i,r,o,a,s){const l=r*o/(2*i),u=e(t-l),c=e(t+l),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(u,f,c,d)||a.getRange(u,f,c,d)||s&&s.getRange(u,f,c,d)}const fE=[-1,-1,1,1],dE=[-1,1,-1,1];const hE=["right","center","left"],pE=["bottom","middle","top"];function mE(e,t,n,i,r,o,a,s,l,u,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const gE={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},yE={naive:function(e,t,n,i){const r=e.width,o=e.height;return function(e){const t=e.datum.datum.items[i].items,n=t.length,a=e.datum.fontSize,s=Up.width(e.datum,e.datum.text);let l,u,c,f,d,h,p,m=0;for(let i=0;i<n;++i)l=t[i].x,c=t[i].y,u=void 0===t[i].x2?l:t[i].x2,f=void 0===t[i].y2?c:t[i].y2,d=(l+u)/2,h=(c+f)/2,p=Math.abs(u-l+f-c),p>=m&&(m=p,e.x=d,e.y=h);return d=s/2,h=a/2,l=e.x-d,u=e.x+d,c=e.y-h,f=e.y+h,e.align="center",l<0&&u<=r?e.align="left":0<=l&&r<u&&(e.align="right"),e.baseline="middle",c<0&&f<=o?e.baseline="top":0<=c&&o<f&&(e.baseline="bottom"),!0}},"reduced-search":function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1];function l(t,n,i,l,u){const c=e.invert(t),f=e.invert(n);let d,h=i,p=o;if(!uE(c,f,l,u,r,o)&&!cE(e,c,f,u,l,h,a,s)&&!cE(e,c,f,u,l,u,a,null)){for(;p-h>=1;)d=(h+p)/2,cE(e,c,f,u,l,d,a,s)?p=d:h=d;if(h>i)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[i].items,u=s.length,c=t.datum.fontSize,f=Up.width(t.datum,t.datum.text);let d,h,p,m,g,y,v,x,b,_,w,k,$,E,A,D,S,C=n?c:0,F=!1,M=!1,O=0;for(let i=0;i<u;++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&&(S=d,d=h,h=S),p>m&&(S=p,p=m,m=S),b=e(d),w=e(h),_=~~((b+w)/2),k=e(p),E=e(m),$=~~((k+E)/2),v=_;v>=b;--v)for(x=$;x>=k;--x)D=l(v,x,C,f,c),D&&([t.x,t.y,C,F]=D);for(v=_;v<=w;++v)for(x=$;x<=E;++x)D=l(v,x,C,f,c),D&&([t.x,t.y,C,F]=D);F||n||(A=Math.abs(h-d+m-p),g=(d+h)/2,y=(p+m)/2,A>=O&&!uE(g,y,f,c,r,o)&&!cE(e,g,y,c,f,c,a,null)&&(O=A,t.x=g,t.y=y,M=!0))}return!(!F&&!M)&&(g=f/2,y=c/2,a.setRange(e(t.x-g),e(t.y-y),e(t.x+g),e(t.y+y)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1],l=e.bitmap();return function(t){const u=t.datum.datum.items[i].items,c=u.length,f=t.datum.fontSize,d=Up.width(t.datum,t.datum.text),h=[];let p,m,g,y,v,x,b,_,w,k,$,E,A=n?f:0,D=!1,S=!1,C=0;for(let i=0;i<c;++i){for(p=u[i].x,g=u[i].y,m=void 0===u[i].x2?p:u[i].x2,y=void 0===u[i].y2?g:u[i].y2,h.push([e((p+m)/2),e((g+y)/2)]);h.length;)if([b,_]=h.pop(),!(a.get(b,_)||s.get(b,_)||l.get(b,_))){l.set(b,_);for(let e=0;e<4;++e)v=b+fE[e],x=_+dE[e],l.outOfBounds(v,x,v,x)||h.push([v,x]);if(v=e.invert(b),x=e.invert(_),w=A,k=o,!uE(v,x,d,f,r,o)&&!cE(e,v,x,f,d,w,a,s)&&!cE(e,v,x,f,d,f,a,null)){for(;k-w>=1;)$=(w+k)/2,cE(e,v,x,f,d,$,a,s)?k=$:w=$;w>A&&(t.x=v,t.y=x,A=w,D=!0)}}D||n||(E=Math.abs(m-p+y-g),v=(p+m)/2,x=(g+y)/2,E>=C&&!uE(v,x,d,f,r,o)&&!cE(e,v,x,f,d,f,a,null)&&(C=E,t.x=v,t.y=x,S=!0))}return!(!D&&!S)&&(v=d/2,x=f/2,a.setRange(e(t.x-v),e(t.y-x),e(t.x+v),e(t.y+x)),t.align="center",t.baseline="middle",!0)}}};function vE(e,t,n,i,r,o,a,s,l,u,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=function(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}(i,f),h=function(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=gE[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}(r,f),p=(b=e[0].datum)&&b.mark&&b.mark.marktype,m="group"===p&&e[0].datum.items[l].marktype,g="area"===m,y=function(e,t,n,i){const r=e=>[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>r(e.datum):"line"===t?e=>{const t=e.datum.items[i].items;return r(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:r}(p,m,s,l),v=null===u||u===1/0,x=g&&"naive"===c;var b;let _=-1,w=-1;const k=e.map((e=>{const t=v?Up.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));u=null===u||u===1/0?Math.max(_,w)+Math.max(...i):u;const $=lE(t[0],t[1],u);let E;if(!x){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;e<h.length&&!t;++e)t=5===h[e]||d[e]<0;const i=(p&&a||g)&&e.map((e=>e.datum));E=o.length||i?function(e,t,n,i,r){const o=e.width,a=e.height,s=i||r,l=Nl(o,a).getContext("2d"),u=Nl(o,a).getContext("2d"),c=s&&Nl(o,a).getContext("2d");n.forEach((e=>tE(l,e,!1))),tE(u,t,!1),s&&tE(c,t,!0);const f=eE(l,o,a),d=eE(u,o,a),h=s&&eE(c,o,a),p=e.bitmap(),m=s&&e.bitmap();let g,y,v,x,b,_,w,k;for(y=0;y<a;++y)for(g=0;g<o;++g)b=y*o+g,_=f[b]&Z$,k=d[b]&Z$,w=s&&h[b]&Z$,(_||w||k)&&(v=e(g),x=e(y),r||!_&&!k||p.set(v,x),s&&(_||w)&&m.set(v,x));return[p,m]}($,i||[],o,t,g):function(e,t){const n=e.bitmap();return(t||[]).forEach((t=>n.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}($,a&&k)}const A=g?yE[c]($,E,a,l):function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1],l=i.length;return function(t){const u=t.boundary,c=t.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>r||u[3]>o)return!1;let f,d,h,p,m,g,y,v,x,b,_,w,k,$,E,A=t.textWidth??0;for(let r=0;r<l;++r){if(f=(3&n[r])-1,d=(n[r]>>>2&3)-1,h=0===f&&0===d||i[r]<0,p=f&&d?Math.SQRT1_2:1,m=i[r]<0?-1:1,g=u[1+f]+i[r]*f*p,_=u[4+d]+m*c*d/2+i[r]*d*p,v=_-c/2,x=_+c/2,w=e(g),$=e(v),E=e(x),!A){if(!mE(w,w,$,E,a,s,0,0,0,0,0,h))continue;A=Up.width(t.datum,t.datum.text)}if(b=g+m*A*f/2,g=b-A/2,y=b+A/2,w=e(g),k=e(y),mE(w,k,$,E,a,s,0,0,0,0,0,h))return t.x=f?f*m<0?y:g:b,t.y=d?d*m<0?x:v:_,t.align=hE[f*m+1],t.baseline=pE[d*m+1],a.setRange(w,$,k,E),!0}return!1}}($,E,h,d);return k.forEach((e=>e.opacity=+A(e))),k}const xE=["x","y","opacity","align","baseline"],bE=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function _E(e){Nr.call(this,null,e)}function wE(e,t){var n,i,r,o,a,s,l=[],u=function(e){return e(o)};if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)o=e[i],(s=n[a=t.map(u)])||(n[a]=s=[],s.dims=a,l.push(s)),s.push(o);return l}function kE(e){Nr.call(this,null,e)}_E.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:bE},{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:xE.length,default:xE}]},(0,m.B)(_E,Nr,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(n){const i=e[n];return(0,m.Tn)(i)&&t.modified(i.fields)}("sort")))return;e.size&&2===e.size.length||(0,m.z3)("Size parameter should be specified as a [width, height] array.");const i=e.as||xE;return vE(t.materialize(t.SOURCE).source||[],e.size,e.sort,(0,m.YO)(null==e.offset?1:e.offset),(0,m.YO)(e.anchor||bE),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,void 0===e.padding?0:e.padding,e.method||"naive").forEach((e=>{const t=e.datum;t[i[0]]=e.x,t[i[1]]=e.y,t[i[2]]=e.opacity,t[i[3]]=e.align,t[i[4]]=e.baseline})),t.reflow(n).modifies(i)}}),kE.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.B)(kE,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=wE(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(m.N6),o=r.length,a=e.as||[(0,m.N6)(e.x),(0,m.N6)(e.y)],s=[];i.forEach((t=>{jo(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let i=0;i<o;++i)n[r[i]]=t.dims[i];n[a[0]]=e[0],n[a[1]]=e[1],s.push(rr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const $E={constant:So,linear:To,log:zo,exp:No,pow:Ro,quad:Po,poly:Bo};function EE(e){Nr.call(this,null,e)}EE.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($E)},{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.B)(EE,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=wE(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(m.N6),o=e.method||"linear",a=null==e.order?3:e.order,s=((e,t)=>"poly"===e?t:"quad"===e?2:1)(o,a),l=e.as||[(0,m.N6)(e.x),(0,m.N6)(e.y)],u=$E[o],c=[];let f=e.extent;(0,m.mQ)($E,o)||(0,m.z3)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),i.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const i=u(n,e.x,e.y,a);if(e.params)return void c.push(rr({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const d=f||(0,m.Xx)(n,e.x),h=e=>{const t={};for(let i=0;i<r.length;++i)t[r[i]]=n.dims[i];t[l[0]]=e[0],t[l[1]]=e[1],c.push(rr(t))};"linear"===o||"constant"===o?d.forEach((e=>h([e,i.predict(e)]))):Yo(i.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const AE=134217729,DE=33306690738754706e-32;function SE(e,t,n,i,r){let o,a,s,l,u=t[0],c=i[0],f=0,d=0;c>u===c>-u?(o=u,u=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>u===c>-u?(a=u+o,s=o-(a-u),u=t[++f]):(a=c+o,s=o-(a-c),c=i[++d]),o=a,0!==s&&(r[h++]=s);f<e&&d<n;)c>u===c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=i[++d]),o=a,0!==s&&(r[h++]=s);for(;f<e;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f],o=a,0!==s&&(r[h++]=s);for(;d<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=i[++d],o=a,0!==s&&(r[h++]=s);return 0===o&&0!==h||(r[h++]=o),h}function CE(e){return new Float64Array(e)}const FE=22204460492503146e-32,ME=11093356479670487e-47,OE=CE(4),TE=CE(8),zE=CE(12),NE=CE(16),RE=CE(4);function PE(e,t,n,i,r,o){const a=(t-o)*(n-r),s=(e-r)*(i-o),l=a-s;if(0===a||0===s||a>0!==s>0)return l;const u=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*u?l:-function(e,t,n,i,r,o,a){let s,l,u,c,f,d,h,p,m,g,y,v,x,b,_,w,k,$;const E=e-r,A=n-r,D=t-o,S=i-o;b=E*S,d=AE*E,h=d-(d-E),p=E-h,d=AE*S,m=d-(d-S),g=S-m,_=p*g-(b-h*m-p*m-h*g),w=D*A,d=AE*D,h=d-(d-D),p=D-h,d=AE*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,OE[0]=_-(y+f)+(f-k),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-w,f=x-y,OE[1]=x-(y+f)+(f-w),$=v+y,f=$-v,OE[2]=v-($-f)+(y-f),OE[3]=$;let C=function(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}(4,OE),F=FE*a;if(C>=F||-C>=F)return C;if(f=e-E,s=e-(E+f)+(f-r),f=n-A,u=n-(A+f)+(f-r),f=t-D,l=t-(D+f)+(f-o),f=i-S,c=i-(S+f)+(f-o),0===s&&0===l&&0===u&&0===c)return C;if(F=ME*a+DE*Math.abs(C),C+=E*c+S*s-(D*u+A*l),C>=F||-C>=F)return C;b=s*S,d=AE*s,h=d-(d-s),p=s-h,d=AE*S,m=d-(d-S),g=S-m,_=p*g-(b-h*m-p*m-h*g),w=l*A,d=AE*l,h=d-(d-l),p=l-h,d=AE*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,RE[0]=_-(y+f)+(f-k),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-w,f=x-y,RE[1]=x-(y+f)+(f-w),$=v+y,f=$-v,RE[2]=v-($-f)+(y-f),RE[3]=$;const M=SE(4,OE,4,RE,TE);b=E*c,d=AE*E,h=d-(d-E),p=E-h,d=AE*c,m=d-(d-c),g=c-m,_=p*g-(b-h*m-p*m-h*g),w=D*u,d=AE*D,h=d-(d-D),p=D-h,d=AE*u,m=d-(d-u),g=u-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,RE[0]=_-(y+f)+(f-k),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-w,f=x-y,RE[1]=x-(y+f)+(f-w),$=v+y,f=$-v,RE[2]=v-($-f)+(y-f),RE[3]=$;const O=SE(M,TE,4,RE,zE);b=s*c,d=AE*s,h=d-(d-s),p=s-h,d=AE*c,m=d-(d-c),g=c-m,_=p*g-(b-h*m-p*m-h*g),w=l*u,d=AE*l,h=d-(d-l),p=l-h,d=AE*u,m=d-(d-u),g=u-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,RE[0]=_-(y+f)+(f-k),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-w,f=x-y,RE[1]=x-(y+f)+(f-w),$=v+y,f=$-v,RE[2]=v-($-f)+(y-f),RE[3]=$;const T=SE(O,zE,4,RE,NE);return NE[T-1]}(e,t,n,i,r,o,u)}CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(8),CE(8),CE(8),CE(4),CE(8),CE(8),CE(8),CE(12);CE(192),CE(192);CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(8),CE(8),CE(8),CE(8),CE(8),CE(8),CE(8),CE(8),CE(8),CE(4),CE(4),CE(4),CE(8),CE(16),CE(16),CE(16),CE(32),CE(32),CE(48),CE(64);CE(1152),CE(1152);CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(4),CE(24),CE(24),CE(24),CE(24),CE(24),CE(24),CE(24),CE(24),CE(24),CE(24),CE(1152),CE(1152),CE(1152),CE(1152),CE(1152),CE(2304),CE(2304),CE(3456),CE(5760),CE(8),CE(8),CE(8),CE(16),CE(24),CE(48),CE(48),CE(96),CE(192),CE(384),CE(384),CE(384),CE(768);CE(96),CE(96),CE(96),CE(1152);const BE=Math.pow(2,-52),LE=new Uint32Array(512);class IE{static from(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:YE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:HE;const i=e.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=e[o];r[2*o]=t(i),r[2*o+1]=n(i)}return new IE(r)}constructor(e){const t=e.length>>1;if(t>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=e.length>>1;let a=1/0,s=1/0,l=-1/0,u=-1/0;for(let E=0;E<o;E++){const t=e[2*E],n=e[2*E+1];t<a&&(a=t),n<s&&(s=n),t>l&&(l=t),n>u&&(u=n),this._ids[E]=E}const c=(a+l)/2,f=(s+u)/2;let d,h,p,m=1/0;for(let E=0;E<o;E++){const t=UE(c,f,e[2*E],e[2*E+1]);t<m&&(d=E,m=t)}const g=e[2*d],y=e[2*d+1];m=1/0;for(let E=0;E<o;E++){if(E===d)continue;const t=UE(g,y,e[2*E],e[2*E+1]);t<m&&t>0&&(h=E,m=t)}let v=e[2*h],x=e[2*h+1],b=1/0;for(let E=0;E<o;E++){if(E===d||E===h)continue;const t=qE(g,y,v,x,e[2*E],e[2*E+1]);t<b&&(p=E,b=t)}let _=e[2*p],w=e[2*p+1];if(b===1/0){for(let i=0;i<o;i++)this._dists[i]=e[2*i]-e[0]||e[2*i+1]-e[1];WE(this._ids,this._dists,0,o-1);const t=new Uint32Array(o);let n=0;for(let e=0,i=-1/0;e<o;e++){const r=this._ids[e];this._dists[r]>i&&(t[n++]=r,i=this._dists[r])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(PE(g,y,v,x,_,w)<0){const e=h,t=v,n=x;h=p,v=_,x=w,p=e,_=t,w=n}const k=function(e,t,n,i,r,o){const a=n-e,s=i-t,l=r-e,u=o-t,c=a*a+s*s,f=l*l+u*u,d=.5/(a*u-s*l),h=e+(u*c-s*f)*d,p=t+(a*f-l*c)*d;return{x:h,y:p}}(g,y,v,x,_,w);this._cx=k.x,this._cy=k.y;for(let E=0;E<o;E++)this._dists[E]=UE(e[2*E],e[2*E+1],k.x,k.y);WE(this._ids,this._dists,0,o-1),this._hullStart=d;let $=3;n[d]=t[p]=h,n[h]=t[d]=p,n[p]=t[h]=d,i[d]=0,i[h]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,y)]=d,r[this._hashKey(v,x)]=h,r[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let E,A,D=0;D<this._ids.length;D++){const o=this._ids[D],a=e[2*o],s=e[2*o+1];if(D>0&&Math.abs(a-E)<=BE&&Math.abs(s-A)<=BE)continue;if(E=a,A=s,o===d||o===h||o===p)continue;let l=0;for(let e=0,t=this._hashKey(a,s);e<this._hashSize&&(l=r[(t+e)%this._hashSize],-1===l||l===n[l]);e++);l=t[l];let u,c=l;for(;u=n[c],PE(a,s,e[2*c],e[2*c+1],e[2*u],e[2*u+1])>=0;)if(c=u,c===l){c=-1;break}if(-1===c)continue;let f=this._addTriangle(c,o,n[c],-1,-1,i[c]);i[o]=this._legalize(f+2),i[c]=f,$++;let m=n[c];for(;u=n[m],PE(a,s,e[2*m],e[2*m+1],e[2*u],e[2*u+1])<0;)f=this._addTriangle(m,o,u,i[o],-1,i[m]),i[o]=this._legalize(f+2),n[m]=m,$--,m=u;if(c===l)for(;u=t[c],PE(a,s,e[2*u],e[2*u+1],e[2*c],e[2*c+1])<0;)f=this._addTriangle(u,o,c,-1,i[c],i[u]),this._legalize(f+2),i[u]=f,n[c]=c,$--,c=u;this._hullStart=t[o]=c,n[c]=t[m]=o,n[o]=m,r[this._hashKey(a,s)]=o,r[this._hashKey(e[2*c],e[2*c+1])]=c}this.hull=new Uint32Array($);for(let E=0,A=this._hullStart;E<$;E++)this.hull[E]=A,A=n[A];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===r)break;e=LE[--r];continue}const l=a-a%3,u=s+(e+1)%3,c=l+(a+2)%3,f=t[o],d=t[e],h=t[u],p=t[c];if(jE(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])){t[e]=p,t[a]=f;const i=n[c];if(-1===i){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,i),this._link(a,n[o]),this._link(o,c);const s=l+(a+1)%3;r<LE.length&&(LE[r++]=s)}else{if(0===r)break;e=LE[--r]}}return o}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,r,o){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,o),this.trianglesLen+=3,a}}function UE(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function jE(e,t,n,i,r,o,a,s){const l=e-a,u=t-s,c=n-a,f=i-s,d=r-a,h=o-s,p=c*c+f*f,m=d*d+h*h;return l*(f*m-p*h)-u*(c*m-p*d)+(l*l+u*u)*(c*h-f*d)<0}function qE(e,t,n,i,r,o){const a=n-e,s=i-t,l=r-e,u=o-t,c=a*a+s*s,f=l*l+u*u,d=.5/(a*u-s*l),h=(u*c-s*f)*d,p=(a*f-l*c)*d;return h*h+p*p}function WE(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{let r=n+1,o=i;GE(e,n+i>>1,r),t[e[n]]>t[e[i]]&&GE(e,n,i),t[e[r]]>t[e[i]]&&GE(e,r,i),t[e[n]]>t[e[r]]&&GE(e,n,r);const a=e[r],s=t[a];for(;;){do{r++}while(t[e[r]]<s);do{o--}while(t[e[o]]>s);if(o<r)break;GE(e,r,o)}e[n+1]=e[o],e[o]=a,i-r+1>=o-n?(WE(e,t,r,i),WE(e,t,n,o-1)):(WE(e,t,n,o-1),WE(e,t,r,i))}}function GE(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function YE(e){return e[0]}function HE(e){return e[1]}const XE=1e-6;class VE{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const i=(e=+e)+(n=+n),r=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>XE||Math.abs(this._y1-r)>XE)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(e,t,n,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class KE{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class QE{constructor(e){let[t,n,i,r]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500];if(!((i=+i)>=(t=+t))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=i,this.xmin=t,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,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 t=2*n[p],i=2*n[p+1],o=2*n[p+2],a=e[t],s=e[t+1],l=e[i],u=e[i+1],c=e[o],f=e[o+1],g=l-a,y=u-s,v=c-a,x=f-s,b=2*(g*x-y*v);if(Math.abs(b)<1e-9){let t=1e9;const i=2*n[0];t*=Math.sign((e[i]-a)*x-(e[i+1]-s)*v),d=(a+c)/2-t*x,h=(s+f)/2+t*v}else{const e=1/b,t=g*g+y*y,n=v*v+x*x;d=a+(x*t-y*n)*e,h=s+(g*n-v*t)*e}r[m]=d,r[m+1]=h}let o,a,s,l=t[t.length-1],u=4*l,c=e[2*l],f=e[2*l+1];i.fill(0);for(let d=0;d<t.length;++d)l=t[d],o=u,a=c,s=f,u=4*l,c=e[2*l],f=e[2*l+1],i[o+2]=i[u]=s-f,i[o+3]=i[u+1]=c-a}render(e){const t=null==e?e=new VE:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:a}=this;if(r.length<=1)return null;for(let u=0,c=n.length;u<c;++u){const t=n[u];if(t<u)continue;const i=2*Math.floor(u/3),r=2*Math.floor(t/3),a=o[i],s=o[i+1],l=o[r],c=o[r+1];this._renderSegment(a,s,l,c,e)}let s,l=r[r.length-1];for(let u=0;u<r.length;++u){s=l,l=r[u];const t=2*Math.floor(i[l]/3),n=o[t],c=o[t+1],f=4*s,d=this._project(n,c,a[f+2],a[f+3]);d&&this._renderSegment(n,c,d[0],d[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new VE:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new VE:void 0,i=this._clip(e);if(null===i||!i.length)return;t.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]||t.lineTo(i[o],i[o+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new KE;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,i,r){let o;const a=this._regioncode(e,t),s=this._regioncode(n,i);0===a&&0===s?(r.moveTo(e,t),r.lineTo(n,i)):(o=this._clipSegment(e,t,n,i,a,s))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(e,t,n){return(t=+t)===t&&(n=+n)===n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let i=0,r=t.length;i<r;i+=2)for(let o=0,a=e.length;o<a;o+=2)if(t[i]==e[o]&&t[i+1]==e[o+1]&&t[(i+2)%r]==e[(o+a-2)%a]&&t[(i+3)%r]==e[(o+a-1)%a]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[e];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(t[2*n],t[2*n+1]),s=s%3===2?s-2:s+1,r[s]!==e)break;s=i[s]}while(s!==o&&-1!==s);return a}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,i=4*e;return n[i]||n[i+1]?this._clipInfinite(e,t,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(e,t)}_clipFinite(e,t){const n=t.length;let i,r,o,a,s=null,l=t[n-2],u=t[n-1],c=this._regioncode(l,u),f=0;for(let d=0;d<n;d+=2)if(i=l,r=u,l=t[d],u=t[d+1],o=c,c=this._regioncode(l,u),0===o&&0===c)a=f,f=0,s?s.push(l,u):s=[l,u];else{let t,n,d,h,p;if(0===o){if(null===(t=this._clipSegment(i,r,l,u,o,c)))continue;[n,d,h,p]=t}else{if(null===(t=this._clipSegment(l,u,i,r,c,o)))continue;[h,p,n,d]=t,a=f,f=this._edgecode(n,d),a&&f&&this._edge(e,a,f,s,s.length),s?s.push(n,d):s=[n,d]}a=f,f=this._edgecode(h,p),a&&f&&this._edge(e,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(e,a,f,s,s.length);else if(this.contains(e,(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(e,t,n,i,r,o){for(;;){if(0===r&&0===o)return[e,t,n,i];if(r&o)return null;let a,s,l=r||o;8&l?(a=e+(n-e)*(this.ymax-t)/(i-t),s=this.ymax):4&l?(a=e+(n-e)*(this.ymin-t)/(i-t),s=this.ymin):2&l?(s=t+(i-t)*(this.xmax-e)/(n-e),a=this.xmax):(s=t+(i-t)*(this.xmin-e)/(n-e),a=this.xmin),r?(e=a,t=s,r=this._regioncode(e,t)):(n=a,i=s,o=this._regioncode(n,i))}}_clipInfinite(e,t,n,i,r,o){let a,s=Array.from(t);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(e,s))for(let l,u=0,c=s.length,f=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)l=f,f=this._edgecode(s[u],s[u+1]),l&&f&&(u=this._edge(e,l,f,s,u),c=s.length);else this.contains(e,(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(e,t,n,i,r){for(;t!==n;){let n,o;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(e,n,o)||(i.splice(r,0,n,o),r+=2)}if(i.length>4)for(let o=0;o<i.length;o+=2){const e=(o+2)%i.length,t=(o+4)%i.length;(i[o]===i[e]&&i[e]===i[t]||i[o+1]===i[e+1]&&i[e+1]===i[t+1])&&(i.splice(e,2),o-=2)}return r}_project(e,t,n,i){let r,o,a,s=1/0;if(i<0){if(t<=this.ymin)return null;(r=(this.ymin-t)/i)<s&&(a=this.ymin,o=e+(s=r)*n)}else if(i>0){if(t>=this.ymax)return null;(r=(this.ymax-t)/i)<s&&(a=this.ymax,o=e+(s=r)*n)}if(n>0){if(e>=this.xmax)return null;(r=(this.xmax-e)/n)<s&&(o=this.xmax,a=t+(s=r)*i)}else if(n<0){if(e<=this.xmin)return null;(r=(this.xmin-e)/n)<s&&(o=this.xmin,a=t+(s=r)*i)}return[o,a]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}}const JE=2*Math.PI,ZE=Math.pow;function eA(e){return e[0]}function tA(e){return e[1]}function nA(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class iA{static from(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eA,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tA,i=arguments.length>3?arguments[3]:void 0;return new iA("length"in e?function(e,t,n,i){const r=e.length,o=new Float64Array(2*r);for(let a=0;a<r;++a){const r=e[a];o[2*a]=t.call(i,r,a,e),o[2*a+1]=n.call(i,r,a,e)}return o}(e,t,n,i):Float64Array.from(function*(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}(e,t,n,i)))}constructor(e){this._delaunator=new IE(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const e=2*t[i],r=2*t[i+1],o=2*t[i+2];if((n[o]-n[e])*(n[r+1]-n[e+1])-(n[r]-n[e])*(n[o+1]-n[e+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,a=t.length/2;o<a;++o){const e=nA(t[2*o],t[2*o+1],r);t[2*o]=e[0],t[2*o+1]=e[1]}this._delaunator=new IE(t)}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,l=n.length;s<l;++s){const e=r[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[e]||(o[e]=s)}for(let s=0,l=i.length;s<l;++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(e){return new QE(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t<a.length-1&&(yield a[t+1]))}const s=t[e];if(-1===s)return;let l=s,u=-1;do{if(yield u=o[l],l=l%3===2?l-2:l+1,o[l]!==e)return;if(l=r[l],-1===l){const t=n[(i[e]+1)%n.length];return void(t!==u&&(yield t))}}while(l!==s)}find(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((e=+e)!==e||(t=+t)!==t)return-1;const i=n;let r;for(;(r=this._step(n,e,t))>=0&&r!==n&&r!==i;)n=r;return r}_step(e,t,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(-1===i[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=ZE(t-l[2*e],2)+ZE(n-l[2*e+1],2);const f=i[e];let d=f;do{let i=s[d];const f=ZE(t-l[2*i],2)+ZE(n-l[2*i+1],2);if(f<c&&(c=f,u=i),d=d%3===2?d-2:d+1,s[d]!==e)break;if(d=a[d],-1===d){if(d=r[(o[e]+1)%r.length],d!==i&&ZE(t-l[2*d],2)+ZE(n-l[2*d+1],2)<c)return d;break}}while(d!==f);return u}render(e){const t=null==e?e=new VE:void 0,{points:n,halfedges:i,triangles:r}=this;for(let o=0,a=i.length;o<a;++o){const t=i[o];if(t<o)continue;const a=2*r[o],s=2*r[t];e.moveTo(n[a],n[a+1]),e.lineTo(n[s],n[s+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){void 0!==t||e&&"function"===typeof e.moveTo||(t=e,e=null),t=void 0==t?2:+t;const n=null==e?e=new VE:void 0,{points:i}=this;for(let r=0,o=i.length;r<o;r+=2){const n=i[r],o=i[r+1];e.moveTo(n+t,o),e.arc(n,o,t,0,JE)}return n&&n.value()}renderHull(e){const t=null==e?e=new VE:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;e.moveTo(i[r],i[r+1]);for(let a=1;a<o;++a){const t=2*n[a];e.lineTo(i[t],i[t+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new KE;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new VE:void 0,{points:i,triangles:r}=this,o=2*r[e*=3],a=2*r[e+1],s=2*r[e+2];return t.moveTo(i[o],i[o+1]),t.lineTo(i[a],i[a+1]),t.lineTo(i[s],i[s+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new KE;return this.renderTriangle(e,t),t.value()}}function rA(e){Nr.call(this,null,e)}rA.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 oA=[-1e5,-1e5,1e5,1e5];function aA(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}(0,m.B)(rA,Nr,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:oA;const o=this.value=iA.from(i,e.x,e.y).voronoi(r);for(let s=0,l=i.length;s<l;++s){const e=o.cellPolygon(s);i[s][n]=e&&(2!==(a=e).length||a[0][0]!==a[1][0]||a[0][1]!==a[1][1])?aA(e):null}var a;return t.reflow(e.modified()).modifies(n)}});var sA=Math.PI/180,lA=64,uA=2048;function cA(){var e,t,n,i,r,o,a,s=[256,256],l=mA,u=[],c=Math.random,f={};function d(e,t,n){for(var i,r,o,a=t.x,u=t.y,f=Math.hypot(s[0],s[1]),d=l(s),h=c()<.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(t.x=a+r,t.y=u+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!dA(t,e,s[0]))&&(!n||pA(t,n))){for(var m,g=t.sprite,y=t.width>>5,v=s[0]>>5,x=t.x-(y<<4),b=127&x,_=32-b,w=t.y1-t.y0,k=(t.y+t.y0)*v+(x>>5),$=0;$<w;$++){m=0;for(var E=0;E<=y;E++)e[k+E]|=m<<_|(E<y?(m=g[$*y+E])>>>b:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var l=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(lA<<5)/t,e.height=uA/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Nl()),f=function(e){var t=[],n=-1;for(;++n<e;)t[n]=0;return t}((s[0]>>5)*s[1]),h=null,p=u.length,m=-1,g=[],y=u.map((s=>({text:e(s),font:t(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(((e,t)=>t.size-e.size));++m<p;){var v=y[m];v.x=s[0]*(c()+.5)>>1,v.y=s[1]*(c()+.5)>>1,fA(l,v,y,m),v.hasText&&d(f,v,h)&&(g.push(v),h?hA(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return g},f.words=function(e){return arguments.length?(u=e,f):u},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=gA(e),f):t},f.fontStyle=function(e){return arguments.length?(i=gA(e),f):i},f.fontWeight=function(e){return arguments.length?(r=gA(e),f):r},f.rotate=function(e){return arguments.length?(o=gA(e),f):o},f.text=function(t){return arguments.length?(e=gA(t),f):e},f.spiral=function(e){return arguments.length?(l=yA[e]||e,f):l},f.fontSize=function(e){return arguments.length?(n=gA(e),f):n},f.padding=function(e){return arguments.length?(a=gA(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function fA(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(lA<<5)/o,uA/o);var a,s,l,u,c,f=0,d=0,h=0,p=n.length;for(--i;++i<p;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,a=r.measureText(t.text+"m").width*o,l=t.size<<1,t.rotate){var m=Math.sin(t.rotate*sA),g=Math.cos(t.rotate*sA),y=a*g,v=a*m,x=l*g,b=l*m;a=Math.max(Math.abs(y+b),Math.abs(y-b))+31>>5<<5,l=~~Math.max(Math.abs(v+x),Math.abs(v-x))}else a=a+31>>5<<5;if(l>h&&(h=l),f+a>=lA<<5&&(f=0,d+=h,h=0),d+l>=uA)break;r.translate((f+(a>>1))/o,(d+(l>>1))/o),t.rotate&&r.rotate(t.rotate*sA),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=a,t.height=l,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=r.getImageData(0,0,(lA<<5)/o,uA/o).data,w=[];--i>=0;)if((t=n[i]).hasText){for(s=(a=t.width)>>5,l=t.y1-t.y0,u=0;u<l*s;u++)w[u]=0;if(null==(f=t.xoff))return;d=t.yoff;var k=0,$=-1;for(c=0;c<l;c++){for(u=0;u<a;u++){var E=s*c+(u>>5),A=_[(d+c)*(lA<<5)+(f+u)<<2]?1<<31-u%32:0;w[E]|=A,k|=A}k?$=c:(t.y0++,l--,c--,d++)}t.y1=t.y0+$,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function dA(e,t,n){n>>=5;for(var i,r=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,l=32-s,u=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f<u;f++){i=0;for(var d=0;d<=o;d++)if((i<<l|(d<o?(i=r[f*o+d])>>>s:0))&t[c+d])return!0;c+=n}return!1}function hA(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function pA(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function mA(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function gA(e){return"function"===typeof e?e:function(){return e}}var yA={archimedean:mA,rectangular:function(e){var t=4*e[0]/e[1],n=0,i=0;return function(e){var r=e<0?-1:1;switch(Math.sqrt(1+4*r*e)-r&3){case 0:n+=t;break;case 1:i+=4;break;case 2:n-=t;break;default:i-=4}return[n,i]}}};const vA=["x","y","font","fontSize","fontStyle","fontWeight","angle"],xA=["text","font","rotate","fontSize","fontStyle","fontWeight"];function bA(e){Nr.call(this,cA(),e)}bA.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:vA}]},(0,m.B)(bA,Nr,{transform(e,t){!e.size||e.size[0]&&e.size[1]||(0,m.z3)("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||xA.some((function(n){const i=e[n];return(0,m.Tn)(i)&&t.modified(i.fields)}))))return;const i=t.materialize(t.SOURCE).source,r=this.value,o=e.as||vA;let a,s=e.fontSize||14;if((0,m.Tn)(s)?a=e.fontSizeRange:s=(0,m.dY)(s),a){const e=s,t=wf("sqrt")().domain((0,m.Xx)(i,e)).range(a);s=n=>t(e(n))}i.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const l=r.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(to).layout(),u=r.size(),c=u[0]>>1,f=u[1]>>1,d=l.length;for(let h,p,m=0;m<d;++m)h=l[m],p=h.datum,p[o[0]]=h.x+c,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 t.reflow(n).modifies(o)}});const _A=e=>new Uint8Array(e),wA=e=>new Uint16Array(e),kA=e=>new Uint32Array(e);function $A(e,t,n){const i=(t<257?_A:t<65537?wA:kA)(e);return n&&i.set(n),i}function EA(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(e,t){const n=this,r=n.bisect(n.range,e.value),o=e.index,a=r[0],s=r[1],l=o.length;let u;for(u=0;u<a;++u)t[o[u]]|=i;for(u=s;u<l;++u)t[o[u]]|=i;return n}}}function AA(){let e=kA(0),t=[],n=0;return{insert:function(i,r,o){if(!r.length)return[];const a=n,s=r.length,l=kA(s);let u,c,f,d=Array(s);for(f=0;f<s;++f)d[f]=i(r[f]),l[f]=f;if(d=function(e,t){return e.sort.call(t,((t,n)=>{const i=e[t],r=e[n];return i<r?-1:i>r?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,l),a)u=t,c=e,t=Array(a+s),e=kA(a+s),function(e,t,n,i,r,o,a,s,l){let u,c=0,f=0;for(u=0;c<i&&f<a;++u)t[c]<r[f]?(s[u]=t[c],l[u]=n[c++]):(s[u]=r[f],l[u]=o[f++]+e);for(;c<i;++c,++u)s[u]=t[c],l[u]=n[c];for(;f<a;++f,++u)s[u]=r[f],l[u]=o[f]+e}(o,u,c,a,d,l,s,t,e);else{if(o>0)for(f=0;f<s;++f)l[f]+=o;t=d,e=l}return n=a+s,{index:l,value:d}},remove:function(i,r){const o=n;let a,s,l;for(s=0;!r[e[s]]&&s<o;++s);for(l=s;s<o;++s)r[a=e[s]]||(e[l]=a,t[l]=t[s],++l);n=o-i},bisect:function(e,i){let r;return i?r=i.length:(i=t,r=n),[(0,Pl.ah)(i,e[0],0,r),(0,Pl.Jj)(i,e[1],0,r)]},reindex:function(t){for(let i=0,r=n;i<r;++i)e[i]=t[e[i]]},index:()=>e,size:()=>n}}function DA(e){Nr.call(this,function(){let e=8,t=[],n=kA(0),i=$A(0,e),r=$A(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,i=0,r=t.length,o=e.length;i<o;++i)n=e[i],n._index=r++,t.push(n)},remove(e,n){const o=t.length,a=Array(o-e),s=t;let l,u,c;for(u=0;!n[u]&&u<o;++u)a[u]=t[u],s[u]=u;for(c=u;u<o;++u)l=t[u],n[u]?s[u]=-1:(s[u]=c,i[c]=i[u],r[c]=r[u],a[c]=l,l._index=c++),i[u]=0;return t=a,s},size:()=>t.length,curr:()=>i,prev:()=>r,reset:e=>r[e]=i[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){i[e]|=t},clear(e,t){i[e]&=~t},resize(t,n){(t>i.length||n>e)&&(e=Math.max(n,e),i=$A(t,e,i),r=$A(t,e))}}}(),e),this._indices=null,this._dims=null}function SA(e){Nr.call(this,null,e)}DA.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.B)(DA,Nr,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],a=i.length;let s,l,u=0;for(;u<a;++u)s=n[u].fname,l=r[s]||(r[s]=AA()),o.push(EA(l,u,i[u]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,a=this._dims,s=this.value,l=s.curr(),u=s.prev(),c=s.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let m,g,y,v,x,b,_,w,k;if(u.set(l),t.rem.length&&(x=this.remove(e,t,n)),t.add.length&&s.add(t.add),t.mod.length)for(b={},v=t.mod,_=0,w=v.length;_<w;++_)b[v[_]._index]=1;for(_=0;_<h;++_)k=i[_],(!a[_]||e.modified("fields",_)||t.modified(k.fields))&&(y=k.fname,(m=p[y])||(o[y]=g=AA(),p[y]=m=g.insert(k,t.source,0)),a[_]=EA(g,_,r[_]).onAdd(m,l));for(_=0,w=s.data().length;_<w;++_)x[_]||(u[_]!==l[_]?f.push(_):b[_]&&l[_]!==c&&d.push(_));return s.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,a=this._indices,s=e.fields,l={},u=n.add,c=r.size()+i.length,f=o.length;let d,h,p,m=r.size();r.resize(c,f),r.add(i);const g=r.curr(),y=r.prev(),v=r.all();for(d=0;d<f;++d)h=s[d].fname,p=l[h]||(l[h]=a[h].insert(s[d],i,m)),o[d].onAdd(p,g);for(;m<c;++m)y[m]=v,g[m]!==v&&u.push(m)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),a=e.mod;let s,l,u;for(s=0,l=a.length;s<l;++s)u=a[s]._index,r[u]!==o&&n.push(u)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),a=r.prev(),s=r.all(),l={},u=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,l[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&u.push(h);for(h in i)i[h].remove(d,l);return this.reindex(t,d,l),l},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter((()=>{const e=r.remove(t,n);for(const t in i)i[t].reindex(e)}))},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,a=i.length;let s,l,u=0;for(n.filters=0,l=0;l<a;++l)e.modified("query",l)&&(s=l,++u);if(1===u)u=i[s].one,this.incrementOne(i[s],r[s],n.add,n.rem);else for(l=0,u=0;l<a;++l)e.modified("query",l)&&(u|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return u},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),a=r.curr(),s=r.prev(),l=e.index(),u=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=u[0],p=u[1],m=e.one;let g,y,v;if(f<h)for(g=f,y=Math.min(h,d);g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;else if(f>h)for(g=h,y=Math.min(f,p);g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;if(d>p)for(g=Math.max(f,p),y=d;g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;else if(d<p)for(g=Math.max(h,d),y=p;g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value.curr(),o=e.index(),a=e.bisect(e.range),s=e.bisect(t),l=s[0],u=s[1],c=a[0],f=a[1],d=e.one;let h,p,m;if(l<c)for(h=l,p=Math.min(c,u);h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(l>c)for(h=c,p=Math.min(l,f);h<p;++h)m=o[h],r[m]^=d,i.push(m);if(u>f)for(h=Math.max(l,f),p=u;h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(u<f)for(h=Math.max(c,u),p=f;h<p;++h)m=o[h],r[m]^=d,i.push(m);e.range=t.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.B)(SA,Nr,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(0===(r&n))return t.StopPropagation;const o=t.fork(t.ALL),a=i.data(),s=i.curr(),l=i.prev(),u=e=>s[e]&n?null:a[e];return o.filter(o.MOD,u),r&r-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^l[e]&n?a[e]:null})),o.filter(o.REM,(e=>{const t=s[e]&n;return t&&!(0^l[e]&n)?a[e]:null}))):(o.filter(o.ADD,u),o.filter(o.REM,(e=>(s[e]&n)===r?a[e]:null))),o.filter(o.SOURCE,(e=>u(e._index)))}});var CA,FA,MA,OA,TA,zA,NA,RA,PA,BA,LA,IA,UA,jA,qA,WA,GA=n(66906),YA=new cx,HA=new cx,XA={point:zx,lineStart:zx,lineEnd:zx,polygonStart:function(){YA=new cx,XA.lineStart=VA,XA.lineEnd=KA},polygonEnd:function(){var e=+YA;HA.add(e<0?gx+e:e),this.lineStart=this.lineEnd=this.point=zx},sphere:function(){HA.add(gx)}};function VA(){XA.point=QA}function KA(){JA(CA,FA)}function QA(e,t){XA.point=JA,CA=e,FA=t,MA=e*=vx,OA=wx(t=(t*=vx)/2+mx),TA=Sx(t)}function JA(e,t){var n=(e*=vx)-MA,i=n>=0?1:-1,r=i*n,o=wx(t=(t*=vx)/2+mx),a=Sx(t),s=TA*a,l=OA*o+s*wx(r),u=s*i*Sx(r);YA.add(_x(u,l)),MA=e,OA=o,TA=a}var ZA,eD,tD,nD,iD,rD,oD,aD,sD,lD,uD,cD,fD,dD,hD,pD,mD={point:gD,lineStart:vD,lineEnd:xD,polygonStart:function(){mD.point=bD,mD.lineStart=_D,mD.lineEnd=wD,jA=new cx,XA.polygonStart()},polygonEnd:function(){XA.polygonEnd(),mD.point=gD,mD.lineStart=vD,mD.lineEnd=xD,YA<0?(zA=-(RA=180),NA=-(PA=90)):jA>fx?PA=90:jA<-fx&&(NA=-90),WA[0]=zA,WA[1]=RA},sphere:function(){zA=-(RA=180),NA=-(PA=90)}};function gD(e,t){qA.push(WA=[zA=e,RA=e]),t<NA&&(NA=t),t>PA&&(PA=t)}function yD(e,t){var n=Hb([e*vx,t*vx]);if(UA){var i=Vb(UA,n),r=Vb([i[1],-i[0],0],i);Jb(r),r=Yb(r);var o,a=e-BA,s=a>0?1:-1,l=r[0]*yx*s,u=xx(a)>180;u^(s*BA<l&&l<s*e)?(o=r[1]*yx)>PA&&(PA=o):u^(s*BA<(l=(l+360)%360-180)&&l<s*e)?(o=-r[1]*yx)<NA&&(NA=o):(t<NA&&(NA=t),t>PA&&(PA=t)),u?e<BA?kD(zA,e)>kD(zA,RA)&&(RA=e):kD(e,RA)>kD(zA,RA)&&(zA=e):RA>=zA?(e<zA&&(zA=e),e>RA&&(RA=e)):e>BA?kD(zA,e)>kD(zA,RA)&&(RA=e):kD(e,RA)>kD(zA,RA)&&(zA=e)}else qA.push(WA=[zA=e,RA=e]);t<NA&&(NA=t),t>PA&&(PA=t),UA=n,BA=e}function vD(){mD.point=yD}function xD(){WA[0]=zA,WA[1]=RA,mD.point=gD,UA=null}function bD(e,t){if(UA){var n=e-BA;jA.add(xx(n)>180?n+(n>0?360:-360):n)}else LA=e,IA=t;XA.point(e,t),yD(e,t)}function _D(){XA.lineStart()}function wD(){bD(LA,IA),XA.lineEnd(),xx(jA)>fx&&(zA=-(RA=180)),WA[0]=zA,WA[1]=RA,UA=null}function kD(e,t){return(t-=e)<0?t+360:t}function $D(e,t){return e[0]-t[0]}function ED(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var AD={sphere:zx,point:DD,lineStart:CD,lineEnd:OD,polygonStart:function(){AD.lineStart=TD,AD.lineEnd=zD},polygonEnd:function(){AD.lineStart=CD,AD.lineEnd=OD}};function DD(e,t){e*=vx;var n=wx(t*=vx);SD(n*wx(e),n*Sx(e),Sx(t))}function SD(e,t,n){++ZA,tD+=(e-tD)/ZA,nD+=(t-nD)/ZA,iD+=(n-iD)/ZA}function CD(){AD.point=FD}function FD(e,t){e*=vx;var n=wx(t*=vx);dD=n*wx(e),hD=n*Sx(e),pD=Sx(t),AD.point=MD,SD(dD,hD,pD)}function MD(e,t){e*=vx;var n=wx(t*=vx),i=n*wx(e),r=n*Sx(e),o=Sx(t),a=_x(Fx((a=hD*o-pD*r)*a+(a=pD*i-dD*o)*a+(a=dD*r-hD*i)*a),dD*i+hD*r+pD*o);eD+=a,rD+=a*(dD+(dD=i)),oD+=a*(hD+(hD=r)),aD+=a*(pD+(pD=o)),SD(dD,hD,pD)}function OD(){AD.point=DD}function TD(){AD.point=ND}function zD(){RD(cD,fD),AD.point=DD}function ND(e,t){cD=e,fD=t,e*=vx,t*=vx,AD.point=RD;var n=wx(t);dD=n*wx(e),hD=n*Sx(e),pD=Sx(t),SD(dD,hD,pD)}function RD(e,t){e*=vx;var n=wx(t*=vx),i=n*wx(e),r=n*Sx(e),o=Sx(t),a=hD*o-pD*r,s=pD*i-dD*o,l=dD*r-hD*i,u=Ex(a,s,l),c=Tx(u),f=u&&-c/u;sD.add(f*a),lD.add(f*s),uD.add(f*l),eD+=c,rD+=c*(dD+(dD=i)),oD+=c*(hD+(hD=r)),aD+=c*(pD+(pD=o)),SD(dD,hD,pD)}function PD(e){return e instanceof ku?e:new ku(e)}const BD=Symbol("vega_selection_getter");function LD(e){return e.getter&&e.getter[BD]||(e.getter=(0,m.ZZ)(e.field),e.getter[BD]=!0),e.getter}const ID="intersect",UD="union",jD="or",qD="and",WD="_vgsid_",GD=(0,m.ZZ)(WD),YD="E",HD="R",XD="R-E",VD="R-LE",KD="R-RE",QD="index:unit";function JD(e,t){for(var n,i,r=t.fields,o=t.values,a=r.length,s=0;s<a;++s)if(n=LD(i=r[s])(e),(0,m.$P)(n)&&(n=(0,m.Ro)(n)),(0,m.$P)(o[s])&&(o[s]=(0,m.Ro)(o[s])),(0,m.cy)(o[s])&&(0,m.$P)(o[s][0])&&(o[s]=o[s].map(m.Ro)),i.type===YD){if((0,m.cy)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===HD){if(!(0,m.PK)(n,o[s]))return!1}else if(i.type===KD){if(!(0,m.PK)(n,o[s],!0,!1))return!1}else if(i.type===XD){if(!(0,m.PK)(n,o[s],!1,!1))return!1}else if(i.type===VD&&!(0,m.PK)(n,o[s],!1,!0))return!1;return!0}const ZD=(0,Ee.A)(GD),eS=ZD.left,tS=ZD.right;var nS={[`${WD}_union`]:function(){const e=new ku;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(const r of n)for(const t of r)e.add(t);return e},[`${WD}_intersect`]:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e=new ku(e),n=n.map(PD);e:for(const r of e)for(const t of n)if(!t.has(r)){e.delete(r);continue e}return e},E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter((e=>t.indexOf(e)>=0)):t},R_union:function(e,t){var n=(0,m.Ro)(t[0]),i=(0,m.Ro)(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=(0,m.Ro)(t[0]),i=(0,m.Ro)(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};function iS(e,t,n,i){t[0].type!==GA.uS&&(0,m.z3)("First argument to selection functions must be a string literal.");const r=t[0].value,o="unit",a="@"+o,s=":"+r;(t.length>=2&&(0,m.se)(t).value)!==ID||(0,m.mQ)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,m.mQ)(i,s)||(i[s]=n.getData(r).tuplesRef())}function rS(e){const t=this.context.data[e];return t?t.values.value:[]}const oS=e=>function(t,n){const i=this.context.dataflow.locale();return null===t?"null":i[e](n)(t)},aS=oS("format"),sS=oS("timeFormat"),lS=oS("utcFormat"),uS=oS("timeParse"),cS=oS("utcParse"),fS=new Date(2e3,0,1);function dS(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(fS.setYear(2e3),fS.setMonth(e),fS.setDate(t),sS.call(this,fS,n)):""}const hS="%",pS="$";function mS(e,t,n,i){t[0].type!==GA.uS&&(0,m.z3)("First argument to data functions must be a string literal.");const r=t[0].value,o=":"+r;if(!(0,m.mQ)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function gS(e,t,n,i){if(t[0].type===GA.uS)yS(n,i,t[0].value);else for(e in n.scales)yS(n,i,e)}function yS(e,t,n){const i=hS+n;if(!(0,m.mQ)(t,i))try{t[i]=e.scaleRef(n)}catch(r){}}function vS(e,t){if((0,m.Tn)(e))return e;if((0,m.Kg)(e)){const n=t.scales[e];return n&&function(e){return e&&!0===e[bf]}(n.value)?n.value:void 0}}function xS(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=gS,n._range=gS,n._scale=gS;const i=t=>"_["+(t.type===GA.uS?(0,m.r$)(hS+t.value):(0,m.r$)(hS)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${i(e[0])})`,_range:e=>`${i(e[0])}.range()`,_scale:t=>`${i(t[0])}(${e(t[1])})`}}function bS(e,t){return function(n,i,r){if(n){const t=vS(n,(r||this).context);return t&&t.path[e](i)}return t(i)}}const _S=bS("area",(function(e){return HA=new cx,ux(e,XA),2*HA})),wS=bS("bounds",(function(e){var t,n,i,r,o,a,s;if(PA=RA=-(zA=NA=1/0),qA=[],ux(e,mD),n=qA.length){for(qA.sort($D),t=1,o=[i=qA[0]];t<n;++t)ED(i,(r=qA[t])[0])||ED(i,r[1])?(kD(i[0],r[1])>kD(i[0],i[1])&&(i[1]=r[1]),kD(r[0],i[1])>kD(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,t=0,i=o[n=o.length-1];t<=n;i=r,++t)r=o[t],(s=kD(i[1],r[0]))>a&&(a=s,zA=r[0],RA=i[1])}return qA=WA=null,zA===1/0||NA===1/0?[[NaN,NaN],[NaN,NaN]]:[[zA,NA],[RA,PA]]})),kS=bS("centroid",(function(e){ZA=eD=tD=nD=iD=rD=oD=aD=0,sD=new cx,lD=new cx,uD=new cx,ux(e,AD);var t=+sD,n=+lD,i=+uD,r=Ex(t,n,i);return r<dx&&(t=rD,n=oD,i=aD,eD<fx&&(t=tD,n=nD,i=iD),(r=Ex(t,n,i))<dx)?[NaN,NaN]:[_x(n,t)*yx,Tx(i/r)*yx]}));function $S(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function ES(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function AS(e){const t=(0,Yu.Qh)(e);return.2126*ES(t.r)+.7152*ES(t.g)+.0722*ES(t.b)}function DS(e,t){return e===t||e!==e&&t!==t||((0,m.cy)(e)?!(!(0,m.cy)(t)||e.length!==t.length)&&function(e,t){for(let n=0,i=e.length;n<i;++n)if(!DS(e[n],t[n]))return!1;return!0}(e,t):!(!(0,m.Gv)(e)||!(0,m.Gv)(t))&&SS(e,t))}function SS(e,t){for(const n in e)if(!DS(e[n],t[n]))return!1;return!0}function CS(e){return t=>SS(e,t)}const FS={};function MS(e){return(0,m.cy)(e)||ArrayBuffer.isView(e)?e:null}function OS(e){return MS(e)||((0,m.Kg)(e)?e:null)}const TS=e=>e.data;function zS(e,t){const n=rS.call(t,e);return n.root&&n.root.lookup||{}}const NS=()=>"undefined"!==typeof window&&window||null;function RS(e,t,n){if(!e)return[];const[i,r]=e,o=(new ch).set(i[0],i[1],r[0],r[1]);return Qg(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=(0,m.YO)(e.marktype),i=(0,m.YO)(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!i.length||i.some((t=>e.name===t)))}return t}(t))}const PS={random:()=>to(),cumulativeNormal:ho,cumulativeLogNormal:xo,cumulativeUniform:Eo,densityNormal:fo,densityLogNormal:vo,densityUniform:$o,quantileNormal:po,quantileLogNormal:bo,quantileUniform:Ao,sampleNormal:co,sampleLogNormal:yo,sampleUniform:ko,isArray:m.cy,isBoolean:m.Lm,isDate:m.$P,isDefined:e=>void 0!==e,isNumber:m.Et,isObject:m.Gv,isRegExp:m.gd,isString:m.Kg,isTuple:tr,isValid:e=>null!=e&&e===e,toBoolean:m.G4,toDate:e=>(0,m.ay)(e),toNumber:m.Ro,toString:m.dI,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return OS(e).indexOf(...n)},join:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return MS(e).join(...n)},lastindexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return OS(e).lastIndexOf(...n)},replace:function(e,t,n){return(0,m.Tn)(n)&&(0,m.z3)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return MS(e).slice().reverse()},slice:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return OS(e).slice(...n)},flush:m.bX,lerp:m.Cc,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),(0,m.X$)(...e)},pad:m.eV,peek:m.se,pluck:function(e,t){const n=FS[t]||(FS[t]=(0,m.ZZ)(t));return(0,m.cy)(e)?e.map(n):n(e)},span:m.Ln,inrange:m.PK,truncate:m.xv,rgb:Yu.Qh,lab:sc,hcl:pc,hsl:Yu.KI,luminance:AS,contrast:function(e,t){const n=AS(e),i=AS(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:Xo,format:aS,utcFormat:lS,utcParse:cS,utcOffset:gt,utcSequence:xt,timeFormat:sS,timeParse:uS,timeOffset:mt,timeSequence:vt,timeUnitSpecifier:Ue,monthFormat:function(e){return dS.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return dS.call(this,e,1,"%b")},dayFormat:function(e){return dS.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return dS.call(this,0,2+e,"%a")},quarter:m.$G,utcquarter:m.vu,week:Ge,utcweek:Qe,dayofyear:We,utcdayofyear:Ke,warn:function(){return $S(this.context.dataflow,"warn",arguments)},info:function(){return $S(this.context.dataflow,"info",arguments)},debug:function(){return $S(this.context.dataflow,"debug",arguments)},extent:e=>(0,m.Xx)(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:RS,clampRange:m.BS,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=NS();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=NS();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Yc(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,i=this.context.data[e].input;return n.pulse(i,n.changeset().remove(m.vN).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?Td(n,t=t||wd(e)):e}},panLinear:m.VC,panLog:m.KH,panPow:m.co,panSymlog:m.zy,zoomLinear:m.lL,zoomLog:m.oV,zoomPow:m.SW,zoomSymlog:m.B2,encode:function(e,t,n){if(e){const n=this.context.dataflow,i=e.mark.source;n.pulse(i,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,i,r,o){const a=this.context.dataflow,s=this.context.data[e],l=s.input,u=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(l.value.length||t||i))return 0;if((!d||d.stamp<u)&&(s.changes=d=a.changeset(),d.stamp=u,a.runAfter((()=>{s.modified=!0,a.pulse(l,d).run()}),!0,1)),n&&(c=!0===n?m.vN:(0,m.cy)(n)||tr(n)?n:CS(n),d.remove(c)),t&&d.insert(t),i&&(c=CS(i),l.value.some(c)?d.remove(c):d.insert(i)),r)for(f in o)d.modify(r,f,o[f]);return 1},lassoAppend:function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const r=(e=(0,m.YO)(e))[e.length-1];return void 0===r||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e},lassoPath:function(e){return(0,m.YO)(e).reduce(((t,n,i)=>{let[r,o]=n;return t+(0==i?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:i,y:r,mark:o}=n,a=(new ch).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,l]of t)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),l<a.y1&&(a.y1=l),l>a.y2&&(a.y2=l);return a.translate(i,r),RS([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[a,s]=n[o],[l,u]=n[r];u>t!=s>t&&e<(a-l)*(t-u)/(s-u)+l&&i++}return 1&i}(e.x,e.y,t)))}},BS=["view","item","group","xy","x","y"],LS="this.",IS={},US={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${(0,m.r$)(pS+e)}]`,functions:function(e){const t=(0,GA.Cn)(e);BS.forEach((e=>t[e]="event.vega."+e));for(const n in PS)t[n]=LS+n;return(0,m.X$)(t,xS(e,PS,IS)),t},constants:GA.AA,visitors:IS},jS=(0,GA.Se)(US);function qS(e,t,n){return 1===arguments.length?PS[e]:(PS[e]=t,n&&(IS[e]=n),jS&&(jS.functions[e]=LS+e),this)}function WS(e,t){const n={};let i;try{e=(0,m.Kg)(e)?e:(0,m.r$)(e)+"",i=(0,GA.YK)(e)}catch(o){(0,m.z3)("Expression parse error: "+e)}i.visit((e=>{if(e.type!==GA.DG)return;const i=e.callee.name,r=US.visitors[i];r&&r(i,e.arguments,t,n)}));const r=jS(i);return r.globals.forEach((e=>{const i=pS+e;!(0,m.mQ)(n,i)&&t.getSignal(e)&&(n[i]=t.signalRef(e))})),{$expr:(0,m.X$)({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}qS("bandwidth",(function(e,t){const n=vS(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),gS),qS("copy",(function(e,t){const n=vS(e,(t||this).context);return n?n.copy():void 0}),gS),qS("domain",(function(e,t){const n=vS(e,(t||this).context);return n?n.domain():[]}),gS),qS("range",(function(e,t){const n=vS(e,(t||this).context);return n&&n.range?n.range():[]}),gS),qS("invert",(function(e,t,n){const i=vS(e,(n||this).context);return i?(0,m.cy)(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}),gS),qS("scale",(function(e,t,n){const i=vS(e,(n||this).context);return i?i(t):void 0}),gS),qS("gradient",(function(e,t,n,i,r){e=vS(e,(r||this).context);const o=pd(t,n);let a=e.domain(),s=a[0],l=(0,m.se)(a),u=m.D_;return l-s?u=Nf(e,s,l):e=(e.interpolator?wf("sequential")().interpolator(e.interpolator()):wf("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,l=1]),e.ticks&&(a=e.ticks(+i||15),s!==a[0]&&a.unshift(s),l!==(0,m.se)(a)&&a.push(l)),a.forEach((t=>o.stop(u(t),e(t)))),o}),gS),qS("geoArea",_S,gS),qS("geoBounds",wS,gS),qS("geoCentroid",kS,gS),qS("geoShape",(function(e,t,n){const i=vS(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}}),gS),qS("geoScale",(function(e,t){const n=vS(e,(t||this).context);return n&&n.scale()}),gS),qS("indata",(function(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r?r.count:r}),(function(e,t,n,i){t[0].type!==GA.uS&&(0,m.z3)("First argument to indata must be a string literal."),t[1].type!==GA.uS&&(0,m.z3)("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,a="@"+o;(0,m.mQ)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),qS("data",rS,mS),qS("treePath",(function(e,t,n){const i=zS(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(TS):void 0}),mS),qS("treeAncestors",(function(e,t){const n=zS(e,this)[t];return n?n.ancestors().map(TS):void 0}),mS),qS("vlSelectionTest",(function(e,t,n){for(var i,r,o,a,s,l=this.context.data[e],u=l?l.values.value:[],c=l?l[QD]&&l[QD].value:void 0,f=n===ID,d=u.length,h=0;h<d;++h)if(i=u[h],c&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=JD(t,i),r[a]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(a).count)return!1}else if(f^(s=JD(t,i)))return s;return d&&f}),iS),qS("vlSelectionIdTest",(function(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[QD]&&i[QD].value:void 0,a=n===ID,s=GD(t),l=eS(r,s);if(l===r.length)return!1;if(GD(r[l])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(tS(r,s)-l<o.size)return!1}return!0}),iS),qS("vlSelectionResolve",(function(e,t,n,i){for(var r,o,a,s,l,u,c,f,d,h,p,g,y=this.context.data[e],v=y?y.values.value:[],x={},b={},_={},w=v.length,k=0;k<w;++k)if(s=(r=v[k]).unit,o=r.fields,a=r.values,o&&a){for(p=0,g=o.length;p<g;++p)l=o[p],f=(c=x[l.field]||(x[l.field]={}))[s]||(c[s]=[]),_[l.field]=d=l.type.charAt(0),h=nS[`${d}_union`],c[s]=h(f,(0,m.YO)(a[p]));n&&(f=b[s]||(b[s]=[])).push((0,m.YO)(a).reduce(((e,t,n)=>(e[o[n].field]=t,e)),{}))}else l=WD,u=GD(r),(f=(c=x[l]||(x[l]={}))[s]||(c[s]=[])).push(u),n&&(f=b[s]||(b[s]=[])).push({[WD]:u});if(t=t||UD,x[WD]?x[WD]=nS[`${WD}_${t}`](...Object.values(x[WD])):Object.keys(x).forEach((e=>{x[e]=Object.keys(x[e]).map((t=>x[e][t])).reduce(((n,i)=>void 0===n?i:nS[`${_[e]}_${t}`](n,i)))})),v=Object.keys(b),n&&v.length){x[i?"vlPoint":"vlMulti"]=t===UD?{[jD]:v.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{[qD]:v.map((e=>({[jD]:b[e]})))}}return x}),iS),qS("vlSelectionTuples",(function(e,t){return e.map((e=>(0,m.X$)(t.fields?{values:t.fields.map((t=>LD(t)(e.datum)))}:{[WD]:GD(e.datum)},t)))}));const GS=(0,m.M1)(["rule"]),YS=(0,m.M1)(["group","image","rect"]);function HS(e){return(e+"").toLowerCase()}function XS(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}var VS={operator:(e,t)=>XS(e,["_"],t.code),parameter:(e,t)=>XS(e,["datum","_"],t.code),event:(e,t)=>XS(e,["event"],t.code),handler:(e,t)=>XS(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const e="o["+(0,m.r$)(o)+"]";r+=`$=${i[o].code};if(${e}!==$)${e}=$,m=1;`}return r+=function(e,t){let n="";return GS[t]||(e.x2&&(e.x?(YS[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(YS[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",XS(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(m.r$).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=Function("a","b","var u, v; return "+e.map(((e,i)=>{const r=t[i];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+i]=e,o=`this.f${i}(a)`,a=`this.f${i}(b)`),function(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}(o,a,-r,r)})).join("")+"0;");return n?i.bind(n):i}}};function KS(e,t,n){if(!e||!(0,m.Gv)(e))return e;for(let i,r=0,o=QS.length;r<o;++r)if(i=QS[r],(0,m.mQ)(e,i.key))return i.parse(e,t,n);return e}var QS=[{key:"$ref",parse:function(e,t){return t.get(e.$ref)||(0,m.z3)("Operator not defined: "+e.$ref)}},{key:"$key",parse:function(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=(0,m.Eb)(e.$key,e.$flat,t.expr.codegen))}},{key:"$expr",parse:function(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=(0,m.sY)(t.parameterExpression(e.$expr),e.$fields))}},{key:"$field",parse:function(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=(0,m.ZZ)(e.$field,e.$name,t.expr.codegen))}},{key:"$encode",parse:function(e,t){const n=e.$encode,i={};for(const r in n){const e=n[r];i[r]=(0,m.sY)(t.encodeExpression(e.$expr),e.$fields),i[r].output=e.$output}return i}},{key:"$compare",parse:function(e,t){const n="c:"+e.$compare+"_"+e.$order,i=(0,m.YO)(e.$compare).map((e=>e&&e.$tupleid?nr:e));return t.fn[n]||(t.fn[n]=(0,m.UD)(i,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,i,r){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(r),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return nr}}];const JS={skip:!0};function ZS(e,t,n,i){return new eC(e,t,n,i)}function eC(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||VS,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function tC(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function nC(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}eC.prototype=tC.prototype={fork(){const e=new tC(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),function(e){return"collect"===HS(e)}(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let r=n.get(e.parent.$ref);r?(i.connect(r,[t]),t.targets().add(r)):(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(e.parent.$ref),i.connect(r,[t]),t.targets().add(r)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const i=n.data[o]||(n.data[o]={});e.data[o].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[HS(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;!function(e){return"operator"===HS(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||(0,m.z3)("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=(0,m.cy)(r)?r.map((e=>KS(e,n,t))):KS(r,n,t)}return t},parseStream:function(e){var t,n=this,i=null!=e.filter?n.eventExpression(e.filter):void 0,r=null!=e.stream?n.get(e.stream):void 0;e.source?r=n.events(e.source,e.type,i):e.merge&&(r=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),r=r.between(t[0],t[1])),e.filter&&(r=r.filter(i)),null!=e.throttle&&(r=r.throttle(+e.throttle)),null!=e.debounce&&(r=r.debounce(+e.debounce)),null==r&&(0,m.z3)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),n.stream(e,r)},parseUpdate:function(e){var t,n=this,i=(0,m.Gv)(i=e.source)?i.$ref:i,r=n.get(i),o=e.update,a=void 0;r||(0,m.z3)("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,r,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach((n=>{const r=t.signals[n];e.signals(n,r)&&(i[n]=r.value)}))}if(e.data){var r=n.data={};Object.keys(t.data).forEach((n=>{const i=t.data[n];e.data(n,i)&&(r[n]=i.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach((e=>{n.update(t.signals[e],r[e],JS)})),Object.keys(i||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(m.vN).insert(i[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const i=t.subcontext[n];i&&i.setState(e)}))}};const iC="default";function rC(e,t){const n=e.globalCursor()?"undefined"!==typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function oC(e,t){var n=e._runtime.data;return(0,m.mQ)(n,t)||(0,m.z3)("Unrecognized data set: "+t),n[t]}function aC(e,t){ur(t)||(0,m.z3)("Second argument to changes must be a changeset.");const n=oC(this,e);return n.modified=!0,this.pulse(n.input,t)}function sC(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function lC(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function uC(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function cC(e,t,n){var i,r,o=e._renderer,a=o&&o.canvas();return a&&(r=uC(e),(i=wm(t.changedTouches?t.changedTouches[0]:t,a))[0]-=r[0],i[1]-=r[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const i=t?"group"===t.mark.marktype?t:t.mark.group:null;function r(e){var n,r=i;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function o(e){if(!e)return n;(0,m.Kg)(e)&&(e=r(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:(0,m.dY)(e),item:(0,m.dY)(t||{}),group:r,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,i),t}const fC="view",dC={trap:!1};function hC(e,t,n,i){e._eventListeners.push({type:n,sources:(0,m.YO)(t),handler:i})}function pC(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return!(!1===i||(0,m.Gv)(i)&&!i[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function mC(e){return e.item}function gC(e){return e.item.mark.source}function yC(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function vC(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return null!=n&&(i.textContent=n),i}const xC="vega-bind",bC="vega-bind-name",_C="vega-bind-radio";function wC(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),hC(i,t,r,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!==typeof Event?new Event(e):{type:e}}(r))}}function kC(e,t,n,i){const r=i.signal(n.signal),o=vC("div",{class:xC}),a="radio"===n.input?o:o.appendChild(vC("label"));a.appendChild(vC("span",{class:bC},n.name||n.signal)),t.appendChild(o);let s=$C;switch(n.input){case"checkbox":s=EC;break;case"select":s=AC;break;case"radio":s=DC;break;case"range":s=SC}s(e,a,n,r)}function $C(e,t,n,i){const r=vC("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,t.appendChild(r),r.addEventListener("input",(()=>e.update(r.value))),e.elements=[r],e.set=e=>r.value=e}function EC(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=vC("input",r);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function AC(e,t,n,i){const r=vC("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};CC(e,i)&&(n.selected=!0),r.appendChild(vC("option",n,(o[t]||e)+""))})),t.appendChild(r),r.addEventListener("change",(()=>{e.update(n.options[r.selectedIndex])})),e.elements=[r],e.set=e=>{for(let t=0,i=n.options.length;t<i;++t)if(CC(n.options[t],e))return void(r.selectedIndex=t)}}function DC(e,t,n,i){const r=vC("span",{class:_C}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map(((t,a)=>{const s={type:"radio",name:n.signal,value:t};CC(t,i)&&(s.checked=!0);const l=vC("input",s);l.addEventListener("change",(()=>e.update(t)));const u=vC("label",{},(o[a]||t)+"");return u.prepend(l),r.appendChild(u),l})),e.set=t=>{const n=e.elements,i=n.length;for(let e=0;e<i;++e)CC(n[e].value,t)&&(n[e].checked=!0)}}function SC(e,t,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,T.sG)(o,r,100),s=vC("input",{type:"range",name:n.signal,min:o,max:r,step:a});s.value=i;const l=vC("span",{},+i);t.appendChild(s),t.appendChild(l);const u=()=>{l.textContent=s.value,e.update(+s.value)};s.addEventListener("input",u),s.addEventListener("change",u),e.elements=[s],e.set=e=>{s.value=e,l.textContent=e}}function CC(e,t){return e===t||e+""===t+""}function FC(e,t,n,i,r,o){return(t=t||new i(e.loader())).initialize(n,sC(e),lC(e),uC(e),r,o).background(e.background())}function MC(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function OC(e,t,n){if("string"===typeof t){if("undefined"===typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const TC=e=>+e||0;function zC(e){return(0,m.Gv)(e)?{top:TC(e.top),bottom:TC(e.bottom),left:TC(e.left),right:TC(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(TC(e))}async function NC(e,t,n,i){const r=Kg(t),o=r&&r.headless;return o||(0,m.z3)("Unrecognized renderer type: "+t),await e.runAsync(),FC(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}var RC="width",PC="height",BC="padding",LC={skip:!0};function IC(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===BC?i.left+i.right:0)}function UC(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===BC?i.top+i.bottom:0)}function jC(e,t){return t.modified&&(0,m.cy)(t.input.value)&&!e.startsWith("_:vega:_")}function qC(e,t){return!("parent"===e||t instanceof Rr.proxy)}function WC(e,t,n,i){const r=e.element();r&&r.setAttribute("title",function(e){return null==e?"":(0,m.cy)(e)?GC(e):(0,m.Gv)(e)&&!(0,m.$P)(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+((0,m.cy)(n)?GC(n):YC(n))})).join("\n")):e+"";var t}(i))}function GC(e){return"["+e.map(YC).join(", ")+"]"}function YC(e){return(0,m.cy)(e)?"[\u2026]":(0,m.Gv)(e)&&!(0,m.$P)(e)?"{\u2026}":e}function HC(e,t){const n=this;if(t=t||{},Tr.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const i=(0,m.X$)({},e.locale,t.locale);n.locale(_i(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Xg.Canvas,n._scenegraph=new mm;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||WC,n._redraw=!0,n._handler=(new Ym).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=(0,m.X$)({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{(0,m.cy)(e[t])&&(e[t]=(0,m.M1)(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(e,t,n){return ZS(e,Rr,PS,n).parse(t)}(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:(0,m.X$)({},e)}))),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=IC(n,n._width),n._viewHeight=UC(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[RC],i=t[PC],r=t[BC];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=IC(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=UC(e,t.size),o()}),{size:i});const a=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,a.rank=r.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:iC,item:null}));e.on(e.events("view","pointermove"),t,((e,n)=>{const i=t.value,r=i?(0,m.Kg)(i)?i:i.user:iC,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}})),e.add(null,(function(t){let n=t.cursor,i=this.value;return(0,m.Kg)(n)||(i=n.item,n=n.user),rC(e,n&&n!==iC?n:i||n),i}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function XC(e,t){return(0,m.mQ)(e._signals,t)?e._signals[t]:(0,m.z3)("Unrecognized signal name: "+(0,m.r$)(t))}function VC(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function KC(e,t,n,i){let r=VC(n,i);return r||(r=MC(e,(()=>i(t,n.value))),r.handler=i,e.on(n,null,r)),e}function QC(e,t,n){const i=VC(t,n);return i&&t._targets.remove(i),e}(0,m.B)(HC,Tr,{async evaluate(e,t,n){if(await Tr.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(e){var t=uC(e),n=sC(e),i=lC(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach((t=>{try{t(n,i)}catch(r){e.error(r)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Ji(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&nC(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=XC(this,e);return 1===arguments.length?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",zC(e)):zC(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Kg(e)||(0,m.z3)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Tr.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(XC(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,i,r,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(RC,n,LC),a._resizeWidth.skip(!0)),a.height()!==i&&(s=1,a.signal(PC,i,LC),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===r[0]&&a._origin[1]===r[1]||(a._resize=1,a._origin=r),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let i=t;return n&&!1===n.trap||(i=MC(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n,i,r=this._handler.handlers(e),o=r.length;--o>=0;)if(i=r[o].type,n=r[o].handler,e===i&&(t===n||t===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return KC(this,e,XC(this,e),t)},removeSignalListener(e,t){return QC(this,XC(this,e),t)},addDataListener(e,t){return KC(this,e,oC(this,e).values,t)},removeDataListener(e,t){return QC(this,oC(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=rC(this,null);this._globalCursor=!!e,t&&rC(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var i=new hk.M4,r=t;return null==t?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(e,t,n){t=+t,n=null==n?(0,hk.tB)():+n,i._restart((function o(a){a+=r,i._restart(o,r+=t,n),e(a)}),t,n)},i.restart(e,t,n),i)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var i,r=this,o=new vr(n),a=function(n,i){r.runAsync(null,(()=>{e===fC&&function(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[t]:r?!r[t]:e.preventDefault()))}(r,t)&&n.preventDefault(),o.receive(cC(r,n,i))}))};if("timer"===e)pC(r,"timer",t)&&r.timer(a,t);else if(e===fC)pC(r,"view",t)&&r.addEventListener(t,a,dC);else if("window"===e?pC(r,"window",t)&&"undefined"!==typeof window&&(i=[window]):"undefined"!==typeof document&&pC(r,"selector",t)&&(i=Array.from(document.querySelectorAll(e))),i){for(var s=0,l=i.length;s<l;++s)i[s].addEventListener(t,a);hC(r,i,t,a)}else r.warn("Can not resolve event source: "+e);return o},finalize:function(){var e,t,n,i,r,o=this._tooltip,a=this._timers,s=this._handler.handlers(),l=this._eventListeners;for(e=a.length;--e>=0;)a[e].stop();for(e=l.length;--e>=0;)for(t=(n=l[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);for(o&&o.call(this,this._handler,null,null,null),e=s.length;--e>=0;)r=s[e].type,i=s[e].handler,this._handler.off(r,i);return this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","pointerover",mC),gC,yC(e)),this.on(this.events("view","pointerout",mC),gC,yC(t)),this},data:function(e,t){return arguments.length<2?oC(this,e).values.value:aC.call(this,e,cr().remove(m.vN).insert(t))},change:aC,insert:function(e,t){return aC.call(this,e,cr().insert(t))},remove:function(e,t){return aC.call(this,e,cr().remove(t))},scale:function(e){var t=this._runtime.scales;return(0,m.mQ)(t,e)||(0,m.z3)("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Kg(i);e=n._el=e?OC(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),nC(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const a=o.handler||Ym,s=e?o.renderer:o.headless;return n._renderer=s?FC(n,n._renderer,e,s):null,n._handler=function(e,t,n,i){const r=new i(e.loader(),MC(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,uC(e),e);return t&&t.handlers().forEach((e=>{r.on(e.type,e.handler)})),r}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==r&&(t=t?n._elBind=OC(n,t,!0):e.appendChild(vC("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==r&&(e.element=OC(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(i.signal)&&e.runAsync(null,(()=>{r.source=!0,e.signal(i.signal,t)}))}},i.debounce&&(r.update=(0,m.sg)(i.debounce,r.update))),(null==i.input&&i.element?wC:kC)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,(()=>{r.source?r.source=!1:r.set(e.signal(i.signal))})),r.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==Xg.Canvas&&e!==Xg.SVG&&e!==Xg.PNG&&(0,m.z3)("Unrecognized image type: "+e);const n=await NC(this,e,t);return e===Xg.SVG?function(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await NC(this,Xg.Canvas,e,t)).canvas()},toSVG:async function(e){return(await NC(this,Xg.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:jC,signals:qC,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this},_watchPixelRatio:function(){if("canvas"===this.renderer()&&this._renderer._canvas){let e=null;const t=()=>{null!=e&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}});var JC=n(60646);function ZC(e){return(0,m.Gv)(e)?e:{type:e||"pad"}}const eF=e=>+e||0,tF=e=>({top:e,bottom:e,left:e,right:e});function nF(e){return(0,m.Gv)(e)?e.signal?e:{top:eF(e.top),bottom:eF(e.bottom),left:eF(e.left),right:eF(e.right)}:tF(eF(e))}const iF=e=>(0,m.Gv)(e)&&!(0,m.cy)(e)?(0,m.X$)({},e):{value:e};function rF(e,t,n,i){if(null!=n){return(0,m.Gv)(n)&&!(0,m.cy)(n)||(0,m.cy)(n)&&n.length&&(0,m.Gv)(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1}return 0}function oF(e,t,n){for(const i in t)rF(e,i,t[i]);for(const i in n)rF(e,i,n[i],"update")}function aF(e,t,n){for(const i in t)n&&(0,m.mQ)(n,i)||(e[i]=(0,m.X$)(e[i]||{},t[i]));return e}function sF(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const lF="mark",uF="frame",cF="scope",fF="axis",dF="axis-domain",hF="axis-grid",pF="axis-label",mF="axis-tick",gF="axis-title",yF="legend",vF="legend-band",xF="legend-entry",bF="legend-gradient",_F="legend-label",wF="legend-symbol",kF="legend-title",$F="title",EF="title-text",AF="title-subtitle";function DF(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const SF=e=>(0,m.Kg)(e)?(0,m.r$)(e):e.signal?`(${e.signal})`:OF(e);function CF(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:(0,m.r$)(e)));for(;t.length&&null==(0,m.se)(t);)t.pop();return t.unshift(SF(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?FF("hcl",e.h,e.c,e.l):e.h||e.s?FF("hsl",e.h,e.s,e.l):e.l||e.a?FF("lab",e.l,e.a,e.b):e.r||e.g||e.b?FF("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?OF(e.field):void 0!==e.value?(0,m.r$)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=SF(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1===+e.band?"":"*"+MF(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${MF(e.exponent)})`),null!=e.mult&&(t+=`*${MF(e.mult)}`),null!=e.offset&&(t+=`+${MF(e.offset)}`),e.round&&(t=`round(${t})`),t}const FF=(e,t,n,i)=>`(${e}(${[t,n,i].map(CF).join(",")})+'')`;function MF(e){return(0,m.Gv)(e)?"("+CF(e)+")":e}function OF(e){return TF((0,m.Gv)(e)?e:{datum:e})}function TF(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):(0,m.z3)("Invalid field reference: "+(0,m.r$)(e));return e.signal||(i=(0,m.Kg)(i)?(0,m.iv)(i).map(m.r$).join("]["):TF(i)),t+"["+i+"]"}function zF(e,t,n,i,r,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,i,r){const o={},a={};let s,l,u,c;for(l in l="lineBreak","text"!==t||null==r[l]||sF(l,e)||DF(o,l,r[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===uF?r.group:n===lF?(0,m.X$)({},r.mark,r[t]):null,c)u=sF(l,e)||("fill"===l||"stroke"===l)&&(sF("fill",e)||sF("stroke",e)),u||DF(o,l,c[l]);for(l in(0,m.YO)(i).forEach((t=>{const n=r.style&&r.style[t];for(const i in n)sF(i,e)||DF(o,i,n[i])})),e=(0,m.X$)({},e),o)c=o[l],c.signal?(s=s||{})[l]=c:a[l]=c;return e.enter=(0,m.X$)(a,e.enter),s&&(e.update=(0,m.X$)(s,e.update)),e}(e,t,n,i,r.config);for(const s in e)a[s]=NF(e[s],t,o,r);return o}function NF(e,t,n,i){const r={},o={};for(const s in e)null!=e[s]&&(r[s]=RF((a=e[s],(0,m.cy)(a)?function(e){let t="";return e.forEach((e=>{const n=CF(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===(0,m.se)(t)&&(t+="null"),t}(a):CF(a)),i,n,o));var a;return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function RF(e,t,n,i){const r=WS(e,t);return r.$fields.forEach((e=>i[e]=1)),(0,m.X$)(n,r.$params),r.$expr}const PF="outer",BF=["value","update","init","react","bind"];function LF(e,t){(0,m.z3)(e+' for "outer" push: '+(0,m.r$)(t))}function IF(e,t){const n=e.name;if(e.push===PF)t.signals[n]||LF("No prior signal definition",n),BF.forEach((t=>{void 0!==e[t]&&LF("Invalid property ",t)}));else{const i=t.addSignal(n,e.value);!1===e.react&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function UF(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function jF(e,t,n,i){return new UF(e,t,n,i)}function qF(e,t){return jF("operator",e,t)}function WF(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function GF(e,t){return t?{$field:e,$name:t}:{$field:e}}const YF=GF("key");function HF(e,t){return{$compare:e,$order:t}}const XF="descending";function VF(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const KF="scope",QF="view";function JF(e){return e&&e.signal}function ZF(e){if(JF(e))return!0;if((0,m.Gv)(e))for(const t in e)if(ZF(e[t]))return!0;return!1}function eM(e,t){return null!=e?e:t}function tM(e){return e&&e.signal||e}const nM="timer";function iM(e,t){return(e.merge?rM:e.stream?oM:e.type?aM:(0,m.z3)("Invalid stream specification: "+(0,m.r$)(e)))(e,t)}function rM(e,t){const n=e.merge.map((e=>iM(e,t))),i=sM({merge:n},e,t);return t.addStream(i).id}function oM(e,t){const n=sM({stream:iM(e.stream,t)},e,t);return t.addStream(n).id}function aM(e,t){let n;e.type===nM?(n=t.event(nM,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===KF?QF:e||QF}(e.source),e.type);const i=sM({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function sM(e,t,n){let i=t.between;return i&&(2!==i.length&&(0,m.z3)('Stream "between" parameter must have 2 entries: '+(0,m.r$)(t)),e.between=[iM(i[0],n),iM(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(function(e,t,n){const i="event.item";return i+(e&&"*"!==e?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===KF&&i.push("inScope(event.item)"),i.length&&(e.filter=WS("("+i.join(")&&(")+")",n).$expr),null!=(i=t.throttle)&&(e.throttle=+i),null!=(i=t.debounce)&&(e.debounce=+i),t.consume&&(e.consume=!0),e}const lM={code:"_.$value",ast:{type:"Identifier",value:"value"}};function uM(e,t,n){const i=e.encode,r={target:n};let o=e.events,a=e.update,s=[];o||(0,m.z3)("Signal update missing events specification."),(0,m.Kg)(o)&&(o=(0,JC.P)(o,t.isSubscope()?KF:QF)),o=(0,m.YO)(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[cM(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=i&&(a&&(0,m.z3)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,m.r$)(i)+")"),r.update=(0,m.Kg)(a)?WS(a,t):null!=a.expr?WS(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:lM,$params:{$value:t.signalRef(a.signal)}}:(0,m.z3)("Invalid signal update specification."),e.force&&(r.options={force:!0}),s.forEach((e=>t.addUpdate((0,m.X$)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):iM(e,t)}}(e,t),r))))}function cM(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const fM=e=>(t,n,i)=>jF(e,n,t||void 0,i),dM=fM("aggregate"),hM=fM("axisticks"),pM=fM("bound"),mM=fM("collect"),gM=fM("compare"),yM=fM("datajoin"),vM=fM("encode"),xM=fM("expression"),bM=fM("facet"),_M=fM("field"),wM=fM("key"),kM=fM("legendentries"),$M=fM("load"),EM=fM("mark"),AM=fM("multiextent"),DM=fM("multivalues"),SM=fM("overlap"),CM=fM("params"),FM=fM("prefacet"),MM=fM("projection"),OM=fM("proxy"),TM=fM("relay"),zM=fM("render"),NM=fM("scale"),RM=fM("sieve"),PM=fM("sortitems"),BM=fM("viewlayout"),LM=fM("values");let IM=0;const UM={min:"min",max:"max",count:"sum"};function jM(e,t){const n=t.getScale(e.name).params;let i;for(i in n.domain=YM(e.domain,e,t),null!=e.range&&(n.range=eO(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=qM(e.type||e),null!=e.gamma&&(t.interpolateGamma=qM(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e,t){return e.signal?t.signalRef(e.signal):(0,m.Gv)(e)?{interval:qM(e.interval),step:qM(e.step)}:qM(e)}(e.nice,t)),null!=e.bins&&(n.bins=function(e,t){return e.signal||(0,m.cy)(e)?WM(e,t):t.objectProperty(e)}(e.bins,t)),e)(0,m.mQ)(n,i)||"name"===i||(n[i]=qM(e[i],t))}function qM(e,t){return(0,m.Gv)(e)?e.signal?t.signalRef(e.signal):(0,m.z3)("Unsupported object: "+(0,m.r$)(e)):e}function WM(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>qM(e,t)))}function GM(e){(0,m.z3)("Can not find data set: "+(0,m.r$)(e))}function YM(e,t,n){if(e)return e.signal?n.signalRef(e.signal):((0,m.cy)(e)?HM:e.fields?VM:XM)(e,t,n);null==t.domainMin&&null==t.domainMax||(0,m.z3)("No scale domain defined for domainMin/domainMax to override.")}function HM(e,t,n){return e.map((e=>qM(e,n)))}function XM(e,t,n){const i=n.getData(e.data);return i||GM(e.data),Af(t.type)?i.valuesRef(n,e.field,QM(e.sort,!1)):Ff(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function VM(e,t,n){const i=e.data,r=e.fields.reduce(((e,t)=>(t=(0,m.Kg)(t)?{data:i,field:t}:(0,m.cy)(t)||t.signal?function(e,t){const n="_:vega:_"+IM++,i=mM({});if((0,m.cy)(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+(0,m.r$)(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,RM({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(Af(t.type)?KM:Ff(t.type)?JM:ZM)(e,n,r)}function KM(e,t,n){const i=QM(e.sort,!0);let r,o;const a=n.map((e=>{const n=t.getData(e.data);return n||GM(e.data),n.countsRef(t,e.field,i)})),s={groupby:YF,pulse:a};i&&(r=i.op||"count",o=i.field?VF(r,i.field):"count",s.ops=[UM[r]],s.fields=[t.fieldRef(o)],s.as=[o]),r=t.add(dM(s));const l=t.add(mM({pulse:WF(r)}));return o=t.add(LM({field:YF,sort:t.sortRef(i),pulse:WF(l)})),WF(o)}function QM(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!UM[e.op]&&(0,m.z3)("Multiple domain scales can not be sorted using "+e.op):(0,m.z3)("No field provided for sort aggregate op: "+e.op):(0,m.Gv)(e)?e.field="key":e={field:"key"}),e}function JM(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||GM(e.data),n.domainRef(t,e.field)}));return WF(t.add(DM({values:i})))}function ZM(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||GM(e.data),n.extentRef(t,e.field)}));return WF(t.add(AM({extents:i})))}function eO(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if((0,m.Kg)(r)){if(i&&(0,m.mQ)(i,r))return eO(e=(0,m.X$)({},e,{range:i[r]}),t,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=Af(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,m.z3)("Unrecognized scale range value: "+(0,m.r$)(r))}else{if(r.scheme)return n.scheme=(0,m.cy)(r.scheme)?WM(r.scheme,t):qM(r.scheme,t),r.extent&&(n.schemeExtent=WM(r.extent,t)),void(r.count&&(n.schemeCount=qM(r.count,t)));if(r.step)return void(n.rangeStep=qM(r.step,t));if(Af(e.type)&&!(0,m.cy)(r))return YM(r,e,t);(0,m.cy)(r)||(0,m.z3)("Unsupported range type: "+(0,m.r$)(r))}return r.map((e=>((0,m.cy)(e)?WM:qM)(e,t)))}function tO(e,t,n){return(0,m.cy)(e)?e.map((e=>tO(e,t,n))):(0,m.Gv)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:(0,m.z3)("Unsupported parameter object: "+(0,m.r$)(e)):e}const nO="top",iO="left",rO="right",oO="bottom",aO="center",sO="vertical",lO="start",uO="end",cO="index",fO="label",dO="offset",hO="perc",pO="perc2",mO="value",gO="guide-label",yO="guide-title",vO="group-title",xO="group-subtitle",bO="symbol",_O="gradient",wO="discrete",kO="size",$O=[kO,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],EO={name:1,style:1,interactive:1},AO={value:0},DO={value:1},SO="group",CO="rect",FO="rule",MO="symbol",OO="text";function TO(e){return e.type=SO,e.interactive=e.interactive||!1,e}function zO(e,t){const n=(n,i)=>eM(e[n],eM(t[n],i));return n.isVertical=n=>sO===eM(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>eM(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>eM(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>eM(e.columns,eM(t.columns,+n.isVertical(!0))),n}function NO(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function RO(e,t,n){return`item.anchor === '${lO}' ? ${e} : item.anchor === '${uO}' ? ${t} : ${n}`}const PO=RO((0,m.r$)(iO),(0,m.r$)(rO),(0,m.r$)(aO));function BO(e,t){return t?e?(0,m.Gv)(e)?Object.assign({},e,{offset:BO(e.offset,t)}):{value:e,offset:t}:t:e}function LO(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=aF(e.encode,t,EO)):e.interactive=!1,e}function IO(e,t,n,i){const r=zO(e,n),o=r.isVertical(),a=r.gradientThickness(),s=r.gradientLength();let l,u,c,f,d;o?(u=[0,1],c=[0,0],f=a,d=s):(u=[0,0],c=[1,0],f=s,d=a);const h={enter:l={opacity:AO,x:AO,y:AO,width:iF(f),height:iF(d)},update:(0,m.X$)({},l,{opacity:DO,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:AO}};return oF(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),LO({type:CO,role:bF,encode:h},i)}function UO(e,t,n,i,r){const o=zO(e,n),a=o.isVertical(),s=o.gradientThickness(),l=o.gradientLength();let u,c,f,d,h="";a?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:AO,fill:{scale:t,field:mO}};p[u]={signal:h+"datum."+hO,mult:l},p[c]=AO,p[f]={signal:h+"datum."+pO,mult:l},p[d]=iF(s);const g={enter:p,update:(0,m.X$)({},p,{opacity:DO}),exit:{opacity:AO}};return oF(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),LO({type:CO,role:vF,key:mO,from:r,encode:g},i)}const jO=`datum.${hO}<=0?"${iO}":datum.${hO}>=1?"${rO}":"${aO}"`,qO=`datum.${hO}<=0?"${oO}":datum.${hO}>=1?"${nO}":"middle"`;function WO(e,t,n,i){const r=zO(e,t),o=r.isVertical(),a=iF(r.gradientThickness()),s=r.gradientLength();let l,u,c,f,d=r("labelOverlap"),h="";const p={enter:l={opacity:AO},update:u={opacity:DO,text:{field:fO}},exit:{opacity:AO}};return oF(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:eM(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=u.baseline={signal:qO},c="y",f="x",h="1-"):(l.align=u.align={signal:jO},l.baseline={value:"top"},c="x",f="y"),l[c]=u[c]={signal:h+"datum."+hO,mult:s},l[f]=u[f]=a,a.offset=eM(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:r("labelSeparation"),method:d,order:"datum."+cO}:void 0,LO({type:OO,role:_F,style:gO,key:mO,from:i,encode:p,overlap:d},n)}function GO(e,t,n,i,r){const o=zO(e,t),a=n.entries,s=!(!a||!a.interactive),l=a?a.name:void 0,u=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${dO} : datum.${kO}`,h=u?iF(u):{field:kO},p=`datum.${cO}`,m=`max(1, ${r})`;let g,y,v,x,b;h.mult=.5,g={enter:y={opacity:AO,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:DO,x:y.x,y:y.y},exit:{opacity:AO}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),oF(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")}),$O.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:mO})}));const k=LO({type:MO,role:wF,key:mO,from:f,clip:!!u||void 0,encode:g},n.symbols),$=iF(c);$.offset=o("labelOffset"),g={enter:y={opacity:AO,x:{signal:d,offset:$},y:h},update:v={opacity:DO,text:{field:fO},x:y.x,y:y.y},exit:{opacity:AO}},oF(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 E=LO({type:OO,role:_F,style:gO,key:mO,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!u},width:AO,height:u?iF(u):AO,opacity:AO},exit:{opacity:AO},update:v={opacity:DO,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${m})`,v.row.signal=`${p}%${x}`,v.column.signal=`floor(${p} / ${x})`,b={field:["row",p]}):(v.row.signal=`floor(${p} / ${m})`,v.column.signal=`${p} % ${m}`,b={field:p}),v.column.signal=`(${r})?${v.column.signal}:${p}`,TO({role:cF,from:i={facet:{data:i,name:"value",groupby:cO}},encode:aF(g,a,EO),marks:[k,E],name:l,interactive:s,sort:b})}const YO='item.orient === "left"',HO='item.orient === "right"',XO=`(${YO} || ${HO})`,VO=`datum.vgrad && ${XO}`,KO=RO('"top"','"bottom"','"middle"'),QO=`datum.vgrad && ${HO} ? (${RO('"right"','"left"','"center"')}) : (${XO} && !(datum.vgrad && ${YO})) ? "left" : ${PO}`,JO=`item._anchor || (${XO} ? "middle" : "start")`,ZO=`${VO} ? (${YO} ? -90 : 90) : 0`,eT=`${XO} ? (datum.vgrad ? (${HO} ? "bottom" : "top") : ${KO}) : "top"`;function tT(e,t){let n;return(0,m.Gv)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+nT(e.path)+")":e.sphere&&(n="geoShape("+nT(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function nT(e){return(0,m.Gv)(e)&&e.signal?e.signal:(0,m.r$)(e)}function iT(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===SO?cF:t||lF}function rT(e){return{marktype:e.type,name:e.name||void 0,role:e.role||iT(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function oT(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function aT(e,t){const n=Pr(e.type);n||(0,m.z3)("Unrecognized transform type: "+(0,m.r$)(e.type));const i=jF(n.type.toLowerCase(),null,sT(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function sT(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const r=e.params[o];i[r.name]=lT(r,t,n)}return i}function lT(e,t,n){const i=e.type,r=t[e.name];return"index"===i?function(e,t,n){(0,m.Kg)(t.from)||(0,m.z3)('Lookup "from" parameter must be a string literal.');return n.getData(t.from).lookupRef(n,t.key)}(0,t,n):void 0!==r?"param"===i?function(e,t,n){const i=t[e.name];return e.array?((0,m.cy)(i)||(0,m.z3)("Expected an array of sub-parameters. Instead: "+(0,m.r$)(i)),i.map((t=>cT(e,t,n)))):cT(e,i,n)}(e,t,n):"projection"===i?n.projectionRef(t[e.name]):e.array&&!JF(r)?r.map((t=>uT(e,t,n))):uT(e,r,n):void(e.required&&(0,m.z3)("Missing required "+(0,m.r$)(t.type)+" parameter: "+(0,m.r$)(e.name)))}function uT(e,t,n){const i=e.type;if(JF(t))return pT(i)?(0,m.z3)("Expression references can not be signals."):mT(i)?n.fieldRef(t):gT(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||mT(i);return r&&fT(t)?n.exprRef(t.expr,t.as):r&&dT(t)?GF(t.field,t.as):pT(i)?WS(t,n):hT(i)?WF(n.getData(t).values):mT(i)?GF(t):gT(i)?n.compareRef(t):t}}function cT(e,t,n){const i=e.params.length;let r;for(let a=0;a<i;++a){r=e.params[a];for(const e in r.key)if(r.key[e]!==t[e]){r=null;break}if(r)break}r||(0,m.z3)("Unsupported parameter: "+(0,m.r$)(t));const o=(0,m.X$)(sT(r,t,n),r.key);return WF(n.add(CM(o)))}const fT=e=>e&&e.expr,dT=e=>e&&e.field,hT=e=>"data"===e,pT=e=>"expr"===e,mT=e=>"field"===e,gT=e=>"compare"===e;function yT(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:WF(t.getData(e.data).output)}function vT(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}function xT(e){return(0,m.Kg)(e)?e:null}function bT(e,t,n){const i=VF(n.op,n.field);let r;if(t.ops){for(let o=0,a=t.as.length;o<a;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function _T(e,t,n,i,r,o,a){const s=t[n]||(t[n]={}),l=function(e){return(0,m.Gv)(e)?(e.order===XF?"-":"+")+VF(e.op,e.field):""}(o);let u,c,f=xT(r);if(null!=f&&(e=t.scope,f+=l?"|"+l:"",u=s[f]),!u){const n=o?{field:YF,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:WF(t.output)};l&&(n.sort=e.sortRef(o)),c=e.add(jF(i,void 0,n)),a&&(t.index[r]=c),u=WF(c),null!=f&&(s[f]=u)}return u}function wT(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,a=e.modify,s=e.values,l=t.add(qF()),u=WS("if("+e.trigger+',modify("'+n+'",'+[r,i,o,a,s].map((e=>null==e?"null":e)).join(",")+"),0)",t);l.update=u.$expr,l.params=u.$params}function kT(e,t){const n=iT(e),i=e.type===SO,r=e.from&&e.from.facet,o=e.overlap;let a,s,l,u,c,f,d,h=e.layout||n===cF||n===uF;const p=n===lF||h||r,g=function(e,t,n){let i,r,o,a,s;return e?(i=e.facet)&&(t||(0,m.z3)("Only group marks can be faceted."),null!=i.field?a=s=yT(i,n):(e.data?s=WF(n.getData(e.data).aggregate):(o=aT((0,m.X$)({type:"aggregate",groupby:(0,m.YO)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=yT(i,n),a=s=WF(n.add(o))),r=n.keyRef(i.groupby,!0))):a=WF(n.add(mM(null,[{}]))),a||(a=yT(e,n)),{key:r,pulse:a,parent:s}}(e.from,i,t);s=t.add(yM({key:g.key||(e.key?GF(e.key):void 0),pulse:g.pulse,clean:!i}));const y=WF(s);s=l=t.add(mM({pulse:y})),s=t.add(EM({markdef:rT(e),interactive:oT(e.interactive,t),clip:tT(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:WF(s)}));const v=WF(s);s=u=t.add(vM(zF(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=aT(e,t),i=n.metadata;(i.generates||i.changes)&&(0,m.z3)("Mark transforms should not generate new data."),i.nomod||(u.params.mod=!0),n.params.pulse=WF(s),t.add(s=n)})),e.sort&&(s=t.add(PM({sort:t.compareRef(e.sort),pulse:WF(s)})));const x=WF(s);(r||h)&&(h=t.add(BM({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:x})),f=WF(h));const b=t.add(pM({mark:v,pulse:f||x}));d=WF(b),i&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(x,f||d,y),r?function(e,t,n){const i=e.from.facet,r=i.name,o=yT(i,t);let a;i.name||(0,m.z3)("Facet must have a name: "+(0,m.r$)(i)),i.data||(0,m.z3)("Facet must reference a data set: "+(0,m.r$)(i)),i.field?a=t.add(FM({field:t.fieldRef(i.field),pulse:o})):i.groupby?a=t.add(bM({key:t.keyRef(i.groupby),group:WF(t.proxy(n.parent)),pulse:o})):(0,m.z3)("Facet must specify groupby or field: "+(0,m.r$)(i));const s=t.fork(),l=s.add(mM()),u=s.add(RM({pulse:WF(l)}));s.addData(r,new vT(s,l,l,u)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const i=t.add(FM({pulse:n.pulse})),r=t.fork();r.add(RM()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const i=e.method,r=e.bound,o=e.separation,a={separation:JF(o)?n.signalRef(o.signal):o,method:JF(i)?n.signalRef(i.signal):i,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));if(r){const e=r.tolerance;a.boundTolerance=JF(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return WF(n.add(SM(a)))}(o,d,t));const _=t.add(zM({pulse:d})),w=t.add(RM({pulse:WF(_)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new vT(t,l,_,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&(0,m.z3)("Marks only support modify triggers."),wT(e,t,c)})))}function $T(e,t){const n=t.config.legend,i=e.encode||{},r=zO(e,n),o=i.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,u={};let c,f,d,h=0;$O.forEach((t=>e[t]?(u[t]=e[t],h=h||e[t]):0)),h||(0,m.z3)("Missing valid scale for legend.");const p=function(e,t){let n=e.type||bO;e.type||1!==function(e){return $O.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=Ef(t)?_O:Df(t)?wO:bO);return n!==_O?n:Df(t)?wO:_O}(e,t.scaleType(h)),g={title:null!=e.title,scales:u,type:p,vgrad:"symbol"!==p&&r.isVertical()},y=WF(t.add(mM(null,[g]))),v=WF(t.add(kM(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===_O?(d=[IO(e,h,n,i.gradient),WO(e,n,i.labels,v)],f.count=f.count||t.signalRef(`max(2,2*floor((${tM(r.gradientLength())})/100))`)):p===wO?d=[UO(e,h,n,i.gradient,v),WO(e,n,i.labels,v)]:(c=function(e,t){const n=zO(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[GO(e,n,i,v,tM(c.columns))],f.size=function(e,t,n){const i=tM(AT("size",e,n)),r=tM(AT("strokeWidth",e,n)),o=tM(function(e,t,n){return NO("fontSize",e)||function(e,t,n){const i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,gO));return WS(`max(ceil(sqrt(${i})+${r}),${o})`,t)}(e,t,d[0].marks)),d=[TO({role:xF,from:y,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,i){const r=zO(e,t),o={enter:{opacity:AO},update:{opacity:DO,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:AO}};return oF(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:JO},angle:{signal:ZO},align:{signal:QO},baseline:{signal:eT},text:e.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")}),LO({type:OO,role:kF,style:yO,from:i,encode:o},n)}(e,n,i.title,y)),kT(TO({role:yF,from:y,encode:aF(ET(r,e,n),o,EO),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:s,style:l}),t)}function ET(e,t,n){const i={enter:{},update:{}};return oF(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function AT(e,t,n){return t[e]?`scale("${t[e]}",datum)`:NO(e,n[0].encode)}vT.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s<n;++s)t[s].params.pulse=WF(t[s-1]),e.add(t[s]),"aggregate"===t[s].type&&(a=t[s]);return new vT(e,o,r,i,a)},vT.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=xT(t);let a,s,l;return null!=o&&(e=i.scope,a=r[o]),a?n&&n.field&&bT(e,a.agg.params,n):(l={groupby:e.fieldRef(t,"key"),pulse:WF(i.output)},n&&n.field&&bT(e,l,n),s=e.add(dM(l)),a=e.add(mM({pulse:WF(s)})),a={agg:s,ref:WF(a)},null!=o&&(r[o]=a)),a.ref},tuplesRef(){return WF(this.values)},extentRef(e,t){return _T(e,this,"extent","extent",t,!1)},domainRef(e,t){return _T(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return _T(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return _T(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return _T(e,this,"indata","tupleindex",t,!0,!0)}};const DT=`item.orient==="${iO}"?-90:item.orient==="${rO}"?90:0`;function ST(e,t){const n=zO(e=(0,m.Kg)(e)?{text:e}:e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,a=r.interactive,s=r.style,l=[],u=WF(t.add(mM(null,[{}])));return l.push(function(e,t,n,i){const r={value:0},o=e.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return oF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),LO({type:OO,role:EF,style:vO,from:i,encode:a},n)}(e,n,function(e){const t=e.encode;return t&&t.title||(0,m.X$)({name:e.name,interactive:e.interactive,style:e.style},t)}(e),u)),e.subtitle&&l.push(function(e,t,n,i){const r={value:0},o=e.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return oF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),LO({type:OO,role:AF,style:xO,from:i,encode:a},n)}(e,n,i.subtitle,u)),kT(TO({role:$F,from:u,encode:CT(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}function CT(e,t){const n={enter:{},update:{}};return oF(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:PO},angle:{signal:DT},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),aF(n,t,EO)}function FT(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(aT(e,t))})),e.on&&e.on.forEach((n=>{wT(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const i=[];let r,o,a,s,l,u=null,c=!1,f=!1;e.values?JF(e.values)||ZF(e.format)?(i.push(OT(t,e)),i.push(u=MT())):i.push(u=MT({$ingest:e.values,$format:e.format})):e.url?ZF(e.url)||ZF(e.format)?(i.push(OT(t,e)),i.push(u=MT())):i.push(u=MT({$request:e.url,$format:e.format})):e.source&&(u=r=(0,m.YO)(e.source).map((e=>WF(t.getData(e).output))),i.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],l=s.metadata,u||l.source||i.push(u=MT()),i.push(s),l.generates&&(f=!0),l.modifies&&!f&&(c=!0),l.source?u=s:l.changes&&(u=null);r&&(a=r.length-1,i[0]=TM({derive:c,pulse:a?r:r[0]}),(c||a)&&i.splice(1,0,MT()));u||i.push(MT());return i.push(RM({})),i}(e,t,n))}function MT(e){const t=mM({},e);return t.metadata={source:!0},t}function OT(e,t){return $M({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const TT=e=>e===oO||e===nO,zT=(e,t,n)=>JF(e)?UT(e.signal,t,n):e===iO||e===nO?t:n,NT=(e,t,n)=>JF(e)?LT(e.signal,t,n):TT(e)?t:n,RT=(e,t,n)=>JF(e)?IT(e.signal,t,n):TT(e)?n:t,PT=(e,t,n)=>JF(e)?jT(e.signal,t,n):e===nO?{value:t}:{value:n},BT=(e,t,n)=>JF(e)?qT(e.signal,t,n):e===rO?{value:t}:{value:n},LT=(e,t,n)=>WT(`${e} === '${nO}' || ${e} === '${oO}'`,t,n),IT=(e,t,n)=>WT(`${e} !== '${nO}' && ${e} !== '${oO}'`,t,n),UT=(e,t,n)=>YT(`${e} === '${iO}' || ${e} === '${nO}'`,t,n),jT=(e,t,n)=>YT(`${e} === '${nO}'`,t,n),qT=(e,t,n)=>YT(`${e} === '${rO}'`,t,n),WT=(e,t,n)=>(t=null!=t?iF(t):t,n=null!=n?iF(n):n,GT(t)&&GT(n)?{signal:`${e} ? (${t=t?t.signal||(0,m.r$)(t.value):null}) : (${n=n?n.signal||(0,m.r$)(n.value):null})`}:[(0,m.X$)({test:e},t)].concat(n||[])),GT=e=>null==e||1===Object.keys(e).length,YT=(e,t,n)=>({signal:`${e} ? (${XT(t)}) : (${XT(n)})`}),HT=(e,t,n,i,r)=>({signal:(null!=i?`${e} === '${iO}' ? (${XT(i)}) : `:"")+(null!=n?`${e} === '${oO}' ? (${XT(n)}) : `:"")+(null!=r?`${e} === '${rO}' ? (${XT(r)}) : `:"")+(null!=t?`${e} === '${nO}' ? (${XT(t)}) : `:"")+"(null)"}),XT=e=>JF(e)?e.signal:null==e?null:(0,m.r$)(e),VT=(e,t)=>0===t?0:JF(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},KT=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function QT(e,t,n,i){let r;if(t&&(0,m.mQ)(t,e))return t[e];if((0,m.mQ)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[yO][r]}if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[gO][r]}return null}function JT(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function ZT(e,t){return{scale:e.scale,range:t}}function ez(e,t,n,i,r){const o=zO(e,t),a=e.orient,s=e.gridScale,l=zT(a,1,-1),u=function(e,t){if(1===t);else if((0,m.Gv)(e)){let n=e=(0,m.X$)({},e);for(;null!=n.mult;){if(!(0,m.Gv)(n.mult))return n.mult=JF(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=(0,m.X$)({},n.mult)}n.mult=t}else e=JF(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,l);let c,f,d;const h={enter:c={opacity:AO},update:d={opacity:DO},exit:f={opacity:AO}};oF(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:mO,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=NT(a,{signal:"height"},{signal:"width"}),y=s?{scale:s,range:0,mult:l,offset:u}:{value:0,offset:u},v=s?{scale:s,range:1,mult:l,offset:u}:(0,m.X$)(g,{mult:l,offset:u});return c.x=d.x=NT(a,p,y),c.y=d.y=RT(a,p,y),c.x2=d.x2=RT(a,v),c.y2=d.y2=NT(a,v),f.x=NT(a,p),f.y=RT(a,p),LO({type:FO,role:hF,key:mO,from:i,encode:h},n)}function tz(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function nz(e,t,n,i){const r=zO(e,t),o=e.orient,a=zT(o,-1,1);let s,l;const u={enter:s={opacity:AO,anchor:iF(r("titleAnchor",null)),align:{signal:PO}},update:l=(0,m.X$)({},s,{opacity:DO,text:iF(e.title)}),exit:{opacity:AO}},c={signal:`lerp(range("${e.scale}"), ${RO(0,1,.5)})`};return l.x=NT(o,c),l.y=RT(o,c),s.angle=NT(o,AO,VT(a,90)),s.baseline=NT(o,PT(o,oO,nO),{value:oO}),l.angle=s.angle,l.baseline=s.baseline,oF(u,{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(e,t,n,i){const r=(e,t)=>null!=e?(n.update[t]=KT(iF(e),n.update[t]),!1):!sF(t,i),o=r(e("titleX"),"x"),a=r(e("titleY"),"y");n.enter.auto=a===o?iF(a):NT(t,iF(a),iF(o))}(r,o,u,n),u.update.align=KT(u.update.align,s.align),u.update.angle=KT(u.update.angle,s.angle),u.update.baseline=KT(u.update.baseline,s.baseline),LO({type:OO,role:gF,style:yO,from:i,encode:u},n)}function iz(e,t){const n=function(e,t){var n,i,r,o=t.config,a=o.style,s=o.axis,l="band"===t.scaleType(e.scale)&&o.axisBand,u=e.orient;if(JF(u)){const e=JT([o.axisX,o.axisY]),t=JT([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},e))n[r]=NT(u,QT(r,o.axisX,s,a),QT(r,o.axisY,s,a));for(r of(i={},t))i[r]=HT(u.signal,QT(r,o.axisTop,s,a),QT(r,o.axisBottom,s,a),QT(r,o.axisLeft,s,a),QT(r,o.axisRight,s,a))}else n=u===nO||u===oO?o.axisX:o.axisY,i=o["axis"+u[0].toUpperCase()+u.slice(1)];return n||i||l?(0,m.X$)({},s,n,i,l):s}(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,a=r.interactive,s=r.style,l=zO(e,n),u=function(e){const t=e("tickBand");let n,i,r=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},(0,m.Gv)(r)||(r={signal:`(${t.signal}) === 'extent' ? 0 : ${r}`})):"extent"===t?(n=1,i=!0,r=0):(n=.5,i=!1):(n=e("bandPosition"),i=e("tickExtra")),{extra:i,band:n,offset:r}}(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=e.title},f=WF(t.add(mM({},[c]))),d=WF(t.add(hM({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(ez(e,n,i.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(function(e,t,n,i,r,o){const a=zO(e,t),s=e.orient,l=zT(s,-1,1);let u,c,f;const d={enter:u={opacity:AO},update:f={opacity:DO},exit:c={opacity:AO}};oF(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=iF(r);h.mult=l;const p={scale:e.scale,field:mO,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=u.y=NT(s,AO,p),f.y2=u.y2=NT(s,h),c.x=NT(s,p),f.x=u.x=RT(s,AO,p),f.x2=u.x2=RT(s,h),c.y=RT(s,p),LO({type:FO,role:mF,key:mO,from:i,encode:d},n)}(e,n,i.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,i,r,o){const a=zO(e,t),s=e.orient,l=e.scale,u=zT(s,-1,1),c=tM(a("labelFlush")),f=tM(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===c||!!c;const g=iF(r);g.mult=u,g.offset=iF(a("labelPadding")||0),g.offset.mult=u;const y={scale:l,field:mO,band:.5,offset:BO(o.offset,a("labelOffset"))},v=NT(s,m?tz(l,c,'"left"','"right"','"center"'):{value:"center"},BT(s,"left","right")),x=NT(s,PT(s,"bottom","top"),m?tz(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),b=tz(l,c,`-(${f})`,f,0);m=m&&f;const _={opacity:AO,x:NT(s,y,g),y:RT(s,y,g)},w={enter:_,update:p={opacity:DO,text:{field:fO},x:_.x,y:_.y,align:v,baseline:x},exit:{opacity:AO,x:_.x,y:_.y}};oF(w,{dx:!d&&m?NT(s,b):null,dy:!h&&m?RT(s,b):null}),oF(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 $=a("labelOverlap");return $=$||k?{separation:a("labelSeparation"),method:$,order:"datum.index",bound:k?{scale:l,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=KT(p.align,v)),p.baseline!==x&&(p.baseline=KT(p.baseline,x)),LO({type:OO,role:pF,style:gO,key:mO,from:i,encode:w,overlap:$},n)}(e,n,i.labels,d,p,u))),c.domain&&h.push(function(e,t,n,i){const r=zO(e,t),o=e.orient;let a,s;const l={enter:a={opacity:AO},update:s={opacity:DO},exit:{opacity:AO}};oF(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=ZT(e,0),c=ZT(e,1);return a.x=s.x=NT(o,u,AO),a.x2=s.x2=NT(o,c),a.y=s.y=RT(o,u,AO),a.y2=s.y2=RT(o,c),LO({type:FO,role:dF,from:i,encode:l},n)}(e,n,i.domain,f)),c.title&&h.push(nz(e,n,i.title,f)),kT(TO({role:fF,from:f,encode:aF(rz(l,e),r,EO),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:a,style:s}),t)}function rz(e,t){const n={enter:{},update:{}};return oF(n,{orient:e("orient"),offset:e("offset")||0,position:eM(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function oz(e,t,n){const i=(0,m.YO)(e.signals),r=(0,m.YO)(e.scales);return n||i.forEach((e=>IF(e,t))),(0,m.YO)(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},i={};for(const r in e)"name"!==r&&(i[r]=tO(e[r],r,t));for(const r in n)null==i[r]&&(i[r]=tO(n[r],r,t));t.addProjection(e.name,i)}(e,t))),r.forEach((e=>function(e,t){const n=e.type||"linear";kf(n)||(0,m.z3)("Unrecognized scale type: "+(0,m.r$)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),(0,m.YO)(e.data).forEach((e=>FT(e,t))),r.forEach((e=>jM(e,t))),(n||i).forEach((e=>function(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?(0,m.z3)("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=WS(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach((e=>uM(e,t,n.id)))}(e,t))),(0,m.YO)(e.axes).forEach((e=>iz(e,t))),(0,m.YO)(e.marks).forEach((e=>kT(e,t))),(0,m.YO)(e.legends).forEach((e=>$T(e,t))),e.title&&ST(e.title,t),t.parseLambdas(),t}const az=e=>aF({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function sz(e,t){const n=t.config,i=WF(t.root=t.add(qF())),r=function(e,t){const n=n=>eM(e[n],t[n]),i=[lz("background",n("background")),lz("autosize",ZC(n("autosize"))),lz("padding",nF(n("padding"))),lz("width",n("width")||0),lz("height",n("height")||0)],r=i.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return(0,m.YO)(e.signals).forEach((e=>{(0,m.mQ)(r,e.name)?e=(0,m.X$)(r[e.name],e):i.push(e),o[e.name]=e})),(0,m.YO)(t.signals).forEach((e=>{(0,m.mQ)(o,e.name)||(0,m.mQ)(r,e.name)||i.push(e)})),i}(e,n);r.forEach((e=>IF(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(mM()),a=t.add(vM(zF(az(e.encode),SO,uF,e.style,t,{pulse:WF(o)}))),s=t.add(BM({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:WF(a)}));t.operators.pop(),t.pushState(WF(a),WF(s),null),oz(e,t,r),t.operators.push(s);let l=t.add(pM({mark:i,pulse:WF(s)}));return l=t.add(zM({pulse:WF(l)})),l=t.add(RM({pulse:WF(l)})),t.addData("root",new vT(t,o,o,l)),t}function lz(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function uz(e,t){this.config=e||{},this.options=t||{},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 cz(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function fz(e){return((0,m.cy)(e)?dz:hz)(e)}function dz(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const t=e[i];n+=(i>0?",":"")+((0,m.Gv)(t)?t.signal||fz(t):(0,m.r$)(t))}return n+"]"}function hz(e){let t,n,i="{",r=0;for(t in e)n=e[t],i+=(++r>1?",":"")+(0,m.r$)(t)+":"+((0,m.Gv)(n)?n.signal||fz(n):(0,m.r$)(n));return i+"}"}function pz(e,t,n){return(0,m.Gv)(e)||(0,m.z3)("Input Vega specification must be an object."),t=(0,m.io)(function(){const e="sans-serif",t="#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:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,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"]}}}(),t,e.config),sz(e,new uz(t,n)).toRuntime()}uz.prototype=cz.prototype={parse(e){return oz(e,this)},fork(){return new cz(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(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof UF?WF(e):e;return this.add(OM({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let i,r;e&&(i=e.data||(e.data={}),r=i[t]||(i[t]=[]),r.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(WF(this.add(RM({pulse:e})))),this._parent.push(t),this._lookup.push(n?WF(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.se)(this._parent)},encode(){return(0,m.se)(this._encode)},lookup(){return(0,m.se)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if((0,m.Kg)(e))return GF(e,t);e.signal||(0,m.z3)("Unsupported field reference: "+(0,m.r$)(e));const n=e.signal;let i=this.field[n];if(!i){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=i=WF(this.add(_M(e)))}return i},compareRef(e){let t=!1;const n=e=>JF(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,i=(0,m.YO)(e.field).map(n),r=(0,m.YO)(e.order).map(n);return t?WF(this.add(gM({fields:i,orders:r}))):HF(i,r)},keyRef(e,t){let n=!1;const i=this.signals;return e=(0,m.YO)(e).map((e=>JF(e)?(n=!0,WF(i[e.signal])):e)),n?WF(this.add(wM({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=VF(e.op,e.field),n=e.order||"ascending";return n.signal?WF(this.add(gM({fields:t,orders:this.signalRef(n.signal)}))):HF(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return(0,m.mQ)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&(0,m.z3)("Duplicate signal name: "+(0,m.r$)(e));const n=t instanceof UF?t:this.add(qF(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||(0,m.z3)("Unrecognized signal name: "+(0,m.r$)(e)),this.signals[e]},signalRef(e){return this.signals[e]?WF(this.signals[e]):((0,m.mQ)(this.lambdas,e)||(this.lambdas[e]=this.add(qF(null))),WF(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const n=e[t],i=WS(n,this),r=this.lambdas[n];r.params=i.$params,r.update=i.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return e&&(0,m.Gv)(e)?this.signalRef(e.signal||fz(e)):e},exprRef(e,t){const n={expr:WS(e,this)};return t&&(n.expr.$name=t),WF(this.add(xM(n)))},addBinding(e,t){this.bindings||(0,m.z3)("Nested signals do not support binding: "+(0,m.r$)(e)),this.bindings.push((0,m.X$)({signal:e},t))},addScaleProj(e,t){(0,m.mQ)(this.scales,e)&&(0,m.z3)("Duplicate scale or projection name: "+(0,m.r$)(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,NM(t))},addProjection(e,t){this.addScaleProj(e,MM(t))},getScale(e){return this.scales[e]||(0,m.z3)("Unrecognized scale name: "+(0,m.r$)(e)),this.scales[e]},scaleRef(e){return WF(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return(0,m.mQ)(this.data,e)&&(0,m.z3)("Duplicate data set name: "+(0,m.r$)(e)),this.data[e]=t},getData(e){return this.data[e]||(0,m.z3)("Undefined data set name: "+(0,m.r$)(e)),this.data[e]},addDataPipeline(e,t){return(0,m.mQ)(this.data,e)&&(0,m.z3)("Duplicate data set name: "+(0,m.r$)(e)),this.addData(e,vT.fromEntries(this,t))}};var mz="5.30.0";(0,m.X$)(Rr,i,o,a,s,l,c,u,f,d,h,p)},93811:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,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 e(n,a,s){var l,u,c,f,d,h,p,m,g,y,v,x;if(n&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===(v=JSON.stringify(n,o)))return v;if(p=r-a.length-s,v.length<=p&&(g=v.replace(t,(function(e,t){return t||e+" "}))).length<=p)return g;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"===typeof n&&null!==n){if(m=a+i,c=[],u=0,Array.isArray(n))for(y="[",l="]",p=n.length;u<p;u++)c.push(e(n[u],m,u===p-1?0:1)||"null");else for(y="{",l="}",p=(h=Object.keys(n)).length;u<p;u++)f=h[u],d=JSON.stringify(f)+": ",void 0!==(x=e(n[f],m,d.length+(u===p-1?0:1)))&&c.push(d+x);if(c.length>0)return[y,i+c.join(",\n"+m),l].join("\n"+a)}return v}(e,"",0)}},83749:(e,t,n)=>{"use strict";n.d(t,{T:()=>u,I:()=>c});var i,r=n(48853),o=180/Math.PI,a={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function s(e,t,n,i,r,a){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(l=Math.sqrt(n*n+i*i))&&(n/=l,i/=l,u/=l),e*i<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*o,skewX:Math.atan(u)*o,scaleX:s,scaleY:l}}function l(e,t,n,i){function o(e){return e.length?e.pop()+" ":""}return function(a,s){var l=[],u=[];return a=e(a),s=e(s),function(e,i,o,a,s,l){if(e!==o||i!==a){var u=s.push("translate(",null,t,null,n);l.push({i:u-4,x:(0,r.A)(e,o)},{i:u-2,x:(0,r.A)(i,a)})}else(o||a)&&s.push("translate("+o+t+a+n)}(a.translateX,a.translateY,s.translateX,s.translateY,l,u),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,i)-2,x:(0,r.A)(e,t)})):t&&n.push(o(n)+"rotate("+t+i)}(a.rotate,s.rotate,l,u),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,i)-2,x:(0,r.A)(e,t)}):t&&n.push(o(n)+"skewX("+t+i)}(a.skewX,s.skewX,l,u),function(e,t,n,i,a,s){if(e!==n||t!==i){var l=a.push(o(a)+"scale(",null,",",null,")");s.push({i:l-4,x:(0,r.A)(e,n)},{i:l-2,x:(0,r.A)(t,i)})}else 1===n&&1===i||a.push(o(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,l,u),a=s=null,function(e){for(var t,n=-1,i=u.length;++n<i;)l[(t=u[n]).i]=t.x(e);return l.join("")}}}var u=l((function(e){const t=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?a:s(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),c=l((function(e){return null==e?a:(i||(i=document.createElementNS("http://www.w3.org/2000/svg","g")),i.setAttribute("transform",e),(e=i.transform.baseVal.consolidate())?s((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):a)}),", ",")",")")},79341:(e,t,n)=>{"use strict";n.d(t,{M4:()=>g,O1:()=>y,tB:()=>p});var i,r,o=0,a=0,s=0,l=1e3,u=0,c=0,f=0,d="object"===typeof performance&&performance.now?performance:Date,h="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function p(){return c||(h(m),c=d.now()+f)}function m(){c=0}function g(){this._call=this._time=this._next=null}function y(e,t,n){var i=new g;return i.restart(e,t,n),i}function v(){c=(u=d.now())+f,o=a=0;try{!function(){p(),++o;for(var e,t=i;t;)(e=c-t._time)>=0&&t._call.call(void 0,e),t=t._next;--o}()}finally{o=0,function(){var e,t,n=i,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:i=t);r=e,b(o)}(),c=0}}function x(){var e=d.now(),t=e-u;t>l&&(f-=t,u=e)}function b(e){o||(a&&(a=clearTimeout(a)),e-c>24?(e<1/0&&(a=setTimeout(v,e-d.now()-f)),s&&(s=clearInterval(s))):(s||(u=d.now(),s=setInterval(x,l)),o=1,h(v)))}g.prototype=y.prototype={constructor:g,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?p():+n)+(null==t?0:+t),this._next||r===this||(r?r._next=this:i=this,r=this),this._call=e,this._time=n,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}}}}]);